:root {
    --ink: #10231f;
    --ink-soft: #3d524c;
    --muted: #6b7f78;
    --line: rgba(16, 35, 31, 0.10);
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #f7faf8;
    --panel: #ffffff;
    --brand: #0d6b5c;
    --brand-deep: #084c42;
    --brand-soft: #d7f0ea;
    --accent: #e8a317;
    --accent-deep: #c4840a;
    --danger: #c23b3b;
    --warn: #d97706;
    --ok: #1f8a5b;
    --info: #2a6f97;
    --shadow: 0 18px 50px rgba(16, 35, 31, 0.10);
    --radius: 18px;
    --radius-sm: 12px;
    --sidebar-w: 268px;
    --font: "Manrope", system-ui, sans-serif;
    --display: "Sora", "Manrope", system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(13, 107, 92, 0.14), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(232, 163, 23, 0.12), transparent 50%),
        linear-gradient(180deg, #eef5f2 0%, #f5f7f6 40%, #e9f0ed 100%);
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: var(--display);
    margin: 0;
    letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

.muted { color: var(--muted); }

/* ===== Login ===== */
.login-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(8, 76, 66, 0.92), rgba(13, 107, 92, 0.75)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        #084c42;
    z-index: -1;
}

.login-grid {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

.login-hero {
    color: #fff;
    display: flex;
    align-items: center;
    padding: 64px;
}

.login-hero-inner { max-width: 520px; }

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.brand-lockup h1 {
    font-size: clamp(2.6rem, 5vw, 3.8rem);
    line-height: 0.95;
    font-weight: 800;
}

.brand-sub {
    margin: 4px 0 0;
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--accent), #f0c14d);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 10px 24px rgba(232, 163, 23, 0.35);
}

.brand-mark.xl {
    width: 72px;
    height: 72px;
    font-size: 1.4rem;
    border-radius: 20px;
}

.login-lead {
    font-size: 1.2rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 28px;
    max-width: 28ch;
}

.login-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.login-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.login-points li::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(232, 163, 23, 0.2);
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    backdrop-filter: blur(8px);
}

.login-form {
    width: min(420px, 100%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    padding: 36px 32px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
}

.login-form h2 { font-size: 1.55rem; }
.login-form label {
    display: grid;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.login-hint {
    margin: 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ===== App shell ===== */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, #0b3d35 0%, #0f4a40 45%, #123f38 100%);
    color: #e8f3ef;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    z-index: 40;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

.sidebar-brand strong {
    display: block;
    font-family: var(--display);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}

.sidebar-brand span {
    display: block;
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-nav {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.nav-label {
    margin: 18px 10px 8px;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(232, 243, 239, 0.45);
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(232, 243, 239, 0.82);
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(232, 163, 23, 0.95), rgba(232, 163, 23, 0.75));
    color: #13231f;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.nav-ico {
    width: 22px;
    text-align: center;
    opacity: 0.9;
}

.sidebar-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.user-chip strong,
.user-chip small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip small {
    color: rgba(232, 243, 239, 0.6);
    font-size: 0.75rem;
}

.btn-logout {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.main-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    backdrop-filter: blur(14px);
    background: rgba(247, 250, 248, 0.78);
    border-bottom: 1px solid var(--line);
}

.topbar-title h1 {
    font-size: 1.45rem;
}

.topbar-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 0.82rem;
    font-weight: 700;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(31, 138, 91, 0.55);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 10px rgba(31, 138, 91, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 138, 91, 0); }
}

.clock {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink-soft);
    min-width: 170px;
    text-align: right;
}

.menu-toggle {
    display: none;
    border: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
}

.content {
    padding: 24px 28px 40px;
    flex: 1;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 28px 22px;
    color: var(--muted);
    font-size: 0.82rem;
}

/* ===== UI kit ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 11px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff;
    box-shadow: 0 10px 24px rgba(13, 107, 92, 0.28);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #1a1a1a;
    box-shadow: 0 10px 24px rgba(232, 163, 23, 0.28);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
}

.btn-danger {
    background: #fde8e8;
    color: var(--danger);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn-block { width: 100%; }

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(13, 107, 92, 0.55);
    box-shadow: 0 0 0 4px rgba(13, 107, 92, 0.12);
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
}

.alert-error {
    background: #fde8e8;
    color: var(--danger);
}

.alert-ok {
    background: #e6f6ee;
    color: var(--ok);
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-head .actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(16, 35, 31, 0.04);
    padding: 20px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head h2,
.panel-head h3 {
    font-size: 1.05rem;
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 18px 18px 16px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(16, 35, 31, 0.04);
    animation: rise 0.55s ease both;
}

.stat::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 107, 92, 0.12), transparent 70%);
}

.stat .label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat .value {
    font-family: var(--display);
    font-size: 1.85rem;
    font-weight: 800;
    margin-top: 8px;
    letter-spacing: -0.03em;
}

.stat .hint {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.stat.accent .value { color: var(--brand); }
.stat.warn .value { color: var(--warn); }
.stat.ok .value { color: var(--ok); }
.stat.gold .value { color: var(--accent-deep); }

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.data th,
table.data td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

table.data th {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 800;
}

table.data tbody tr {
    transition: background 0.15s;
}

table.data tbody tr:hover {
    background: rgba(13, 107, 92, 0.04);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.badge-ok { background: #e6f6ee; color: var(--ok); }
.badge-warn { background: #fff4e5; color: var(--warn); }
.badge-danger { background: #fde8e8; color: var(--danger); }
.badge-info { background: #e7f2f8; color: var(--info); }
.badge-neutral { background: #eef2f0; color: var(--ink-soft); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid .full { grid-column: 1 / -1; }

.form-grid label {
    display: grid;
    gap: 7px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tab {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 700;
    cursor: pointer;
}

.tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: rise 0.35s ease both; }

.ticket-preview {
    background:
        linear-gradient(180deg, #fff 0%, #f8faf9 100%);
    border: 1px dashed rgba(13, 107, 92, 0.35);
    border-radius: 16px;
    padding: 22px;
    font-family: var(--display);
}

.ticket-preview .qr {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    background:
        repeating-linear-gradient(0deg, #10231f 0 2px, transparent 2px 6px),
        repeating-linear-gradient(90deg, #10231f 0 2px, transparent 2px 6px);
    opacity: 0.85;
    margin: 12px auto;
}

.ticket-preview .center { text-align: center; }
.ticket-preview .row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.9rem;
}

.spaces-map {
    display: grid;
    gap: 18px;
}

.zone-block h3 {
    margin-bottom: 12px;
    font-size: 0.98rem;
}

.slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
}

.slot {
    aspect-ratio: 1;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    border: 1px solid transparent;
    cursor: default;
    transition: transform 0.15s;
}

.slot:hover { transform: scale(1.04); }
.slot.free { background: #e6f6ee; color: var(--ok); border-color: rgba(31, 138, 91, 0.2); }
.slot.busy { background: #fde8e8; color: var(--danger); border-color: rgba(194, 59, 59, 0.2); }
.slot.reserved { background: #fff4e5; color: var(--warn); border-color: rgba(217, 119, 6, 0.2); }
.slot.vip { background: linear-gradient(145deg, #fff4d6, #ffe8a8); color: #8a6500; }
.slot.moto { border-radius: 50%; }

.legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-weight: 600;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend i {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
}

.chart-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: end;
    gap: 10px;
    height: 180px;
    padding-top: 10px;
}

.chart-bars .bar-wrap {
    display: grid;
    gap: 8px;
    justify-items: center;
    height: 100%;
    align-content: end;
}

.chart-bars .bar {
    width: 100%;
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, var(--brand), #178a76);
    min-height: 12px;
    animation: grow 0.8s ease both;
}

@keyframes grow {
    from { transform: scaleY(0.2); transform-origin: bottom; opacity: 0.3; }
    to { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
}

.chart-bars small {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.72rem;
}

.kpi-list {
    display: grid;
    gap: 12px;
}

.kpi-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.report-card {
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #f8fbfa);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.report-card:hover {
    transform: translateY(-3px);
    border-color: rgba(13, 107, 92, 0.35);
    box-shadow: 0 14px 28px rgba(16, 35, 31, 0.08);
}

.report-card strong {
    display: block;
    font-family: var(--display);
    margin-bottom: 6px;
}

.report-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.role-card {
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
}

.role-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.role-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    background: var(--ink);
    color: #fff;
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    z-index: 100;
    transform: translateY(20px);
    opacity: 0;
    transition: 0.25s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.reveal {
    animation: rise 0.7s ease both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

.split-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.money {
    font-family: var(--display);
    font-weight: 800;
    color: var(--brand-deep);
}

.empty-note {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
}

/* Responsive */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .login-grid { grid-template-columns: 1fr; }
    .login-hero { padding: 48px 28px 20px; min-height: auto; }
    .login-panel { padding-top: 10px; padding-bottom: 48px; }

    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        width: min(300px, 86vw);
        box-shadow: var(--shadow);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: inline-grid; place-items: center; }
    .content { padding: 18px 16px 32px; }
    .topbar { padding: 14px 16px; }
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .clock { display: none; }
}
