:root {
    --sidebar: #070b14;
    --sidebar-text: #9aa3b2;
    --sidebar-hover: #111827;
    --active: #2f6fed;
    --page: #f4f6f9;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e6e8ee;
    --primary: #2f6fed;
    --primary-hover: #2158d4;
    --danger: #ef4444;
    --warning-bg: #fff7ed;
    --warning-border: #fed7aa;
    --success-bg: #ecfdf3;
    --success-border: #bbf7d0;
    --danger-bg: #fff1f2;
    --danger-border: #fecdd3;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--page);
}

a { color: inherit; }

.guest-body { min-height: 100vh; background: #fff; }
.guest-shell { display: grid; min-height: 100vh; grid-template-columns: 42% 58%; }
.guest-brand {
    background: var(--sidebar);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 64px;
}
.guest-brand h1 { font-size: 32px; line-height: 1.25; margin: 36px 0 16px; font-weight: 650; }
.guest-brand p { color: #9aa3b2; margin: 0; max-width: 420px; line-height: 1.6; }
.guest-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: #f7f8fb; }
.guest-card { width: 100%; max-width: 440px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 36px; }

.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-name { font-weight: 700; }
.brand-sub { color: #9aa3b2; font-size: 13px; margin-top: 2px; }
.brand-mark { display: inline-flex; }
.brand-mark.sm { margin-right: 10px; }

.form-head h2 { margin: 0 0 8px; font-size: 26px; }
.form-head p { margin: 0 0 24px; color: var(--muted); }

.stack { display: grid; gap: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    background: #fff;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 12px) 18px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.data-table a { color: var(--primary); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.data-table .muted { margin-top: 4px; font-size: 12px; }
.req { color: var(--danger); margin-right: 4px; }

.btn {
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-block { width: 100%; }

.alert { border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-danger { background: var(--danger-bg); border: 1px solid var(--danger-border); color: #9f1239; }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: #9a3412; }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: #166534; }

.panel-body { display: flex; min-height: 100vh; background: var(--page); }
.sidebar {
    width: 248px;
    background: var(--sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 100vh;
}
.sidebar-brand {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: 700;
    letter-spacing: .06em;
    font-size: 14px;
}
.sidebar-nav { padding: 12px 12px 24px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sidebar-nav a, .sidebar-logout button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-decoration: none;
    color: var(--sidebar-text);
    background: transparent;
    border: 0;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}
.sidebar-nav a:hover, .sidebar-logout button:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active { background: var(--active); color: #fff; }
.sidebar-logout { margin-top: auto; }

.panel-main { flex: 1; min-width: 0; }
.panel-top {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}
.icon-btn {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    display: grid;
    align-content: center;
    gap: 5px;
    cursor: pointer;
}
.icon-btn span { display: block; height: 2px; width: 16px; background: #6b7280; }
.user-chip {
    background: #eef2ff;
    color: #1e3a8a;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
}
.panel-content { padding: 28px; }
.page-title h1,
.page-head h1 { margin: 0 0 8px; font-size: 26px; font-weight: 650; }
.page-head { margin-bottom: 18px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; color: #9aa3b2; font-size: 13px; }
.breadcrumb a { color: #6b7280; text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb strong { color: #6b7280; font-weight: 500; }

.page-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.subnav-tab {
    border: 0;
    background: #e8f1ff;
    color: var(--primary);
    border-radius: 8px;
    padding: 9px 14px;
    font-weight: 600;
    font-size: 13px;
}
.btn-outline {
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--primary);
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn-outline:hover { background: #f4f8ff; }
.btn-outline .plus { font-size: 16px; line-height: 1; }
.btn-ghost {
    background: transparent;
    color: #4b5563;
    border: 0;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}

.table-card { background: #fff; border-radius: 4px; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid #eef0f4; font-size: 14px; vertical-align: top; }
.data-table th { color: #6b7280; font-weight: 600; background: #fff; }
.data-table .col-check { width: 42px; }
.data-table .empty-row { color: var(--muted); text-align: left; padding: 28px 16px; }
.price-details { color: #4b5563; line-height: 1.7; }

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .28);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    z-index: 40;
}
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(560px, 100%);
    height: 100vh;
    background: #fff;
    z-index: 50;
    transform: translateX(100%);
    transition: transform .28s ease;
    box-shadow: -12px 0 32px rgba(15, 23, 42, .12);
}
.drawer-open .drawer-overlay { opacity: 1; visibility: visible; }
.drawer-open .drawer { transform: translateX(0); }
.drawer-form { height: 100%; display: flex; flex-direction: column; }
.drawer-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 18px; font-weight: 650; }
.drawer-close {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}
.drawer-body { padding: 22px; overflow: auto; flex: 1; }
.drawer-section { margin: 22px 0 14px; font-size: 15px; font-weight: 650; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field-full { grid-column: 1 / -1; }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.input-prefix span {
    display: grid;
    place-items: center;
    min-width: 42px;
    background: #f8fafc;
    color: #6b7280;
    border-right: 1px solid var(--line);
    font-weight: 600;
}
.input-prefix input { border: 0; border-radius: 0; box-shadow: none; }
.input-prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.drawer-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.stat-icon.indigo { background: #6366f1; }
.stat-icon.mint { background: #34d399; }
.stat-icon.amber { background: #f59e0b; }
.stat-icon.rose { background: #f43f5e; }
.stat-value { font-size: 22px; font-weight: 700; word-break: break-word; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card-head h3 { margin: 0 0 8px; }
.muted { color: var(--muted); margin: 0; }

.settings-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    background: #fff;
    border-radius: 8px;
    min-height: 560px;
    overflow: hidden;
}
.settings-nav {
    padding: 24px 16px;
    border-right: 1px solid var(--line);
    background: #fff;
}
.settings-nav-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    padding: 0 10px 12px;
}
.settings-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 4px;
}
.settings-nav a:hover { background: #f3f4f6; color: #111827; }
.settings-nav a.is-active { background: #e8f1ff; color: var(--primary); font-weight: 600; }
.settings-main { padding: 28px 32px; }
.settings-panel-head h2 { margin: 0 0 8px; font-size: 22px; }
.settings-panel-head p { margin: 0 0 22px; color: var(--muted); }
.status-list { display: grid; gap: 10px; }
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}
.status-row:hover { border-color: #c7d7fb; background: #f8fbff; }
.status-name { font-weight: 650; }
.status-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.status-pill.is-on { background: #dcfce7; color: #15803d; }
.status-pill.is-off { background: #f3f4f6; color: #6b7280; }

@media (max-width: 960px) {
    .guest-shell { grid-template-columns: 1fr; }
    .guest-brand { min-height: 280px; padding: 36px 24px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .sidebar { display: none; }
    .drawer-grid { grid-template-columns: 1fr; }
    .settings-shell { grid-template-columns: 1fr; }
    .settings-nav { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr; }
    .guest-card { padding: 24px; }
}
