/* ============================================================
   UlianaNails — design system
   Elegant light theme · plum accent · zero dependencies
   ============================================================ */

:root {
    --bg: #F7F5F2;
    --surface: #FFFFFF;
    --surface-2: #FBFAF8;
    --border: #E9E4DF;
    --border-strong: #DCD5CD;

    --text: #2C2A28;
    --text-2: #7D7870;
    --text-3: #A8A29A;

    --accent: #A85D77;
    --accent-strong: #8F4B63;
    --accent-soft: #F7ECF0;
    --accent-border: #EBD3DC;

    --green: #2E7A54;
    --green-bright: #3E9268;
    --green-soft: #E8F1EC;
    --red: #BC4A3E;
    --red-bright: #D95C50;
    --red-soft: #FCE9E7;
    --amber: #A46A2E;
    --amber-soft: #FBEFE1;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 4px 12px rgba(28, 25, 23, .04);
    --shadow-lg: 0 4px 12px rgba(28, 25, 23, .06), 0 16px 48px rgba(28, 25, 23, .12);

    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    background-image: linear-gradient(rgba(247, 245, 242, 0.9), rgba(247, 245, 242, 0.95)), url("/static/uploads/theme/cats.jpg");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 720px) {
    body { background-attachment: scroll; }
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

a { color: var(--accent-strong); text-decoration: none; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 19px;
    color: var(--text);
    letter-spacing: .01em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #B96F89, #8F4B63);
    color: #fff;
    font-family: var(--font-display);
    font-size: 17px;
    flex: none;
}

.brand-mark-lg { width: 56px; height: 56px; font-size: 28px; }

img.brand-mark { object-fit: cover; border: 1px solid var(--border); }

/* ---------- orders / schedule ---------- */
.contact-kind {
    display: block;
    font-size: 10.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #A8A29A;
    margin-bottom: 2px;
}

.contact-link {
    color: #8F4B63;
    text-decoration: none;
    border-bottom: 1px dashed rgba(143, 75, 99, 0.45);
}

.contact-link:hover { border-bottom-style: solid; }

.client-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

.client-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #A85D77; }

.badge-planned { background: #F7ECF0; color: #8F4B63; }

.badge-done { background: #E8F3ED; color: #2E7A54; }

.badge-canceled { background: #F1EEEB; color: #A19B93; }

.service-price { font-weight: 700; white-space: nowrap; }

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-2);
    transition: background .15s, color .15s;
}

.nav-link:hover { background: var(--surface-2); color: var(--text); }

.nav-link.active { background: var(--accent-soft); color: var(--accent-strong); }

.nav-icon { display: inline-flex; flex: none; color: inherit; opacity: .75; }
.nav-link.active .nav-icon { opacity: 1; }
.nav-label { white-space: nowrap; }

@media (min-width: 761px) {
    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--sidebar-w);
        height: 100vh;
        border-right: 1px solid var(--border);
        border-bottom: none;
        overflow-y: auto;
    }
    .topbar-inner {
        max-width: none;
        height: auto;
        min-height: 100%;
        padding: 22px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 22px;
    }
    .brand { padding: 0 8px; font-size: 18px; }
    .topbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }
    .nav-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        width: 100%;
    }
    .nav-beta { margin-left: auto; }
    .topbar-right {
        margin-left: 0;
        margin-top: auto;
        width: 100%;
    }
    .account { width: 100%; }
    .account-btn { width: 100%; }
    .account-menu {
        left: 100%;
        right: auto;
        top: auto;
        bottom: 0;
        margin-left: 12px;
    }
    main.container {
        margin: 0 0 0 var(--sidebar-w);
        max-width: none;
        padding: 32px 32px 64px;
    }
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent-strong);
    font-weight: 600;
    font-size: 14px;
    flex: none;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.25; }

.user-name { font-size: 14px; font-weight: 600; }

.user-role { font-size: 11.5px; color: var(--text-3); }

.btn-logout {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    transition: background .15s, color .15s;
}

.btn-logout:hover { background: var(--red-soft); color: var(--red); }

/* ---------- Layout ---------- */

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

body.has-tabbar .container { padding-bottom: 120px; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: .005em;
}

.page-subtitle {
    margin: 6px 0 0;
    font-size: 14.5px;
    color: var(--text-2);
}

/* ---------- Cards / panels ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
}

.card + .card { margin-top: 20px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .005em;
}

.card-note { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }

.tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 600;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-strong); }

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
}

.btn-secondary:hover { background: var(--surface-2); }

.btn-block { width: 100%; }

.btn-icon {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    color: var(--text-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}

.btn-icon:hover { background: var(--red-soft); color: var(--red); }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 16px; }

.form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.form input[type="text"],
.form input[type="password"],
.form input[type="number"],
.form input[type="datetime-local"],
.form select {
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    min-height: 44px;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}

.form input:focus,
.form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form ::placeholder { color: var(--text-3); }

.form-inline {
    flex-direction: row;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.form-inline label { flex: 1 1 180px; }

.form-inline .btn { flex: none; }

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 10px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    font-size: 14px !important;
    cursor: pointer;
    min-height: 44px;
}

.checkbox-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.checkbox-box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
    flex: none;
}

.checkbox-box::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
    opacity: 0;
}

.checkbox-label input:checked + .checkbox-box {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-box::after { opacity: 1; }

.checkbox-label input:focus-visible + .checkbox-box {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* segmented income/expense toggle */

.segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.segment label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}

.segment input:checked + label {
    background: var(--surface);
    box-shadow: var(--shadow);
}

.segment input:checked + label.seg-expense { color: var(--red); }

.segment input:checked + label.seg-income { color: var(--green); }

.segment input:focus-visible + label {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background: var(--red-soft);
    border: 1px solid #F3CCC7;
    color: var(--red);
}

/* ---------- Auth ---------- */

.auth-wrapper {
    min-height: calc(100vh - 96px);
    min-height: calc(100dvh - 96px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px 36px 36px;
    text-align: center;
}

.auth-title {
    margin: 18px 0 4px;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
}

.auth-subtitle {
    margin: 0 0 26px;
    font-size: 14px;
    color: var(--text-2);
}

.auth-card .form { text-align: left; }

.auth-card .alert { margin-bottom: 16px; text-align: left; }

/* ---------- Stats ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-3);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.stat-value.pos { color: var(--green); }

.stat-value.neg { color: var(--red); }

.stat-foot { font-size: 12.5px; color: var(--text-3); }

.stat-accent { border-top: 3px solid var(--accent); }

/* ---------- Charts ---------- */

.charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card { display: flex; flex-direction: column; }

.chart-wide { grid-column: 1 / -1; }

.chart-box { position: relative; height: 240px; min-width: 0; }

.chart-box svg { display: block; }

.chart-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-3);
}

.chart-tooltip {
    position: fixed;
    z-index: 90;
    pointer-events: none;
    background: var(--text);
    color: #fff;
    font-size: 12.5px;
    line-height: 1.4;
    border-radius: 8px;
    padding: 7px 10px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity .1s;
    max-width: 220px;
}

.chart-tooltip strong { font-variant-numeric: tabular-nums; }

.legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
}

.legend-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-2);
}

.legend-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }

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

.table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr { transition: background .1s; }

.table tbody tr:hover { background: var(--surface-2); }

.table .cell-num {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table .cell-actions { width: 44px; text-align: right; }

.cell-date { color: var(--text-2); white-space: nowrap; font-size: 13.5px; }

.cell-desc { color: var(--text-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.amount-income { color: var(--green); }

.amount-expense { color: var(--red); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 999px;
    padding: 3px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    white-space: nowrap;
}

.badge-income {
    background: var(--green-soft);
    border-color: #CFE4D8;
    color: var(--green);
}

.badge-expense {
    background: var(--red-soft);
    border-color: #F3CCC7;
    color: var(--red);
}

.badge-accent {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent-strong);
}

.empty-state {
    text-align: center;
    color: var(--text-3);
    font-size: 14.5px;
    padding: 32px 16px;
    margin: 0;
}

/* ---------- Promo codes ---------- */
.promo-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.promo-form-card .card-head { margin-bottom: 4px; }
.promo-form-card .form { margin-top: 14px; }

.promo-lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.promo-card-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.promo-card-item.promo-used { opacity: .6; }

.promo-card-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--accent-soft);
    aspect-ratio: 640 / 860;
}
.promo-card-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.promo-used-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 4px 10px;
    border-radius: 999px;
}

.promo-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13.5px;
    color: var(--text-2);
}
.promo-card-meta strong { color: var(--text); font-size: 14.5px; }

.promo-code-tag {
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: 12px;
    letter-spacing: .03em;
    color: var(--accent-strong);
}

.promo-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.promo-card-actions form { margin: 0; }

.promo-scan-result {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.5;
}
.promo-scan-ok { background: rgba(46, 122, 84, 0.12); border: 1px solid var(--green); color: var(--text); }
.promo-scan-warn { background: rgba(164, 106, 46, 0.12); border: 1px solid var(--amber); color: var(--text); }

@media (max-width: 640px) {
    .promo-actions-grid, .promo-lists-grid { grid-template-columns: 1fr; }
    .promo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ---------- Loyalty cards ---------- */
.loyalty-explainer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
}
.tier-badge-start { background: rgba(140, 140, 150, 0.14); color: #6b6b76; border: 1px solid rgba(140, 140, 150, 0.35); }
.tier-badge-silver { background: rgba(120, 144, 168, 0.16); color: #4c6a86; border: 1px solid rgba(120, 144, 168, 0.4); }
.tier-badge-gold { background: rgba(198, 149, 44, 0.16); color: #92700f; border: 1px solid rgba(198, 149, 44, 0.45); }

.loyalty-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--accent-soft);
    aspect-ratio: 1000 / 630;
}
.loyalty-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.loyalty-card-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.loyalty-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13.5px;
    color: var(--text-2);
}
.loyalty-card-meta strong { color: var(--text); font-size: 14.5px; }

.loyalty-points-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.loyalty-points-value { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--accent-strong); }
.loyalty-points-label { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }

.tier-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.tier-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-strong), var(--accent));
}
.tier-progress-note { font-size: 11.5px; color: var(--text-3); margin: 4px 0 0; }

.loyalty-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.loyalty-card-actions form { margin: 0; }

.loyalty-scan-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.loyalty-scan-toggle button {
    flex: 1 1 auto;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
}
.loyalty-scan-toggle button.active { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }

.loyalty-stat-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

.loyalty-tx-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.loyalty-tx-table th, .loyalty-tx-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.loyalty-tx-table th { color: var(--text-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.tx-kind-earn { color: var(--green); font-weight: 700; }
.tx-kind-redeem { color: var(--red); font-weight: 700; }

@media (max-width: 640px) {
    .loyalty-scan-toggle { flex-direction: column; }
}

/* ---------- Modal ---------- */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(28, 25, 23, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s, visibility .18s;
}

.overlay.open { opacity: 1; visibility: visible; }

.dialog {
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    transform: translateY(10px) scale(.98);
    transition: transform .18s;
}

.overlay.open .dialog { transform: none; }

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.dialog-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
}

.btn-close {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    transition: background .15s, color .15s;
}

.btn-close:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Hosting banner & urgent overlay ---------- */

.notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--text-2);
    margin-bottom: 20px;
}

.notice strong { color: var(--text); font-variant-numeric: tabular-nums; }

.notice-icon { display: inline-flex; color: var(--text-3); flex: none; }

.notice.warning {
    background: var(--amber-soft);
    border-color: #EFD9BC;
    color: var(--amber);
}

.notice.warning strong, .notice.warning .notice-icon { color: var(--amber); }

.notice.expired {
    background: var(--red-soft);
    border-color: #F3CCC7;
    color: var(--red);
}

.notice.expired strong, .notice.expired .notice-icon { color: var(--red); }

.urgent-dialog { text-align: center; max-width: 420px; }

.urgent-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 6px auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--red-soft);
    font-size: 28px;
}

.urgent-title {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
}

.urgent-text { margin: 0 0 18px; font-size: 14.5px; color: var(--text-2); }

.urgent-timer {
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--red);
    margin-bottom: 20px;
}

.urgent-close {
    margin-top: 12px;
    font-size: 13.5px;
    color: var(--text-3);
    min-height: 44px;
    padding: 0 12px;
}

.urgent-close:not(:disabled):hover { color: var(--text); }

.urgent-close:disabled { cursor: default; }

/* ---------- Categories ---------- */

.split {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}

.count-chips { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.count-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 18px;
    flex: 1 1 180px;
}

.count-chip-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    flex: none;
}

.count-chip-income .count-chip-icon { background: var(--green-soft); color: var(--green); }

.count-chip-expense .count-chip-icon { background: var(--red-soft); color: var(--red); }

.count-chip strong { display: block; font-size: 19px; line-height: 1.2; }

.count-chip span { display: block; font-size: 12.5px; color: var(--text-2); }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.category-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow .15s, border-color .15s;
}

.category-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }

.category-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    overflow: hidden;
    flex: none;
}

.category-icon img { width: 100%; height: 100%; object-fit: cover; }

.category-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.category-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.emoji-picker { display: flex; flex-wrap: wrap; gap: 8px; }

.emoji-option {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, background .15s, transform .1s;
}

.emoji-option:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.emoji-option.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.file-upload {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: border-color .15s, background .15s;
    cursor: pointer;
}

.file-upload:hover { border-color: var(--accent); background: var(--accent-soft); }

.file-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: none;
}

.file-upload-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }

.file-upload-text strong { font-size: 13.5px; font-weight: 600; color: var(--text); }

.file-upload-text small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Bottom tab bar (mobile) ---------- */

.tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    min-height: 44px;
}

.tab-item.active { color: var(--accent-strong); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .charts { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar-nav, .topbar .user-meta, .topbar .btn-logout { display: none; }
    .topbar-inner { height: 58px; padding: 0 16px; }
    .container { padding: 20px 16px 64px; }
    body.has-tabbar .container { padding-bottom: 110px; }
    .tabbar { display: flex; }
    .page-title { font-size: 24px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 14px 16px; }
    .stat-value { font-size: 19px; }
    .card { padding: 18px; }
    .table-wrap { margin: 0 -18px; padding: 0 18px; }

    /* transactions table -> cards */
    /* Универсальные карточки вместо таблиц на телефоне: работает для любого
       набора столбцов — заказы, склад, операции, пользователи. */
    .table-collapse thead { display: none; }
    .table-collapse tbody tr {
        display: flex;
        flex-direction: column;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--surface-2);
        padding: 12px 14px;
        margin-bottom: 10px;
    }
    .table-collapse tbody tr:last-child { margin-bottom: 0; }
    .table-collapse td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 5px 0;
        border: none;
        text-align: right;
    }
    .table-collapse td:empty { display: none; }
    .table-collapse td[data-label]::before {
        content: attr(data-label);
        flex: none;
        max-width: 44%;
        text-align: left;
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .05em;
        text-transform: uppercase;
        color: var(--text-3);
        padding-top: 2px;
    }
    /* Первая ячейка каждой строки — как заголовок карточки, без подписи */
    .table-collapse td.cell-primary {
        display: block;
        order: -3;
        text-align: left;
        font-weight: 700;
        font-size: 15px;
        color: var(--text);
        padding: 0 0 8px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--border);
    }
    .table-collapse td.cell-primary::before { content: none; }
    /* Статус/тип поднимаем сразу под заголовок карточки */
    .table-collapse td.cell-badge { order: -2; }
    .table-collapse td.cell-num { font-size: 15px; font-weight: 700; }
    .table-collapse td.cell-desc,
    .table-collapse td.cell-contact,
    .table-collapse td.cell-service,
    .table-collapse td.cell-audit {
        text-align: right;
        max-width: none;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-word;
    }
    /* Действия — всегда внизу карточки, с разделителем */
    .table-collapse td.cell-actions {
        order: 9;
        justify-content: flex-end;
        border-top: 1px solid var(--border);
        margin-top: 6px;
        padding-top: 10px;
    }
    .table-collapse td.cell-actions::before { content: none; }
    .table-collapse .btn-icon { width: 32px; height: 32px; min-height: 32px; }
}

/* --- Push-уведомления, таймер обслуживания, баннер оплаты хостинга --- */
.alarm {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: #FBEAE7;
    border: 1px solid #E7B4AC;
    border-left: 4px solid #BC4A3E;
    color: #8C2F25;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 18px;
    animation: alarmPulse 2.2s ease-in-out infinite;
}
@keyframes alarmPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(188, 74, 62, 0.28); }
    50% { box-shadow: 0 0 0 7px rgba(188, 74, 62, 0.05); }
}
.alarm-icon { font-size: 22px; }
.alarm-body { flex: 1; min-width: 220px; font-size: 14px; line-height: 1.5; }
.alarm-body strong { display: block; font-size: 15px; margin-bottom: 2px; }
.btn-telegram {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2AABEE;
    color: #fff;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, transform .15s ease;
}
.btn-telegram:hover { background: #1E96D6; transform: translateY(-1px); }

.notif-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #FFFDFB;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13.5px;
}
.notif-prompt-actions { display: inline-flex; align-items: center; gap: 8px; }
.btn-small { padding: 7px 14px; font-size: 13px; }

.badge-inprogress { background: #FFF4E0; color: #9A6A1B; }

.cell-sub { display: block; font-size: 12px; color: #A19B93; margin-top: 2px; }

.order-photo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
    vertical-align: middle;
}
.order-photo-link { display: inline-block; margin-left: 8px; }

.dialog-text { font-size: 14px; color: #6F6961; margin: 0 0 16px; line-height: 1.5; }
.dialog-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: inherit;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    transition: background .15s ease;
}
.btn-ghost:hover { background: rgba(0, 0, 0, 0.04); }

.timer-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 16px;
    background: #2B2126;
    color: #fff;
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 12px 30px rgba(43, 33, 38, 0.35);
}
.timer-widget[hidden] { display: none; }
.timer-info { display: flex; flex-direction: column; }
.timer-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .65; }
.timer-client { font-size: 14px; font-weight: 600; }
.timer-time { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700; }

@media (max-width: 720px) {
    .timer-widget {
        left: 12px;
        right: 12px;
        bottom: calc(72px + env(safe-area-inset-bottom));
        justify-content: space-between;
    }
    .alarm { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   ТЕМЫ ОФОРМЛЕНИЯ · Стандартная / Тёмная / Йогуртовая / Space
   ============================================================ */

:root {
    --topbar-bg: rgba(255, 255, 255, .92);
    --tabbar-bg: rgba(255, 255, 255, .96);
    --overlay-bg: rgba(28, 25, 23, .45);
    --grid: #EDE9E4;
    --grid-soft: #F1EDE8;
    --tooltip-bg: #2C2A28;
    --tooltip-text: #FFFFFF;
    --on-accent: #FFFFFF;
    --glass: none;
    color-scheme: light;
}

.topbar { background: var(--topbar-bg); }
.tabbar { background: var(--tabbar-bg); }
.overlay { background: var(--overlay-bg); }
.brand-mark { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); }

/* ---------- Тёмная ---------- */

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141317;
    --surface: #1C1B21;
    --surface-2: #24232A;
    --border: #2E2C36;
    --border-strong: #3B3945;

    --text: #ECE9F2;
    --text-2: #A8A3B4;
    --text-3: #7B7689;

    --accent: #C77E9A;
    --accent-strong: #E3A5BC;
    --accent-soft: #2B2029;
    --accent-border: #402F3A;

    --green: #5FC292;
    --green-bright: #74D6A4;
    --green-soft: #16281F;
    --red: #E4776B;
    --red-bright: #F18C80;
    --red-soft: #2D1B19;
    --amber: #DBA458;
    --amber-soft: #2C2318;

    --topbar-bg: rgba(20, 19, 23, .92);
    --tabbar-bg: rgba(20, 19, 23, .96);
    --overlay-bg: rgba(0, 0, 0, .62);
    --grid: #2A2832;
    --grid-soft: #232128;
    --tooltip-bg: #3A3844;
    --tooltip-text: #FFFFFF;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .28);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .5), 0 24px 64px rgba(0, 0, 0, .55);
}

/* ---------- Йогуртовая ---------- */

html[data-theme="yogurt"] {
    --bg: #F3EEFF;
    --surface: #FFFFFF;
    --surface-2: #F8F4FF;
    --border: #E5DCF8;
    --border-strong: #D3C7F0;

    --text: #2F2450;
    --text-2: #6D6194;
    --text-3: #9C93BA;

    --accent: #7C5CE0;
    --accent-strong: #6544C6;
    --accent-soft: #EEE8FF;
    --accent-border: #DBD0FB;

    --green: #3E8F73;
    --green-bright: #4FA987;
    --green-soft: #E4F4EE;
    --red: #C2497C;
    --red-bright: #D95F92;
    --red-soft: #FBE8F1;
    --amber: #A2701F;
    --amber-soft: #FBF0DC;

    --topbar-bg: rgba(255, 255, 255, .9);
    --tabbar-bg: rgba(255, 255, 255, .96);
    --overlay-bg: rgba(46, 33, 84, .4);
    --grid: #EBE4FA;
    --grid-soft: #F2EDFD;
    --tooltip-bg: #3B2C6B;

    --shadow: 0 1px 2px rgba(80, 55, 160, .07), 0 6px 18px rgba(80, 55, 160, .08);
    --shadow-lg: 0 6px 18px rgba(80, 55, 160, .12), 0 20px 56px rgba(80, 55, 160, .18);
}

html[data-theme="yogurt"] body {
    background:
        radial-gradient(900px 520px at 12% -8%, #FBE6FA 0%, rgba(251, 230, 250, 0) 62%),
        radial-gradient(760px 480px at 92% 6%, #E2E4FF 0%, rgba(226, 228, 255, 0) 60%),
        var(--bg);
    background-attachment: fixed;
}

/* ---------- Space ---------- */

html[data-theme="space"] {
    color-scheme: dark;
    --bg: #070915;
    --surface: rgba(23, 21, 51, .72);
    --surface-2: rgba(35, 31, 71, .6);
    --border: rgba(146, 122, 226, .22);
    --border-strong: rgba(160, 138, 235, .38);

    --text: #EDE8FF;
    --text-2: #A9A1D8;
    --text-3: #7E76AC;

    --accent: #B577E8;
    --accent-strong: #D7A8FF;
    --accent-soft: rgba(150, 100, 230, .18);
    --accent-border: rgba(170, 120, 245, .34);

    --green: #5ED6B0;
    --green-bright: #74EFC6;
    --green-soft: rgba(60, 190, 155, .14);
    --red: #F2799B;
    --red-bright: #FF8FAD;
    --red-soft: rgba(240, 100, 140, .15);
    --amber: #F0C46A;
    --amber-soft: rgba(240, 190, 100, .14);

    --topbar-bg: rgba(10, 10, 30, .7);
    --tabbar-bg: rgba(10, 10, 30, .82);
    --overlay-bg: rgba(4, 4, 16, .72);
    --grid: rgba(150, 130, 220, .16);
    --grid-soft: rgba(150, 130, 220, .1);
    --tooltip-bg: #2B2258;
    --tooltip-text: #F2ECFF;

    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 22px rgba(60, 30, 120, .35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55), 0 26px 70px rgba(70, 35, 140, .45);

    background: #070915;
}

html[data-theme="space"] body { background: transparent; }

#space-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    display: block;
}

html[data-theme="space"] .topbar,
html[data-theme="space"] .tabbar,
html[data-theme="space"] .card,
html[data-theme="space"] .stat,
html[data-theme="space"] .dialog,
html[data-theme="space"] .chart-card,
html[data-theme="space"] .account-menu {
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

html[data-theme="space"] .card,
html[data-theme="space"] .stat,
html[data-theme="space"] .chart-card {
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
}

html[data-theme="space"] .page-title,
html[data-theme="space"] .auth-title {
    text-shadow: 0 0 22px rgba(170, 120, 245, .5);
}

html[data-theme="space"] .brand-mark,
html[data-theme="space"] .user-avatar {
    box-shadow: 0 0 18px rgba(180, 120, 250, .5);
}

html[data-theme="space"] .btn-primary {
    background: linear-gradient(135deg, #8E5CE6, #C36BE0);
    color: #fff;
}

html[data-theme="space"] .btn-primary:hover {
    background: linear-gradient(135deg, #9E6DF2, #D47DEF);
}

/* Тёмные темы: инпуты и таблицы */

html[data-theme="dark"] .form input,
html[data-theme="dark"] .form select,
html[data-theme="dark"] .form textarea,
html[data-theme="space"] .form input,
html[data-theme="space"] .form select,
html[data-theme="space"] .form textarea {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="space"] input::placeholder { color: var(--text-3); }

html[data-theme="dark"] .alarm,
html[data-theme="space"] .alarm {
    background: rgba(230, 90, 80, .16);
    border-color: rgba(240, 120, 110, .4);
    color: var(--text);
}

html[data-theme="dark"] .badge-planned,
html[data-theme="space"] .badge-planned { background: var(--accent-soft); color: var(--accent-strong); }
html[data-theme="dark"] .badge-done,
html[data-theme="space"] .badge-done { background: var(--green-soft); color: var(--green-bright); }
html[data-theme="dark"] .badge-canceled,
html[data-theme="space"] .badge-canceled { background: var(--surface-2); color: var(--text-3); }
html[data-theme="dark"] .badge-inprogress,
html[data-theme="space"] .badge-inprogress { background: var(--amber-soft); color: var(--amber); }

/* ============================================================
   Меню аккаунта · аватар · выбор темы
   ============================================================ */

.account { position: relative; }

.account-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 5px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}

.account-btn:hover { background: var(--surface-2); border-color: var(--border); }
.account-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-border); }

.account-caret { color: var(--text-3); flex: none; transition: transform .18s; }
.account-btn[aria-expanded="true"] .account-caret { transform: rotate(180deg); }

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.user-avatar { overflow: hidden; padding: 0; }

.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 288px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 16px;
    z-index: 60;
    display: none;
}

.account-menu.open { display: block; animation: menuIn .16s ease-out; }

@keyframes menuIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.account-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.account-avatar-lg {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent-strong);
    font-family: var(--font-display);
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: none;
}

.account-name { font-weight: 700; font-size: 15px; color: var(--text); }
.account-role { font-size: 12px; color: var(--text-3); }

.account-avatar-actions { display: flex; gap: 8px; margin-top: 8px; }

.avatar-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    padding: 5px 11px;
    cursor: pointer;
}

.avatar-pick:hover { filter: brightness(.97); }
.avatar-remove { font-size: 12px; color: var(--text-3); border-radius: 999px; padding: 5px 10px; }
.avatar-remove:hover { color: var(--red); background: var(--red-soft); }

.menu-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-3);
    margin: 14px 0 9px;
}

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.theme-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    text-align: left;
    transition: border-color .15s, color .15s, transform .12s;
}

.theme-opt:hover { transform: translateY(-1px); color: var(--text); }
.theme-opt.active { border-color: var(--accent); color: var(--accent-strong); box-shadow: 0 0 0 2px var(--accent-soft); }

.theme-swatch {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    flex: none;
    border: 1px solid rgba(0, 0, 0, .12);
}

.sw-light { background: linear-gradient(135deg, #FFFFFF 48%, #A85D77 48%); }
.sw-dark { background: linear-gradient(135deg, #23222A 48%, #C77E9A 48%); }
.sw-yogurt { background: linear-gradient(135deg, #EFE7FF 48%, #7C5CE0 48%); }
.sw-space { background: linear-gradient(135deg, #0B0B22 40%, #B577E8 100%); }

.menu-divider { height: 1px; background: var(--border); margin: 14px 0 12px; }

.menu-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid transparent;
}

.menu-logout:hover { border-color: var(--red); }

@media (max-width: 720px) {
    .account-menu { position: fixed; top: 62px; right: 10px; left: 10px; width: auto; }
    .account-btn { padding: 4px; }
}

/* Непрозрачные поверхности поверх контента в теме Space */
html[data-theme="space"] .account-menu {
    background: rgba(17, 15, 41, .97);
    border-color: var(--accent-border);
}

html[data-theme="space"] .dialog,
html[data-theme="space"] .timer-widget {
    background: rgba(19, 17, 45, .97);
}

html[data-theme="space"] .theme-opt,
html[data-theme="space"] .avatar-pick {
    background: rgba(40, 34, 78, .85);
}


/* Заработок по заказу */
.cell-earn { color: var(--green); font-weight: 600; }


/* ==========================================================================
   СКЛАД (BETA)
   ========================================================================== */

.beta-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: var(--font-body, inherit);
    text-transform: uppercase;
}

.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn-line {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-line:hover { border-color: var(--accent); color: var(--accent-strong); }

.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    margin-top: 10px;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.hint-card {
    padding: 14px 16px;
    margin-bottom: 16px;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
}

/* — верхний блок склада — */
.stock-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.audit-date { font-size: 20px; font-weight: 600; margin: 2px 0 10px; }
.audit-date.muted { color: var(--text-3); font-size: 16px; font-weight: 500; }
.audit-result { display: flex; gap: 8px; margin: 0 0 10px; }

.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.pill-found { background: rgba(46, 122, 84, 0.12); color: var(--green); }
.pill-missing { background: rgba(188, 74, 62, 0.12); color: var(--red); }

.progress {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    transition: width .35s ease;
}

.audit-live {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    border-color: var(--accent);
}
.audit-live-text { flex: 1 1 240px; }
.audit-live-badge {
    display: inline-block;
    margin-bottom: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent, #fff);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
}
.audit-live .progress { margin-top: 10px; }

/* — склады — */
.wh-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wh-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
}
.wh-name { flex: 1; font-weight: 600; }
.wh-count { color: var(--text-2); font-size: 13px; }

.form-inline-end { margin-top: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* — товары — */
.item-cell { display: flex; align-items: center; gap: 10px; }
.item-cell-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-name { font-weight: 600; color: var(--text); text-decoration: none; }
.item-name:hover { color: var(--accent-strong); text-decoration: underline; }
.item-code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-3);
}
.item-thumb {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--surface-2);
    flex: none;
}
.item-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 18px; }
.item-photo { width: 100%; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 12px; }

.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.qty-btn-lg { width: 46px; height: 46px; font-size: 24px; }
.qty-value { min-width: 64px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.qty-low { color: var(--amber); }
.qty-zero { color: var(--red); }
.qty-big { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0 14px; }
.qty-big-value { font-size: 34px; font-weight: 700; font-family: var(--font-display); font-variant-numeric: tabular-nums; }

.badge-found { background: rgba(46, 122, 84, 0.14); color: var(--green); }
.badge-missing { background: rgba(188, 74, 62, 0.14); color: var(--red); }

.cell-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }

/* — карточка товара и QR — */
.item-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    align-items: start;
}
.qr-card { text-align: center; }
.qr-holder {
    display: flex;
    justify-content: center;
    padding: 14px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border);
}
.qr-holder svg { display: block; max-width: 100%; height: auto; }
.qr-code-text {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    letter-spacing: 3px;
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0 4px;
}

.scan-result {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.scan-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    flex: none;
}
.scan-good { border-color: var(--green); }
.scan-good .scan-icon { background: var(--green); }
.scan-bad { border-color: var(--red); text-align: center; flex-direction: column; }
.scan-bad .scan-icon { background: var(--red); }
.scan-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }

/* — учёт (мини-игра) — */
.audit-progress-card {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.audit-score { font-family: var(--font-display); font-size: 30px; font-weight: 700; white-space: nowrap; }
.score-found { color: var(--green); }
.score-sep, .score-total { color: var(--text-3); }
.audit-progress-body { flex: 1 1 220px; }
.audit-progress-body .card-note { margin: 8px 0 0; }

.scanner-card { margin-bottom: 16px; }
.scanner-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 12px;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}
.scanner-box video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame {
    position: absolute;
    inset: 14%;
    border: 3px solid rgba(255, 255, 255, .85);
    border-radius: 16px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .28);
}
.scanner-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.scan-flash {
    margin: 12px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    animation: flashIn .2s ease;
}
.flash-good { background: rgba(46, 122, 84, 0.14); color: var(--green); border: 1px solid var(--green); }
.flash-bad { background: rgba(188, 74, 62, 0.14); color: var(--red); border: 1px solid var(--red); }
@keyframes flashIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.audit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.audit-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
    transition: background .25s ease, border-color .25s ease;
}
.audit-item-main { display: flex; align-items: center; gap: 10px; }
.audit-item-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.audit-item-name { font-weight: 600; }
.audit-item-sub { font-size: 12px; color: var(--text-2); }
.audit-item-status { font-size: 12px; font-weight: 600; color: var(--text-2); min-width: 42px; text-align: right; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); flex: none; }

.audit-found { border-color: var(--green); background: rgba(46, 122, 84, 0.10); }
.audit-found .status-dot { background: var(--green); }
.audit-found .audit-item-status { color: var(--green); }
.audit-missing { border-color: var(--red); background: rgba(188, 74, 62, 0.10); }
.audit-missing .status-dot { background: var(--red); }
.audit-missing .audit-item-status { color: var(--red); }
.just-scanned { animation: scanPop .6s ease; }
@keyframes scanPop {
    0% { transform: scale(1); }
    35% { transform: scale(1.025); box-shadow: 0 0 0 6px rgba(46, 122, 84, .18); }
    100% { transform: scale(1); }
}

.audit-item-extra { margin-top: 8px; }
.audit-item-extra summary { cursor: pointer; font-size: 12px; color: var(--text-2); }
.audit-item-extra summary:hover { color: var(--accent-strong); }
.row-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.row-form input { flex: 1 1 140px; }
.row-form .btn { flex: none; }

.audit-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.audit-history a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    background: var(--surface-2);
}
.audit-history a:hover { border-color: var(--accent); }
.audit-history-date { font-weight: 600; }
.audit-history-scope { flex: 1; color: var(--text-2); font-size: 13px; }

.dialog-wide { max-width: 520px; }

@media (max-width: 720px) {
    .head-actions { width: 100%; }
    .head-actions .btn { flex: 1; justify-content: center; }
    .form-row { grid-template-columns: 1fr; }
    .audit-score { font-size: 26px; }
    .stock-table .item-thumb { width: 34px; height: 34px; }
}

@media print {
    .topbar, .tabbar, .head-actions, .btn, .form, #hosting-banner { display: none !important; }
    .card { border: 0; box-shadow: none; }
}

/* тёмные темы: QR всегда на белом фоне, чтоб�� читался камерой */
[data-theme="dark"] .qr-holder,
[data-theme="space"] .qr-holder,
[data-theme="yogurt"] .qr-holder { background: #fff; }

.nav-beta {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .8px;
    padding: 2px 5px;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    vertical-align: super;
}

/* Кнопка-файл для снимка QR (фолбэк для Safari без HTTPS) */
.btn-file {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.scanner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 640px) {
    .scanner-actions .btn,
    .scanner-actions .btn-file {
        flex: 1 1 100%;
    }
}

/* ============================================================ Навигация: меню «Ещё» */
.nav-more {
    position: relative;
}

.nav-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

.nav-more-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 210px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(20, 16, 14, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 60;
}

.nav-more-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-more-item {
    display: block;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
}

.nav-more-item:hover,
.nav-more-item.active {
    background: var(--surface-2);
    color: var(--accent-strong);
}

/* Нижняя шторка «Ещё» */
.tab-more {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

.more-sheet {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 14, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 120;
}

.more-sheet[hidden] {
    display: none;
}

.more-sheet-panel {
    width: min(560px, 100%);
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 12px 16px calc(90px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: sheet-up 0.22s ease;
}

@keyframes sheet-up {
    from { transform: translateY(24px); opacity: 0.4; }
    to { transform: translateY(0); opacity: 1; }
}

.more-sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    margin: 2px auto 10px;
}

.more-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}

.more-sheet-item.active {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.more-sheet-icon {
    font-size: 1.4rem;
}

.more-sheet-item strong {
    display: block;
    font-size: 0.98rem;
}

.more-sheet-item em {
    display: block;
    font-style: normal;
    font-size: 0.82rem;
    color: var(--text-2);
    margin-top: 2px;
}

/* ============================================================ Портфолио */
.portfolio-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.stat-chip {
    flex: 1 1 140px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-chip-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-chip-value {
    display: block;
    margin-top: 4px;
    font-family: var(--font-display), Georgia, serif;
    font-size: 1.35rem;
    color: var(--text);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.work-card {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.work-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(20, 16, 14, 0.12);
}

.work-card.work-fav {
    border-color: var(--accent);
}

.work-photo {
    position: relative;
    aspect-ratio: 4 / 5;
    background: var(--surface-2);
}

.work-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.work-star {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.86);
    color: var(--accent-strong);
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.work-price {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.work-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.work-title {
    margin: 0;
    font-size: 1rem;
    font-family: var(--font-display), Georgia, serif;
}

.work-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-2);
}

.pill-soft {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
}

.work-desc {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-2);
}

.work-edit summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--accent-strong);
    padding: 4px 0;
}

.work-edit .form {
    margin-top: 8px;
    gap: 8px;
}

.work-edit-actions {
    display: flex;
    justify-content: flex-end;
}

/* Загрузка фото в модалке */
.photo-drop {
    position: relative;
    display: block;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

.photo-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.photo-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 26px 16px;
    text-align: center;
    color: var(--text-2);
    font-size: 0.9rem;
}

.photo-drop-icon {
    font-size: 1.7rem;
}

.photo-preview {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    display: block;
}

/* Просмотр фото */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 9, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
}

.lightbox[hidden] {
    display: none;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 640px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .work-body {
        padding: 10px;
    }

    .work-title {
        font-size: 0.92rem;
    }

    .stat-chip {
        flex: 1 1 calc(50% - 10px);
        padding: 10px 12px;
    }
}

/* ============================================================ Финансовая панель */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.kpi {
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-hero {
    background: linear-gradient(140deg, var(--accent), var(--accent-strong));
    border-color: transparent;
    color: #fff;
}

.kpi-hero .kpi-label,
.kpi-hero .kpi-foot {
    color: rgba(255, 255, 255, 0.82);
}

.kpi-hero .kpi-value {
    color: #fff;
}

.kpi-wide {
    grid-column: span 2;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-value {
    font-family: var(--font-display), Georgia, serif;
    font-size: 1.5rem;
    color: var(--text);
    line-height: 1.2;
}

.kpi-service {
    font-size: 1.15rem;
}

.kpi-foot {
    font-size: 0.8rem;
    color: var(--text-2);
}

/* Цель месяца */
.goal-card {
    position: relative;
    margin-bottom: 18px;
}

.goal-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-bottom: 12px;
}

.goal-numbers strong {
    display: block;
    font-family: var(--font-display), Georgia, serif;
    font-size: 1.3rem;
}

.goal-num-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.goal-bar {
    height: 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow: hidden;
}

.goal-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    transition: width 0.4s ease;
}

.goal-hint {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: var(--text-2);
}

.goal-percent {
    position: absolute;
    top: 16px;
    right: 16px;
    font-family: var(--font-display), Georgia, serif;
    font-size: 1.1rem;
    color: var(--accent-strong);
}

.goal-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.goal-form .input {
    flex: 1;
}

.goal-form input[type="number"] {
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    min-height: 44px;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.goal-form input[type="number"]::-webkit-outer-spin-button,
.goal-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.goal-form input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================================ Клиенты */
.client-search {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 0 18px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(28, 25, 23, .05));
    transition: border-color .15s, box-shadow .15s;
}
.client-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.client-search .input {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    border: none;
    background: transparent;
    padding: 8px 6px 8px 38px;
    min-height: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
}
.client-search .input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}
.client-search .input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") no-repeat center;
    cursor: pointer;
}
.client-search .btn { flex: none; border-radius: 12px; }

@media (max-width: 480px) {
    .client-search { padding: 8px; gap: 8px; }
    .client-search .input { font-size: 14.5px; }
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.client-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
}

.client-card-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    font-size: 18px;
    line-height: 1;
    transform: rotate(-6deg);
    z-index: 2;
}

.client-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--accent), var(--accent-strong));
    color: #fff;
    font-family: var(--font-display), Georgia, serif;
    font-size: 1.2rem;
}

.client-name {
    margin: 0;
    font-size: 1.05rem;
    font-family: var(--font-display), Georgia, serif;
}

.client-contact {
    margin: 2px 0 0;
    font-size: 0.86rem;
    color: var(--text-2);
}

.client-contact a {
    color: var(--accent-strong);
    text-decoration: none;
}

.client-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.client-facts dt {
    font-size: 0.74rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.client-facts dd {
    margin: 2px 0 0;
    font-size: 0.98rem;
    color: var(--text);
}

.client-next {
    margin: 0;
    font-size: 0.86rem;
    color: var(--accent-strong);
}

.client-likes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.client-likes-label {
    font-size: 0.74rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.client-notes {
    margin: 0;
    font-size: 0.87rem;
    color: var(--text-2);
}

.client-edit summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--accent-strong);
    padding: 2px 0;
}

.client-edit .form {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-edit-actions {
    display: flex;
    justify-content: flex-end;
}

/* VIP */
.vip-card {
    margin-bottom: 18px;
}

.vip-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid transparent;
}

.vip-item.vip-top {
    border-color: var(--border);
}

.vip-medal {
    width: 28px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-2);
}

.vip-name {
    flex: 1;
    font-size: 0.98rem;
}

.vip-visits {
    font-size: 0.8rem;
    color: var(--text-2);
}

.vip-sum {
    font-family: var(--font-display), Georgia, serif;
    color: var(--accent-strong);
}

/* ============================================================ Аналитика */
.analytics-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.month-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.month-row {
    display: grid;
    grid-template-columns: 92px 1fr 100px 130px;
    align-items: center;
    gap: 10px;
}

.month-name {
    font-size: 0.9rem;
}

.month-name em {
    display: block;
    font-style: normal;
    font-size: 0.74rem;
    color: var(--text-2);
}

.month-track {
    height: 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow: hidden;
}

.month-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    border-radius: 999px;
}

.month-sum {
    font-family: var(--font-display), Georgia, serif;
    text-align: right;
}

.month-profit {
    font-size: 0.8rem;
    text-align: right;
    color: var(--text-2);
}

.service-stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.service-stat-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.service-stat-name {
    font-size: 0.95rem;
}

.service-stat-percent {
    font-family: var(--font-display), Georgia, serif;
    color: var(--accent-strong);
}

.service-track {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow: hidden;
}

.service-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.service-stat-foot {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-2);
}

.dow-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    height: 190px;
    padding-top: 10px;
}

.dow-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 5px;
}

.dow-bar {
    width: 100%;
    max-width: 34px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    min-height: 6px;
}

.dow-count {
    font-size: 0.8rem;
    color: var(--text-2);
}

.dow-label {
    font-size: 0.8rem;
    color: var(--text);
}

.empty-card {
    text-align: center;
}

.head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .kpi {
        padding: 11px 12px;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    .clients-grid {
        grid-template-columns: 1fr;
    }

    .month-row {
        grid-template-columns: 74px 1fr 88px;
    }

    .month-profit {
        display: none;
    }

    .goal-numbers {
        gap: 14px;
    }
}

/* ============================================================
   Перестройка расположения: чёткая группировка разделов,
   сворачиваемая детальная статистика, кнопки на всю ширину
   на телефоне. Цвета и тема не менялись.
   ============================================================ */

.section-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-3);
    margin: 0 0 10px;
}

.kpi-details { margin-bottom: 18px; }

.kpi-details summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.kpi-details summary::-webkit-details-marker { display: none; }

.kpi-details summary .kpi-details-caret {
    color: var(--text-3);
    transition: transform .18s ease;
    flex: none;
}

.kpi-details[open] summary .kpi-details-caret { transform: rotate(180deg); }

.kpi-details summary:hover { border-color: var(--accent); }

.kpi-details .kpi-grid { margin-top: 12px; margin-bottom: 0; }

@media (max-width: 760px) {
    .page-head {
        flex-direction: column;
        align-items: stretch;
    }
    .page-head > .head-actions,
    .page-head > .btn,
    .page-head > a.btn,
    .page-head > button.btn {
        width: 100%;
    }
    .head-actions {
        width: 100%;
        flex-direction: column;
    }
    .head-actions .btn,
    .head-actions form {
        width: 100%;
    }
    .head-actions form .btn { width: 100%; }
}

/* Кнопки +/- на складе — увеличиваем для удобного нажатия пальцем на телефоне */
@media (max-width: 760px) {
    .qty-btn { width: 44px; height: 44px; font-size: 19px; }
    .qty-controls { gap: 10px; }
}

/* ============================================================ Универсальный сканер QR (быстрые действия) */
.topbar-scan-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--accent-strong);
    margin-right: 10px;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.topbar-scan-btn:hover { background: var(--accent-soft); border-color: var(--accent-border); transform: translateY(-1px); }
.topbar-scan-btn:active { transform: scale(.94); }

.more-sheet-item-scan {
    width: 100%;
    text-align: left;
    border: 1px solid var(--accent-border);
    background: var(--accent-soft);
    cursor: pointer;
    font: inherit;
}
.more-sheet-item-scan strong { color: var(--accent-strong); }

.scan-dialog {
    max-width: 460px;
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .22s ease;
}
.scan-overlay.open .scan-dialog { animation: sheet-pop .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-pop {
    from { transform: translateY(18px) scale(.97); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.scan-camera-view .scanner-tag { font-weight: 600; text-align: center; margin: 4px 0 2px; }
.scan-camera-view .card-note { text-align: center; }
.scan-camera-view .form-inline-end {
    margin: 16px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 280px;
}
.scan-camera-view .form-inline-end label {
    flex: none;
    width: 100%;
    font-size: 12.5px;
    color: var(--text-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}
.scan-camera-view .form-inline-end label input {
    width: 100%;
    text-align: center;
    font: inherit;
    font-size: 15px;
    letter-spacing: 1px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    min-height: 44px;
    transition: border-color .15s, box-shadow .15s;
}
.scan-camera-view .form-inline-end label input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.scan-camera-view .form-inline-end button {
    width: 100%;
    align-self: center;
}

.scan-result-panel {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .24s ease, transform .24s ease;
}
.scan-result-panel.scan-result-in { opacity: 1; transform: none; }

.scan-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.scan-card-photo {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
    background: #fff;
}
.scan-card-photo-empty {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    background: var(--accent-soft);
}
.scan-card-photo-tall { max-height: 260px; object-fit: contain; background: #fff; }
.scan-card-photo-wide { max-height: 200px; object-fit: contain; background: #fff; }
.scan-card-body { padding: 4px 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.scan-card-kind {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent-strong);
}
.scan-card-title { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 500; }
.scan-card-sub { margin: 0; font-size: 13.5px; color: var(--text-2); }

.scan-used-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 12.5px;
    font-weight: 700;
}

.scan-loyalty-toggle {
    display: flex;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
}
.scan-loyalty-tab {
    flex: 1;
    padding: 9px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-2);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
.scan-loyalty-tab.active { background: var(--accent); color: #fff; }

.scan-loyalty-pane { display: flex; flex-direction: column; gap: 12px; animation: flashIn .18s ease; }
.scan-loyalty-pane label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
}

/* Крупное поле суммы/баллов в сканере */
.scan-loyalty-pane input[type="number"] {
    font: inherit;
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-display);
    text-align: center;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    min-height: 56px;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    transition: border-color .15s, box-shadow .15s;
}
.scan-loyalty-pane input[type="number"]::-webkit-outer-spin-button,
.scan-loyalty-pane input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.scan-loyalty-pane input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.scan-loyalty-pane input[type="number"]:disabled {
    background: var(--surface-2, #f5f5f4);
    color: var(--text-3);
    border-style: dashed;
}

/* Быстрые суммы-чипсы */
.scan-quick-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.scan-chip {
    padding: 11px 6px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease, border-color .15s, background .15s, color .15s;
}
.scan-chip:active { transform: scale(.95); }
.scan-chip.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

/* Выбор режима списания — карточки вместо голых радиокнопок */
.scan-loyalty-redeem-opts { display: flex; flex-direction: column; gap: 8px; }
.radio-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color .15s, background .15s, color .15s;
}
.radio-line:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}
.radio-line input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex: none;
    margin: 0;
}

/* Итог операции — сколько баллов начислится */
.scan-calc-hint {
    margin: 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-2);
    min-height: 18px;
}
.scan-calc-hint b { color: var(--accent-strong); font-size: 15px; }

.scan-loyalty-pane .btn-block { min-height: 52px; font-size: 15.5px; font-weight: 700; }

.loyalty-points-row { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.loyalty-points-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--accent-strong); transition: transform .18s ease; }
.loyalty-points-label { font-size: 12.5px; color: var(--text-2); }

.qty-pulse { animation: scanPop .5s ease; }

.scan-result-foot { margin-top: 4px; }

.btn-danger {
    background: var(--red-soft);
    color: var(--red);
    border: 1px solid var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

/* ============================================================ Быстрые действия (дашборд) */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.quick-action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--text);
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.quick-action-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--accent-border); }
.quick-action-tile:active { transform: scale(.97); }
.quick-action-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}
.quick-action-tile.quick-action-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-color: transparent;
    color: #fff;
}
.quick-action-tile.quick-action-primary .quick-action-icon { background: rgba(255,255,255,.22); color: #fff; }

/* ============================================================ Мобильная шапка-приветствие */
.mobile-hero { display: none; }
@media (max-width: 760px) {
    .mobile-hero {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 22px 20px 24px;
        border-radius: 20px;
        margin-bottom: 18px;
        background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
        color: #fff;
        box-shadow: var(--shadow-lg);
        animation: heroIn .32s ease;
    }
    @keyframes heroIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
    .mobile-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .mobile-hero-greeting { font-family: var(--font-display); font-size: 20px; font-weight: 500; margin: 0; }
    .mobile-hero-sub { margin: 2px 0 0; font-size: 13px; opacity: .85; }
    .mobile-hero-avatar {
        width: 42px; height: 42px; border-radius: 50%;
        background: rgba(255,255,255,.22);
        display: flex; align-items: center; justify-content: center;
        font-family: var(--font-display); font-size: 17px; overflow: hidden; flex: none;
    }
    .mobile-hero-stats { display: flex; gap: 10px; }
    .mobile-hero-stat {
        flex: 1;
        background: rgba(255,255,255,.16);
        border-radius: 14px;
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .mobile-hero-stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
    .mobile-hero-stat-value { font-family: var(--font-display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

    body.has-mobile-hero .stats { display: none; }

    .quick-actions { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-bottom: 16px; }
    .quick-action-tile { padding: 12px 6px; font-size: 11px; }
    .quick-action-icon { width: 40px; height: 40px; font-size: 18px; }
}

/* ============================================================ Плавные анимации по всему сайту */
.card, .stat, .table tbody tr, .quick-action-tile, .more-sheet-item, .audit-history a {
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.btn { transition: transform .15s ease, box-shadow .15s ease, background .18s ease, border-color .18s ease, color .18s ease; }
.btn:active { transform: scale(.97); }
a, .nav-link, .tab-item, .more-sheet-item { transition: color .18s ease, background .18s ease, border-color .18s ease; }
.page-head, .card, .stats, .quick-actions, .mobile-hero { animation: fadeInUp .28s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .scan-dialog, .scan-result-panel, .mobile-hero, .quick-action-tile, .page-head, .card, .stats, .quick-actions,
    .scan-overlay.open .scan-dialog { animation: none !important; transition: none !important; }
}

/* ============================================================ AI-анализ (чат) */
.ai-page-head .page-title { display: flex; align-items: center; gap: 8px; }
.ai-chat-wrap { display: flex; flex-direction: column; gap: 14px; }
.ai-templates { display: flex; flex-direction: column; gap: 8px; }
.ai-template-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-chip {
    border: 1px solid var(--accent-border);
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.ai-chip:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.ai-chip:active { transform: scale(.96); }

.ai-chat-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 420px;
}
.ai-chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    max-height: 52vh;
    overflow-y: auto;
}
.ai-msg { display: flex; align-items: flex-start; gap: 10px; max-width: 92%; }
.ai-msg-user { align-self: flex-end; flex-direction: row; margin-left: auto; }
.ai-msg-bot { align-self: flex-start; }
.ai-msg-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); font-size: 15px;
}
.ai-msg-bubble {
    background: var(--bg-soft, #f4f4f6);
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    box-shadow: var(--shadow);
}
.ai-msg-user .ai-msg-bubble {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
}
.ai-typing { display: flex; align-items: center; gap: 10px; padding: 0 18px 14px; }
.ai-typing-dots { display: flex; gap: 4px; padding: 10px 14px; background: var(--bg-soft, #f4f4f6); border-radius: 16px; }
.ai-typing-dots span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent-strong);
    opacity: .4; animation: aiTypingBlink 1.1s infinite ease-in-out;
}
.ai-typing-dots span:nth-child(2) { animation-delay: .15s; }
.ai-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes aiTypingBlink { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }

.ai-chat-input-row {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.ai-chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 11px 16px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
}
.ai-chat-input:focus { outline: none; border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-chat-send { border-radius: 999px; padding: 10px 20px; }
.ai-chat-send:disabled, .ai-chat-input:disabled { opacity: .6; cursor: not-allowed; }

@media (max-width: 760px) {
    .ai-chat-messages { max-height: 60vh; }
    .ai-msg { max-width: 100%; }
}

/* ============================================================ Достижения */
.progress-bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    transition: width .4s ease;
}

.achievements-progress-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.achievements-progress-head {
    display: flex;
    align-items: center;
    gap: 18px;
}
.achievements-progress-ring {
    --pct: 0;
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--border) 0);
}
.achievements-progress-ring::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: var(--surface);
}
.achievements-progress-ring-value {
    position: relative;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}
.achievements-progress-bar { margin-top: 4px; }

.achievements-category-card { margin-top: 16px; }
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.achievement-tile {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: transform .15s, border-color .15s;
}
.achievement-tile.is-earned {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}
.achievement-tile.is-locked { opacity: .72; }
.achievement-tile.is-locked .achievement-tile-icon { filter: grayscale(1); opacity: .6; }
.achievement-tile-icon { font-size: 30px; line-height: 1; flex-shrink: 0; }
.achievement-tile-icon-img-wrap { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.achievement-tile-icon-img { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; display: block; }
.achievement-tile.is-locked .achievement-tile-icon-img { filter: grayscale(1); opacity: .6; }
.achievement-tile-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.achievement-tile-title { font-size: 14.5px; color: var(--text); }
.achievement-tile-desc { font-size: 12.5px; color: var(--text-2); }
.achievement-tile-status { font-size: 12px; margin-top: 4px; }
.achievement-tile-status-earned { color: var(--accent-strong); font-weight: 600; }
.achievement-tile-progress { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.achievement-tile-progress .progress-bar { flex: 1; }
.achievement-tile-progress-label { font-size: 11.5px; color: var(--text-3); min-width: 32px; text-align: right; }

/* Плавная анимация появления при получении достижения */
.achievement-celebration {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 16, .55);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
    padding: 20px;
}
.achievement-celebration.open { opacity: 1; visibility: visible; }
.achievement-celebration-card {
    position: relative;
    max-width: 380px;
    width: 100%;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-lg, 20px);
    padding: 36px 28px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    transform: scale(.82) translateY(18px);
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
}
.achievement-celebration.open .achievement-celebration-card {
    transform: scale(1) translateY(0);
}
.achievement-celebration-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 8px;
    animation: achievement-icon-pop .6s ease;
}
@keyframes achievement-icon-pop {
    0% { transform: scale(.4) rotate(-8deg); opacity: 0; }
    60% { transform: scale(1.15) rotate(4deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}
.achievement-celebration-kicker {
    margin: 0 0 4px;
    font-size: 12.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent-strong);
    font-weight: 700;
}
.achievement-celebration-title {
    margin: 0 0 8px;
    font-family: var(--font-display), Georgia, serif;
    font-size: 22px;
    color: var(--text);
}
.achievement-celebration-desc {
    margin: 0 0 10px;
    font-size: 13.5px;
    color: var(--text-2);
}
.achievement-celebration-hype {
    margin: 0 0 20px;
    font-size: 13.5px;
    color: var(--text);
    font-style: italic;
}
.achievement-celebration-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.achievement-celebration-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.achievement-celebration.open .achievement-celebration-confetti::before,
.achievement-celebration.open .achievement-celebration-confetti::after {
    content: "🎉";
    position: absolute;
    top: -10%;
    font-size: 28px;
    animation: achievement-confetti-fall 1.8s ease-in forwards;
}
.achievement-celebration.open .achievement-celebration-confetti::before { left: 18%; animation-delay: .05s; }
.achievement-celebration.open .achievement-celebration-confetti::after { left: 74%; animation-delay: .25s; content: "✨"; }
@keyframes achievement-confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(120vh) rotate(160deg); opacity: 0; }
}

/* Кнопка включения уведомлений в меню аккаунта */
.menu-notif-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 4px;
    border: none;
    background: none;
    font: inherit;
    font-size: 13.5px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    border-radius: var(--radius-sm);
}
.menu-notif-btn:hover { background: var(--surface-2, var(--bg)); }
.menu-notif-btn:disabled { opacity: .55; cursor: not-allowed; }
.menu-notif-btn.is-done { color: var(--accent-strong); }
.menu-notif-btn.is-info { color: var(--text-2); }
.menu-notif-btn svg { flex-shrink: 0; }


/* ============================================================ Карточки заказов */

.order-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-card {
    display: grid;
    grid-template-columns: 116px 1fr auto;
    gap: 16px;
    align-items: start;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--border-strong);
    border-radius: 16px;
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s, transform .12s;
}

.order-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-strong);
}

.order-card.order-planned { border-left-color: var(--accent); }
.order-card.order-done { border-left-color: var(--green, #3fae6a); }
.order-card.order-canceled { border-left-color: var(--border-strong); opacity: .68; }
.order-card.order-live { border-left-color: #e0a800; background: linear-gradient(90deg, rgba(224, 168, 0, .07), transparent 40%); }

/* Колонка со временем */
.order-card-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}

.order-date {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.order-duration { font-size: 12px; color: var(--text-3); }

/* Центральная часть */
.order-card-main { display: flex; flex-direction: column; gap: 9px; min-width: 0; }

.order-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.order-client { font-size: 15px; font-weight: 700; color: var(--text); }

.order-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.order-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-2);
    text-decoration: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-chip-service { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); font-weight: 600; }
.order-chip-earn { background: var(--green-soft, #e7f6ec); border-color: transparent; color: var(--green, #2f8f52); font-weight: 700; }
.order-chip-link:hover { border-color: var(--accent); color: var(--accent-strong); }

.order-desc {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.5;
}

.order-photo-link { display: inline-block; }

.order-photo {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Действия */
.order-card-actions { display: flex; align-items: center; gap: 8px; }

.order-act {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 13px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .12s;
}

.order-act:active { transform: scale(.95); }

.order-act-done:hover {
    border-color: var(--green, #3fae6a);
    background: var(--green-soft, #e7f6ec);
    color: var(--green, #2f8f52);
}

.order-act-del { padding: 9px 11px; }

.order-act-del:hover {
    border-color: #e58a8a;
    background: #fdecec;
    color: #c94f4f;
}

@media (max-width: 820px) {
    .order-card {
        grid-template-columns: 1fr;
        gap: 11px;
        padding: 14px;
    }
    .order-card-time {
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
        padding-top: 0;
    }
    .order-card-actions { justify-content: flex-end; }
    .order-act { flex: 1; justify-content: center; }
    .order-act-del { flex: 0 0 auto; }
}


/* ============================================================ Блок услуг */

.services-panel { margin-top: 18px; }

.services-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.services-head-left { display: flex; align-items: center; gap: 10px; }

.services-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12.5px;
    font-weight: 700;
}

.services-filter {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 14px;
    scrollbar-width: none;
}

.services-filter::-webkit-scrollbar { display: none; }

.service-tab {
    flex: none;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}

.service-tab:hover { border-color: var(--accent); color: var(--accent-strong); }
.service-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 11px;
}

.service-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s, transform .12s;
}

.service-tile:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.service-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 13px;
    background: var(--accent-soft);
    font-size: 21px;
}

.service-tile-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }

.service-tile-name {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.service-tile-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.service-tile-price { font-size: 13.5px; font-weight: 700; color: var(--accent-strong); }
.service-tile-noprice { font-size: 12.5px; color: var(--text-3); }

.service-tile-cat {
    font-size: 11.5px;
    color: var(--text-3);
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-2);
}

.service-tile-del {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s, background .15s, color .15s;
}

.service-tile:hover .service-tile-del { opacity: 1; }
.service-tile-del:hover { background: #fdecec; color: #c94f4f; }

@media (hover: none) {
    .service-tile-del { opacity: 1; }
}

.service-add-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 74px;
    border: 1.5px dashed var(--border-strong);
    border-radius: 16px;
    background: transparent;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.service-add-tile:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
    background: var(--accent-soft);
}

/* Сетка эмодзи в модалке */
.emoji-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.emoji-option {
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    font-size: 21px;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .12s;
}

.emoji-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.emoji-option:active { transform: scale(.93); }
.emoji-option.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

@media (max-width: 560px) {
    .services-grid { grid-template-columns: 1fr; }
}


/* Карточка, открытая из push-уведомления */
html { scroll-behavior: smooth; }

.order-card:target,
.order-card.is-focused {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    animation: orderPing 1.6s ease-out 2;
}

@keyframes orderPing {
    0% { box-shadow: 0 0 0 0 var(--accent-soft); }
    60% { box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); }
    100% { box-shadow: 0 0 0 3px var(--accent-soft); }
}

/* ============================================================
   Modal (.modal-overlay / .modal) — единое оформление модалок
   Используется на: Клиенты (Новая клиентка), Портфолио (Новая работа)
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(28, 25, 23, .45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s, visibility .18s;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

/* Модалка внутри универсального .overlay (страница Клиенты) */
.overlay > .modal,
.modal-overlay > .modal {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 22px 22px calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateY(12px) scale(.98);
    transition: transform .18s ease;
}

.overlay.open > .modal,
.modal-overlay.open > .modal { transform: none; }

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.modal-head h2,
.modal-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.modal-close,
.icon-btn {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    color: var(--text-3);
    background: var(--surface-2);
    transition: background .15s, color .15s;
}

.modal-close:hover,
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-strong); }

/* Поля формы с подписями (.field / .field-label) */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.modal .form { gap: 14px; }

.modal .input,
.modal textarea.input {
    font: inherit;
    font-size: 16px; /* 16px — iOS не зумит при фокусе */
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    min-height: 46px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}

.modal textarea.input { min-height: 78px; resize: vertical; line-height: 1.45; }

.modal .input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal .btn-block { margin-top: 4px; min-height: 48px; }

/* На телефоне — нижний «шит» на всю ширину */
@media (max-width: 560px) {
    .overlay:has(> .modal),
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .overlay > .modal,
    .modal-overlay > .modal {
        max-width: none;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
        padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
        transform: translateY(24px);
    }

    .modal-head { position: sticky; top: -18px; background: var(--surface); z-index: 1; padding-top: 4px; }
}

/* ===== Карусель фото в портфолио ===== */
.work-carousel { position: relative; overflow: hidden; }
.work-carousel .work-slides { position: relative; width: 100%; height: 100%; }
.work-carousel .work-slide { display: none; width: 100%; height: 100%; object-fit: cover; }
.work-carousel .work-slide.is-active { display: block; }
.work-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border: none; border-radius: 50%;
    background: rgba(20, 12, 20, 0.42); color: #fff; font-size: 22px; line-height: 1;
    cursor: pointer; opacity: 0.85; backdrop-filter: blur(4px);
}
.work-nav:hover { opacity: 1; }
.work-prev { left: 8px; }
.work-next { right: 8px; }
.work-dots {
    position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px;
}
.work-dot {
    width: 7px; height: 7px; padding: 0; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.55); cursor: pointer;
}
.work-dot.is-active { background: #fff; transform: scale(1.25); }
.work-counter {
    position: absolute; top: 10px; left: 10px;
    padding: 2px 8px; border-radius: 999px; font-size: 12px;
    background: rgba(20, 12, 20, 0.45); color: #fff;
}
.photo-drop-count { display: block; margin-top: 6px; font-size: 13px; opacity: 0.75; }
.work-photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.work-photo-item { position: relative; width: 62px; height: 62px; }
.work-photo-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.work-photo-del {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
    border: none; border-radius: 50%; background: rgba(20, 12, 20, 0.7);
    color: #fff; font-size: 14px; line-height: 1; cursor: pointer;
}
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 28px; line-height: 1;
    cursor: pointer;
}
.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }
.lightbox-counter {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 14px; opacity: 0.85;
}

/* ===== Эмодзи-знак карточки клиентки (имя остаётся чистым) ===== */
.client-sign-hint {
    display: inline-block;
    margin: 2px 0 0;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ===== Знакомая клиентка в форме записи ===== */
.known-client-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-top: -4px;
    border: 1px solid var(--accent-border);
    background: var(--accent-soft);
    border-radius: 12px;
    animation: known-client-in 0.18s ease;
}

@keyframes known-client-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.known-client-hint-badge {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--accent-border);
    font-size: 15px;
}

.known-client-hint-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.known-client-hint-title {
    font-size: 13px;
    color: var(--accent-strong);
}

.known-client-hint-title strong {
    font-weight: 700;
}

.known-client-hint-last {
    font-size: 12px;
    color: var(--text-2);
}

/* ===== Выбор нескольких услуг в записи ===== */
.service-choices-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-choices-label {
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.75;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.service-choices-hint {
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: none;
    opacity: 0.65;
}

.service-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 190px;
    overflow-y: auto;
    padding: 4px 2px;
}

.service-choice {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.service-choice input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.service-choice-body {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    line-height: 1.2;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.service-choice:hover .service-choice-body {
    border-color: rgba(255, 255, 255, 0.32);
}

.service-choice.is-on .service-choice-body {
    border-color: rgba(168, 130, 255, 0.85);
    background: rgba(168, 130, 255, 0.22);
    transform: translateY(-1px);
}

.service-choice.is-on .service-choice-body::after {
    content: "✓";
    font-size: 0.82rem;
    opacity: 0.9;
}

.service-choice-price {
    font-size: 0.82rem;
    opacity: 0.75;
}

.service-choices-total {
    margin: 0;
    font-size: 0.86rem;
    opacity: 0.85;
}

.order-chip-total {
    background: rgba(168, 130, 255, 0.2);
    border-color: rgba(168, 130, 255, 0.5);
}

/* ===== Клиентка не пришла: предложение написать ей ===== */
#noshow-overlay .dialog {
    max-width: 420px;
}

.noshow-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 14px;
    margin-bottom: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.noshow-contact-label {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.6;
}

.noshow-contact-value {
    font-size: 1rem;
    font-weight: 600;
    word-break: break-all;
}

.noshow-message-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 0.86rem;
    opacity: 0.9;
}

.noshow-message-field textarea {
    width: 100%;
    resize: vertical;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    line-height: 1.4;
}

#noshow-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 6px;
}

#noshow-actions .btn {
    text-align: center;
    text-decoration: none;
}

.btn-secondary {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger-ghost {
    color: var(--red-bright);
}

/* ===== Ближайшая клиентка + лайв-таймер ===== */
.next-client {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
    border-radius: 20px;
    border: 1px solid var(--accent-border);
    background: linear-gradient(135deg, var(--accent-soft), var(--surface));
    box-shadow: var(--shadow);
}

.next-client-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.next-client-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
    font-weight: 600;
}

.next-client-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.next-client-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.next-client-avatar {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(140deg, var(--accent), var(--accent-strong));
    color: #fff;
    font-family: var(--font-display), Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
}

.next-client-badge {
    position: absolute;
    bottom: -6px;
    right: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    font-size: 14px;
    line-height: 1;
    transform: rotate(-6deg);
}

.next-client-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.next-client-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.next-client-meta {
    font-size: 0.82rem;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-client-hint {
    display: inline-block;
    align-self: flex-start;
    margin-top: 1px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 600;
}

.next-client-timer-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-top: 2px;
    border-top: 1px dashed var(--border);
    padding-top: 12px;
}

.next-client-timer {
    font-variant-numeric: tabular-nums;
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    color: var(--accent-strong);
}

.next-client-timer.is-relative {
    font-size: 1.4rem;
    font-variant-numeric: normal;
}

.next-client-when {
    font-size: 0.84rem;
    color: var(--text-2);
    font-weight: 500;
}

.next-client.is-live {
    border-color: var(--green-bright);
    background: linear-gradient(135deg, var(--green-soft), var(--surface));
}

.next-client.is-live .next-client-timer {
    color: var(--green-bright);
    animation: next-client-pulse 2s ease-in-out infinite;
}

.next-client.is-late {
    border-color: var(--red-bright);
    background: linear-gradient(135deg, var(--red-soft), var(--surface));
}

.next-client.is-late .next-client-timer {
    color: var(--red-bright);
}

@keyframes next-client-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.next-client-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.next-client-actions .btn {
    text-decoration: none;
}

.next-client-empty {
    background: var(--surface);
    border: 1px dashed var(--border-strong);
}

.next-client-empty-text {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-2);
}

.next-client-empty-text a {
    color: var(--accent-strong);
    font-weight: 600;
}
