:root {
    --bg: #a8cddd;
    --shell: #0f0f10;
    --shell-2: #171718;
    --panel: #1b1b1d;
    --panel-2: #222224;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f6f2ec;
    --muted: #a3a3ab;
    --yellow: #f2ff3c;
    --cyan: #57d2ff;
    --gray-dot: #66666c;
    --danger: #ff7373;
    --success: #86f7aa;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.18), transparent 18%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0, rgba(255, 255, 255, 0.12) 12px, transparent 12px, transparent 52px),
        linear-gradient(180deg, #a6cbdb 0%, #b5d4e1 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-frame {
    padding: 24px;
}

.app-shell {
    display: grid;
    grid-template-columns: 180px 1fr;
    min-height: calc(100vh - 48px);
    max-width: 1240px;
    margin: 0 auto;
    background: var(--shell);
    border-radius: 30px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar {
    background: var(--shell);
    padding: 28px 18px 24px;
    display: flex;
    flex-direction: column;
}

.logo-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    padding: 4px 4px 12px;
}

.logo-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--yellow), #dfe73b);
    color: #111;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.logo-block h1 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--yellow);
}

.logo-block p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.83rem;
}

.nav-links {
    display: grid;
    gap: 8px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 10px;
    color: #e8e8ea;
    transition: background 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background: #262628;
}

.nav-icon {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    display: inline-grid;
    place-items: center;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 10px 0;
    display: grid;
    gap: 10px;
}

.sidebar-footer a {
    color: var(--muted);
    font-size: 0.95rem;
}

.sidebar-footer a:last-child {
    color: var(--cyan);
}

.content-area {
    background: var(--shell);
    padding: 26px 24px 22px 8px;
}

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

.topbar-search {
    flex: 1;
    max-width: 360px;
    background: #1f1f21;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.topbar-search input::placeholder,
.search-form input::placeholder,
.form-grid input::placeholder,
.form-grid textarea::placeholder {
    color: #888890;
}

.search-icon,
.top-icon,
.avatar-pill {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #1f1f21;
    border: 1px solid var(--line);
    color: #fff;
    font-size: 0.75rem;
}

.avatar-pill {
    background: linear-gradient(135deg, #ff9d7a, #7e4bff);
    border: 0;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-text {
    color: #f2f0ee;
    font-size: 0.96rem;
}

.logout-btn,
.btn,
.btn-secondary,
.btn-danger,
.cta-pill {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease;
}

.btn,
.cta-pill {
    background: var(--yellow);
    color: #111;
    font-weight: 800;
}

.btn-secondary {
    background: #252527;
    color: var(--text);
    border-radius: 14px;
}

.btn-danger {
    background: #8c2f2f;
    color: #fff;
}

.btn:hover,
.btn-secondary:hover,
.cta-pill:hover {
    transform: translateY(-1px);
}

.panel,
.card,
.dashboard-panel,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
}

.panel h2,
.card h3,
.dashboard-panel h2,
.stat-card h3 {
    margin-top: 0;
}

.subtle {
    color: var(--muted);
    font-size: 0.92rem;
}

.eyebrow {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    margin: 0 0 8px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) 320px;
    gap: 18px;
}

.dashboard-main,
.dashboard-side {
    display: grid;
    gap: 18px;
}

.dashboard-head,
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.dashboard-title {
    margin: 0;
    font-size: 2.15rem;
    line-height: 1;
}

.dashboard-filters {
    display: flex;
    gap: 10px;
    color: var(--muted);
    font-size: 0.88rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    min-height: 150px;
}

.stat-card-featured {
    background: var(--yellow);
    color: #111;
    border-color: transparent;
}

.stat-card-featured .metric,
.stat-card-featured p {
    color: #111;
}

.metric {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    margin: 18px 0 12px;
}

.stat-card p {
    margin: 0;
    color: var(--muted);
}

.schedule-panel {
    min-height: 280px;
}

.trend-grid {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.trend-row {
    display: grid;
    grid-template-columns: 90px 1fr 110px;
    gap: 14px;
    align-items: center;
}

.trend-bar {
    height: 13px;
    border-radius: 999px;
    background: #2a2a2d;
    overflow: hidden;
}

.trend-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--yellow), #b9d432);
}

.activity-list,
.mini-list {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

.activity-item,
.mini-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.activity-item p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.activity-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd399, #ff7e7e);
    color: #111;
    display: grid;
    place-items: center;
    font-weight: 800;
    flex: 0 0 auto;
}

.donut-panel {
    text-align: center;
}

.donut-chart {
    --progress: 71%;
    width: 176px;
    height: 176px;
    margin: 12px auto 14px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--panel) 57%, transparent 58%),
        conic-gradient(var(--cyan) 0 var(--progress), #48484c var(--progress) 100%);
    display: grid;
    place-items: center;
}

.donut-center {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--panel);
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 900;
}

.legend-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 6px;
}

.legend-dot-cyan {
    background: var(--cyan);
}

.legend-dot-gray {
    background: var(--gray-dot);
}

.split-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
}

.toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.line-items-table select,
.line-items-table input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--panel-2);
    color: var(--text);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: #b7b7be;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

td {
    color: #f4f1eb;
}

.status-pill {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(134, 247, 170, 0.12);
    color: var(--success);
    font-size: 0.82rem;
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.line-items-table th,
.line-items-table td {
    min-width: 150px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 40;
}

.modal-backdrop.visible {
    display: flex;
}

.modal {
    width: min(960px, 100%);
    max-height: 92vh;
    overflow: auto;
    background: var(--shell-2);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(134, 247, 170, 0.12);
    color: var(--success);
}

.empty-state {
    padding: 26px 18px;
    color: var(--muted);
    text-align: center;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(440px, 100%);
    background: var(--shell);
    border: 1px solid var(--line);
}

.footer-note {
    margin-top: 18px;
    color: #82828a;
    text-align: center;
    font-size: 0.88rem;
}

@media (max-width: 1100px) {
    .dashboard-layout,
    .split-layout,
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .page-frame {
        padding: 12px;
    }

    .app-shell {
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .sidebar {
        border-bottom: 1px solid var(--line);
    }

    .content-area {
        padding: 18px 16px;
    }

    .topbar,
    .toolbar,
    .form-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .topbar-search {
        max-width: none;
    }

    .topbar-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .trend-row {
        grid-template-columns: 1fr;
    }
}
