:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --ink: #1f2733;
    --muted: #68758a;
    --line: #e3e8f0;
    --brand: #1f5f4b;
    --brand-2: #2b8a6b;
    --brand-ink: #0f3d30;
    --accent: #c9a227;
    --sidebar: #12232e;
    --sidebar-ink: #c7d3da;
    --sidebar-active: #1f5f4b;
    --danger: #c0392b;
    --success: #1e7f43;
    --warning: #b7791f;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", Roboto, "Noto Sans Devanagari", "Nirmala UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }

/* ---------------------------------------------------------------- shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px; flex: 0 0 250px; background: var(--sidebar); color: var(--sidebar-ink);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: .65rem; align-items: center; padding: 1.1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-2), var(--accent)); color: #fff; font-weight: 800; }
.brand-text strong { display: block; color: #fff; font-size: .95rem; }
.brand-text small { color: #93a6b1; font-size: .72rem; }
.nav { padding: .75rem .5rem; display: flex; flex-direction: column; gap: .15rem; }
.nav-section { color: #6d8492; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; padding: 1rem .75rem .35rem; }
.nav-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: 8px; color: var(--sidebar-ink); font-size: .88rem; }
.nav-item:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar-foot { margin-top: auto; padding: .5rem; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; background: var(--surface); border-bottom: 1px solid var(--line); padding: .7rem 1.25rem; position: sticky; top: 0; z-index: 20; }
.hamburger { display: none; font-size: 1.3rem; background: none; border: none; cursor: pointer; }
.global-search { flex: 1 1 auto; display: flex; max-width: 520px; }
.global-search input { flex: 1; padding: .55rem .8rem; border: 1px solid var(--line); border-right: none; border-radius: 8px 0 0 8px; font-size: .9rem; }
.global-search button { padding: 0 1rem; border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 0 8px 8px 0; cursor: pointer; }
.topbar-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: .5rem; }
.user-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; }
.user-meta strong { display: block; font-size: .85rem; }
.user-meta small { color: var(--muted); font-size: .72rem; }
.content { padding: 1.25rem; flex: 1 1 auto; }
.footer { padding: 1rem 1.25rem; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- page head */
.page-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.4rem; }
.page-head p { margin: 0; color: var(--muted); }
.page-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-head { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; }
.card-head h3 { margin: 0; font-size: 1rem; }
.card-head .page-actions { margin-left: auto; }
.card-body { padding: 1.1rem; }
.grid { display: grid; gap: 1rem; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); display: block; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.stat-card:hover { transform: translateY(-2px); text-decoration: none; }
.stat-card .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 1.9rem; font-weight: 700; margin: .25rem 0 0; }
.stat-card .sub { color: var(--muted); font-size: .78rem; }
.stat-card.accent-green .value { color: var(--success); }
.stat-card.accent-amber .value { color: var(--warning); }
.stat-card.accent-red .value { color: var(--danger); }
.stat-card.accent-brand .value { color: var(--brand); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th, table.data td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { background: #f8fafc; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; }
table.data tbody tr:hover { background: #f9fbfd; }
table.data td .muted, .muted { color: var(--muted); }
.actions-cell { white-space: nowrap; }
.actions-cell a, .actions-cell button { margin-right: .35rem; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-block; padding: .18rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: #eef2f7; color: #445; }
.badge.green { background: #e2f4e8; color: #1e7f43; }
.badge.red { background: #fbe6e3; color: #c0392b; }
.badge.amber { background: #fbf0da; color: #b7791f; }
.badge.blue { background: #e2ecfb; color: #2258a5; }
.badge.orange { background: #fde9d9; color: #c1662b; }
.badge.purple { background: #ece3fb; color: #6b39b8; }
.badge.teal { background: #dcf2ee; color: #1c7d6b; }
.badge.rose { background: #fbe0ec; color: #b83280; }
.badge.gray { background: #eef2f7; color: #55606f; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .85rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font-size: .85rem; font-weight: 600; text-decoration: none; }
.btn:hover { text-decoration: none; background: #f6f8fb; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-ghost { background: transparent; }
.btn-sm { padding: .3rem .55rem; font-size: .78rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .3rem; color: #3a4557; }
.field input, .field select, .field textarea {
    width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .88rem; font-family: inherit; background: #fff;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(43,138,107,.35); border-color: var(--brand-2); }
.field .hint { font-size: .74rem; color: var(--muted); margin-top: .25rem; }
.form-actions { display: flex; gap: .6rem; margin-top: 1.2rem; }
.inline-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { min-width: 180px; }

/* ---------------------------------------------------------------- filters */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }
.filters .field input, .filters .field select { padding: .45rem .6rem; }

/* ---------------------------------------------------------------- alerts */
.alert { padding: .75rem .95rem; border-radius: 8px; margin-bottom: 1rem; font-size: .88rem; border: 1px solid transparent; }
.alert-success { background: #e6f6ec; border-color: #b8e5c9; color: #186a37; }
.alert-error { background: #fdeaea; border-color: #f3c0c0; color: #a32920; }
.alert-warning { background: #fdf6e3; border-color: #f0dfa8; color: #8a6a10; }
.alert-info { background: #e9f1fd; border-color: #c2d6f5; color: #1d4f9c; }

/* ---------------------------------------------------------------- pagination */
.pagination { display: flex; gap: .3rem; margin-top: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .35rem .65rem; border: 1px solid var(--line); border-radius: 6px; font-size: .82rem; background: #fff; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { color: #b7c0cd; }

/* ---------------------------------------------------------------- auth */
.auth-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, #10222b, #1f5f4b 70%, #2b8a6b); padding: 1rem; }
.auth-card { background: #fff; border-radius: 16px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); padding: 2rem; width: min(400px, 100%); }
.auth-card .brand-mark { width: 52px; height: 52px; font-size: 1.1rem; }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head h1 { font-size: 1.25rem; margin: .8rem 0 .2rem; }
.auth-head p { margin: 0; color: var(--muted); font-size: .85rem; }
.auth-note { margin-top: 1rem; padding: .75rem; background: #f7f9fc; border-radius: 8px; font-size: .76rem; color: var(--muted); }

/* ---------------------------------------------------------------- misc */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.tag-list { display: flex; gap: .4rem; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.detail-item .lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.detail-item .val { font-weight: 600; word-break: break-word; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { padding: .45rem .8rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: .84rem; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab:hover { text-decoration: none; }
.progress-mini { background: #eef2f7; border-radius: 999px; height: 8px; overflow: hidden; margin-top: .35rem; }
.progress-mini > span { display: block; height: 100%; background: var(--brand-2); }
.contact-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

@media (max-width: 900px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .hamburger { display: block; }
    .topbar { flex-wrap: wrap; }
    .global-search { order: 3; width: 100%; max-width: none; }
    .user-meta { display: none; }
}
