﻿:root {
    --bg: #09080f;
    --bg-elev: #100d1f;
    --surface: #151128;
    --surface-soft: #1b1531;
    --surface-strong: #21183d;
    --text: #f2eeff;
    --text-muted: #b2a9d6;
    --line: #322653;
    --line-soft: #2a2146;
    --primary: #7f4dff;
    --primary-soft: #2a1f4b;
    --success: #11c982;
    --warning: #f0b441;
    --danger: #ef4f74;
    --radius: 16px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: var(--text);
    background:
        radial-gradient(120% 80% at 15% -20%, #2a1450 0%, transparent 45%),
        radial-gradient(80% 60% at 100% 0%, #1f1240 0%, transparent 42%),
        linear-gradient(180deg, #09080f 0%, #0d0a18 100%);
}

.mobile-app {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 460px;
    margin: 0 auto;
    background: transparent;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(13, 10, 25, 0.94);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(8px);
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}

.icon-btn:hover { filter: brightness(1.08); }

.hamburger {
    display: inline-block;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: #d9d2ff;
    box-shadow: 0 -5px 0 #d9d2ff, 0 5px 0 #d9d2ff;
}

.topbar-title {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.topbar-title strong {
    font-size: 1rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-title small {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-pill {
    margin-left: auto;
    font-size: 0.73rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--text);
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.status-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.app-content {
    flex: 1;
    padding: 12px 12px 88px;
    display: grid;
    gap: 12px;
}

.panel {
    background: linear-gradient(180deg, rgba(31, 23, 57, 0.95) 0%, rgba(22, 17, 43, 0.96) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    display: grid;
    gap: 10px;
}

h2, h3, h4 {
    margin: 0;
    line-height: 1.2;
}

h2 { font-size: 1.02rem; }
h3 { font-size: 0.95rem; }
h4 { font-size: 0.85rem; color: var(--text-muted); }

.row {
    display: flex;
    align-items: center;
}

.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }

.btn {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.active { border-color: var(--primary); color: #d8cbff; }
.btn.primary { background: #6f3dff; border-color: #6f3dff; color: #fff; }
.btn.success { background: #0f9d67; border-color: #0f9d67; color: #fff; }
.btn.warning { background: #6d5621; border-color: #8a6a2a; color: #ffd88a; }
.btn.danger { background: #8a2a45; border-color: #a93456; color: #ffe3ea; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 6px 10px; font-size: 0.75rem; border-radius: 10px; }

.input, select.input, textarea.input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text);
    background: #120f24;
}

.input::placeholder,
textarea.input::placeholder { color: #9c93c2; }

.input:focus,
select.input:focus,
textarea.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(127, 77, 255, 0.22);
}

.form-grid {
    display: grid;
    gap: 10px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-size: 0.79rem;
    color: var(--text-muted);
}

.grid-kpi {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.grid-kpi article {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: rgba(24, 19, 45, 0.92);
    display: grid;
    gap: 4px;
}

.grid-kpi span { font-size: 0.75rem; color: var(--text-muted); }
.grid-kpi strong { font-size: 1rem; color: #f6f3ff; }

.summary-box {
    background: rgba(27, 21, 49, 0.95);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    font-size: 0.85rem;
}

.summary-box.ok {
    background: rgba(18, 71, 49, 0.35);
    border-color: rgba(46, 178, 122, 0.45);
    color: #8ef0c7;
}

.summary-box.warn {
    background: rgba(97, 74, 30, 0.35);
    border-color: rgba(210, 164, 76, 0.45);
    color: #ffd88f;
}

.list-cards {
    display: grid;
    gap: 8px;
}

.card-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(23, 18, 44, 0.97);
    padding: 10px;
    display: grid;
    gap: 8px;
}

.card-item.active {
    border-color: #8a61ff;
    background: rgba(42, 30, 80, 0.96);
}

.card-item strong { display: block; font-size: 0.92rem; color: #f4f1ff; }
.card-item small { display: block; color: var(--text-muted); font-size: 0.75rem; margin-top: 2px; }

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

.list-simple {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.list-simple li {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(24, 19, 44, 0.97);
    padding: 8px;
    font-size: 0.82rem;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.list-simple li span small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

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

.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(22, 17, 40, 0.97);
    color: var(--text);
    font-size: 0.78rem;
    padding: 6px 10px;
    cursor: pointer;
}

.chip.active {
    background: rgba(127, 77, 255, 0.3);
    border-color: #8f68ff;
    color: #f5f0ff;
}

.chip input { margin-right: 6px; }

.inline-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.payment-box {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(20, 15, 38, 0.92);
    padding: 10px;
    display: grid;
    gap: 10px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: min(430px, calc(100% - 20px));
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 50;
    background: rgba(21, 17, 39, 0.98);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
}

.nav-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    border-radius: 12px;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 7px 4px;
    display: grid;
    gap: 4px;
    justify-items: center;
    align-items: center;
}

.icon-lucide {
    width: 18px;
    height: 18px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.nav-btn .icon-lucide {
    opacity: 0.72;
}

.nav-icon {
    font-size: 1rem;
    line-height: 1;
}

.nav-label {
    font-size: 0.62rem;
    line-height: 1;
}

.nav-btn.active {
    color: #ffffff;
    border-color: rgba(152, 111, 255, 0.7);
    background: linear-gradient(180deg, rgba(129, 71, 255, 0.95) 0%, rgba(99, 49, 224, 0.95) 100%);
}

.nav-btn.active .icon-lucide {
    opacity: 1;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(6, 5, 12, 0.72);
    display: block;
    padding: 0;
}

.modal-card {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: auto;
    border-radius: 0;
    background: #120f22;
    border: 0;
    box-shadow: none;
    position: relative;
}

.modal-close {
    position: sticky;
    top: 10px;
    margin: 10px 10px 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(21, 17, 39, 0.95);
    color: #cfc6ef;
    font-size: 1.15rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.modal-body {
    padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
    display: grid;
    gap: 10px;
}

.app-drawer {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 90;
    width: min(320px, 86%);
    background: #0f0c1d;
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 20px rgba(0, 0, 0, 0.4);
    transform: translateX(-110%);
    transition: transform 0.2s ease;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.app-drawer.open {
    transform: translateX(0);
}

.drawer-head {
    padding: calc(14px + env(safe-area-inset-top)) 14px 12px;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 2px;
}

.drawer-head strong { font-size: 1rem; }
.drawer-head small { color: var(--text-muted); font-size: 0.75rem; }

.drawer-nav {
    padding: 6px;
    display: grid;
    gap: 2px;
    align-content: start;
    grid-auto-rows: max-content;
    overflow: auto;
}

.drawer-item {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    cursor: pointer;
}

.drawer-item.active {
    background: rgba(127, 77, 255, 0.22);
    border-color: rgba(145, 97, 255, 0.5);
    color: #efe9ff;
}

.drawer-logout {
    margin: 8px;
    text-decoration: none;
    text-align: center;
    border-radius: 12px;
    border: 1px solid rgba(239, 79, 116, 0.55);
    background: rgba(106, 27, 49, 0.45);
    color: #ffdce6;
    font-weight: 700;
    padding: 10px 12px;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.drawer-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 84px;
    transform: translateX(-50%) translateY(16px);
    opacity: 0;
    background: #1e1740;
    color: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    z-index: 200;
    transition: all 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success { background: #0d6f4b; border-color: #199b6b; }
.toast.error { background: #7d2741; border-color: #aa3b5b; }

@media (min-width: 960px) {
    .app-content {
        padding: 16px 18px 24px;
        max-width: 1180px;
        width: 100%;
        margin: 0 auto;
    }

    .app-topbar {
        padding: 16px 18px;
    }

    .mobile-app {
        display: flex;
        min-height: 100vh;
    }
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-shell {
    width: min(420px, 100%);
}

.auth-card {
    background: linear-gradient(180deg, rgba(24, 19, 44, 0.97) 0%, rgba(16, 13, 31, 0.98) 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 18px;
    display: grid;
    gap: 10px;
}

.auth-card h1 {
    margin: 0;
    font-size: 1.3rem;
}

.auth-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-card label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
}

.auth-card input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    font-size: 0.94rem;
    background: #130f27;
    color: var(--text);
}

.auth-card button[type="submit"] {
    border: 0;
    border-radius: 12px;
    background: #6f3dff;
    color: #fff;
    padding: 11px;
    font-size: 0.95rem;
    font-weight: 700;
}

.alert.error {
    border: 1px solid rgba(239, 79, 116, 0.65);
    background: rgba(122, 32, 55, 0.45);
    color: #ffdce6;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.82rem;
}
