/* Garud Payroll - design tokens */
:root {
  --brand: #c8202a; --brand-600: #a91b24; --brand-50: #fff1f1; --brand-100: #ffe0e0;
  --gold: #d4a63a; --gold-50: #fff8e6;
  --navy-900: #0f1626; --navy-800: #151e33; --navy-700: #1d2842; --navy-600: #2a3756;
  --bg: #f3f5f9; --panel: #ffffff; --panel-2: #f8fafc;
  --text: #141a26; --text-2: #4a5468; --muted: #7a8498; --line: #e4e8ef; --line-2: #eef1f5;
  --ok: #12804a; --ok-bg: #e6f6ed; --warn: #9a6200; --warn-bg: #fff4d6; --bad: #b42318; --bad-bg: #fdecea;
  --info: #1f5fbf; --info-bg: #e8f0fe; --violet: #5b3fc4; --violet-bg: #efeafd;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4;
  --grid: #e9edf3;
  --radius: 14px; --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --shadow-lg: 0 24px 60px -20px rgba(15, 22, 38, .35);
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); line-height: 1.5;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1 { font-size: 1.55rem; margin: 0; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 1.02rem; margin: 0 0 .85rem; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: .92rem; margin: 0 0 .5rem; font-weight: 650; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 .3rem; font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  background: radial-gradient(120% 60% at 0% 0%, #26304d 0%, var(--navy-900) 55%);
  color: #c4cbdb; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1.1rem .75rem 2rem;
  scrollbar-width: thin; scrollbar-color: var(--navy-600) transparent;
}
.brand { display: flex; align-items: center; gap: .75rem; padding: .3rem .5rem 1.1rem; margin-bottom: .4rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 12px; padding: 3px; box-shadow: 0 6px 18px -6px rgba(200, 32, 42, .6); }
.brand b { color: #fff; display: block; font-size: .95rem; line-height: 1.2; }
.brand span { font-size: .72rem; color: var(--gold); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #6f7a94; padding: 1rem .75rem .35rem; font-weight: 600; }
.sidebar a.nav { display: flex; align-items: center; gap: .65rem; color: #c4cbdb; padding: .48rem .75rem; border-radius: 10px; margin: 1px 0; font-weight: 500; transition: background .15s, color .15s; }
.sidebar a.nav .icon { width: 17px; height: 17px; opacity: .75; }
.sidebar a.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a.nav.active { background: linear-gradient(90deg, rgba(200,32,42,.95), rgba(200,32,42,.75)); color: #fff; box-shadow: 0 8px 20px -10px rgba(200,32,42,.9); }
.sidebar a.nav.active .icon { opacity: 1; }
.sidebar .count { margin-left: auto; background: var(--gold); color: var(--navy-900); font-size: .7rem; font-weight: 700; border-radius: 99px; padding: 0 .45rem; }
details.nav-group > summary { list-style: none; cursor: pointer; }
details.nav-group > summary::-webkit-details-marker { display: none; }
details.nav-group > summary::after { content: "›"; float: right; transition: transform .15s; }
details.nav-group[open] > summary::after { transform: rotate(90deg); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1.75rem;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.topbar form { display: flex; align-items: center; gap: .5rem; margin: 0; }
.fy-pill { display: inline-flex; align-items: center; gap: .4rem; background: linear-gradient(135deg, var(--brand), #e2463c); color: #fff; border-radius: 999px; padding: .28rem .8rem; font-weight: 650; font-size: .85rem; box-shadow: 0 6px 16px -8px rgba(200,32,42,.8); }
.date-pill { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; font-size: .82rem; }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .2rem .7rem .2rem .2rem; border-radius: 99px; color: var(--text); transition: background .15s; }
.user-chip:hover { background: var(--panel-2); color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .85rem; background: linear-gradient(135deg, var(--navy-700), var(--navy-600)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
.avatar.super { background: linear-gradient(135deg, var(--gold), #b8811a); }
.user-chip .who { line-height: 1.15; }
.user-chip .who b { display: block; font-size: .86rem; }
.user-chip .who span { font-size: .74rem; color: var(--muted); }
.content { padding: 1.75rem; max-width: 1560px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head .eyebrow { font-size: .75rem; font-weight: 650; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .2rem; }
.page-head .sub { color: var(--muted); margin-top: .3rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.menu-toggle { display: none; }

/* ---------- Surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.35rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2, .card.flush > .card-head { padding: 1.1rem 1.35rem .2rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.card .sub, .card-sub { color: var(--muted); font-size: .84rem; margin: -.55rem 0 .9rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mb { margin-bottom: 1.25rem; }

/* Stat tiles */
.stat { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--tint, var(--brand-50)); opacity: .9; }
.stat .ico { position: absolute; right: 1rem; top: 1rem; z-index: 1; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--tone, var(--brand)); background: #fff; box-shadow: var(--shadow-sm); }
.stat .label { color: var(--text-2); font-size: .8rem; font-weight: 600; position: relative; z-index: 1; }
.stat .value { font-size: 1.65rem; font-weight: 750; margin-top: .3rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.stat .hint { color: var(--muted); font-size: .8rem; margin-top: .15rem; position: relative; z-index: 1; }
.stat.red { --tint: var(--brand-50); --tone: var(--brand); }
.stat.blue { --tint: var(--info-bg); --tone: var(--info); }
.stat.green { --tint: var(--ok-bg); --tone: var(--ok); }
.stat.gold { --tint: var(--gold-50); --tone: #b07c12; }
.stat.violet { --tint: var(--violet-bg); --tone: var(--violet); }
.hero { background: linear-gradient(135deg, var(--navy-800), #2b1d2b 60%, #5a1820); color: #fff; border: 0; }
.hero::after { background: rgba(255,255,255,.06); width: 220px; height: 220px; right: -60px; top: -80px; }
.hero .label, .hero .hint { color: rgba(255,255,255,.72); }
.hero .value { font-size: 2.1rem; }
.hero .ico { background: rgba(255,255,255,.12); color: var(--gold); box-shadow: none; }

/* Charts */
.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 230px; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .2rem 0 .8rem; font-size: .82rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }
.legend-table td { padding: .32rem .3rem; border-bottom: 1px solid var(--line-2); font-size: .84rem; }
.legend-table td:first-child { color: var(--text-2); }
.legend-table i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .5rem; vertical-align: -1px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .62rem .8rem; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
th { background: var(--panel-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbfe; }
tfoot td { font-weight: 700; background: var(--panel-2); border-top: 1px solid var(--line); }
table.compact th, table.compact td { padding: .42rem .6rem; font-size: .86rem; }
table.kv td { border-bottom: 1px dashed var(--line-2); }
table.kv td:first-child { color: var(--muted); width: 45%; }
.att-grid input { width: 76px; text-align: right; padding: .3rem .4rem; }
.att-grid th { white-space: normal; min-width: 84px; line-height: 1.25; vertical-align: bottom; }
.att-grid th:first-child { min-width: 0; }
.att-grid input::placeholder { color: #b9c0cc; font-style: italic; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { font-size: .78rem; color: var(--muted); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: .3rem; color: var(--text-2); }
.field { margin-bottom: .9rem; }
.field .help { color: var(--muted); font-size: .76rem; margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], input[type=date], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid #d5dbe5; border-radius: var(--radius-sm); background: #fff; font: inherit; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #aab2bf; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(200, 32, 42, .12); }
.inline-form { display: flex; gap: .65rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.1rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem .3rem; margin: 0 0 1.1rem; background: linear-gradient(180deg, var(--panel-2), #fff 60px); }
legend { font-weight: 700; padding: 0 .5rem; color: var(--text); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .52rem .95rem; border-radius: 10px; border: 1px solid #d5dbe5; background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm); transition: transform .08s, background .15s, box-shadow .15s; }
.btn:hover { background: var(--panel-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(135deg, var(--brand), #dd3a33); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -10px rgba(200,32,42,.9); }
.btn.primary:hover { background: linear-gradient(135deg, var(--brand-600), var(--brand)); color: #fff; }
.btn.success { background: linear-gradient(135deg, #12804a, #1a9c5c); border-color: transparent; color: #fff; }
.btn.info { background: linear-gradient(135deg, #1f5fbf, #2a78d6); border-color: transparent; color: #fff; }
.btn.gold { background: linear-gradient(135deg, #c99524, var(--gold)); border-color: transparent; color: #1b1405; }
.btn.danger { color: var(--bad); border-color: #f2c0bb; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.sm { padding: .28rem .6rem; font-size: .8rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font: inherit; }

/* ---------- Badges & alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 650; background: #eef1f5; color: #3b4558; white-space: nowrap; text-transform: capitalize; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.plain::before { display: none; }
.badge.draft, .badge.submitted, .badge.on_hold { background: var(--warn-bg); color: var(--warn); }
.badge.verified { background: var(--violet-bg); color: var(--violet); }
.badge.approved, .badge.active, .badge.success { background: var(--info-bg); color: var(--info); }
.badge.paid, .badge.closed { background: var(--ok-bg); color: var(--ok); }
.badge.rejected, .badge.inactive, .badge.resigned, .badge.failed { background: var(--bad-bg); color: var(--bad); }
.badge.staff { background: #eef2ff; color: #3730a3; }
.badge.non_staff { background: #fff4e5; color: #92400e; }
.badge.super { background: linear-gradient(135deg, #fff3d4, #ffe7a8); color: #7a5300; }
.badge.lock::before { content: "🔒"; width: auto; height: auto; background: none; opacity: 1; font-size: .7rem; }

.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid; box-shadow: var(--shadow-sm); }
.alert.success { background: var(--ok-bg); border-color: #b6e3c8; color: #0d6139; }
.alert.error { background: var(--bad-bg); border-color: #f5c2bd; color: var(--bad); }
.alert.warn { background: var(--warn-bg); border-color: #f0d68a; color: #7a4d00; }
.alert.info { background: var(--info-bg); border-color: #c7d9fb; color: var(--info); }
.alert ul { margin: .3rem 0 0 1.1rem; padding: 0; }

/* Tabs, pagination, bars */
.tabs { display: inline-flex; gap: .25rem; background: #e9edf3; padding: .25rem; border-radius: 12px; margin-bottom: 1.1rem; flex-wrap: wrap; }
.tabs a { padding: .42rem .9rem; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: .88rem; }
.tabs a.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.tabs a:hover { color: var(--text); }
.pagination { display: flex; gap: .3rem; list-style: none; padding: 0; margin: 1rem 0 0; flex-wrap: wrap; }
.pagination li > * { display: block; padding: .32rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pagination .active > * { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled > * { color: #aab; }
.bar { height: 8px; background: #edf0f5; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #e2463c); border-radius: 99px; }

/* Workflow stepper & timeline */
.stepper { display: flex; align-items: center; gap: 0; margin: .2rem 0 1.2rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-weight: 600; font-size: .84rem; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #e9edf3; color: var(--muted); font-size: .8rem; font-weight: 700; }
.step.done { color: var(--text); }
.step.done .dot { background: var(--ok); color: #fff; }
.step.current .dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 5px rgba(200,32,42,.15); }
.step.current { color: var(--brand); }
.step-line { flex: 1; min-width: 28px; height: 2px; background: #e3e7ee; margin: 0 .6rem; }
.step-line.done { background: var(--ok); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.4rem; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: .76rem; color: var(--muted); }
.workflow-bar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-start; }
.workflow-bar form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.workflow-bar input[name=remarks] { width: 220px; padding: .45rem .6rem; }

/* Permission matrix */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix input { width: 16px; height: 16px; accent-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; padding: .22rem .5rem; font-size: .74rem; font-weight: 600; cursor: pointer; color: var(--text-2); }
.seg input { display: none; }
.seg input:checked + span { color: #fff; }
.seg label:has(input:checked) { background: var(--navy-700); color: #fff; }
.seg label.allow:has(input:checked) { background: var(--ok); }
.seg label.deny:has(input:checked) { background: var(--bad); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(80% 60% at 20% 10%, rgba(212,166,58,.25), transparent 60%), radial-gradient(70% 70% at 90% 90%, rgba(200,32,42,.55), transparent 60%), linear-gradient(135deg, var(--navy-900), #1d2236); }
.login-art h1 { font-size: 2.3rem; line-height: 1.15; max-width: 460px; }
.login-art p { color: rgba(255,255,255,.75); max-width: 440px; }
.login-art .feat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; max-width: 520px; }
.login-art .feat div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: .75rem .9rem; font-size: .86rem; }
.login-art .feat b { display: block; color: var(--gold); }
.login-side { display: grid; place-items: center; padding: 2rem; }
.login { width: 100%; max-width: 400px; }
.login .logo img { width: 120px; }
.login h2 { font-size: 1.5rem; margin: 1rem 0 .3rem; }

/* ---------- Payslip ---------- */
.payslip { background: #fff; max-width: 860px; margin: 0 auto 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.8rem; page-break-after: always; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.payslip::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--brand), var(--gold)); }
.payslip-head { display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .9rem; margin-bottom: 1rem; }
.payslip-head img { width: 78px; }
.payslip-head .co { flex: 1; }
.payslip-head .co b { font-size: 1.2rem; display: block; }
.payslip-head .title { text-align: right; }
.payslip-head .title b { font-size: 1.05rem; color: var(--brand-600); display: block; letter-spacing: .06em; }
.payslip table td, .payslip table th { padding: .34rem .55rem; }
.payslip .net { margin-top: .9rem; background: linear-gradient(135deg, var(--navy-800), #3a1a22); color: #fff; border-radius: 12px; padding: .85rem 1.1rem; display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 700; }
.sign { display: flex; justify-content: space-between; margin-top: 2.6rem; font-size: .84rem; color: var(--muted); }
.sign div { border-top: 1px solid #aab; padding-top: .3rem; min-width: 160px; text-align: center; }

/* ---------- Print & responsive ---------- */
@media print {
  .sidebar, .topbar, .no-print, .page-head .actions, .workflow-bar { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .card, .payslip, .stat { border: 0; padding: 0; margin: 0 0 1rem; box-shadow: none; }
  .payslip::before { display: none; }
  th { position: static; }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; width: 264px; z-index: 30; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: inline-flex; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .user-chip .who, .date-pill { display: none; }
}

/* Module switches */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #d5dbe5; border-radius: 99px; transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px rgba(18,128,74,.2); }
.module-card { transition: border-color .15s, box-shadow .15s; opacity: .78; }
.module-card.on { opacity: 1; border-color: #b6e3c8; box-shadow: 0 0 0 3px rgba(18,128,74,.07), var(--shadow); }

/* Designations & grades */
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.designation-card { position: relative; overflow: hidden; padding: 0; border-top: 4px solid var(--accent, var(--brand)); }
.designation-card .head { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.25rem .9rem; }
.designation-card .badge-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1rem;
  background: linear-gradient(135deg, var(--accent, var(--brand)), color-mix(in srgb, var(--accent, var(--brand)) 60%, #000)); box-shadow: 0 10px 22px -12px var(--accent, var(--brand)); flex: none; }
.designation-card .title { flex: 1; min-width: 0; }
.designation-card .title h2 { margin: 0; font-size: 1.1rem; }
.designation-card .title .meta { color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.grade-ladder { display: flex; flex-wrap: wrap; gap: .85rem; padding: .2rem 1.25rem 1.2rem; align-items: stretch; }
.grade-tile { position: relative; display: block; color: inherit; width: 190px; border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem .8rem; background: linear-gradient(180deg, #fff, var(--panel-2)); transition: transform .15s, box-shadow .15s; }
.grade-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; border-color: color-mix(in srgb, var(--accent, var(--brand)) 40%, var(--line)); }
.is-inactive { opacity: .6; }
.grade-tile .letter { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  color: var(--accent, var(--brand)); background: color-mix(in srgb, var(--accent, var(--brand)) 12%, #fff); border: 2px solid color-mix(in srgb, var(--accent, var(--brand)) 35%, #fff); }
.grade-tile .pay { font-size: 1.15rem; font-weight: 750; margin-top: .55rem; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.grade-tile .pay small { font-size: .72rem; font-weight: 500; color: var(--muted); }
.grade-tile .facts { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.grade-tile .chip { font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 99px; background: #eef1f5; color: var(--text-2); }
.grade-tile .chip.hot { background: var(--brand-50); color: var(--brand-600); }
.grade-tile .order { position: absolute; top: .7rem; right: .8rem; font-size: .7rem; color: var(--muted); font-weight: 600; }
.grade-tile details summary { list-style: none; cursor: pointer; margin-top: .6rem; font-size: .78rem; font-weight: 600; color: var(--brand); }
.grade-tile details summary::-webkit-details-marker { display: none; }
.grade-tile details[open] { margin-top: .4rem; }
.grade-tile details .field { margin-bottom: .5rem; }
.grade-tile details input { padding: .35rem .5rem; font-size: .85rem; }
.ladder-step { align-self: center; color: #c9d0db; font-size: 1.2rem; }
.add-grade { width: 130px; min-height: 120px; border: 2px dashed var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .8rem; color: var(--muted); font-weight: 600; font-size: .85rem; }
.add-grade:hover { border-color: var(--accent, var(--brand)); color: var(--accent, var(--brand)); }
.add-grade input { padding: .35rem .5rem; }
details.statutory > summary { list-style: none; }
details.statutory > summary::-webkit-details-marker { display: none; }
details.statutory > summary::before { content: "▸"; display: inline-block; margin-right: .45rem; transition: transform .15s; color: var(--accent, var(--brand)); }
details.statutory[open] > summary::before { transform: rotate(90deg); }
@media (max-width: 1100px) { .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .summary-strip { grid-template-columns: 1fr; } .grade-tile { width: 100%; } }


/* Pagination bar */
.pager { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .9rem 0 1.2rem; }
.pager-flush { margin: 0; padding: .75rem 1.2rem; border-top: 1px solid var(--line-2); }
.pager .pagination { margin: 0 0 0 auto; }
.pager-size { display: flex; align-items: center; gap: .4rem; margin: 0; }
.pager-size label { margin: 0; }
.pager-size select { width: auto; padding: .25rem .5rem; }

/* Notification bell */
.bell { position: relative; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px;
  background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
