/* Кабинет «Касса · облако» — в стиле кассового приложения: тёмный фон, неоновые акценты, белые карточки. */
:root {
    --bg1: #1A4552; --bg2: #10303B; --bg3: #0A1B24;
    --text: #1d2320; --muted: #6b7570; --line: #e2e6e4;
    --on-dark: #E8EEF2; --on-dark-muted: #9FB0BB;
    --teal: #2DD4BF; --yellow: #FACC15; --pink: #E879F9; --blue: #60A5FA; --green: #4ADE80; --gray: #94A3B8; --red: #F87171; --violet: #8B7CF6;
    --ok: #0FB65A; --danger: #D9534F;
}
* { box-sizing: border-box; }
/* Атрибут hidden сильнее любых display у классов (.actions и т.п.) — иначе «Удалить выбранные (0)» видна всегда. */
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--text); font-size: 15px;
    background: radial-gradient(900px 600px at -10% -10%, rgba(45,212,191,.16), transparent 60%),
                radial-gradient(900px 700px at 110% 110%, rgba(139,92,246,.14), transparent 60%),
                linear-gradient(135deg, var(--bg1), var(--bg2) 45%, var(--bg3));
    background-attachment: fixed;
}
a { color: #0f766e; }

/* ── Шапка ── */
.top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; flex-wrap: wrap; }
.brand { color: #fff; font-size: 24px; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand small { font-size: 13px; font-weight: 600; color: var(--teal); text-transform: uppercase; letter-spacing: .08em; }
.brand-icon { color: #5EEAD4; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; justify-content: center; }
.pill {
    --c: var(--teal);
    color: #F1F5F9; text-decoration: none; font-weight: 600; font-size: 14px;
    padding: 9px 16px; border-radius: 9px; border: 1.5px solid var(--c);
    background: color-mix(in srgb, var(--c) 14%, rgba(20,36,48,.85));
    box-shadow: 0 0 12px color-mix(in srgb, var(--c) 45%, transparent);
    transition: background .15s;
}
.pill:hover, .pill.active { background: color-mix(in srgb, var(--c) 38%, rgba(20,36,48,.85)); }
.pill.teal { --c: var(--teal); } .pill.yellow { --c: var(--yellow); } .pill.pink { --c: var(--pink); }
.pill.blue { --c: var(--blue); } .pill.green { --c: var(--green); } .pill.gray { --c: var(--gray); } .pill.violet { --c: var(--violet); }
.me { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.chip {
    color: var(--on-dark); background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    border-radius: 7px; padding: 6px 11px; font-size: 13px; text-decoration: none; cursor: pointer; font-family: inherit;
}
.chip.red { border-color: rgba(248,113,113,.6); }
.chip.warn { border-color: rgba(250,204,21,.7); background: rgba(250,204,21,.16); }
form.inline { display: inline; margin: 0; }

/* ── Содержимое ── */
.page { max-width: 1280px; margin: 0 auto; padding: 4px 16px 32px; }
.page.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.card { background: #fff; border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.card h1, .card h2 { margin: 0 0 12px; }
h1 { font-size: 22px; } h2 { font-size: 18px; }
.page-title { color: #fff; font-size: 24px; font-weight: 700; margin: 8px 2px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title .sub { font-size: 14px; font-weight: 400; color: var(--on-dark-muted); }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi .card { margin: 0; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.two { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }

/* ── Таблицы ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; background: #EAF6EF; font-size: 13px; font-weight: 600; padding: 9px 10px; white-space: nowrap; }
td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.link { cursor: pointer; } tr.link:hover td { background: #f3faf6; }
.r { text-align: right; } .b { font-weight: 600; } .nowrap { white-space: nowrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #eef2f5; }
.tag.ok { background: #dcfce7; color: #166534; } .tag.bad { background: #fee2e2; color: #991b1b; } .tag.warn { background: #fef9c3; color: #854d0e; }
.neg { color: var(--danger); }

/* ── Формы ── */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.form .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
    width: 100%; margin-top: 4px; padding: 9px 11px; font-size: 15px; font-family: inherit;
    border: 1px solid #BFC7C3; border-radius: 7px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ok); box-shadow: 0 0 0 3px rgba(15,182,90,.15); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 15px; margin-top: 8px; }
.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar > * { margin: 0; }
.toolbar label { min-width: 150px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.btn {
    display: inline-block; padding: 9px 16px; border-radius: 7px; border: 1px solid #CFCFCF; background: #F3F3F3;
    color: #222; font-size: 14px; font-family: inherit; cursor: pointer; text-decoration: none; font-weight: 500;
}
.btn:hover { filter: brightness(.95); }
.btn.green { background: var(--ok); border-color: #0A9A4A; color: #fff; font-weight: 600; }
.btn.red { background: var(--danger); border-color: #B94340; color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.alert.ok { background: #dcfce7; color: #14532d; } .alert.err { background: #fee2e2; color: #7f1d1d; } .alert.info { background: #e0f2fe; color: #0c4a6e; } .alert.warn { background: #fef3c7; color: #78350f; }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; }

/* ── Вход ── */
.login { width: 380px; max-width: 100%; }
.login .card { padding: 26px 28px; }
.login .brand { justify-content: center; margin-bottom: 18px; font-size: 30px; }

/* ── Вкладки внутри раздела ── */
.tabs { display: flex; gap: 4px; margin: -4px 0 12px; flex-wrap: wrap; }
.tab {
    color: var(--on-dark); text-decoration: none; font-weight: 600; font-size: 14px;
    padding: 8px 16px; border-radius: 8px 8px 0 0; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); border-bottom: 0;
}
.tab:hover { background: rgba(255,255,255,.18); }
.tab.active { background: #fff; color: var(--text); }

/* ── Мини-график по дням ── */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .fill { width: 100%; background: linear-gradient(180deg, #2DD4BF, #0FB65A); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .d { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.bars .v { font-size: 10px; color: var(--muted); margin-bottom: 2px; white-space: nowrap; }

@media (max-width: 640px) {
    .top { padding: 10px 12px; } .nav { justify-content: flex-start; } .me { margin-left: 0; }
    .page { padding: 4px 10px 24px; } .card { padding: 14px; }
    .hide-sm { display: none; }
}

/* ── Строка настройки: слева название и пояснение, справа выбор одинаковой ширины ── */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: 0; }
.setting-row > div { min-width: 0; }
.setting-row b { display: block; font-size: 15px; }
.setting-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.setting-row select { width: 250px; flex: 0 0 250px; margin: 0; }
@media (max-width: 640px) { .setting-row { flex-direction: column; align-items: stretch; } .setting-row select { width: 100%; flex-basis: auto; } }
/* Админка → клиент: входы в кабинет (логин и имя правятся прямо в строке). */
.owner-row { padding: 10px 0; border-top: 1px solid var(--line); }
.owner-row:first-of-type { border-top: 0; padding-top: 0; }
.owner-edit { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.owner-edit input { flex: 1 1 130px; min-width: 0; margin: 0; padding: 7px 9px; font-size: 14px; }
.owner-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 13px; }
/* Название в строке таблицы: поле + кнопка «Переименовать». */
.inline-rename { display: flex; gap: 6px; max-width: 460px; margin: 0; }
.inline-rename input { margin: 0; min-width: 0; }
.inline-rename.compact input { padding: 6px 9px; font-size: 14px; }
