:root {
    --bg: #0f1115;
    --panel: #171a21;
    --border: #2a2e38;
    --text: #e6e8eb;
    --muted: #8b909c;
    --accent: #4f8cff;
    --ok: #35c46a;
    --warn: #e0a11c;
    --off: #e0463c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

header nav a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 16px;
    font-size: 14px;
}

header nav a:hover { color: var(--text); }

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

main.wide {
    max-width: 1700px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

/* Стилі тексту дошки (location-settings.html) — колір + розмір по 4
   елементах, кожен рядок: підпис / color picker / select / кнопка скидання. */
.text-style-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.text-style-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.text-style-row span {
    flex: 1;
    min-width: 0;
}

.text-style-row input[type=color] {
    width: 48px;
    height: 38px;
    padding: 2px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.text-style-row select {
    width: 130px;
    flex-shrink: 0;
    margin: 0;
}

.text-style-row button {
    flex-shrink: 0;
    margin: 0;
}

.login-wrap {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 320px;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    margin: 6px 0 14px;
    background: #10131a;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
}

label { display: block; font-size: 13px; color: var(--muted); }

/* Поля код/назва в таблиці локацій: за замовчуванням "зливаються" з рядком
   (прозора рамка) — інакше власна рамка input-а впритул до border-bottom
   комірки таблиці виглядає як подвійна лінія під рядком. Рамка/фон
   з'являються лише при наведенні чи фокусі — сигнал "це можна редагувати". */
.inline-edit {
    margin: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: background-color 0.15s, border-color 0.15s;
}

.inline-edit:hover {
    background: #10131a;
    border-color: var(--border);
}

.inline-edit:focus {
    background: #10131a;
    border-color: var(--accent);
    outline: none;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

button:hover { opacity: 0.9; }

button.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.error {
    color: var(--off);
    font-size: 13px;
    min-height: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 500; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge.ONLINE { background: rgba(53,196,106,.15); color: var(--ok); }
.badge.WARNING { background: rgba(224,161,28,.15); color: var(--warn); }
.badge.OFFLINE { background: rgba(224,70,60,.15); color: var(--off); }

.row-actions {
    display: flex;
    flex-wrap: nowrap; /* один рядок — якщо 8 кнопок не влазять, скрол в межах комірки (тонкий, не заважає) */
    gap: 6px;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
}

.row-actions a {
    display: inline-block;
    color: var(--text);
    background: #20242e;
    border: 1px solid var(--border);
    text-decoration: none;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.row-actions a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.dish-edit input, .dish-edit textarea {
    margin: 2px 0;
    font-size: 14px;
    padding: 8px 10px;
    width: 100%;
}

.dish-edit textarea { min-height: 52px; resize: vertical; }

.dish-edit input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 0 4px;
}

.pager button:disabled {
    opacity: 0.35;
    cursor: default;
}

.table-scroll {
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table-scroll table {
    margin: 0;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 1;
}

.location-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.location-nav a {
    color: var(--muted);
    text-decoration: none;
}

.location-nav a:hover { color: var(--text); }

#locationQuickActions a { margin-right: 12px; }
#locationQuickActions a:last-child { margin-right: 0; }

.location-nav-active {
    color: var(--accent);
    font-weight: 600;
}

.location-nav-sep {
    color: var(--border);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* Рядок "файл + кнопка завантажити" (location-settings.html) — нативний
   input[type=file] має свій внутрішній розмір, який без цього правила
   робить кнопку поруч видимо вищою за рядок вибору файлу. */
.toolbar input[type=file] {
    flex: 1;
    margin: 0;
    padding: 8px 10px;
}

.toolbar input[type=file] + button {
    flex-shrink: 0;
    margin: 0;
}

.muted { color: var(--muted); font-size: 13px; }
