/* Khata — AgileLancer design tokens (same base as agilelancer.com and app.agilelancer.com) */
@font-face { font-family: "Geist"; src: url("fonts/geist-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #0a0a0a;
  --ink-2: #27272a;
  --muted: #5f6368;
  --soft: #71717a;
  --line: #eaeaea;
  --line-2: #f1f1f2;
  --bg: #fafafa;
  --surface: #ffffff;
  --blue: #0e47a1;
  --blue-soft: #eef3fb;
  --red: #d92d20;
  --red-soft: #fef3f2;
  --amber: #b54708;
  --amber-soft: #fef7d6;
  --green: #067647;
  --green-dot: #17b26a;
  --amber-dot: #f5b70a;
  --red-dot: #f04438;
  --green-soft: #ecfdf3;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: .01em; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }

/* ---------- Sign-in, access denied ---------- */
.auth { min-height: 100vh; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px; overflow: hidden; background: #fff; box-sizing: border-box; }
.auth-bg { position: absolute; inset: 0; background: url("img/hero-waves.jpg") center / cover no-repeat; }
.auth-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 70% at center, rgba(255,255,255,.9) 0%, rgba(255,255,255,.55) 60%, rgba(255,255,255,0) 100%); }
.auth > *:not(.auth-bg) { position: relative; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand img { width: 30px; height: 30px; }
.auth-brand span { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.auth h1 { margin: 0; font-size: 44px; line-height: 1.05; letter-spacing: -.045em; font-weight: 600; }
.auth .lede { margin: 12px 0 28px; color: var(--muted); font-size: 16px; text-align: center; max-width: 440px; }
.auth-card { width: 100%; max-width: 448px; box-sizing: border-box; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; backdrop-filter: blur(6px); }
.btn-ms { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 48px; border-radius: 999px; background: var(--ink); color: #fff !important; font-weight: 500; font-size: 15px; border: 0; cursor: pointer; text-decoration: none !important; transition: background .15s, transform .15s; font-family: var(--font); }
.btn-ms:hover { background: var(--ink-2); }
.btn-ms:active { transform: translateY(1px); }
.btn-ms .arrow { transition: transform .15s; }
.btn-ms:hover .arrow { transform: translateX(3px); }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }
.auth-help { margin: 16px 4px 0; text-align: center; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.auth-help b { color: var(--ink); font-weight: 600; }
.auth-divider { height: 1px; background: var(--line); margin: 24px 0 18px; }
.auth-trouble .eyebrow { margin-bottom: 10px; }
.auth-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 5px 0; font-size: 13.5px; color: var(--muted); }
.auth-row a { white-space: nowrap; font-weight: 500; }
.auth-row .note { text-align: right; max-width: 230px; color: var(--muted); }
.auth-row .note b { color: var(--ink); font-weight: 500; }
.auth-foot { margin-top: 22px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.auth-alert { margin-bottom: 18px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.auth-alert.info { background: var(--blue-soft); color: var(--blue); }
.auth-alert.error { background: var(--red-soft); color: var(--red); }
.auth-denied-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; margin: 0 auto 16px; }
.auth-card h2 { margin: 0 0 8px; text-align: center; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.auth-card p.center { margin: 0 0 22px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }
.btn-outline { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink) !important; font-weight: 500; font-size: 14px; text-decoration: none !important; box-sizing: border-box; }
.btn-outline:hover { background: var(--bg); }
@media (max-width: 520px) { .auth h1 { font-size: 34px; } .auth-card { padding: 24px 20px; } .auth-row { flex-direction: column; gap: 2px; } .auth-row .note { text-align: left; } }

/* ---------- App shell ---------- */
.shell-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 14px; text-decoration: none !important; }
.shell-brand img { width: 26px; height: 26px; }
.shell-brand .name { font-weight: 600; font-size: 15px; color: var(--ink); letter-spacing: -.01em; line-height: 1.15; }
.shell-brand .sub { font-size: 11.5px; color: var(--soft); }
.nav-section { padding: 18px 20px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; height: 36px; margin: 1px 10px; padding: 0 10px; border-radius: 10px; color: var(--ink-2) !important; font-size: 14px; font-weight: 450; text-decoration: none !important; }
a.nav-link:hover { background: var(--line-2); }
a.nav-link.active { background: var(--ink); color: #fff !important; }
a.nav-link.active .mud-icon-root { color: #fff; }
.nav-link .mud-icon-root { font-size: 18px; color: var(--soft); }
span.nav-link.soon { color: var(--soft) !important; cursor: default; }
.soon-badge { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 2px 8px; }
.drawer-body { display: flex; flex-direction: column; height: 100%; }
.drawer-foot { margin-top: auto; padding: 16px 20px 20px; font-size: 12px; color: var(--soft); line-height: 1.55; border-top: 1px solid var(--line); }
.drawer-foot .lock { display: flex; gap: 6px; align-items: center; color: var(--muted); font-weight: 500; }

.topbar { display: flex; align-items: center; gap: 14px; width: 100%; }
.topbar .spacer { flex: 1; }
.role-chip { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); }
.user { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.2; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.link-btn { background: none; border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; color: var(--ink-2); font: 500 13px var(--font); cursor: pointer; }
.link-btn:hover { background: var(--line-2); color: var(--ink); }
.fy-select { display: flex; align-items: center; gap: 8px; }

.page { max-width: 1280px; margin: 0 auto; padding: 32px 32px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 6px 0 0; font-size: 28px; line-height: 1.15; letter-spacing: -.035em; font-weight: 600; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.mt { margin-top: 16px; }
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.two { grid-template-columns: 1.4fr 1fr; }
.two > .card:first-child { grid-row: span 2; }
.kpi .label { font-size: 12.5px; color: var(--muted); }
.kpi .value { margin-top: 8px; font-size: 24px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .delta { margin-top: 4px; font-size: 12px; color: var(--soft); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .two { grid-template-columns: 1fr; } }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.status.none { color: var(--soft); background: var(--line-2); }
.status.draft { color: var(--amber); background: var(--amber-soft); }
.status.submitted { color: var(--blue); background: var(--blue-soft); }
.status.approved, .status.paid { color: var(--green); background: var(--green-soft); }
.status.locked { color: var(--ink); background: var(--line-2); }

.flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.flag.red { color: var(--red); background: var(--red-soft); }
.flag.amber { color: var(--amber); background: var(--amber-soft); }
.flag.ok { color: var(--green); background: var(--green-soft); }
.flag.blue { color: var(--blue); background: var(--blue-soft); }

.issues { list-style: none; margin: 0; padding: 0; }
.issues li { display: flex; align-items: center; gap: 12px; padding: 10px 22px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.issues li:last-child { border-bottom: 0; }
.issues .who { font-weight: 500; min-width: 180px; }

.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.month { display: block; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: #fff; text-align: center; color: var(--ink) !important; text-decoration: none !important; transition: border-color .15s, background .15s; }
.month:hover { border-color: var(--ink); }
.month .m { font-size: 13px; font-weight: 600; }
.month .y { font-size: 11px; color: var(--soft); }
.month .dot { width: 8px; height: 8px; border-radius: 99px; margin: 8px auto 0; background: var(--line); }
.month.draft .dot { background: #f79009; } .month.submitted .dot { background: var(--blue); }
.month.approved .dot, .month.paid .dot { background: #12b76a; } .month.locked .dot { background: var(--ink); }
.month.current { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--soft); }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; background: var(--c); }
@media (max-width: 900px) { .months { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.steps { display: flex; align-items: center; flex-wrap: wrap; row-gap: 8px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); }
.step .n { width: 22px; height: 22px; border-radius: 99px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 600; background: #fff; }
.step.done { color: var(--ink); } .step.done .n { background: var(--ink); color: #fff; border-color: var(--ink); }
.step.now { color: var(--ink); font-weight: 600; } .step.now .n { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 3px var(--line-2); }
.step + .step::before { content: ""; width: 28px; height: 1px; background: var(--line); margin: 0 10px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fcfcfc; white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #fcfcfd; }
table.data th.num, table.data td.num { text-align: right; }
table.data tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: #fcfcfc; }
table.data tr.clickable { cursor: pointer; }
table.data .name { font-weight: 500; color: var(--ink); }
table.data .sub { font-size: 12px; color: var(--soft); }
.table-wrap { overflow-x: auto; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); font-size: 14px; }
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 16px; font-weight: 600; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 12px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.app-footer { padding: 16px 32px; font-size: 12px; color: var(--soft); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.notice.info { background: var(--blue-soft); color: var(--blue); }
.notice.warn { background: var(--amber-soft); color: var(--amber); }

/* MudBlazor refinements */
.mud-button-root { text-transform: none !important; letter-spacing: 0 !important; font-weight: 500 !important; }
.mud-button-filled { box-shadow: none !important; }
.mud-tabs-tabbar { border-bottom: 1px solid var(--line); }
.mud-tab { text-transform: none !important; letter-spacing: 0 !important; font-weight: 500 !important; min-width: 0 !important; }
.mud-drawer { border-right: 1px solid var(--line) !important; }
.mud-appbar { border-bottom: 1px solid var(--line) !important; }

#blazor-error-ui { display: none; position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 2000; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); }
#blazor-error-ui a { color: #9ec1ff; margin-left: 12px; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 12px; }

/* Financial-year chart */
.fy-chart { margin: 0; }
.fy-chart figcaption { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.fy-chart figcaption .t { font-size: 14px; font-weight: 600; color: var(--ink); }
.fy-chart figcaption .s { font-size: 12.5px; color: var(--muted); }
.fy-chart svg { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font); }
.fy-chart .grid { stroke: var(--line-2); stroke-width: 1; }
.fy-chart .base { stroke: #d4d4d8; stroke-width: 1; }
.fy-chart .axis { font-size: 11px; fill: var(--soft); font-variant-numeric: tabular-nums; }
.fy-chart .bar { fill: var(--blue); transition: opacity .15s; }
.fy-chart .col.now .bar { fill: #0a2f6b; }
.fy-chart .col.now .axis { fill: var(--ink); font-weight: 600; }
.fy-chart .nil { stroke: #d4d4d8; stroke-width: 2; stroke-linecap: round; }
.fy-chart .hit { fill: transparent; }
.fy-chart .col:hover .hit { fill: rgba(14, 71, 161, .04); }
.fy-chart .tip { opacity: 0; pointer-events: none; transition: opacity .12s; }
.fy-chart .col:hover .tip { opacity: 1; }
.fy-chart .tip-bg { fill: var(--ink); }
.fy-chart .tip-h { font-size: 11px; fill: #c4c4c8; }
.fy-chart .tip-v { font-size: 13px; font-weight: 600; fill: #fff; font-variant-numeric: tabular-nums; }
.ytd { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.ytd div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfc; }
.ytd .label { font-size: 12px; color: var(--muted); }
.ytd .value { margin-top: 4px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .ytd { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Photos and completeness */
.photo { width: 32px; height: 32px; border-radius: 999px; object-fit: cover; background: var(--line-2); flex: none; }
.photo.lg { width: 72px; height: 72px; }
.initials { width: 32px; height: 32px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.initials.lg { width: 72px; height: 72px; font-size: 22px; }
.person { display: flex; align-items: center; gap: 12px; }
.req { color: var(--red); margin-left: 2px; }
.missing-list { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Employee page (compact sheet) ---------- */
.page-narrow { max-width: 1080px; }
.crumb { font-size: 13px; color: var(--soft); margin-bottom: 14px; display: flex; gap: 8px; }
.crumb a { color: var(--muted); }
.photo.xl, .initials.xl { width: 64px; height: 64px; font-size: 20px; }
.emp-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px 24px; flex-wrap: wrap; }
.emp-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.emp-id h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.emp-meta { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.dot-sep { width: 3px; height: 3px; border-radius: 9px; background: #c4c4c8; }
.emp-photo { position: relative; }
.emp-photo-edit { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 99px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.emp-photo-edit:hover { background: var(--bg); }
.emp-stats { display: flex; gap: 28px; }
.emp-stats .k { font-size: 11.5px; color: var(--soft); }
.emp-stats .v { margin-top: 2px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 720px) { .emp-stats { gap: 18px; } .emp-stats .v { font-size: 15px; } }

.alert-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 12px 16px; border: 1px solid #f4d4d0; background: var(--red-soft); border-radius: 12px; font-size: 13.5px; color: #7a271a; line-height: 1.5; }
.alert-text { flex: 1; }

.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink) !important; font: 500 13px var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.pill-btn:hover { background: var(--bg); }
.pill-btn.dark { background: var(--ink); border-color: var(--ink); color: #fff !important; }
.pill-btn.dark:hover { background: var(--ink-2); }
.pill-btn.ghost { border-color: transparent; background: transparent; color: var(--muted) !important; }
.pill-btn[disabled] { opacity: .5; cursor: default; }

.sheet { margin-top: 12px; overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line-2); min-height: 36px; }
.sheet-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.sheet-group { padding: 16px 24px 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 24px; padding: 10px 24px 18px; }
.fields + .sheet-group { border-top: 1px solid var(--line-2); }
.field { min-width: 0; }
.field.wide { grid-column: span 2; }
.field-label { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.field-value { font-size: 14px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; min-height: 20px; display: flex; align-items: center; gap: 8px; }
.field-value.mono, .field-value .mono { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.field-empty { color: #a1a1aa; font-weight: 400; }
.field.missing .field-empty { color: var(--red); font-weight: 500; }
.field-edit .mud-input-control { margin: 0 !important; }
.field-edit .mud-input-outlined input, .field-edit .mud-select-input { font-size: 14px !important; }
.field-edit .mud-input.mud-input-outlined { background: #fff; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line-2); background: #fcfcfc; font-size: 13px; flex-wrap: wrap; }
.sheet-empty { padding: 22px 24px; color: var(--muted); font-size: 13.5px; }
@media (max-width: 900px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } .field.wide { grid-column: auto; } }

table.breakup { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.breakup th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); padding: 10px 24px; border-bottom: 1px solid var(--line-2); background: #fcfcfc; }
table.breakup td { padding: 9px 24px; border-bottom: 1px solid var(--line-2); }
table.breakup tbody tr:last-child td { border-bottom: 0; }
table.breakup .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.breakup tr.sub-total td { font-weight: 600; background: #fcfcfc; }
table.breakup tr.total td { font-weight: 600; font-size: 14.5px; border-top: 1px solid var(--line); }
table.breakup tr.total td.num { color: var(--blue); }
table.breakup .neg { color: var(--muted); }
.mini-select { height: 32px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; font: 500 13px var(--font); color: var(--ink); background: #fff; }
.link-inline { background: none; border: 0; padding: 0; color: var(--blue); font: 500 12.5px var(--font); cursor: pointer; }
.link-inline:hover { text-decoration: underline; }
.file-pick { position: relative; cursor: pointer; }
.file-pick-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.page-foot-actions { margin-top: 14px; text-align: right; font-size: 13px; }

/* Validation */
.issue-icon { font-size: 14px !important; color: var(--red); flex: none; }
.field.has-issue .field-label { color: var(--red); }
.field-issue { margin-top: 4px; display: flex; align-items: flex-start; gap: 4px; font-size: 12px; line-height: 1.35; color: var(--red); }
.field.has-issue .field-edit .mud-input-outlined-border { border-color: #f04438 !important; }
.group-issues { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--red); }
.flag .issue-icon { font-size: 13px !important; }

table.breakup tr.group-row td { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); background: #fcfcfc; padding-top: 8px; padding-bottom: 8px; }
table.breakup tr.clickable { cursor: pointer; }
table.breakup tr.clickable:hover td { background: #fcfcfd; }

/* Uploads */
.upload-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 24px 20px; }
.upload-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border: 1px dashed #d4d4d8; border-radius: 12px; cursor: pointer; background: #fcfcfc; transition: border-color .15s, background .15s; }
.upload-tile:hover { border-color: var(--ink); background: #fff; }
.upload-tile .mud-icon-root { color: var(--blue); margin-bottom: 4px; }
.upload-tile .t { font-weight: 600; font-size: 14px; }
.upload-tile .h { font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) { .upload-row { grid-template-columns: 1fr; } }

/* Reports */
.toggle-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.hbar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.hbar span { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
table.breakup tr.detail-row td { font-size: 13px; background: #fcfcfd; padding-top: 7px; padding-bottom: 7px; }
.pivot-controls { display: flex; gap: 24px; flex-wrap: wrap; padding: 14px 24px 16px; border-bottom: 1px solid var(--line-2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; margin-top: 4px; background: #fff; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font: 500 12.5px var(--font); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--ink); color: #fff; }
table.pivot td, table.pivot th { padding-left: 14px; padding-right: 14px; }
table.pivot td:first-child, table.pivot th:first-child { padding-left: 24px; white-space: nowrap; }
table.pivot td.zero { color: #c4c4c8; }

/* Approvals */
.approvals { display: flex; gap: 12px; flex-wrap: wrap; }
.approval { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; min-width: 220px; color: var(--soft); }
.approval .name { font-size: 14px; font-weight: 600; color: var(--ink); }
.approval .sub { font-size: 12px; color: var(--muted); }
.approval.done { border-color: #abefc6; background: var(--green-soft); color: var(--green); }

/* Client invoices */
.invoice-sum { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.invoice-sum div { flex: 1; min-width: 160px; padding: 10px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.invoice-sum span { font-size: 12px; color: var(--muted); }
.invoice-sum b { font-size: 15px; font-variant-numeric: tabular-nums; }
.invoice-sum div:last-child { background: var(--blue-soft); border-color: #c7d7f0; }
.invoice-sum div:last-child b { color: var(--blue); }

/* Client invoices, grouped by month */
.inv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.inv-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.inv-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle; }
.inv-table th:first-child, .inv-table td:first-child { padding-left: 24px; }
.inv-table th:last-child, .inv-table td:last-child { padding-right: 20px; }
.inv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-table td.strong { font-weight: 600; }
.inv-table tr.clickable { cursor: pointer; transition: background .12s; }
.inv-table tr.clickable:hover { background: var(--bg); }
.inv-table .sub { font-size: 11.5px; color: var(--soft); margin-top: 1px; }
.inv-table .dash { color: var(--soft); }
.inv-month td { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-top: 9px; padding-bottom: 9px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.inv-month td b { color: var(--ink); font-size: 13.5px; font-weight: 600; margin-right: 10px; }
.inv-table tbody:first-of-type .inv-month td { border-top: 0; }
.inv-no { font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--ink); display: inline-block; min-width: 30px; }
.inv-date { color: var(--soft); font-size: 12px; margin-left: 10px; }
.inv-client { color: var(--ink-2); }
.inv-payto { margin-left: 10px; font-size: 11.5px; color: var(--muted); background: var(--line-2); padding: 2px 8px; border-radius: 999px; }
.inv-pdf { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--soft) !important; }
.inv-pdf:hover { background: var(--line-2); color: var(--ink) !important; }
.page-head h1:focus, h1:focus-visible { outline: none; }

/* Invoice dialog: read view first, edit on demand */
.inv-dlg-title { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; }
.inv-dlg-title .mono { font-size: 17px; }
.inv-dlg-client { font-size: 14px; font-weight: 400; color: var(--muted); }
.inv-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 6px; }
.inv-sum.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.inv-sum > div { padding: 12px 16px; border-left: 1px solid var(--line); }
.inv-sum > div:first-child { border-left: 0; }
.inv-sum span { display: block; font-size: 12px; color: var(--muted); }
.inv-sum b { display: block; margin-top: 3px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-sum small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
.dlg-section { margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.dlg-section span { margin-left: 8px; letter-spacing: 0; text-transform: none; font-weight: 400; }
.fields.dlg-fields { padding: 0; }
.inv-lines { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.inv-lines th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); padding: 6px 10px; }
.inv-lines td { padding: 9px 10px; border-top: 1px solid var(--line-2); vertical-align: top; }
.inv-lines th:first-child, .inv-lines td:first-child { padding-left: 0; }
.inv-lines th:last-child, .inv-lines td:last-child { padding-right: 0; }
.inv-lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-lines td b { font-weight: 500; }
.inv-lines .sub { font-size: 12px; color: var(--soft); margin-top: 1px; }
.inv-lines .amt { font-weight: 600; }
.inv-lines tr.extra td { color: var(--muted); }
.inv-lines tfoot td { border-top: 1px solid var(--line); font-weight: 600; padding-top: 11px; }
.line-cards { display: grid; gap: 10px; }
.line-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; background: #fff; }
.line-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.lc { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lc > span { font-size: 11.5px; color: var(--muted); }
.lc .mud-input-control { margin: 0 !important; }
.lc.grow { flex: 1 1 160px; } .lc.grow2 { flex: 2 1 220px; }
.lc.w70 { width: 70px; } .lc.w80 { width: 80px; } .lc.w90 { width: 100px; } .lc.w120 { width: 130px; } .lc.w140 { width: 172px; }
.lc-calc { height: 40px; display: flex; align-items: center; justify-content: flex-end; font-weight: 600; font-variant-numeric: tabular-nums; }
.lc-remove { border: 0; background: none; color: var(--soft); width: 32px; height: 40px; border-radius: 8px; cursor: pointer; }
.lc-remove:hover { background: var(--red-soft); color: var(--red); }
@media (max-width: 700px) { .inv-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } .inv-sum > div:nth-child(3) { border-left: 0; } }

/* Bank and money */
.ok-text { color: var(--green) !important; }
.red-text { color: var(--red) !important; }
.kpi-of { font-size: 13px; font-weight: 400; color: var(--soft); letter-spacing: 0; }
.month-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 18px 20px; }
.mstep { position: relative; padding: 0 8px; text-align: center; }
.mstep::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.mstep:first-child::before { display: none; }
.mstep.done::before, .mstep.now::before { background: var(--ink); }
.mstep .dot { position: relative; z-index: 1; width: 28px; height: 28px; margin: 0 auto 8px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: #fff; border: 2px solid var(--line); color: var(--soft); }
.mstep.done .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.mstep.now .dot { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 4px var(--line-2); }
.mstep .t { font-size: 13px; font-weight: 600; color: var(--ink); }
.mstep .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mstep .w { font-size: 11.5px; color: var(--soft); }
.how-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 24px; border-bottom: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.how { font-style: normal; display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; margin-right: 4px; }
.how.rule { background: var(--line-2); color: var(--ink-2); }
.how.ai { background: var(--green-soft); color: var(--green); }
.how.suggest { background: var(--amber-soft); color: var(--amber); }
.how.none { background: var(--red-soft); color: var(--red); }
.how.wait { background: var(--blue-soft); color: var(--blue); }
.bank-table td { vertical-align: top; }
.bank-table td.narr { max-width: 300px; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bank-table td.match { white-space: normal; min-width: 260px; }
.bank-table td.match b { font-weight: 500; }
.bank-table td.in { color: var(--green); }
.bank-table .resolved { color: var(--green); }
.bank-table .nowrap, .nowrap { white-space: nowrap; }
.bank-table tr.row-red td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.bank-table tr.row-amber td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.bank-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.bank-chip.axis { background: #fbeaf0; color: #97144d; }
.bank-chip.hdfc { background: #e8eefb; color: #004c8f; }
.resolve-row td { background: var(--bg); white-space: normal; }
.resolve { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.resolve .lc.w220 { width: 220px; }
.resolve .mini-select, .plain-input { height: 36px; width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: 14px var(--font); background: #fff; color: var(--ink); }
.plain-input:focus, .resolve .mini-select:focus { outline: none; border-color: var(--ink); }
.resolve-hint { margin-top: 8px; font-size: 12px; color: var(--soft); }
.expect-list { list-style: none; margin: 0; padding: 0; }
.expect-list li { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.expect-list li:last-child { border-bottom: 0; }
.expect-list li .grow { flex: 1; min-width: 0; }
.expect-list li b { font-weight: 500; }
.expect-list li .sub { font-size: 12px; color: var(--soft); margin-top: 1px; }
.expect-list li .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.expect-list li.done b, .expect-list li.done .num { color: var(--muted); }
.review { padding: 14px 24px 18px; font-size: 13.5px; }
.review ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.review li { display: flex; gap: 10px; align-items: baseline; line-height: 1.45; }
@media (max-width: 900px) { .month-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; } .mstep::before { display: none; } }

.accounts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 16px; overflow: hidden; }
.acct { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; border-left: 1px solid var(--line); transition: background .12s; }
.acct:first-child { border-left: 0; }
.acct:hover { background: var(--bg); }
.acct.on { background: var(--bg); box-shadow: inset 0 -2px 0 var(--ink); }
.acct .bank-chip { align-self: flex-start; }
.acct-name { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 4px; }
.acct-use { font-size: 12px; color: var(--muted); }
.acct-stat { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.acct-who { font-size: 11.5px; color: var(--soft); }
.bank-chip.anuj { background: #eef3fb; color: #0e47a1; }
.bank-chip.kusum { background: #f3eefb; color: #5b2ca0; }
.bank-chip.card { background: #fff4e5; color: #9a4d00; }
.how.personal { background: var(--line-2); color: var(--soft); font-weight: 500; }
.paid-from { margin-top: 4px; font-size: 11.5px; color: var(--blue); }
@media (max-width: 1100px) { .accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .acct { border-left: 0; border-top: 1px solid var(--line); } }

/* Bank: month status, tabs, filters, pending */
.month-status { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; padding: 18px 22px; margin-bottom: 14px; border-left: 4px solid var(--red); }
.month-status.ready { border-left-color: var(--green); }
.month-status.closed { border-left-color: var(--ink); }
.ms-left { display: flex; align-items: center; gap: 14px; }
.ms-count { font-size: 34px; font-weight: 700; color: var(--red); line-height: 1; letter-spacing: -.02em; }
.ms-icon { font-size: 30px !important; color: var(--green); }
.month-status.closed .ms-icon { color: var(--ink); }
.ms-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.ms-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ms-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ms-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.ms-bar > div { height: 100%; background: var(--green); border-radius: 99px; transition: width .3s; }
.ms-force { grid-column: 1 / -1; display: flex; gap: 10px; }
.ms-force .plain-input { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: 500 14px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab-count { font-size: 11px; font-weight: 600; background: var(--red); color: #fff; border-radius: 999px; padding: 1px 7px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.filters .mini-select, .filters .plain-input { height: 32px; width: auto; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; font: 13px var(--font); background: #fff; color: var(--ink); }
.filters .plain-input.search { width: 220px; }
.filters .grow { flex: 1; }
.acct-n { font-weight: 500; }
.cat-bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.cat-bar > div { height: 100%; background: var(--ink); border-radius: 99px; }
.inv-table tfoot td { border-top: 1px solid var(--line); font-weight: 600; padding: 11px 14px; font-variant-numeric: tabular-nums; }
.inv-table tfoot td:first-child { padding-left: 24px; }
.inv-table td.in { color: var(--green); }
.month-sum { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; padding: 16px 24px; font-size: 13.5px; }
.month-sum dt { color: var(--muted); }
.month-sum dd { margin: 0; font-weight: 500; }
.ai-note { margin: 0 24px 18px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); }
.ai-note-h { font-size: 12px; color: var(--soft); display: flex; gap: 6px; align-items: center; }
.ai-note p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; }
.pend-list { list-style: none; margin: 0; padding: 0; }
.pend-list li { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.pend-list li .grow { flex: 1; min-width: 0; }
.pend-list li b { font-weight: 500; }
.pend-list li .sub { font-size: 12px; color: var(--soft); margin-top: 2px; }
.pend-list li .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pend-list li.done b { color: var(--muted); }
.pend-list li.pend-form { background: var(--bg); flex-wrap: wrap; align-items: flex-end; }
.pend-kind { width: 86px; flex: none; text-align: center; font-size: 11px; font-weight: 600; padding: 3px 0; border-radius: 999px; }
.pend-kind.red { background: var(--red-soft); color: var(--red); }
.pend-kind.amber { background: var(--amber-soft); color: var(--amber); }
.pend-kind.stmt { background: var(--blue-soft); color: var(--blue); }
.pend-kind.ok { background: var(--green-soft); color: var(--green); }
.pend-kind.ovr { background: var(--ink); color: #fff; }
.link-inline { border: 0; background: none; color: var(--blue); font: 12px var(--font); cursor: pointer; padding: 0 0 0 6px; }

/* Setup checklist */
.cl-grid th.c, .cl-grid td.c { text-align: center; width: 54px; padding-left: 4px; padding-right: 4px; }
.cl-cell { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 0; font-family: var(--font); }
.cl-cell.mini { width: 18px; height: 18px; font-size: 11px; border-radius: 6px; margin-right: 4px; vertical-align: -4px; }
.cl-cell.ok { background: var(--green-soft); color: var(--green); }
.cl-cell.warn { background: var(--amber-soft); color: var(--amber); cursor: help; }
.cl-cell.need { background: var(--red-soft); color: var(--red); cursor: pointer; }
button.cl-cell.need:hover { background: var(--red); color: #fff; }
.cl-cell.na { color: #c4c4c8; }
.who { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.who.lilly { background: #fbeaf0; color: #97144d; }
.who.anuj { background: var(--blue-soft); color: var(--blue); }
.who.ca { background: var(--amber-soft); color: var(--amber); }
.sheet-head .legend > span { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }

/* Dashboard to-do */
.todo { list-style: none; margin: 0; padding: 6px 0 10px; }
.todo li { display: flex; align-items: baseline; gap: 10px; padding: 7px 22px; font-size: 14px; line-height: 1.45; }
.todo li a { color: var(--ink-2) !important; text-decoration: none !important; }
.todo li a:hover { color: var(--ink) !important; text-decoration: underline !important; }
.todo-dot { flex: none; width: 8px; height: 8px; border-radius: 99px; transform: translateY(-1px); background: var(--soft); }
.todo-dot.red { background: var(--red); }
.todo-dot.amber { background: #f79009; }
.todo-dot.info { background: var(--blue); }
.cl-grid tr.later td { opacity: .45; }

/* Settings */
.set-layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
.set-nav { position: sticky; top: 80px; display: grid; gap: 2px; }
.set-item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; transition: background .12s; }
.set-item:hover { background: var(--line-2); }
.set-item.on { background: #fff; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(16,24,40,.04); }
.set-icon { font-size: 19px !important; color: var(--soft); }
.set-item.on .set-icon { color: var(--ink); }
.set-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.set-text b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.set-text span { font-size: 12px; color: var(--soft); }
.set-body { display: grid; gap: 16px; min-width: 0; }
.set-card { overflow: hidden; }
.set-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line-2); }
.set-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.set-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.set-pad { padding: 16px 24px 20px !important; }
.set-sub { padding: 14px 24px 0; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.set-foot { padding: 12px 24px; border-top: 1px solid var(--line-2); background: var(--bg); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.set-rows { list-style: none; margin: 6px 0 0; padding: 0; }
.set-rows li { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.set-rows li:last-child { border-bottom: 0; }
.set-rows li .grow { flex: 1; min-width: 0; }
.set-rows li b { font-weight: 500; }
.set-rows li .sub { font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.set-rows li.set-edit { background: var(--bg); padding-left: 76px; }
.set-bank { width: 44px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; font-size: 11px; font-weight: 700; background: var(--line-2); color: var(--ink-2); }
.set-bank.axis { background: #fbeaf0; color: #97144d; }
.set-bank.hdfc { background: #e8eefb; color: #004c8f; }
.set-bank.anuj { background: #eef3fb; color: #0e47a1; }
.set-bank.kusum { background: #f3eefb; color: #5b2ca0; }
.set-bank.card { background: #fff4e5; color: #9a4d00; }
.set-promise { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.set-promise span { display: inline-flex; align-items: center; gap: 6px; }
.set-promise .mud-icon-root { font-size: 16px; color: var(--green); }
.set-add { padding: 14px 24px; display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line-2); }
.set-add .plain-input { max-width: 320px; height: 34px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; font: 13.5px var(--font); }
.pw-box { position: relative; flex: 1; max-width: 360px; }
.pw-box input { width: 100%; box-sizing: border-box; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 40px 0 12px; font: 14px var(--font); background: #fff; }
.pw-box input:focus { outline: none; border-color: var(--ink); }
.pw-eye { position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border: 0; background: none; border-radius: 8px; color: var(--soft); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { background: var(--line-2); color: var(--ink); }
.set-connect { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 24px; }
.conn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.conn .grow { flex: 1; min-width: 0; font-size: 14px; }
.conn .sub { font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.conn-icon { font-size: 22px !important; color: var(--soft); }
.inv-table th.c, .inv-table td.c { text-align: center; }
@media (max-width: 900px) { .set-layout { grid-template-columns: 1fr; } .set-nav { position: static; grid-template-columns: repeat(2, 1fr); } .set-connect { grid-template-columns: 1fr; } }

/* Activity log */
.date-in { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.date-in input { height: 32px; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; font: 13px var(--font); color: var(--ink); background: #fff; }
.log-day { padding: 14px 24px 6px; font-size: 12px; font-weight: 600; color: var(--ink); background: var(--bg); border-bottom: 1px solid var(--line-2); border-top: 1px solid var(--line-2); }
.log-day span { font-weight: 400; color: var(--soft); margin-left: 6px; }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-list > li { display: flex; align-items: center; gap: 14px; padding: 10px 24px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.log-list > li.can { cursor: pointer; }
.log-list > li.can:hover, .log-list > li.open { background: var(--bg); }
.log-list .grow { flex: 1; min-width: 0; }
.log-list .sub { font-size: 12.5px; color: var(--soft); margin-top: 1px; }
.log-time { width: 42px; flex: none; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.log-ico { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); }
.log-ico.download { background: var(--amber-soft); color: var(--amber); }
.log-ico.signin { background: var(--blue-soft); color: var(--blue); }
.log-ico.alert { background: var(--red-soft); color: var(--red); }
.log-ico.change { background: var(--green-soft); color: var(--green); }
.log-what { font-weight: 500; color: var(--ink); }
.log-who { font-size: 13px; color: var(--muted); white-space: nowrap; }
.log-list > li.log-detail { display: block; background: var(--bg); padding: 4px 24px 14px 108px; cursor: default; }
.log-detail table { border-collapse: collapse; font-size: 13px; margin-bottom: 8px; max-width: 100%; }
.log-detail th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); padding: 6px 18px 6px 0; }
.log-detail td { padding: 5px 18px 5px 0; border-top: 1px solid var(--line-2); vertical-align: top; overflow-wrap: anywhere; }
.log-detail td:first-child { color: var(--muted); white-space: nowrap; }
.log-detail td.before { color: var(--soft); text-decoration: line-through; text-decoration-color: #d4d4d8; }
.log-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--soft); }
.log-count { margin-left: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--line-2); border-radius: 999px; padding: 1px 7px; }
.set-card .filters .plain-input.search { width: 190px; }
.date-in input { width: 132px; }

/* Accounting polish: numbers and status colours */
body { font-feature-settings: "tnum" 1; }
.num, td.num, .kpi .value, .inv-sum b, .ms-count { font-variant-numeric: tabular-nums lining-nums; }
.kpi .value { letter-spacing: -.02em; }
.neg { color: var(--red); }
.flag.ok { box-shadow: inset 0 0 0 1px #abefc6; }
.flag.red { box-shadow: inset 0 0 0 1px #fecdca; }
.flag.amber { box-shadow: inset 0 0 0 1px #fde68a; color: #93560a; }
.flag.blue { box-shadow: inset 0 0 0 1px #d1e0ff; }
.todo-dot.red, .ms-count { color: var(--red); }
.todo-dot.red { background: var(--red-dot); } .todo-dot.amber { background: var(--amber-dot); }
.month-status.ready { border-left-color: var(--green-dot); }
.ms-bar > div { background: var(--green-dot); }
.how.ai { box-shadow: inset 0 0 0 1px #abefc6; } .how.suggest { box-shadow: inset 0 0 0 1px #fde68a; color: #93560a; } .how.none { box-shadow: inset 0 0 0 1px #fecdca; }

/* Top bar */
.month-step { display: inline-flex; align-items: center; gap: 4px; }
.month-step .step { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.month-step .step:hover:not([disabled]) { background: var(--line-2); }
.month-step .step[disabled] { opacity: .35; cursor: default; }
.fy-chip { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.user-block { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; }
.user-block .who { display: flex; flex-direction: column; line-height: 1.2; }
.user-block .who b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.user-block .who span { font-size: 11.5px; color: var(--soft); }
.signout-btn { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.signout-btn:hover { background: var(--red-soft); color: var(--red); border-color: #fecdca; }

/* Footer */
.app-footer2 { margin-top: 24px; border-top: 1px solid var(--line); background: #fff; }
.app-footer2 .f-in { max-width: 1280px; margin: 0 auto; padding: 22px 32px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; font-size: 12.5px; color: var(--muted); }
.app-footer2 .f-brand { display: flex; gap: 10px; align-items: flex-start; }
.app-footer2 .f-brand img { width: 26px; height: 26px; }
.app-footer2 .f-brand b { display: block; color: var(--ink); font-size: 13.5px; }
.app-footer2 h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.app-footer2 .f-links { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.app-footer2 .f-links a { color: var(--ink-2); }
.app-footer2 .f-safe div { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.app-footer2 .f-safe .mud-icon-root { font-size: 15px; color: var(--green-dot); }
.app-footer2 .f-base { border-top: 1px solid var(--line-2); }
.app-footer2 .f-base div { max-width: 1280px; margin: 0 auto; padding: 10px 32px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--soft); }
@media (max-width: 900px) { .app-footer2 .f-in { grid-template-columns: 1fr; } }

/* Settings: salary rules */
.rule-split { padding: 8px 24px 18px; display: grid; gap: 8px; }
.rule-row { display: grid; grid-template-columns: 220px 1fr 110px; gap: 14px; align-items: center; font-size: 13.5px; }
.rule-row .lbl b { font-weight: 500; } .rule-row .lbl span { color: var(--soft); font-size: 12px; margin-left: 6px; }
.rule-bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.rule-bar > div { height: 100%; background: var(--blue); border-radius: 99px; opacity: .85; }
.rule-row.basic .rule-bar > div { background: var(--ink); }
.rule-row.ded .rule-bar > div { background: var(--red-dot); }
.rule-row .amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rule-row.total { border-top: 1px solid var(--line); padding-top: 8px; }
.rule-row.total .amt { color: var(--green); }

/* Deactivate employee */
.deact { margin: 14px 24px 0; padding: 14px 16px; border: 1px solid #fecdca; background: var(--red-soft); border-radius: 12px; }
.deact-h { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--red); }
.deact p { margin: 6px 0 10px; font-size: 13px; color: var(--ink-2); }
.deact-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.deact-row .plain-input, .deact-row .mini-select { height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: 14px var(--font); background: #fff; box-sizing: border-box; }

/* Confirm changes */
.cc-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; }
.cc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cc-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.cc-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; overflow-wrap: anywhere; }
.cc-table td:first-child { color: var(--muted); }
.cc-table td.before { color: var(--soft); text-decoration: line-through; text-decoration-color: #d4d4d8; }
.cc-table td.after { font-weight: 600; color: var(--ink); }
.cc-table td.arrow { color: var(--soft); width: 16px; }
.cc-table tr.money td.after { font-variant-numeric: tabular-nums; }
.cc-table .up { color: var(--green); font-weight: 600; }
.cc-table .down { color: var(--red); font-weight: 600; }

/* ===== Responsive: iPad, laptop and large screens (same breakpoints as agilelancer.com) ===== */
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields.f2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet { overflow-x: auto; }

/* Large monitors: use the extra width for tables, keep text lines comfortable */
@media (min-width: 1600px) {
  .page { max-width: 1440px; }
  .app-footer2 .f-in, .app-footer2 .f-base div { max-width: 1440px; }
}

/* Laptops and iPad landscape */
@media (max-width: 1280px) {
  .page { padding: 28px 24px 44px; }
  .set-layout { grid-template-columns: 220px 1fr; }
  .accounts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .acct:nth-child(4) { border-left: 0; }
}

/* iPad portrait and small laptops */
@media (max-width: 1024px) {
  .page { padding: 22px 18px 40px; }
  .page-head h1 { font-size: 26px; }
  .kpis, .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
  .month-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .mstep::before { display: none; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs button { white-space: nowrap; }
  .filters .plain-input.search { width: 100%; max-width: 280px; }
  .rule-row { grid-template-columns: 170px 1fr 96px; }
  .log-list > li.log-detail { padding-left: 24px; }
  .set-rows li.set-edit { padding-left: 24px; }
  .inv-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-sum > div:nth-child(3) { border-left: 0; }
  .inv-sum > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .topbar { gap: 10px; }
}

/* Phones and narrow windows */
@media (max-width: 700px) {
  .page { padding: 18px 14px 36px; }
  .kpis, .kpis.k3, .accounts { grid-template-columns: 1fr; }
  .acct { border-left: 0; border-top: 1px solid var(--line); }
  .fields.f2 { grid-template-columns: 1fr; }
  .month-status { grid-template-columns: 1fr; }
  .ms-actions { justify-content: flex-start; flex-wrap: wrap; }
  .fy-chip { display: none; }
  .month-step .mud-select { min-width: 140px !important; }
  .set-nav { grid-template-columns: 1fr; }
  .rule-row { grid-template-columns: 1fr 90px; }
  .rule-row .rule-bar { display: none; }
  .log-who { display: none; }
  .set-connect { grid-template-columns: 1fr; }
}

/* Touch screens (iPad): bigger targets */
@media (pointer: coarse) {
  .pill-btn { height: 38px; padding: 0 16px; }
  .seg button { padding: 8px 14px; }
  .nav-link { height: 42px; }
  .month-step .step, .signout-btn { width: 40px; height: 40px; }
  .set-item { padding: 12px; }
  .cl-cell { width: 30px; height: 30px; }
}

/* Checklist */
.ck-hero { display: flex; align-items: center; gap: 28px; padding: 22px 28px; }
.ck-ring { position: relative; width: 120px; height: 120px; flex: none; }
.ck-ring svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.ck-ring circle { fill: none; stroke-width: 12; }
.ck-ring .track { stroke: var(--line-2); }
.ck-ring .bar { stroke: var(--green-dot); stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ck-pct { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ck-pct b { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.ck-pct span { font-size: 12px; color: var(--soft); }
.ck-cheer { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.ck-count { margin-top: 4px; font-size: 14px; color: var(--muted); }
.ck-count b { color: var(--ink); }
.ck-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ck-next { margin-top: 14px; padding: 16px 22px; border: 1px solid #c7d7fe; background: linear-gradient(0deg, #fff, #f5f8ff); }
.ck-next-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.ck-next-body { display: flex; align-items: center; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.ck-next-body .grow { flex: 1; min-width: 220px; }
.ck-next-name { font-size: 16px; font-weight: 600; }
.ck-next .sub, .ck-list .sub { font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.ck-all-done { display: flex; align-items: center; gap: 14px; border-color: #abefc6; background: var(--green-soft); }
.ck-toolbar { display: flex; justify-content: flex-end; margin: 14px 2px 0; }
.ck-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.ck-month .sheet-head h2 { font-size: 15px; }
.ck-mini { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.ck-mini-bar { width: 120px; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.ck-mini-bar > div { height: 100%; background: var(--green-dot); border-radius: 99px; }
.ck-list { list-style: none; margin: 0; padding: 0; }
.ck-list > li { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.ck-list > li:last-child { border-bottom: 0; }
.ck-list .grow { flex: 1; min-width: 0; }
.ck-name { font-weight: 500; }
.ck-state .mud-icon-root { font-size: 20px; color: #c4c4c8; }
.ck-list li.done .ck-state .mud-icon-root { color: var(--green-dot); }
.ck-list li.late .ck-state .mud-icon-root { color: var(--red-dot); }
.ck-list li.done .ck-name { color: var(--muted); }
.ck-due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ck-due.late { color: var(--red); font-weight: 600; }
.ck-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.ck-actions .file-pick.pill-btn { position: relative; }
.ck-form-row { background: var(--bg); }
.ck-form { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; padding-top: 4px; }
.ck-form .plain-input { flex: 1; min-width: 240px; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: 14px var(--font); background: #fff; }
.ck-next .ck-form { margin-top: 12px; }
@media (max-width: 700px) {
  .ck-hero { flex-direction: column; align-items: flex-start; }
  .ck-list > li { flex-wrap: wrap; }
  .ck-mini-bar { width: 70px; }
}

/* Settings: monthly documents */
.set-rows li.off b, .set-rows li.off .sub { opacity: .5; }
.doc-form { padding: 14px 24px 16px; background: var(--bg); border-bottom: 1px solid var(--line-2); }
.doc-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.doc-grid .lc { min-width: 150px; }
.doc-grid .lc.grow2 { flex: 2 1 260px; }
.doc-grid .plain-input, .doc-grid .mini-select { height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: 14px var(--font); background: #fff; width: 100%; box-sizing: border-box; }
.doc-months { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.doc-months button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font: 500 12.5px var(--font); cursor: pointer; }
.doc-months button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.doc-checks { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.doc-checks label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* Document library */
.lib { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.lib-tree { position: sticky; top: 80px; padding: 8px; display: grid; gap: 1px; max-height: calc(100vh - 110px); overflow-y: auto; }
.lib-node { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); }
.lib-node:hover { background: var(--line-2); }
.lib-node.on { background: var(--ink); color: #fff; }
.lib-node.on .lib-ico, .lib-node.on .lib-n { color: #fff; }
.lib-node .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-ico { font-size: 18px !important; color: #e3a008; }
.lib-n { font-size: 11.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
.lib-newfolder { display: grid; gap: 6px; padding: 10px; margin-top: 6px; border-top: 1px solid var(--line-2); }
.lib-newfolder .plain-input { height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: 13.5px var(--font); }
.lib-newfolder .sub { font-size: 12px; color: var(--soft); }
.lib-main { min-width: 0; }
.lib-bar { padding: 12px 16px; display: grid; gap: 10px; }
.lib-crumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.lib-crumb .sep { color: #c4c4c8; }
.lib-crumb span:last-child { color: var(--ink); font-weight: 600; }
.lib-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.lib-search:focus-within { border-color: var(--ink); }
.lib-search input { flex: 1; border: 0; outline: none; font: 14px var(--font); background: transparent; }
.lib-tags, .lib-dtags, .tag-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 10px; font: 500 12px var(--font); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tag span { color: var(--soft); font-weight: 400; }
.tag:hover { border-color: var(--ink-2); }
.tag.on { background: var(--blue-soft); border-color: #c7d7fe; color: var(--blue); }
.tag button { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }
.lib-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.lib-tile { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; transition: border-color .12s, box-shadow .12s; }
.lib-tile:hover { border-color: var(--ink-2); box-shadow: var(--shadow); }
.lib-tile b { font-size: 14px; font-weight: 600; margin-top: 6px; }
.lib-tile span { font-size: 12.5px; color: var(--soft); }
.lib-tile-ico { font-size: 26px !important; color: #e3a008; }
.lib-docs { list-style: none; margin: 0; padding: 0; }
.lib-docs li { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--line-2); }
.lib-docs li:last-child { border-bottom: 0; }
.lib-docs .grow { flex: 1; min-width: 0; }
.lib-title { font-weight: 600; color: var(--ink) !important; font-size: 14px; }
.lib-docs .sub { font-size: 12.5px; color: var(--soft); margin: 2px 0 6px; }
.lib-file { width: 40px; height: 46px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; background: var(--line-2); color: var(--ink-2); }
.lib-file.pdf { background: #fef3f2; color: #b42318; }
.lib-file.xlsx, .lib-file.xls, .lib-file.xlsm, .lib-file.csv { background: #ecfdf3; color: #067647; }
.lib-file.jpg, .lib-file.jpeg, .lib-file.png { background: var(--blue-soft); color: var(--blue); }
.lib-size { font-size: 12px; color: var(--soft); white-space: nowrap; }
.lib-modal-back { position: fixed; inset: 0; background: rgba(10,10,10,.35); z-index: 1400; }
.lib-modal { position: fixed; z-index: 1401; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: 0 24px 60px -20px rgba(16,24,40,.35); }
.lib-form { padding: 16px 24px; display: grid; gap: 14px; }
.lib-form .plain-input, .lib-form .mini-select { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: 14px var(--font); background: #fff; width: 100%; box-sizing: border-box; }
.lib-form .lc > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.lib-form .lc em { font-style: normal; font-weight: 400; color: var(--soft); margin-left: 6px; }
.req { color: var(--red); font-style: normal; }
.lib-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px; border: 1.5px dashed #c4c4c8; border-radius: 14px; text-align: center; color: var(--muted); background: var(--bg); }
.lib-drop:hover { border-color: var(--ink); color: var(--ink); }
.lib-drop b { color: var(--ink); font-size: 14px; }
.lib-drop span { font-size: 12px; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 38px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tag-input:focus-within { border-color: var(--ink); }
.tag-input input { flex: 1; min-width: 140px; border: 0; outline: none; font: 14px var(--font); height: 28px; }
.tag-suggest { margin-top: 6px; }
.lib-row2 { display: flex; gap: 12px; flex-wrap: wrap; }
.lib-row2 .lc { flex: 1 1 180px; }
.lib-modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--line-2); background: var(--bg); position: sticky; bottom: 0; }
.lib-modal-foot .grow { flex: 1; }
@media (max-width: 1024px) { .lib { grid-template-columns: 1fr; } .lib-tree { position: static; max-height: 260px; } }
.lib-tree { overflow-x: hidden; }

/* Folder tree, collapsible */
.lib-tree { position: static; max-height: none; overflow: visible; padding: 8px 6px; }
.lib-row { display: flex; align-items: center; gap: 2px; padding-left: calc(var(--d) * 16px); border-radius: 10px; }
.lib-row:hover { background: var(--line-2); }
.lib-row.on { background: var(--ink); }
.lib-row.on .lib-node, .lib-row.on .lib-ico, .lib-row.on .lib-meta, .lib-row.on .lib-chev { color: #fff; }
.lib-chev { width: 22px; height: 30px; flex: none; display: grid; place-items: center; border: 0; background: none; color: var(--soft); cursor: pointer; border-radius: 6px; padding: 0; }
button.lib-chev:hover { color: var(--ink); }
.lib-row .lib-node { flex: 1; min-width: 0; padding: 7px 8px 7px 2px; border-radius: 10px; background: none; }
.lib-row .lib-node:hover, .lib-row.on .lib-node { background: none; }
.lib-meta { display: inline-flex; align-items: center; gap: 6px; min-width: 34px; justify-content: flex-end; color: var(--soft); }
.lib-n { min-width: 14px; text-align: right; }
.lib-sep { height: 1px; background: var(--line-2); margin: 4px 8px; }

/* Drag and drop, lock */
.lib-dropbar { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 18px; border: 1.5px dashed #c4c4c8; border-radius: 14px; background: #fff; color: var(--muted); font-size: 13.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.lib-dropbar:hover, .lib-dropbar:focus-within, .lib-drop:hover, .lib-drop:focus-within { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.lib-dropbar b { color: var(--ink); font-weight: 600; }
.lib-drop { position: relative; cursor: pointer; }
.lib-drop.has { border-style: solid; border-color: #abefc6; background: var(--green-soft); }
.lib-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.lib-queue { font-size: 12.5px; color: var(--blue); background: var(--blue-soft); border-radius: 10px; padding: 8px 12px; }
.lib-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lib-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--soft); cursor: pointer; display: grid; place-items: center; }
.lib-x:hover { background: var(--line-2); color: var(--ink); }
.lock-flag { margin-left: 8px; background: var(--ink) !important; color: #fff !important; box-shadow: none !important; font-size: 11px; vertical-align: 2px; }

/* Folder tree stays inside its card */
.lib-tree { grid-template-columns: minmax(0, 1fr); }
.lib-row { min-width: 0; }
.lib-meta { min-width: 40px; flex: none; }
.lib-meta .mud-icon-root { opacity: .75; }

/* Documents: three panels (folders · list · viewer) */
.page.page-wide { max-width: 1680px; }
.lib { grid-template-columns: 250px minmax(0, 1fr) minmax(0, 1.05fr); }
.lib-view { position: sticky; top: 80px; height: calc(100vh - 104px); display: flex; flex-direction: column; overflow: hidden; }
.lib-view-head { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px 8px; }
.lib-view-head .grow { flex: 1; min-width: 0; }
.lib-view-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.lib-view .sub { font-size: 12px; color: var(--soft); margin-top: 2px; }
.lib-view-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; border-bottom: 1px solid var(--line-2); }
.lib-view-body { flex: 1; min-height: 0; background: #f4f4f5; display: grid; }
.lib-view-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.lib-view-body img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; padding: 12px; box-sizing: border-box; }
.lib-view-foot { padding: 10px 16px 12px; border-top: 1px solid var(--line-2); display: grid; gap: 4px; }
.lib-noview, .lib-view-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; color: var(--muted); font-size: 13px; max-width: 300px; }
.lib-noview b, .lib-view-empty b { color: var(--ink); font-size: 14px; }
.lib-view-empty { height: 100%; justify-content: center; }
.lib-view-empty .mud-icon-root { color: #c4c4c8; }
.lib-file.big { width: 64px; height: 76px; font-size: 13px; border-radius: 12px; }
.lib-file.docx, .lib-file.doc { background: #eef3fb; color: #1d4ed8; }
.lib-docs li { cursor: pointer; transition: background .12s; }
.lib-docs li:hover { background: var(--bg); }
.lib-docs li.on { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.lib-go { font-size: 18px !important; color: #c4c4c8; }
.lib-docs li.on .lib-go { color: var(--blue); }
.lib-folders { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 1400px) {
  .lib { grid-template-columns: 230px minmax(0, 1fr); }
  .lib-view { grid-column: 1 / -1; position: static; height: 70vh; }
}
@media (max-width: 1024px) { .lib { grid-template-columns: 1fr; } }

/* Documents: pinned folders, tabs, paging */
.lib-pinned { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.lib-pinned-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--soft); margin-right: 2px; }
.lib-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: 500 13px var(--font); color: var(--ink-2); cursor: pointer; }
.lib-chip span { color: var(--soft); font-weight: 400; font-size: 12px; }
.lib-chip:hover { border-color: var(--ink-2); }
.lib-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.lib-chip.on span { color: #d4d4d8; }
.lib-head { padding-top: 0; padding-bottom: 0; align-items: stretch; }
.lib-tabs { display: flex; gap: 2px; }
.lib-tabs button { border: 0; background: none; padding: 14px 12px 12px; font: 500 14px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.lib-tabs button span { font-size: 11.5px; color: var(--soft); background: var(--line-2); border-radius: 999px; padding: 0 7px; }
.lib-tabs button:hover { color: var(--ink); }
.lib-tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.lib-head-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; padding: 8px 0; }
.lib-pin { width: 32px; height: 32px; flex: none; border: 0; border-radius: 8px; background: none; color: #c4c4c8; cursor: pointer; display: grid; place-items: center; }
.lib-pin:hover { background: var(--line-2); color: var(--ink); }
.lib-pin.on { color: var(--blue); }
.lib-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.lib-pager span { margin-right: auto; }
/* Viewer about 15% wider */
.lib { grid-template-columns: 240px minmax(0, 0.85fr) minmax(0, 1.2fr); }
.lib-head-actions { flex-wrap: nowrap; } .lib-head-actions .pill-btn { padding: 0 10px; }
.lib-subs { border-bottom: 1px solid var(--line); }
.lib-sub-ico { font-size: 34px !important; color: #e3a008; width: 40px; flex: none; }

/* ===== Documents, final layout ===== */
.lib { grid-template-columns: 250px minmax(0, 0.9fr) minmax(0, 1.15fr); }
.lib-tree { padding: 10px 8px 12px; align-self: start; }
.lib-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.lib-group:first-child { padding-top: 2px; }
.lib-row .lib-node .grow { white-space: normal; overflow: visible; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.lib-ico.q { color: var(--blue) !important; }
.lib-row.on .lib-ico.q { color: #fff !important; }
.lib-addfolder { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 8px 12px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); cursor: pointer; border-radius: 0 0 10px 10px; }
.lib-addfolder:hover { color: var(--ink); }
.lib-main { padding: 0; overflow: hidden; align-self: start; }
.lib-searchbox { display: flex; align-items: center; gap: 10px; margin: 14px 16px 6px; height: 46px; padding: 0 10px 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--soft); transition: border-color .15s, box-shadow .15s; }
.lib-searchbox:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px var(--line-2); color: var(--ink); }
.lib-searchbox.active { border-color: var(--blue); }
.lib-searchbox input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: 15px var(--font); color: var(--ink); }
.lib-searchbox kbd { font: 600 11px var(--mono); color: var(--soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; background: var(--bg); }
.lib-scope { display: inline-flex; align-items: center; gap: 4px; flex: none; max-width: 45%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; font-weight: 500; color: var(--blue); background: var(--blue-soft); border: 1px solid #c7d7fe; border-radius: 999px; padding: 2px 4px 2px 10px; }
.lib-scope button { border: 0; background: none; color: var(--blue); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.lib-listhead { display: flex; align-items: flex-end; gap: 12px; padding: 10px 18px 12px; border-bottom: 1px solid var(--line-2); }
.lib-listhead .grow { flex: 1; min-width: 0; }
.lib-listhead h2 { margin: 2px 0 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-listhead .sub { font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.lib-crumb { font-size: 12.5px; min-height: 0; }
.lib-crumb .crumb { padding: 0; color: var(--blue); font-size: 12.5px; }
.lib-sort { height: 32px; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; font: 13px var(--font); background: #fff; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.icon-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.lib-docs mark { background: #fef08a; color: inherit; border-radius: 3px; padding: 0 1px; }
.lib-docs li { padding: 11px 18px; }
.lib-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 44px 24px; color: var(--muted); font-size: 13.5px; }
.lib-empty b { color: var(--ink); font-size: 15px; }
.lib-empty span { max-width: 360px; }
.lib-empty .mud-icon-root { color: #c4c4c8; }
.lib-empty-drop { position: relative; margin: 16px; border: 1.5px dashed #c4c4c8; border-radius: 14px; cursor: pointer; }
.lib-empty-drop:hover, .lib-empty-drop:focus-within { border-color: var(--blue); background: var(--blue-soft); }
.lib-dropbar.slim { margin: 0; border-radius: 0; border: 0; border-top: 1px dashed var(--line); padding: 12px 18px; font-size: 13px; }
.lib-view-foot .tag { cursor: pointer; }
@media (max-width: 1400px) { .lib { grid-template-columns: 230px minmax(0, 1fr); } }

/* Less scrolling: search and heading stay put, only the list scrolls */
.lib-main { position: sticky; top: 80px; display: flex; flex-direction: column; height: calc(100vh - 104px); }
.lib-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.lib-docs li { padding: 9px 18px; gap: 12px; }
.lib-docs .lib-file { width: 34px; height: 40px; font-size: 9.5px; }
.lib-docs .sub { margin: 1px 0 0; }
.lib-tree { position: sticky; top: 80px; max-height: calc(100vh - 104px); overflow-y: auto; overflow-x: hidden; }
@media (max-width: 1400px) { .lib-main { position: static; height: auto; } .lib-scroll { overflow: visible; } }

/* ===== Documents: compact type, resizable panels, row menu ===== */
.lib { gap: 0; grid-template-columns: var(--lib-a, 240px) 12px var(--lib-b, minmax(0, 0.9fr)) 12px minmax(0, 1.15fr); font-size: 13px; }
.lib-resizer { cursor: col-resize; position: relative; align-self: stretch; touch-action: none; }
.lib-resizer::after { content: ""; position: absolute; top: 12px; bottom: 12px; left: 5px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.lib-resizer:hover::after, .lib-resizer.dragging::after { background: var(--blue); }
body.lib-resizing { cursor: col-resize; user-select: none; }
body.lib-resizing iframe { pointer-events: none; }
.lib-group { font-size: 10.5px; }
.lib-row .lib-node { font-size: 13px; padding-top: 6px; padding-bottom: 6px; }
.lib-row .lib-node .grow { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset; }
.lib-n { font-size: 11px; }
.lib-searchbox { height: 42px; }
.lib-searchbox input { font-size: 14px; }
.lib-listhead h2 { font-size: 16px; }
.lib-listhead .sub { font-size: 12px; }
.lib-docs li { padding: 8px 12px 8px 16px; gap: 11px; align-items: center; }
.lib-docs .lib-file { width: 32px; height: 38px; font-size: 9px; border-radius: 7px; }
.lib-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin-top: 2px; font-size: 11.5px; color: var(--soft); line-height: 1.5; }
.lib-line > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.lib-line > span + span::before { content: "\00B7"; margin: 0 6px; color: #c4c4c8; }
.mtag { font-style: normal; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 10.5px; line-height: 17px; }
.mtag.hit { background: #fef08a; }
.lib-pinned-ico { font-size: 15px !important; color: var(--blue); flex: none; }
.lib-menu-wrap { position: relative; flex: none; }
.lib-dots { width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--soft); cursor: pointer; display: grid; place-items: center; }
.lib-docs li:hover .lib-dots { color: var(--ink); }
.lib-dots:hover { background: var(--line-2); }
.lib-menu-back { position: fixed; inset: 0; z-index: 50; }
.lib-menu { position: absolute; right: 0; top: 32px; z-index: 51; min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(16,24,40,.25); display: grid; }
.lib-menu button, .lib-menu a { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2) !important; cursor: pointer; text-decoration: none !important; }
.lib-menu button:hover, .lib-menu a:hover { background: var(--line-2); color: var(--ink) !important; }
.lib-menu .mud-icon-root { font-size: 17px !important; color: var(--soft); }
.lib-view-title { font-size: 14px; }
.lib-view .sub { font-size: 11.5px; }
@media (max-width: 1400px) { .lib { grid-template-columns: 230px minmax(0, 1fr); gap: 16px; } .lib-resizer { display: none; } }
.lib-line { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.lib-line > span { flex: 0 1 auto; min-width: 0; }
.lib-line > span:first-child { flex-shrink: 2; }
.mtag { flex: none; }
/* The facts stay readable; tags at the end are what gets cut when space runs out */
.lib-line > span { flex: 0 0 auto; max-width: 200px; }
.lib-line > span:first-child { flex: 0 1 auto; max-width: 42%; }
.mtag { flex: 0 0 auto; }
.lib-line > span:first-child { min-width: 90px; max-width: 34%; }
.lib-line > span:nth-child(3) { max-width: 140px; }
