:root {
  color-scheme: light;
  --ink: #17332a;
  --muted: #51645a;
  --deep: #163d32;
  --green: #26604c;
  --green-soft: #edf5ef;
  --cream: #f7f6f0;
  --white: #fff;
  --line: #dce4dc;
  --amber: #7b510f;
  --amber-soft: #f8edda;
  --red: #9e3832;
  --red-soft: #fbefeb;
  --radius: 20px;
  --shadow: 0 12px 36px #17332a0b;
  font-family: "Noto Sans Gujarati", "Gujarati Sangam MN", "Nirmala UI", Shruti, system-ui, sans-serif;
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--cream); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.85rem, 4.5vw, 2.8rem); }
h2 { font-size: clamp(1.22rem, 3vw, 1.47rem); }
h3 { font-size: 1.04rem; }
:focus-visible { outline: 3px solid #b57727; outline-offset: 3px; }
.skip { position: absolute; z-index: 9; top: 8px; left: 8px; transform: translateY(-160%); background: white; padding: 10px; }
.skip:focus { transform: none; }
.site-header { background: var(--deep); color: #fff; border-bottom: 1px solid #396153; }
.header-inner {
  max-width: 1160px; padding: 17px 28px; margin: auto; display: flex; justify-content: space-between;
  align-items: center; gap: 16px; min-height: 78px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: #e4cb92; color: #1f392f; font-size: 1.26rem; line-height: 1; font-weight: 800; flex: none;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.13rem; }
.brand small { color: #d3e0d6; font-size: .75rem; }
#navigation, .tabs, .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#navigation button { min-height: 42px; color: #e9f0e9; border: 1px solid transparent; padding: 7px 14px; border-radius: 10px; background: transparent; }
#navigation button:hover, #navigation button[aria-current="page"] { background: #ffffff17; border-color: #ffffff28; }
#navigation .logout { color: #efdcaf; }
.shell { max-width: 1160px; margin: auto; padding: 30px 28px 66px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin-top: 5px; }
.month-picker { display: flex; gap: 5px; align-items: center; align-self: center; }
.month-picker input { width: auto; min-width: 0; min-height: 43px; padding-block: 5px; }
.month-picker button { width: 42px; padding: 0; font-size: 1.35rem; }
.tabs { border-bottom: 1px solid var(--line); gap: 4px; margin-bottom: 18px; }
.tabs button { background: transparent; color: var(--muted); border: 0; border-bottom: 3px solid transparent; padding: 11px 14px; min-height: 45px; font-weight: 700; }
.tabs button[aria-current="page"] { color: var(--deep); border-bottom-color: var(--green); }
.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(15px, 3vw, 24px); box-shadow: var(--shadow); min-width: 0;
}
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.panel-head p { color: var(--muted); font-size: .87rem; margin-top: 3px; }
.stack { display: grid; gap: 16px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.work-form { max-width: 100%; }
.login-grid { min-height: 475px; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(16px, 4vw, 42px); align-items: stretch; }
.login-cover {
  position: relative; isolation: isolate; min-height: 370px; padding: clamp(22px, 5vw, 47px);
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  border-radius: var(--radius); color: #fff; background: #193f32;
}
.login-cover::after {
  position: absolute; z-index: -1; inset: 0; content: ""; opacity: .80;
  background: linear-gradient(0deg, #102e26 7%, #102e26ca 34%, #15382b2c 100%), url("/banner.jpg") center / cover;
}
.login-cover h1 { max-width: 350px; }
.login-cover p { color: #f3db9e; font-weight: 700; margin-bottom: 7px; }
.login-panel { align-self: center; width: 100%; max-width: 460px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: .87rem; font-weight: 700; min-width: 0; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 45px; border: 1px solid #bdcbbf; border-radius: 10px;
  padding: 9px 11px; color: var(--ink); background: #fbfcfa; font-size: 1rem; line-height: 1.3;
}
textarea { min-height: 70px; resize: vertical; }
input[type="checkbox"] { width: 18px; min-height: 18px; padding: 0; accent-color: var(--green); }
.form-grid .check { display: flex; flex-direction: row; align-items: center; gap: 7px; }
.extra-fields { border: 1px solid var(--line); border-radius: 10px; padding-inline: 10px; }
.extra-fields summary { cursor: pointer; padding: 9px 0; color: var(--green); font-weight: 700; }
.extra-fields .form-grid { padding-bottom: 10px; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; font-weight: 700; text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease;
}
.button:hover { background: var(--green-soft); border-color: #b8cabc; }
.button.primary { background: var(--deep); color: white; border-color: var(--deep); }
.button.primary:hover { background: var(--green); }
.button.danger { color: var(--red); }
.button.small { min-height: 38px; padding: 5px 9px; font-size: .82rem; }
.button:disabled { opacity: .6; cursor: default; }
.segmented { display: flex; gap: 5px; padding: 4px; background: #ebf0e8; border-radius: 12px; margin-bottom: 15px; }
.segmented button { flex: 1; background: transparent; border: 1px solid transparent; border-radius: 9px; min-height: 42px; color: var(--muted); font-weight: 700; }
.segmented button[aria-pressed="true"] { background: white; border-color: var(--line); color: var(--deep); box-shadow: 0 2px 5px #17332a12; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; background: white; }
.metric span { display: block; font-size: .84rem; color: var(--muted); }
.metric data { display: block; width: 100%; margin-top: 5px; font-size: clamp(1.13rem, 2.8vw, 1.65rem); font-weight: 800; overflow-wrap: anywhere; }
.metric.accent { background: var(--deep); border-color: var(--deep); color: #fff; }
.metric.accent span { color: #e5deb9; }
.number { font-variant-numeric: tabular-nums; }
.amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bad { color: var(--red); }
.good { color: var(--green); }
.muted, .empty { color: var(--muted); }
.empty { padding: 16px 0; font-size: .95rem; }
.notice { border: 1px solid #e2cfaa; background: var(--amber-soft); color: var(--amber); padding: 10px 13px; border-radius: 10px; }
.error { padding: 9px 10px; color: var(--red); border-radius: 8px; background: var(--red-soft); font-size: .9rem; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 9px; background: var(--green-soft); color: var(--green); font-size: .77rem; font-weight: 700; }
.pill.wait { background: var(--amber-soft); color: var(--amber); }
.pill.off { background: var(--red-soft); color: var(--red); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .91rem; text-align: left; }
th, td { padding: 9px 10px; border-bottom: 1px solid #e7ece5; vertical-align: top; overflow-wrap: anywhere; }
th { background: #f2f5ef; color: var(--deep); font-size: .83rem; font-weight: 750; }
td small { display: block; color: var(--muted); }
td.actions-cell { min-width: 220px; }
tbody tr:hover { background: #fafbf8; }
.table-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.ledger-list { list-style: none; margin: 0; padding: 0; }
.ledger-list li { display: flex; gap: 12px; justify-content: space-between; border-top: 1px solid #e8ece5; padding: 12px 0; }
.ledger-list li:first-child { border: 0; }
.ledger-list .row-main { min-width: 0; overflow-wrap: anywhere; }
.ledger-list strong, .ledger-list small { display: block; }
.ledger-list small { color: var(--muted); margin-top: 3px; }
.team-list { list-style: none; margin: 0; padding: 0; }
.team-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .5fr) auto; gap: 10px; align-items: center;
  border-top: 1px solid var(--line); padding: 12px 0; overflow-wrap: anywhere; }
.team-list small { display: block; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.filters input { flex: 2 1 170px; }
.filters select { flex: 1 1 115px; }
.report-cover { display: grid; gap: 11px; }
.report-banner { display: block; width: 100%; max-height: 236px; object-fit: contain; background: #fbf3dd; border-radius: 12px; }
.toast { position: fixed; z-index: 3; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100% - 32px); padding: 10px 15px; color: white; background: var(--deep); border-radius: 10px; box-shadow: var(--shadow); }
dialog { max-width: min(620px, calc(100% - 24px)); width: 100%; max-height: 90vh; padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); box-shadow: 0 25px 80px #132f2955; }
dialog::backdrop { background: #122a22a3; }
.dialog-inner { padding: clamp(15px, 4vw, 24px); }
.dialog-inner > h2 { margin-bottom: 13px; }
.dialog-inner > p { margin-bottom: 12px; }
.dialog-inner > img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; }
.dialog-inner .actions { margin-top: 12px; }
.audit-data { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.audit-data dl { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.audit-data dt { color: var(--muted); font-size: .82rem; }
.audit-data dd { margin: 0 0 5px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; padding: 13px 16px; gap: 8px; }
  .shell { padding: 18px 13px 42px; }
  .workspace-grid, .login-grid { grid-template-columns: minmax(0, 1fr); }
  .login-grid { min-height: auto; gap: 13px; }
  .login-cover { min-height: 185px; padding: 20px; }
  .login-panel { max-width: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 10px; }
  .tabs button { padding-inline: 9px; }
  .page-head { gap: 10px; margin-bottom: 13px; align-items: flex-start; }
  .report-banner { max-height: 160px; }
  .team-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .team-list li > :nth-child(2) { text-align: right; }
  .team-list li > button { grid-column: 2; }
}
@media (max-width: 355px) {
  .form-grid:not(.entry-contact), .audit-data { grid-template-columns: minmax(0, 1fr); }
  .brand small { font-size: .69rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
