:root {
    --gold: #F5D300;
    --black: #0A0A0A;
    --white: #FFFFFF;
    --soft: #F9FAFB;
    --muted: #6B7280;
    --line: rgba(0, 0, 0, .10);
    --purple: #7E22CE;
    --purple-soft: #FAF5FF;
    --radius: 12px;
    --shadow: none;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Poppins', Arial, sans-serif;
    background: var(--soft);
    color: var(--black);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app-shell { min-height: 100vh; display: flex; background: var(--soft); }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 224px;
    padding: 0;
    background: var(--white);
    color: #111827;
    border-right: 1px solid var(--line);
    z-index: 20;
    display: flex;
    flex-direction: column;
}
.brand { height: 81px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); }
.brand img { height: 48px; width: auto; object-fit: contain; }
.menu { display: grid; gap: 2px; padding: 12px; overflow-y: auto; }
.menu-item { display: flex; gap: 10px; align-items: center; min-height: 38px; padding: 8px 12px; border-radius: 8px; color: #4B5563; transition: .15s; font-size: 14px; font-weight: 400; }
.menu-item span { color: #6B7280; width: 18px; text-align: center; font-size: 15px; }
.menu-item:hover { background: #F9FAFB; color: #1F2937; }
.menu-item.active { background: var(--purple-soft); color: var(--purple); font-weight: 600; }
.menu-item.active span { color: var(--purple); }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); text-align: center; }
.sidebar-footer p { margin: 0 0 10px; color: #9CA3AF; font-size: 12px; }
.logout { display: block; border-radius: 8px; padding: 8px 10px; color: #6B7280; font-size: 13px; font-weight: 500; }
.logout:hover { background: #F9FAFB; color: #111827; }
.sidebar-backdrop { display: none; }

.main-content { margin-left: 224px; width: calc(100% - 224px); min-height: 100vh; overflow: auto; }
.topbar { padding: 32px 32px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.topbar h1 { margin: 0 0 4px; font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.topbar p { margin: 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 800; color: var(--gold); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.search-box { position: relative; min-width: 280px; }
.search-box input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; outline: none; background: var(--white); }
.icon-btn { border: 1px solid var(--line); background: var(--white); color: #111827; border-radius: 8px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; }
.profile-chip { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; display: grid; font-size: 13px; }
.profile-chip small { color: var(--muted); }
.mobile-menu { display: none; }
.page-content { padding: 32px; }

.grid { display: grid; gap: 20px; }
.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.card, .panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 24px; position: relative; overflow: hidden; }
.card::after { content: none; }
.card small { color: #374151; font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.card strong { display: block; font-size: 24px; line-height: 1; margin-top: 14px; font-weight: 600; }
.card p { margin: 8px 0 0; color: #6B7280; font-size: 12px; }
.panel { padding: 24px; margin-bottom: 24px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.panel-header h2 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 500; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid label { display: grid; gap: 7px; font-weight: 500; color: #111827; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 14px; background: var(--white); outline-color: var(--purple); }
textarea { min-height: 100px; resize: vertical; }
.full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; border: 1px solid transparent; border-radius: 8px; padding: 7px 14px; font-size: 14px; font-weight: 500; cursor: pointer; transition: .15s; }
.btn.primary, .btn.dark { background: #0F172A; color: var(--white); }
.btn.primary:hover, .btn.dark:hover { background: var(--purple); color: var(--white); }
.btn.ghost { background: var(--white); color: #111827; border-color: var(--line); }
.btn.ghost:hover { background: #F9FAFB; }
.btn.danger { background: var(--white); color: #DC2626; border-color: #FEE2E2; }
.btn.danger:hover { background: #FEF2F2; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; }
th, td { padding: 12px; border-bottom: 1px solid #F3F4F6; vertical-align: middle; font-size: 14px; }
tr:hover td { background: #F9FAFB; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid transparent; padding: 3px 9px; font-size: 12px; font-weight: 500; }
.badge-blue { background: #e8f1ff; color: #1455b8; }
.badge-purple { background: #F3E8FF; color: #7E22CE; border-color: #E9D5FF; }
.badge-orange { background: #fff1df; color: #b95f00; }
.badge-dark, .badge-black { background: #111; color: #fff; }
.badge-gold { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }
.badge-red { background: #ffe6e6; color: #b00020; }
.badge-green { background: #e9f9ee; color: #087b2f; }
.badge-light { background: var(--soft); color: var(--black); }
.text-green { color: #16A34A; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.list-card { margin-bottom: 0; }
.list-stack { display: grid; gap: 16px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.list-item.muted-item { background: #F9FAFB; border-color: transparent; }
.list-item strong { display: block; font-size: 14px; font-weight: 500; }
.list-item small, .list-item em { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-style: normal; }
.item-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item-right { text-align: right; display: grid; gap: 5px; justify-items: end; }
.icon-tile { width: 48px; height: 48px; border-radius: 10px; background: var(--purple-soft); color: var(--purple); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto; }
.empty-state { margin: 0; color: var(--muted); font-size: 14px; }
.alert { padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; font-weight: 700; }
.alert.error { background: #ffe7e7; color: #9b111e; }
.alert.success { background: #e9f9ee; color: #087b2f; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: var(--soft); }
.login-card { width: min(420px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: 0 12px 30px rgba(15, 23, 42, .06); }
.login-logo { width: 120px; height: auto; object-fit: contain; margin: 0 auto 20px; }
.login-card h1 { margin: 6px 0; line-height: 1.1; }
.login-card p { color: var(--muted); }

@media (max-width: 1100px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .search-box { min-width: 220px; }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(-105%); transition: .25s; box-shadow: 20px 0 50px rgba(15,23,42,.08); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 15; }
    .main-content { margin-left: 0; width: 100%; }
    .mobile-menu { display: inline-flex; align-items: center; justify-content: center; }
    .topbar { align-items: flex-start; padding: 20px 16px 0; flex-wrap: wrap; }
    .topbar-actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
    .search-box { min-width: 100%; order: 2; }
    .page-content { padding: 16px; }
    .form-grid, .cards { grid-template-columns: 1fr; }
    .panel-header { align-items: flex-start; flex-direction: column; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .list-item { align-items: flex-start; flex-direction: column; }
    .item-right { text-align: left; justify-items: start; }
}
