:root {
    --navy: #082B59;
    --navy-deep: #061f41;
    --gold: #D7A43A;
    --saffron: #FF8A00;
    --green: #146C43;
    --red: #B3261E;
    --ink: #12233f;
    --muted: #55617a;
    --line: #dfe4ec;
    --bg: #f5f6f9;
    --sidebar: 240px;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans Tamil", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--navy); }
h1 { font-size: 1.55rem; margin: 0; color: var(--navy); }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; color: var(--navy); }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); font-size: .9rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.demo-banner { background: var(--saffron); color: #1d1200; font-weight: 600; text-align: center; padding: .4rem 1rem; font-size: .9rem; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: 0 0 var(--sidebar); background: var(--navy); color: #fff; padding: 1rem .75rem; }
.brand { display: block; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; line-height: 1.25; padding: .25rem .5rem 1rem; border-bottom: 1px solid rgba(255,255,255,.18); margin-bottom: .75rem; }
.brand small { display: block; color: var(--gold); font-weight: 500; font-size: .78rem; margin-top: .2rem; }
.nav-label { color: #c7d3e6; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; padding: .8rem .5rem .25rem; }
.sidebar nav a { display: block; color: #fff; text-decoration: none; padding: .45rem .6rem; border-radius: 6px; border-left: 3px solid transparent; }
.sidebar nav a:hover, .sidebar nav a:focus-visible { background: rgba(255,255,255,.12); }
.sidebar nav a.active { background: var(--navy-deep); border-left-color: var(--gold); font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem; background: #fff; border-bottom: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
.content { padding: 1.25rem; max-width: 1280px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }

.nav-check { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nav-toggle { display: none; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; padding: .3rem .6rem; font-weight: 600; color: var(--navy); }
.nav-check:focus-visible ~ .shell .nav-toggle { outline: 2px solid var(--saffron); }

@media (max-width: 960px) {
    .nav-toggle { display: inline-block; }
    .sidebar { display: none; }
    .nav-check:checked ~ .shell .sidebar { display: block; position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; overflow-y: auto; box-shadow: 0 0 30px rgba(0,0,0,.35); }
    .content { padding: 1rem; }
}

.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 10px; padding: .8rem 1rem; }
.stat .label { color: var(--muted); font-size: .82rem; }
.stat .value { font-size: 1.45rem; font-weight: 700; color: var(--navy); }
.stat .sub { color: var(--muted); font-size: .8rem; }
.stat.alert { border-top-color: var(--red); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
th.right, td.right { text-align: right; }
tfoot td { font-weight: 700; background: #fafbfd; }

.chip { display: inline-block; padding: .08rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.chip-good { background: #dff1e8; color: #0c5233; }
.chip-bad { background: #fbe3e1; color: #8c1d18; }
.chip-warn { background: #fdf0d3; color: #6b4a00; }
.chip-info { background: #e3ebf7; color: var(--navy); }

.btn { display: inline-block; font: inherit; font-weight: 600; font-size: .88rem; padding: .42rem .85rem; border-radius: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--navy-deep); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--saffron); outline-offset: 1px; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1d1200; }
.btn-gold:hover { background: #c49430; }
.btn-ghost { background: #fff; color: var(--navy); }
.btn-ghost:hover { background: #eef2f8; }
.btn-good { background: var(--green); border-color: var(--green); }
.btn-good:hover { background: #0f5535; }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #fbe3e1; }
.btn-sm { padding: .22rem .55rem; font-size: .8rem; }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .2rem; }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=search], input[type=file], select, textarea {
    width: 100%; padding: .42rem .55rem; border: 1px solid #aab4c5; border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; }
select[multiple] { min-height: 110px; }
.field { margin-bottom: .75rem; }
.fields { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: flex; gap: .45rem; align-items: flex-start; font-weight: 500; margin-bottom: .4rem; }
.check input { margin-top: .22rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; flex: 1; }

.flash { padding: .6rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.flash-ok { background: #dff1e8; color: #0c5233; }
.flash-err { background: #fbe3e1; color: #8c1d18; }
.flash ul { margin: .2rem 0 0; padding-left: 1.2rem; }

.bars { display: grid; gap: .55rem; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 70px; gap: .6rem; align-items: center; font-size: .88rem; }
.bar-track { background: #e9edf3; border-radius: 5px; height: 16px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--gold); }
.bar-fill.done { background: var(--green); }
.bar-fill.move { background: var(--saffron); }
.bar-fill.base { background: var(--navy); }

.proofs { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.proof img, .proof video { width: 100%; height: 190px; object-fit: cover; border-radius: 8px; background: #eef1f6; display: block; margin-bottom: .6rem; }
.thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 4px; background: #eef1f6; }
.cover-preview { max-width: 220px; border-radius: 8px; display: block; margin-bottom: .4rem; }

.pagination-wrap { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.pagination-wrap a, .pagination-wrap span.page { padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 5px; text-decoration: none; background: #fff; font-size: .88rem; }
.pagination-wrap span.current { background: var(--navy); color: #fff; border-color: var(--navy); }

.login-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--navy); }
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { background: #fff; border-radius: 12px; padding: 1.75rem; width: 100%; max-width: 400px; border-top: 4px solid var(--gold); }
.login-card h1 { font-size: 1.3rem; }
.login-card .tagline { color: #6b5312; margin-bottom: 1.1rem; font-size: .9rem; }
.login-card .btn { width: 100%; padding: .55rem; }
