@font-face { font-family: Gotham; src: url("./brand/gotham-book.otf") format("opentype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Gotham; src: url("./brand/gotham-bold.otf") format("opentype"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: Clab; src: url("./brand/clab-bold.otf") format("opentype"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: Rex; src: url("./brand/rex-bold.otf") format("opentype"); font-style: normal; font-weight: 700; font-display: swap; }
:root {
  color-scheme: light;
  --brand: #003764; --brand-dark: #002647; --brand-on: white;
  --brand-sky: #8dc6e8; --brand-orange: #ff6b00; --brand-soft: #e5f2fa;
  --ink: var(--brand); --text: #253e52; --muted: #506579; --line: #d7e2ea;
  --surface: white; --bg: #f5f8fb;
  --radius: 14px; --shadow: 0 3px 9px #00376406;
  font-family: Gotham, "Segoe UI", Arial, sans-serif; font-size: 100%; color: var(--ink); background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button,input,select,textarea { font: inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
a { color: inherit; text-decoration: none; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline: 3px solid #147abb; outline-offset: 3px;
}
button, a { touch-action: manipulation; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { color: var(--ink); font-family: Clab, Gotham, sans-serif; font-weight: 700; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.boot, .loading { font-size: .94rem; color: var(--muted); padding: 2rem; }
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; height: auto; width: 100%; }
.login-layout { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); background: white; }
.login-visual { display: flex; flex-direction: column; align-items: stretch; min-height: 36rem; background: var(--brand); color: white; }
.login-identity { flex: 1; display: grid; place-items: center; padding: 6rem clamp(3rem,7vw,9rem) 3rem; }
.login-identity img { display: block; width: 100%; max-width: 27rem; height: auto; }
.login-band { display: flex; align-items: center; justify-content: space-between; gap: 1.75rem; border-top: 1px solid #316185; margin: 0 clamp(2rem,4vw,4.5rem); padding: 2.5rem 0; }
.login-caption strong { display: block; font-family: Rex, Gotham, sans-serif; font-weight: 700; line-height: 1.1; font-size: 2rem; }
.login-caption p { margin-top: .4rem; font-size: .94rem; color: var(--brand-sky); line-height: 1.5; }
.brand-activities { display: flex; align-items: center; gap: clamp(.55rem,1.2vw,1.2rem); }
.brand-activities img { display: block; width: clamp(2.45rem,3.5vw,3.8rem); height: auto; }
.login-area { display: grid; place-items: center; padding: clamp(1.8rem,6vw,6rem); }
.login-box { width: min(100%,25.5rem); }
.empty-icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--brand-soft); color: var(--brand); }
.login-box h1 { margin: 0 0 2rem; font-size: clamp(2rem,2.55vw,2.45rem); line-height: 1.12; }
#login-form { display: grid; gap: 1.25rem; }
.field { display: flex; flex-direction: column; align-items: stretch; gap: .45rem; min-width: 0; color: var(--text); font-size: .9rem; font-weight: 600; }
.field small,.check-row small { color: var(--muted); font-weight: 400; line-height: 1.5; }
input:not([type=checkbox]):not([type=radio]),select,textarea {
  border: 1px solid #bfced9; background: white; color: var(--ink); border-radius: .55rem; padding: .68rem .8rem; min-height: 2.65rem; min-width: 0; width: 100%; font-size: .93rem; font-weight: 400;
}
input::placeholder,textarea::placeholder { color: #667a8c; opacity: 1; }
input:read-only { background: #f2f6f9; }
select { appearance: none; padding-right: 2.35rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23405970' stroke-width='1.7' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; }
textarea { resize: vertical; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > svg { position: absolute; left: .85rem; color: #61798b; pointer-events: none; }
.input-icon > input:not([type=checkbox]) { padding-left: 2.55rem; }
.input-icon:has(.field-action) input { padding-right: 3rem; }
.field-action,.icon-btn { display: inline-grid; place-items: center; flex: none; border: 0; color: var(--muted); background: transparent; border-radius: .45rem; min-width: 2.5rem; min-height: 2.5rem; }
.field-action:hover,.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.field-action { position: absolute; right: .22rem; min-height: 2.15rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: .57rem; min-height: 2.6rem; padding: .6rem 1rem; border: 1px solid transparent; font-weight: 600; font-size: .92rem; line-height: 1.35; white-space: nowrap; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--brand-soft); }
.btn-ghost { color: var(--brand); background: transparent; }
.btn-ghost:hover { background: var(--brand-soft); }
.login-submit { width: 100%; margin-top: .5rem; min-height: 2.95rem; }
.form-error { background: #fff1ee; color: #993828; border: 1px solid #f1c5bd; padding: .72rem .9rem; border-radius: .55rem; font-size: .9rem; line-height: 1.4; }
.app-layout { min-height: 100vh; display: grid; grid-template-columns: 15rem minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 0 1rem; background: #fff; border-right: 1px solid var(--line); z-index: 6; }
.sidebar-brand { display: flex; align-items: center; justify-content: center; padding: 1.9rem 1.1rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.sidebar-brand .brand { width: min(9.3rem,100%); }
.sidebar nav { display: flex; flex-direction: column; gap: 1.65rem; overflow: auto; }
.nav-group { display: grid; gap: .23rem; }
.nav-label,.eyebrow { font-size: .76rem; letter-spacing: .105em; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.nav-label { padding: .3rem .85rem .4rem; }
.nav-link { display: flex; gap: .78rem; align-items: center; min-height: 2.7rem; padding: .65rem .85rem; border-radius: .55rem; font-size: .91rem; color: var(--text); font-weight: 510; }
.nav-link:hover { background: #f1f7fb; }
.nav-link[aria-current=page] { box-shadow: inset 3px 0 var(--brand-orange); background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.account-block { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding: 1.05rem .15rem; border-top: 1px solid var(--line); }
.avatar,.mini-avatar,.workspace-icon { display: inline-grid; place-items: center; flex: none; }
.avatar { background: var(--brand-soft); border: 1px solid var(--line); color: var(--brand); border-radius: 50%; width: 2.4rem; height: 2.4rem; font-size: .86rem; font-weight: 700; }
.account-block > div,.person-cell > div { min-width: 0; }
.account-block strong,.account-block small,.person-cell strong,.person-cell small { display: block; }
.account-block strong,.account-block small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 8rem; }
.account-block strong,.person-cell strong { font-size: .89rem; font-weight: 650; }
.account-block small,.person-cell small { color: var(--muted); font-size: .78rem; margin-top: .17rem; }
.account-block .logout { margin-left: auto; }
.work-area { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 clamp(1.4rem,3.2vw,3.3rem); min-height: 4.35rem; background: white; border-bottom: 1px solid var(--line); }
.crumb,.top-date { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .87rem; }
.workspace-icon { width: 1.7rem; height: 1.7rem; background: var(--brand-soft); color: var(--brand); border-radius: .41rem; }
.crumb-divider { color: #8ba3b6; }
.crumb strong { font-weight: 600; color: var(--text); }
.top-date { gap: .45rem; }
.main-content { width: 100%; max-width: 104rem; margin: auto; padding: 2.35rem clamp(1.4rem,3.2vw,3.3rem) 3.3rem; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; margin: 0 0 1.55rem; }
.eyebrow { display: flex; align-items: center; gap: .42rem; color: var(--brand); margin: 0 0 .55rem; }
.eyebrow i { width: 1.1rem; height: .15rem; border-radius: .15rem; background: var(--brand-orange); }
.page-title { font-size: clamp(2rem,3.2vw,2.8rem); letter-spacing: -.025em; font-weight: 700; line-height: 1.11; }
.page-desc { margin-top: .52rem; color: var(--muted); line-height: 1.5; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-head p { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.dashboard-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: clamp(2rem,4vw,3.75rem); background: var(--brand); border-radius: var(--radius); color: var(--brand-on);
}
.dashboard-hero .page-title { color: white; font-size: clamp(2.5rem,4vw,4rem); letter-spacing: -.025em; }
.dashboard-hero p { margin-top: .7rem; line-height: 1.55; color: #e4f2fa; }
.dashboard-hero .brand-activities { align-self: center; padding-left: 1.5rem; }
.dashboard-hero .brand-activities img { width: clamp(2.6rem,5.1vw,5.15rem); }
.module-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .65rem; margin: 2.2rem 0 1.05rem; }
.module-section-head h2 { font-size: 1.7rem; }
.module-section-head > span { color: var(--muted); font-size: .89rem; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,19rem),1fr)); gap: 1.15rem; }
.module-card { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(1.35rem,2.3vw,2rem); border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.module-card:hover { border-color: var(--brand-sky); box-shadow: 0 .25rem 1.2rem #0037640c; }
.module-card h3 { font-size: 1.52rem; line-height: 1.2; margin: 1rem 0 .55rem; }
.module-card p { color: var(--muted); line-height: 1.62; font-size: .96rem; margin: 0 0 1.35rem; max-width: 40ch; }
.module-card-icon { display: inline-grid; place-items: center; width: 3.15rem; height: 3.15rem; border-radius: .8rem; color: var(--brand); background: var(--brand-soft); }
.module-card:nth-child(3n + 2) .module-card-icon { background: #fff0e1; color: #984000; }
.module-card:nth-child(3n + 3) .module-card-icon { background: #f8f4d5; color: #655e00; }
.module-card-foot { width: 100%; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem; margin-top: auto; border-top: 1px solid var(--line); padding-top: 1rem; font-size: .88rem; }
.module-summary { color: var(--muted); }
.open-module { font-weight: 700; color: var(--brand); }
.module-card:hover .open-module { text-decoration: underline; text-underline-offset: .22rem; }
.panel-head,.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.24rem 1.35rem 1.05rem; }
.panel-head h2,.modal-head h2,.panel-body h2 { font-size: 1.14rem; letter-spacing: -.01em; line-height: 1.35; font-weight: 700; }
.panel-head p { margin: .25rem 0 0; }
.panel-body,.modal-body { padding: 1.25rem 1.35rem; }

.table-wrap { overflow-x: auto; max-width: 100%; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th,td { padding: .82rem 1.25rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f2f7fa; color: var(--text); font-size: .8rem; font-weight: 640; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.person-cell { display: flex; gap: .7rem; align-items: center; min-width: 9.5rem; }
.mini-avatar { width: 2rem; height: 2rem; border-radius: 50%; font-size: .73rem; font-weight: 650; background-color: var(--brand-soft); color: var(--brand); }
.badge-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge { display: inline-block; padding: .2rem .56rem; border-radius: 999px; font-size: .79rem; font-weight: 570; line-height: 1.45; white-space: nowrap; }
.badge-green { background: #e4f2e7; color: #2d663d; }
.badge-neutral { background: #edf3f7; color: var(--text); }
.badge-amber { background: #faf0d9; color: #805c17; }
.badge-red { background: #fbebe6; color: #9a4536; }
.empty-state,.error-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: 2.5rem 1.5rem; text-align: center; }
.empty-state .empty-icon,.error-panel .empty-icon { margin-bottom: .4rem; }
.empty-state p,.error-panel p { color: var(--muted); font-size: .9rem; line-height: 1.55; margin: .2rem 0; }
.empty-state strong { font-size: .96rem; }
.error-panel h1 { font-size: 1.3rem; }
.error-panel button { margin-top: .5rem; }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .8rem; padding: 0 1.35rem 1.15rem; }
.user-filters .field:first-child { flex: 1 1 18rem; }
.user-filters .field:last-child { min-width: 10.5rem; }
.row-edit { width: 2.25rem; height: 2.25rem; }
.tabs { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.tab { border: 1px solid transparent; border-radius: .5rem; padding: .6rem .85rem; color: var(--text); background: transparent; font-size: .92rem; font-weight: 550; }
.tab:hover { background: var(--brand-soft); }
.tab[aria-selected=true],.tab[aria-current=page] { color: var(--brand); background: var(--brand-soft); }
.modal { width: min(35rem,calc(100% - 1.5rem)); max-height: calc(100dvh - 2.25rem); margin: auto; padding: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 1rem; color: var(--text); box-shadow: 0 1.5rem 6rem #00274740; }
.modal::backdrop { background: #0d2c43a3; }
.modal-head { padding: .95rem 1.35rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.24rem; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .55rem; padding: .95rem 1.35rem; border-top: 1px solid var(--line); background: #f8fafc; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .9rem; }
.form-grid .full { grid-column: 1/-1; }
.permission-set { border: none; padding: 0; margin: 1.2rem 0 .85rem; }
.permission-set legend { margin-bottom: .45rem; font-size: .95rem; font-weight: 650; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.check-row > span { min-width: 0; }
.check-row strong,.check-row small { display: block; font-size: .89rem; }
.check-row small { font-size: .81rem; margin-top: .15rem; }
.check-row input { width: 1.16rem; height: 1.16rem; accent-color: var(--brand); flex: none; }
.check-row input:disabled { opacity: .7; }
.account-check { border: 0; }
.modal-body .form-error { margin-top: .6rem; }
#notifications { position: fixed; z-index: 20; bottom: 1rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); pointer-events: none; }
.toast { display: flex; align-items: center; gap: .65rem; padding: .8rem 1rem; margin-top: .3rem; background: var(--brand); color: white; border-radius: .65rem; box-shadow: 0 4px 20px #00376424; font-size: .92rem; }
.toast-error { background: #873f34; }
.open-nav,.close-nav,.mobile-scrim { display: none; }
@media(min-width:1550px) { .app-layout { grid-template-columns: 16rem minmax(0,1fr); } }
@media(max-width:1150px) {
  .app-layout { grid-template-columns: 13.75rem minmax(0,1fr); }
}
@media(max-width:950px) {
  .app-layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: fixed; left: 0; bottom: 0; width: min(18rem,85vw); transform: translateX(-101%); visibility: hidden; }
  .nav-open .sidebar { transform: translateX(0); visibility: visible; }
  .open-nav,.close-nav { display: inline-grid; }
  .close-nav { position: absolute; top: .25rem; right: .25rem; }
  .mobile-scrim { display: block; position: fixed; inset: 0; z-index: 5; background: #0c30487a; }
  .topbar { justify-content: flex-start; gap: .65rem; }
  .top-date { margin-left: auto; }
  .login-area { padding: 2rem; }
}
@media(max-width:720px) {
  .dashboard-hero { align-items: flex-start; gap: 1rem; padding: 1.65rem 1.35rem; }
  .dashboard-hero .brand-activities { padding: 0; }
  .dashboard-hero .brand-activities img { width: 2.8rem; }
  .dashboard-hero .brand-activities img:nth-child(n + 2) { display: none; }
  .module-section-head { margin-top: 1.6rem; }
  .login-identity { padding: 1.9rem 2.25rem; }
  .login-identity img { width: 9rem; }
  .login-caption strong { font-size: 1.45rem; }
  .login-caption p { font-size: .8rem; }
  .login-band { border: 0; padding: .6rem 0; margin: 0 1.3rem 0 0; }
  .login-band .brand-activities { display: none; }
  .login-layout { display: flex; flex-direction: column; }
  .login-visual { flex-direction: row; align-items: center; min-height: 0; }
  .login-identity { justify-content: start; }
  .login-area { flex: 1; padding: 2.1rem 1.25rem 3rem; }
  .login-box h1 { margin: 0 0 1.5rem; font-size: clamp(1.85rem,7.7vw,2.2rem); }
  .topbar { padding: 0 .85rem; min-height: 3.8rem; }
  .main-content { padding: 1.6rem 1rem 2.5rem; }
  .page-head { align-items: flex-start; flex-wrap: wrap; margin-bottom: 1.2rem; }
  .page-title { font-size: 2.1rem; }
  .page-desc { font-size: .94rem; }
  .panel-head,.panel-body { padding-left: 1rem; padding-right: 1rem; }
  .filters { padding-left: 1rem; padding-right: 1rem; }
  th,td { padding-left: .85rem; padding-right: .85rem; }
}
@media(max-width:480px) {
  .dashboard-hero .brand-activities { display: none; }
  .top-date,.crumb .workspace-icon { display: none; }
  .page-head { gap: .8rem; }
  .page-actions { width: 100%; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .user-filters .field { flex-basis: 100%; width: 100%; }
  .modal-body { padding: 1rem; }
  .modal-head,.modal-foot { padding: .8rem 1rem; }
}
@media(prefers-reduced-motion: no-preference) {
  .btn,.nav-link,.icon-btn { transition: background-color .16s ease, color .16s ease; }
}
