:root {
    --bg: #f4efe7;
    --bg-alt: #fcfaf7;
    --surface: #ffffff;
    --surface-soft: #f6f1ea;
    --surface-strong: #1f2937;
    --text: #1f2937;
    --muted: #667085;
    --line: #e7dccf;
    --brand: #b45309;
    --brand-strong: #92400e;
    --brand-soft: #fef3e2;
    --accent: #0f766e;
    --accent-soft: #dbf5f0;
    --info: #1d4ed8;
    --info-soft: #dbeafe;
    --success: #15803d;
    --success-soft: #dcfce7;
    --warning: #b45309;
    --warning-soft: #fef3c7;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --shadow: 0 20px 50px rgba(31, 41, 55, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --max-width: 1240px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Cairo", "DM Sans", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(180, 83, 9, 0.12), transparent 32%),
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 26%),
        linear-gradient(180deg, #fffdf9 0%, var(--bg) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

img {
    max-width: 100%;
}

.container {
    width: min(var(--max-width), calc(100% - 2rem));
    margin: 0 auto;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background: rgba(31, 41, 55, 0.94);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 700;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f59e0b, #b45309);
    color: #fff;
    box-shadow: 0 10px 26px rgba(180, 83, 9, 0.28);
}

.site-nav-links,
.inline-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    list-style: none;
}

.site-nav-links a,
.inline-links a {
    color: rgba(255, 255, 255, 0.82);
    transition: color 0.2s ease;
}

.site-nav-links a:hover,
.inline-links a:hover {
    color: #fff;
}

.hero-home {
    padding: 5rem 0 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
    align-items: stretch;
}

.hero-panel,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: var(--radius-xl);
}

.hero-panel {
    padding: 2rem;
}

.hero-banner {
    background:
        linear-gradient(135deg, rgba(146, 64, 14, 0.96), rgba(180, 83, 9, 0.94) 60%, rgba(245, 158, 11, 0.82) 100%);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.hero-banner::after {
    content: "";
    position: absolute;
    inset: auto -70px -90px auto;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 36px;
    transform: rotate(18deg);
}

.hero-banner h1,
.hero-panel h1,
.title-block h1,
.title-block h2 {
    line-height: 1.2;
}

.hero-banner p,
.hero-copy,
.muted,
.panel-copy,
.table-caption {
    color: var(--muted);
}

.hero-banner p {
    color: rgba(255, 255, 255, 0.88);
}

.eyebrow,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.eyebrow {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    margin-bottom: 1rem;
}

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

.badge.info {
    background: var(--info-soft);
    color: var(--info);
}

.badge.success {
    background: var(--success-soft);
    color: var(--success);
}

.badge.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-row,
.toolbar,
.top-actions,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 0.88rem 1.1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

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

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

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
}

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.section {
    padding: 1rem 0 4rem;
}

.section-title {
    margin-bottom: 1.5rem;
}

.cards-4,
.cards-3,
.cards-2,
.split-grid,
.mini-grid {
    display: grid;
    gap: 1rem;
}

.cards-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-2,
.split-grid,
.mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.feature-card,
.table-card,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.3rem;
    box-shadow: var(--shadow);
}

.metric-card strong,
.stat-card strong {
    display: block;
    font-size: 1.9rem;
    margin: 0.4rem 0;
}

.shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.sidebar {
    background:
        radial-gradient(circle at top, rgba(245, 158, 11, 0.18), transparent 24%),
        linear-gradient(180deg, #21160f 0%, #382215 100%);
    color: #fff;
    padding: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar .brand-mark {
    background: linear-gradient(135deg, #f59e0b, #c2410c);
}

.sidebar-copy,
.nav-section-label {
    color: rgba(255, 255, 255, 0.7);
}

.nav-section-label {
    margin: 1.5rem 0 0.75rem;
    font-size: 0.78rem;
}

.side-nav {
    display: grid;
    gap: 0.45rem;
}

.side-nav-link,
.side-nav-group-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.88rem 1rem;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.86);
    background: transparent;
    border: none;
    text-align: right;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.96rem;
    text-decoration: none;
}

.side-nav-link:hover,
.side-nav-group-toggle:hover,
.side-nav-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.side-nav-group {
    display: grid;
    gap: 0.35rem;
}

.side-nav-group-items {
    display: none;
    padding-right: 0.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: 0.25rem;
}

.side-nav-group.open .side-nav-group-items {
    display: grid;
}

.side-nav-group-items .side-nav-link {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    margin-top: 0.15rem;
    background: transparent;
}

.side-nav-group-toggle .chevron {
    display: inline-block;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
    color: rgba(255, 255, 255, 0.65);
}

.side-nav-group.open .side-nav-group-toggle .chevron {
    transform: rotate(180deg);
}

.sidebar-note {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.main {
    padding: 1.5rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.hero-dashboard {
    background: linear-gradient(135deg, #2d1b12 0%, #b45309 70%, #fdba74 100%);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 1.6rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1.25fr 0.85fr;
    gap: 1rem;
}

.hero-dashboard p {
    color: rgba(255, 255, 255, 0.88);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    padding: 1rem;
}

.hero-stat strong {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.panel {
    padding: 1.35rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.list {
    list-style: none;
    display: grid;
    gap: 0.9rem;
}

.list li,
.timeline-item,
.approval-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.list li:last-child,
.timeline-item:last-child,
.approval-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.stack {
    display: grid;
    gap: 1rem;
}

.soft-pills,
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.86rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.96rem;
}

th,
td {
    text-align: right;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-weight: 700;
}

tr:last-child td {
    border-bottom: 0;
}

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

.field {
    display: grid;
    gap: 0.45rem;
}

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

label {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    font: inherit;
    background: #fff;
    color: var(--text);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.12);
}

.helper {
    color: var(--muted);
    font-size: 0.88rem;
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    font-size: 0.94rem;
}

.alert.success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid #86efac;
}

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

.auth-shell {
    min-height: calc(100vh - 76px);
    display: grid;
    place-items: center;
    padding: 2rem 0 3rem;
}

.auth-grid {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.2rem;
}

.auth-side,
.auth-card {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-side {
    background: linear-gradient(135deg, #21160f 0%, #9a3412 70%, #f59e0b 100%);
    color: #fff;
    padding: 2rem;
    position: relative;
}

.auth-side::after {
    content: "";
    position: absolute;
    inset: auto -32px -54px auto;
    width: 180px;
    height: 180px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(12deg);
}

.auth-side p {
    color: rgba(255, 255, 255, 0.84);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 2rem;
}

.demo-box {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1rem;
}

.demo-box ul {
    list-style: none;
    display: grid;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.footer-note {
    color: var(--muted);
    text-align: center;
    padding: 1rem 0 2rem;
}

.hidden {
    display: none !important;
}

@media (max-width: 1100px) {
    .hero-grid,
    .auth-grid,
    .shell,
    .hero-dashboard,
    .cards-4,
    .cards-3,
    .cards-2,
    .split-grid,
    .mini-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(var(--max-width), calc(100% - 1rem));
    }

    .site-nav-inner,
    .topbar,
    .panel-header {
        align-items: stretch;
    }

    .site-nav-links,
    .top-actions,
    .actions,
    .toolbar,
    .btn-row {
        flex-direction: column;
    }

    .btn,
    .top-actions .btn,
    .actions .btn {
        width: 100%;
    }

    .hero-home {
        padding-top: 2.5rem;
    }

    .hero-panel,
    .auth-card,
    .auth-side,
    .main,
    .sidebar {
        padding: 1.2rem;
    }
}
