:root {
  --primary: #183f4c;
  --primary-2: #245b6c;
  --bg: #f3f6f7;
  --border: #dce5e8;
  --text: #17272e;
  --muted: #6e7e87;
  --green: #1f7a4d;
  --red: #b4232d;
  --orange: #a46308;
  --blue: #356b87;
  --shadow: 0 8px 26px rgba(22, 48, 57, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hide { display: none !important; }

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 15% 10%, rgba(52, 113, 134, 0.12), transparent 32%), var(--bg);
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.authbox {
  width: min(430px, 100%);
  padding: 28px;
  display: grid;
  gap: 10px;
}

.authbox h1 { margin: 2px 0 0; }
.authbox label { margin-top: 5px; font-weight: 750; font-size: 13px; }

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(145deg, var(--primary-2), var(--primary));
  color: #fff;
  font-weight: 950;
  letter-spacing: -1px;
}

.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 13px; }

input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd7dc;
  border-radius: 11px;
  background: #fff;
  color: var(--text);
}

textarea { resize: vertical; min-height: 88px; }

input:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(53, 107, 135, 0.2);
  outline-offset: 1px;
}

button {
  border: 0;
  border-radius: 11px;
  padding: 10px 13px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

button:hover { filter: brightness(1.04); }
.sec { background: #edf2f4; color: var(--primary); }
.ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.mut { color: var(--muted); font-size: 13px; }

aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  z-index: 20;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--border);
}

aside h2 { margin: 10px 0 3px; }
nav { display: grid; gap: 5px; }
nav button { background: transparent; color: #56666f; text-align: left; }
nav button.on { background: var(--primary); color: #fff; }
.nav-home { width: 100%; }
.nav-group { border: 1px solid transparent; border-radius: 12px; }
.nav-group[open] { border-color: var(--border); background: #f8fafb; }
.nav-group > summary {
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #6c7b83;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary span { transition: transform .2s ease; }
.nav-group[open] > summary span { transform: rotate(180deg); }
.nav-group > div { padding: 0 5px 5px; display: grid; gap: 3px; }
.nav-group button { width: 100%; padding: 9px 10px; font-size: 13px; }
aside > #logout { margin-top: auto; }

header {
  min-height: 72px;
  margin-left: 250px;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(240px, 520px) auto;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

#menu { display: none; }
.header-title { display: flex; flex-direction: column; min-width: 0; }
.header-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-title span { color: var(--muted); font-size: 11px; }

.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #f8fafb;
}

.global-search input {
  min-width: 0;
  padding-left: 0;
  border: 0;
  background: transparent;
}

.global-search input:focus { outline: none; }
.header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.header-tools select { width: auto; min-width: 126px; padding: 9px 10px; }
.icon-btn { padding: 9px; background: transparent; color: var(--text); font-size: 20px; }
.notification-btn { position: relative; }

.notification-count {
  position: absolute;
  top: 0;
  right: -1px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  border: 2px solid #fff;
  font-size: 9px;
}

.header-user {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

main {
  max-width: 1320px;
  min-height: calc(100vh - 72px);
  margin-left: 250px;
  padding: 28px 24px 64px;
}

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.hero h1 { margin: 0; font-size: clamp(27px, 3vw, 38px); letter-spacing: -0.035em; }
.hero p { margin: 5px 0 0; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-grid { margin: 14px 0 22px; }
.stat { min-height: 142px; padding: 17px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-top { display: flex; justify-content: space-between; gap: 8px; }
.stat-icon { font-size: 20px; }
.num { margin: 7px 0 2px; font-size: 30px; font-weight: 950; line-height: 1.05; }
.num.pending { font-size: 19px; line-height: 1.18; }
.stat-label { font-size: 13px; font-weight: 800; }
.stat-detail { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; }

.section { margin-top: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.section-heading .mut { text-align: right; }
.section-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 14px; align-items: start; }

.dashboard-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dashboard-filters select { width: auto; min-width: 170px; }

.list { overflow: hidden; }
.row {
  width: 100%;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--border);
}
.row:first-child { border-top: 0; }
button.row { border-radius: 0; background: #fff; color: var(--text); text-align: left; }
button.row:hover { background: #f8fafb; filter: none; }
.row > span:first-child { min-width: 0; }
.row-title, .row b { display: block; font-weight: 850; overflow-wrap: anywhere; }
.row-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.row-actions { display: flex; align-items: flex-end; justify-content: center; gap: 6px; flex-direction: column; }
.row-actions .small-action { margin-top: 0; }
.accreditation-row .row-meta { line-height: 1.65; }
.accreditation-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.directive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.directive-card { padding: 17px; display: grid; gap: 14px; align-content: start; }
.directive-card.missing { border-style: dashed; background: #fffdf8; }
.directive-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.directive-site { display: block; font-size: 18px; font-weight: 900; letter-spacing: -.02em; }
.directive-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.directive-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.directive-facts > div { padding: 10px; border: 1px solid #e8edef; border-radius: 11px; background: #f8fafb; }
.directive-facts label, .directive-next > span { display: block; color: #7a8991; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.directive-facts b { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; }
.directive-next { padding: 12px; border-left: 4px solid var(--primary-2); border-radius: 10px; background: #eef4f6; }
.directive-next p { margin: 5px 0; font-size: 13px; line-height: 1.45; }
.directive-next small { color: var(--muted); }
.directive-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

.insurance-section { scroll-margin-top: 20px; }
.insurance-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.insurance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.insurance-card { padding: 17px; display: grid; gap: 14px; align-content: start; }
.insurance-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.insurance-head b { display: block; margin-top: 4px; line-height: 1.35; }
.insurance-type { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.insurance-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.insurance-facts > div { padding: 10px; border: 1px solid #e8edef; border-radius: 11px; background: #f8fafb; }
.insurance-facts label { display: block; color: #7a8991; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.insurance-facts b { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.insurance-summary { margin: 0; padding: 12px; border-left: 4px solid var(--primary-2); border-radius: 10px; background: #eef4f6; color: var(--muted); font-size: 13px; line-height: 1.45; }
.insurance-sources { margin-top: 14px; overflow: hidden; }
.insurance-sources > summary { display: flex; justify-content: space-between; gap: 10px; padding: 15px 17px; cursor: pointer; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e9eef2;
  color: #536975;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.badge.good { background: #e7f4ec; color: var(--green); }
.badge.warn { background: #fff0d3; color: var(--orange); }
.badge.bad { background: #fae5e7; color: var(--red); }
.badge.info { background: #e8f1f5; color: var(--blue); }

.alert-list { overflow: hidden; }
.alert-item {
  width: 100%;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  background: #fff;
  color: var(--text);
  border-radius: 0;
  border-top: 1px solid var(--border);
  text-align: left;
}
.alert-item:first-child { border-top: 0; }
.alert-item:hover { background: #f8fafb; filter: none; }
.severity-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--blue); }
.severity-dot.critical { background: var(--red); box-shadow: 0 0 0 4px rgba(180, 35, 45, 0.09); }
.severity-dot.high { background: #de7616; }
.severity-dot.medium { background: #d5ad14; }
.severity-dot.info { background: var(--blue); }
.alert-arrow { color: var(--muted); }

.coverage-list { display: grid; gap: 9px; }
.coverage-card { padding: 14px; display: grid; gap: 9px; background: #fff; color: var(--text); text-align: left; }
.coverage-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.coverage-values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.coverage-value { padding: 8px; border-radius: 10px; background: #f5f8f9; }
.coverage-value b { display: block; font-size: 16px; }
.coverage-value span { color: var(--muted); font-size: 10px; }
.progress { height: 7px; overflow: hidden; border-radius: 999px; background: #e8edef; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--green); }

.dashboard-summary { margin-top: 4px; }
.dashboard-priority-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.list-more { width: 100%; border-radius: 0; border-top: 1px solid var(--border); background: #f8fafb; color: var(--primary); }
.dashboard-details { border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.dashboard-details > summary { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.dashboard-details > summary::-webkit-details-marker { display: none; }
.dashboard-details > summary b { display: block; font-size: 18px; }
.dashboard-details > summary small { display: block; margin-top: 3px; color: var(--muted); }
.dashboard-details > summary::after { content: '+'; font-size: 24px; color: var(--primary); }
.dashboard-details[open] > summary::after { content: '−'; }
.dashboard-details .summary-state { margin-left: auto; padding: 5px 9px; border-radius: 999px; background: #fff0d3; color: var(--orange); font-size: 11px; font-weight: 900; }
.dashboard-details .coverage-list { padding: 0 14px 14px; }

.expiry-tabs, .quick, .legend { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 8px 11px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: #52636d; font-size: 12px; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.activity-item { padding: 13px 15px; border-top: 1px solid var(--border); }
.activity-item:first-child { border-top: 0; }
.activity-item b { font-size: 13px; }
.activity-time { color: var(--muted); font-size: 11px; }

.birthday-section .list { border-color: #eadbb2; }
.birthday-row { background: linear-gradient(90deg, #fffdf7, #fff) !important; }
.birthday-row:hover { background: #fff9e8 !important; }
.birthday-person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.birthday-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff1ca;
  font-size: 20px;
}

.scroll-hint { display: none; margin: 10px 1px 0; color: var(--muted); font-size: 11px; }

.notice {
  padding: 13px 15px;
  border: 1px solid #c8dde5;
  border-radius: 13px;
  background: #e8f1f5;
  color: #274f61;
  line-height: 1.45;
}
.notice.warning { border-color: #ecd39e; background: #fff5df; color: #785310; }
.notice.error { border-color: #e7b8bd; background: #fff0f1; color: #8f1c25; }

.detail { padding: 17px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.info-box { padding: 11px; border: 1px solid #e8edef; border-radius: 12px; background: #f8fafb; }
.info-box label { display: block; color: #84929a; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.info-box div { margin-top: 4px; font-weight: 800; }

.tablewrap { overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.mini { width: 100%; border-collapse: collapse; }
.mini th, .mini td { padding: 11px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.mini th { color: #44565f; background: #f8fafb; font-size: 12px; }
.mini tr:last-child td { border-bottom: 0; }

.gantt { border-collapse: separate; border-spacing: 0; min-width: max-content; font-size: 11px; }
.gantt th, .gantt td { min-width: 32px; height: 34px; padding: 0 5px; border-right: 1px solid #e6ecef; border-bottom: 1px solid #e6ecef; text-align: center; }
.gantt th { position: sticky; top: 0; z-index: 3; background: #f8fafb; }
.gantt .person { position: sticky; left: 0; z-index: 2; min-width: 230px; padding: 7px 9px; background: #fff; text-align: left; font-weight: 800; }
.gantt th.person { z-index: 4; background: #f8fafb; }
.worker-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 600; }
.calendar-cell { width: 100%; min-height: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; }
.calendar-cell:hover { background: rgba(255,255,255,.55); filter: none; }
.D { background: #dce9f7; color: #1f5676; }
.N { background: #e2e0f5; color: #494287; }
.L { background: #f0f2f3; color: #738087; }
.V { background: #e4f3e8; color: var(--green); }
.LM { background: #dceef4; color: #28647b; }
.P, .PC, .PS { background: #fff1d5; color: #8a6509; }
.X, .A { background: #fae5e7; color: var(--red); }
.projected-cell { position: relative; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.34) 0 5px, rgba(255,255,255,.02) 5px 10px); }
.projection-dot { position: absolute; top: 2px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }

.document-type-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 14px 0; }
.document-type-strip > div { padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.document-type-strip b { display: block; font-size: 22px; }
.document-type-strip span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.attendance-file-row .button-link { white-space: nowrap; }

.loan-month-list { overflow: hidden; }
.loan-month-row { padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--border); }
.loan-month-row:first-child { border-top: 0; }
.loan-month-row span { min-width: 0; }
.loan-month-row b, .loan-month-row small { display: block; }
.loan-month-row small { margin-top: 3px; color: var(--muted); }
.loan-month-row strong { font-size: 18px; white-space: nowrap; }
.loan-worker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.loan-worker-card { padding: 16px; display: grid; gap: 13px; }
.loan-worker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.loan-worker-head b, .loan-worker-head small { display: block; }
.loan-worker-head small { margin-top: 3px; color: var(--muted); }
.loan-worker-head strong { color: var(--primary); font-size: 20px; white-space: nowrap; }
.loan-components { display: grid; gap: 7px; }
.loan-component { padding: 10px 11px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; border-radius: 11px; background: #f5f8f9; }
.loan-component span { font-weight: 850; }
.loan-component b { text-align: right; }
.loan-component small { grid-column: 1 / -1; color: var(--muted); }

.chat-shell { min-height: 560px; display: grid; grid-template-rows: 1fr auto; overflow: hidden; }
.chat-log { padding: 17px; display: flex; flex-direction: column; gap: 11px; overflow-y: auto; max-height: 570px; }
.bubble { max-width: min(760px, 88%); padding: 12px 14px; border-radius: 16px; white-space: pre-line; line-height: 1.48; }
.bubble.user { margin-left: auto; background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.bubble.bot { background: #f0f4f5; color: var(--text); border-bottom-left-radius: 5px; }
.bubble-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.bubble-actions button { padding: 6px 9px; background: #fff; color: var(--primary); border: 1px solid var(--border); font-size: 11px; }
.chat-form { padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; border-top: 1px solid var(--border); }
.copilot-mini { padding: 16px; }
.copilot-mini form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }

.search-results { display: grid; gap: 12px; }
.empty { padding: 28px 18px; color: var(--muted); text-align: center; }
.back { margin-bottom: 12px; }

.modal-backdrop { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(10,28,35,.58); }
.modal-card { width: min(720px,100%); max-height: calc(100vh - 36px); overflow: auto; padding: 20px; border-radius: 20px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.modal-head h2 { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-field { display: grid; gap: 6px; }
.form-field > span { color: #53656e; font-size: 12px; font-weight: 800; }
.form-wide, .form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.toast { position: fixed; z-index: 1100; right: 18px; bottom: 18px; max-width: min(420px,calc(100vw - 36px)); padding: 13px 16px; border-radius: 12px; background: #176844; color: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.2); font-weight: 800; }
.toast.bad { background: #9d2630; }
.small-action { display: block; margin-top: 6px; padding: 6px 9px; font-size: 11px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 800; }
.email-row { align-items: flex-start; }
.email-body { padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.news-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.news-card { min-height: 210px; padding: 17px; display: flex; flex-direction: column; align-items: stretch; color: var(--text); text-align: left; }
.news-card:hover { background: #fbfcfc; filter: none; border-color: #bfd2d9; transform: translateY(-1px); }
.news-card-top, .news-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.news-title { margin-top: 16px; font-size: 17px; line-height: 1.3; }
.news-card p { margin: 9px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.news-footer { margin-top: auto; padding-top: 11px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.validity-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.validity-card { min-height: 116px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.validity-card.missing { border-style: dashed; background: #fffdf8; }
.validity-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.validity-card-head b { line-height: 1.3; }
.validity-card p { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.cash-numbers { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 10px; }
.cash-numbers > span { padding: 9px; border-radius: 10px; background: #f5f8f9; }
.cash-numbers small, .cash-numbers strong { display: block; }
.cash-numbers small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.cash-numbers strong { margin-top: 3px; font-size: 13px; }
.cash-balance { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 12px; }
.segment-control { display: flex; gap: 7px; padding: 5px; margin: 4px 0 18px; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.segment-control button { flex: 1 0 auto; min-width: 120px; background: transparent; color: #5b6c74; }
.segment-control button.on { background: var(--primary); color: #fff; }
.payment-row > span:last-child { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.cash-row .row-actions { align-items: stretch; }
.compact { padding: 7px 9px; font-size: 11px; }
.dashboard-filters label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 800; }
.dashboard-filters label input { width: auto; }
.finance-calendar { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.finance-date { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center; padding: 14px; }
.finance-date.uncertain { border-style: dashed; background: #fffdf8; }
.finance-day { display: grid; place-items: center; min-height: 58px; border-radius: 13px; background: #edf7f3; color: var(--primary); }
.finance-day small { font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.finance-day strong { font-size: 23px; line-height: 1; }
.finance-date p { margin: 5px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.compact-notice { margin-top: 10px; }
.finance-check-grid, .cash-summary-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.finance-check { min-height: 128px; padding: 15px; }
.finance-check.alert { border-color: #e6bc75; background: #fffaf1; }
.finance-check small { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .05em; }
.finance-check strong { display: block; margin: 7px 0 5px; font-size: 24px; }
.finance-check p, .finance-method { margin: 0; font-size: 11px; line-height: 1.45; }
.finance-method { margin-top: 9px; }

.skeleton { position: relative; overflow: hidden; background: #e9eef0; color: transparent; border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: shimmer 1.25s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

@media (max-width: 1050px) {
  header { grid-template-columns: minmax(160px, auto) minmax(180px, 1fr) auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-priority-grid { grid-template-columns: 1fr; }
  .validity-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .finance-calendar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .finance-check-grid, .cash-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 850px) {
  aside { left: -260px; transition: left .2s ease; box-shadow: 18px 0 45px transparent; }
  aside.open { left: 0; box-shadow: 18px 0 45px rgba(0, 0, 0, 0.14); }
  header, main { margin-left: 0; }
  header { min-height: 68px; padding: 9px 12px; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  #menu { display: inline-grid; }
  .global-search { grid-column: 1 / -1; grid-row: 2; }
  .header-tools select { display: none; }
  main { min-height: calc(100vh - 118px); padding: 18px 12px 56px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .directive-grid { grid-template-columns: 1fr; }
  .insurance-grid { grid-template-columns: 1fr; }
  .insurance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loan-worker-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { min-height: 118px; padding: 13px; }
  .num { font-size: 25px; }
  .num.pending { font-size: 16px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading .mut { text-align: left; }
  .dashboard-filters select { width: 100%; }
  .dashboard-filters { gap: 7px; }
  .hero h1 { font-size: 28px; }
  .hero { margin-bottom: 12px; gap: 10px; }
  .section { margin-top: 17px; }
  .section-heading h2 { font-size: 19px; }
  .row, .alert-item { padding: 12px; gap: 9px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row-title, .row b { font-size: 14px; line-height: 1.3; }
  .row-meta { font-size: 11px; }
  .badge { padding: 5px 8px; font-size: 10px; }
  .birthday-icon { width: 34px; height: 34px; flex-basis: 34px; font-size: 17px; }
  .birthday-person { gap: 9px; }
  .scroll-hint { display: block; }
  .gantt .person { min-width: 165px; max-width: 165px; }
  .gantt th, .gantt td { min-width: 38px; }
  .dashboard-details > summary { padding: 14px; }
  .dashboard-details > summary b { font-size: 16px; }
  .dashboard-details .summary-state { display: none; }
  .coverage-values { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .mini { min-width: 760px; }
  .header-user { display: none; }
  .segment-control { margin-inline: -2px; }
  .segment-control button { min-width: 105px; padding: 9px 10px; }
  .payment-row, .cash-row { grid-template-columns: 1fr; }
  .payment-row > span:last-child, .cash-row .row-actions { justify-content: flex-start; align-items: flex-start; }
  .bubble { max-width: 94%; }
  .chat-form, .copilot-mini form { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-wide, .form-actions { grid-column: 1; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions button { width: 100%; }
  .directive-facts { grid-template-columns: 1fr; }
  .insurance-facts { grid-template-columns: 1fr; }
  .insurance-head { flex-direction: column; }
  .insurance-sources > summary { flex-direction: column; }
  .document-type-strip { grid-template-columns: 1fr 1fr; }
  .attendance-file-row { grid-template-columns: minmax(0, 1fr); }
  .attendance-file-row .button-link { width: 100%; }
  .loan-worker-head { align-items: flex-start; flex-direction: column; }
  .loan-component { grid-template-columns: 1fr; }
  .loan-component b { text-align: left; }
  .loan-component small { grid-column: 1; }
  .validity-grid { grid-template-columns: 1fr; }
  .cash-numbers { grid-template-columns: 1fr; }
  .finance-calendar, .finance-check-grid, .cash-summary-grid { grid-template-columns: 1fr; }
  .news-footer { align-items: flex-start; flex-direction: column; }
}


/* Inicio y navegación simplificados */
.nav-home,.nav-primary{display:flex;align-items:center;gap:9px;width:100%;font-weight:900}
.nav-primary{margin-top:6px;background:linear-gradient(135deg,var(--primary),#164e63);color:#fff;border-color:transparent}
.nav-primary.on{box-shadow:0 8px 20px rgba(15,118,110,.24)}
.nav-group-title{display:flex;align-items:center;gap:8px}
.nav-group-title i{width:19px;font-style:normal;text-align:center;color:var(--primary)}
.nav-group>summary .nav-chevron{margin-left:auto}
.nav-system{margin-top:5px}
.role-focus{margin:4px 0 16px}
.role-focus-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.role-focus-card{display:flex;align-items:center;gap:10px;min-height:82px;padding:13px;text-align:left;background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);color:var(--text)}
.role-focus-card:hover{transform:translateY(-1px);border-color:var(--primary);box-shadow:0 10px 25px rgba(15,118,110,.12)}
.role-focus-card>span:nth-child(2){min-width:0;flex:1}
.role-focus-card b{display:block;font-size:14px}
.role-focus-card small{display:block;margin-top:4px;color:var(--muted);line-height:1.3}
.role-focus-icon{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border-radius:11px;background:#e9f7f5;color:var(--primary);font-weight:900}
.role-focus-arrow{color:var(--primary);font-weight:900}
@media(max-width:1050px){.role-focus-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:580px){.role-focus-grid{grid-template-columns:1fr}.role-focus-card{min-height:70px}}


/* Ajustes finales del menú y contenido secundario */
.nav-group>.nav-group-title,.nav-group>summary .nav-group-title{transition:none}
.nav-group[open]>summary .nav-group-title{transform:none}
.nav-group[open]>summary .nav-chevron{transform:rotate(180deg)}
.dashboard-secondary{padding:0 14px 14px}
.dashboard-secondary>.section{margin:10px 0}
.dashboard-secondary-details>.summary-state{background:#eef4f7;color:var(--muted)}


/* Tema rosado personal: acento rosado sin alterar colores semánticos */
body.theme-pink {
  --primary: #b83f76;
  --primary-2: #d86598;
  --bg: #fff7fb;
  --border: #f0d9e5;
  --text: #38232d;
  --muted: #826979;
  --blue: #8e5270;
  --shadow: 0 8px 26px rgba(142, 45, 91, 0.08);
  background:
    radial-gradient(circle at 92% 4%, rgba(232, 146, 186, 0.16), transparent 28%),
    var(--bg);
}
body.theme-pink aside {
  background: linear-gradient(180deg, #fff 0%, #fff8fb 100%);
  border-right-color: #efd4e1;
}
body.theme-pink header {
  background: rgba(255, 250, 253, 0.97);
  border-bottom-color: #efd4e1;
}
body.theme-pink .nav-group[open],
body.theme-pink .global-search {
  background: #fff6fa;
}
body.theme-pink .role-focus-icon {
  background: #fde8f2;
}
body.theme-pink .role-focus-card:hover {
  box-shadow: 0 10px 25px rgba(184, 63, 118, 0.14);
}
body.theme-pink .header-user {
  background: #fde2ee;
  color: #9d285e;
}


/* Tema personal de Roman: acento verde sin alterar colores semanticos */
body.theme-roman-green {
  --primary: #16734a;
  --primary-2: #249767;
  --bg: #f5fbf7;
  --border: #d6e9dd;
  --text: #173328;
  --muted: #647c70;
  --blue: #3c725a;
  --shadow: 0 8px 26px rgba(22, 115, 74, 0.08);
  background:
    radial-gradient(circle at 92% 4%, rgba(87, 190, 132, 0.16), transparent 28%),
    var(--bg);
}
body.theme-roman-green aside {
  background: linear-gradient(180deg, #fff 0%, #f7fcf9 100%);
  border-right-color: #d2e7da;
}
body.theme-roman-green header {
  background: rgba(249, 253, 250, 0.97);
  border-bottom-color: #d2e7da;
}
body.theme-roman-green .nav-group[open],
body.theme-roman-green .global-search {
  background: #f3faf6;
}
body.theme-roman-green .role-focus-icon {
  background: #e1f5e9;
}
body.theme-roman-green .role-focus-card:hover {
  box-shadow: 0 10px 25px rgba(22, 115, 74, 0.14);
}
body.theme-roman-green .header-user {
  background: #dcf2e5;
  color: #11633e;
}


.vehicle-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.vehicle-card { padding: 18px; min-width: 0; }
.vehicle-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.vehicle-head h3 { margin: 6px 0 4px; font-size: 19px; }
.vehicle-head p { margin: 0; font-size: 12px; }
.vehicle-plate { display: inline-flex; padding: 5px 9px; border-radius: 8px; background: var(--soft); color: var(--accent); font-weight: 800; letter-spacing: .08em; }
.vehicle-checks { display: grid; gap: 7px; margin: 15px 0; }
.vehicle-check { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border-radius: 10px; background: var(--soft); }
.vehicle-check span:first-child { display: grid; gap: 2px; }
.vehicle-check small { color: var(--muted); }
.vehicle-docs { border-top: 1px solid var(--line); padding-top: 12px; }
.vehicle-docs summary { cursor: pointer; font-weight: 700; }
.vehicle-docs .list { margin-top: 10px; }
.vehicle-doc-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.vehicle-doc-row > span:first-child { min-width: 0; }
.vehicle-doc-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.vehicle-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

@media (max-width: 850px) { .vehicle-grid { grid-template-columns: 1fr; } }


@media (max-width: 580px) {
  .vehicle-head, .vehicle-doc-row { grid-template-columns: 1fr; display: grid; }
  .vehicle-doc-actions { justify-content: flex-start; }
}

