:root {
    color-scheme: light;
    --blue: #0878c9;
    --blue-dark: #045f9f;
    --blue-deep: #044c7d;
    --blue-soft: #eaf5fc;
    --blue-ring: rgba(8, 120, 201, .18);
    --teal: #0b4942;
    --teal-deep: #062f2b;
    --teal-darkest: #032421;
    --teal-mid: #125a52;
    --teal-soft: #e7f1ef;
    --surface: #ffffff;
    --surface-subtle: #f9fbfa;
    --canvas: #f3f6f4;
    --line: #dce5e1;
    --line-strong: #c5d2cd;
    --ink: #172825;
    --muted: #62736f;
    --muted-light: #879590;
    --red: #b92f3c;
    --red-dark: #98232e;
    --red-soft: #fbedef;
    --green: #16724a;
    --green-soft: #e7f5ed;
    --amber: #8d5e0a;
    --amber-soft: #fff4dc;
    --violet: #6251a4;
    --violet-soft: #f0eefb;
    --slate: #596871;
    --slate-soft: #edf1f2;
    --sidebar-width: 272px;
    --topbar-height: 72px;
    --control-height: 48px;
    --radius-xs: 6px;
    --radius-sm: 9px;
    --radius: 13px;
    --radius-lg: 17px;
    --shadow-xs: 0 1px 2px rgba(3, 36, 33, .05);
    --shadow-sm: 0 2px 5px rgba(3, 36, 33, .045), 0 8px 22px rgba(3, 36, 33, .04);
    --shadow: 0 2px 5px rgba(3, 36, 33, .045), 0 16px 42px rgba(3, 36, 33, .065);
    --shadow-lg: 0 24px 70px rgba(3, 36, 33, .16);
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    overflow-x: clip;
    scroll-behavior: smooth;
    scrollbar-color: #b9c8c3 transparent;
    scrollbar-width: thin;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: clip;
    color: var(--ink);
    background:
        radial-gradient(circle at 92% 0, rgba(8, 120, 201, .045), transparent 28rem),
        var(--canvas);
    font-family: "Roboto", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { color: var(--teal-deep); background: #cce8f7; }

button,
input,
textarea,
select { font: inherit; }

button,
summary,
select,
input[type="checkbox"],
input[type="radio"] { -webkit-tap-highlight-color: transparent; }

a { color: var(--blue); text-decoration: none; text-underline-offset: .18em; }
a:hover { color: var(--blue-dark); }
a:focus-visible { outline: 3px solid var(--blue-ring); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
    position: fixed;
    top: -64px;
    left: 18px;
    z-index: 1000;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: #fff;
    background: var(--blue);
    box-shadow: var(--shadow-lg);
    font-weight: 700;
}
.skip-link:focus { top: 14px; color: #fff; }

.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow-y: auto;
    color: rgba(255, 255, 255, .84);
    background:
        radial-gradient(circle at 15% -5%, rgba(67, 161, 232, .12), transparent 19rem),
        linear-gradient(180deg, #073b36 0%, var(--teal-darkest) 100%);
    box-shadow: 7px 0 32px rgba(3, 36, 33, .11);
}

.sidebar-brand {
    display: flex;
    min-height: 116px;
    align-items: center;
    justify-content: space-between;
    padding: 17px 25px 13px;
    border-bottom: 1px solid rgba(255, 255, 255, .085);
}
.sidebar-brand a { display: block; width: 178px; border-radius: var(--radius-xs); }
.sidebar-brand img { display: block; width: 100%; height: 82px; object-fit: contain; object-position: left center; }

.sidebar-context {
    display: flex;
    flex-direction: column;
    margin: 19px 17px 7px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-left: 3px solid #49a8e9;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: rgba(255, 255, 255, .045);
}
.sidebar-context span { color: rgba(255, 255, 255, .52); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.sidebar-context strong { margin-top: 3px; color: #fff; font-family: "Roboto Condensed", sans-serif; font-size: 15px; font-weight: 600; letter-spacing: .01em; }

.sidebar-nav { flex: 1; padding: 15px 12px 23px; }
.nav-label { margin: 0 13px 9px; color: rgba(255, 255, 255, .38); font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 28px; }
.nav-item {
    position: relative;
    display: flex;
    min-height: 47px;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    font-weight: 500;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s var(--ease);
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: .88; transition: opacity .18s ease, transform .18s var(--ease); }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .065); border-color: rgba(255, 255, 255, .04); }
.nav-item:hover svg { opacity: 1; transform: translateX(1px); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, rgba(24, 108, 98, .96), rgba(16, 84, 77, .96)); border-color: rgba(255, 255, 255, .08); box-shadow: inset 3px 0 #55b2ee, 0 7px 18px rgba(0, 0, 0, .1); }

.sidebar-user { display: flex; align-items: center; gap: 11px; margin: 0 12px 14px; padding: 14px; border: 1px solid rgba(255, 255, 255, .06); border-radius: var(--radius-sm); background: rgba(0, 0, 0, .1); }
.sidebar-user-copy { display: flex; min-width: 0; flex-direction: column; }
.sidebar-user-copy strong { overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy small { color: rgba(255, 255, 255, .5); font-size: 11px; }

.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    border-bottom: 1px solid rgba(197, 210, 205, .82);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 5px 20px rgba(3, 36, 33, .025);
    backdrop-filter: blur(16px) saturate(145%);
    -webkit-backdrop-filter: blur(16px) saturate(145%);
}
.mobile-menu { display: none; }
.topbar-wordmark { display: flex; align-items: center; gap: 11px; color: var(--teal); }
.topbar-mark { display: grid; width: 35px; height: 35px; place-items: center; border-radius: var(--radius-sm); color: #fff; background: linear-gradient(145deg, var(--teal-mid), var(--teal-deep)); box-shadow: 0 4px 12px rgba(6, 47, 43, .17); font-family: "Roboto Condensed", sans-serif; font-size: 13px; font-weight: 700; }
.topbar-wordmark > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.topbar-wordmark strong { font-family: "Roboto Condensed", sans-serif; font-size: 15px; letter-spacing: .035em; text-transform: uppercase; }
.topbar-wordmark small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.quick-add { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: var(--radius-sm); color: var(--blue-dark); font-size: 13px; font-weight: 700; transition: color .15s ease, background .15s ease; }
.quick-add span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 7px; color: #fff; background: linear-gradient(145deg, #168bd6, var(--blue)); box-shadow: 0 3px 9px rgba(8, 120, 201, .22); font-size: 20px; font-weight: 400; line-height: 1; }
.quick-add .ui-icon { width: 16px; height: 16px; stroke-width: 2.2; }
.quick-add:hover { color: var(--blue-dark); background: var(--blue-soft); }

.icon-button { display: inline-grid; width: 42px; height: 42px; padding: 0; place-items: center; border: 1px solid transparent; border-radius: var(--radius-sm); color: inherit; background: transparent; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s var(--ease); }
.icon-button:hover { background: rgba(8, 120, 201, .08); border-color: rgba(8, 120, 201, .09); }
.icon-button:active { transform: scale(.96); }
.icon-button svg { width: 22px; height: 22px; }

.user-menu { position: relative; }
.user-menu summary { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 4px 8px 4px 5px; border: 1px solid transparent; border-radius: 999px; color: var(--ink); cursor: pointer; list-style: none; transition: background .15s ease, border-color .15s ease; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { border-color: var(--line); background: var(--surface-subtle); }
.user-menu-identity { display: flex; min-width: 0; flex-direction: column; line-height: 1.25; }
.user-menu-name { max-width: 140px; overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-role { color: var(--muted); font-size: 10px; }
.user-menu-chevron { color: var(--muted); font-size: 13px; transition: transform .16s var(--ease); }
.user-menu[open] .user-menu-chevron { transform: rotate(180deg); }
.avatar { display: inline-grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--teal-mid), var(--teal-deep)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); font-family: "Roboto Condensed", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.avatar-light { color: var(--teal-deep); background: #dfece9; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.user-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 240px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .98); box-shadow: var(--shadow-lg); animation: menu-in .16s var(--ease); }
.user-menu-profile { display: flex; flex-direction: column; padding: 11px 12px 14px; border-bottom: 1px solid var(--line); }
.user-menu-profile strong { font-size: 13px; }
.user-menu-profile small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; }
.menu-button { width: 100%; min-height: 42px; margin-top: 5px; padding: 9px 12px; border: 0; border-radius: var(--radius-sm); color: var(--red); background: transparent; font-weight: 600; text-align: left; cursor: pointer; }
.menu-button:hover { background: var(--red-soft); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-5px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.content { width: min(1500px, 100%); min-height: calc(100vh - 122px); margin: 0 auto; padding: 36px 38px 56px; }
.content > form.card, .content > .form-card { width: min(1180px, 100%); margin-right: auto; margin-left: auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.page-heading-copy { min-width: 0; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-family: "Roboto Condensed", sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, h4, h5, h6 { margin-top: 0; color: var(--teal-deep); font-family: "Roboto Condensed", sans-serif; line-height: 1.18; }
h1 { margin-bottom: 0; font-size: clamp(29px, 3vw, 39px); font-weight: 600; letter-spacing: -.025em; }
h2 { font-size: 23px; letter-spacing: -.012em; }
h3 { font-size: 18px; }
.page-description { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.app-footer { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 36px; border-top: 1px solid var(--line); color: var(--muted-light); background: rgba(255, 255, 255, .8); font-size: 11px; }

.card { position: relative; border: 1px solid rgba(197, 210, 205, .9); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 22px; }
.stack > .card + .card { margin-top: 0; }
.card-header, .form-card-header { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 24px; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(180deg, #fff, #fcfdfc); }
.card-header h2, .card-header h3, .form-card-header h2, .form-card-header h3 { margin: 0; }
.card-header p, .form-card-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.form-card-header .form-section-eyebrow, .form-section-heading .form-section-eyebrow { margin: 0 0 5px; color: var(--blue-dark); font-size: 10px; }
.card-body, .form-card-body { padding: 25px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-subtle); }
.card-flat { box-shadow: var(--shadow-xs); }
.card-accent, .form-card { border-top: 0; }
.card-accent::before, .form-card::before { position: absolute; z-index: 1; top: -1px; right: 14px; left: 14px; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--blue), #39a2df 55%, var(--teal-mid)); content: ""; }

.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-aside { grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr); align-items: start; }
.grid-detail { grid-template-columns: minmax(0, 1.65fr) minmax(310px, .8fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 21px; }

.metric-card { display: flex; min-height: 132px; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px; overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--ease); }
.metric-card > * { position: relative; z-index: 1; }
.metric-card:hover { border-color: #b8cdc5; box-shadow: var(--shadow); transform: translateY(-2px); }
.metric-card::after { position: absolute; z-index: 0; right: -22px; bottom: -42px; width: 100px; height: 100px; border: 18px solid var(--blue-soft); border-radius: 50%; content: ""; pointer-events: none; }
.metric-label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.metric-value { display: block; color: var(--teal-deep); font-family: "Roboto Condensed", sans-serif; font-size: 36px; font-weight: 600; line-height: 1; }
.metric-meta { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.metric-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border: 1px solid #d7ebf7; border-radius: 11px; color: var(--blue); background: linear-gradient(145deg, #f3faff, var(--blue-soft)); }
.metric-icon svg { width: 20px; height: 20px; }
.metric-card-primary { border-top: 3px solid var(--blue); }
.metric-card-warning { border-top: 3px solid #d18a18; }
.metric-card-danger { border-top: 3px solid var(--red); }
.metric-card-success { border-top: 3px solid var(--green); }
.metric-card-warning .metric-icon { border-color: #f1ddb5; color: var(--amber); background: var(--amber-soft); }
.metric-card-warning::after { border-color: var(--amber-soft); }
.metric-card-danger .metric-icon { border-color: #efd2d6; color: var(--red); background: var(--red-soft); }
.metric-card-danger::after { border-color: var(--red-soft); }
.metric-card-success .metric-icon { border-color: #d1e8dc; color: var(--green); background: var(--green-soft); }
.metric-card-success::after { border-color: var(--green-soft); }

.btn { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; line-height: 1.2; cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s var(--ease); }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, summary:focus-visible, .icon-button:focus-visible, .menu-button:focus-visible { outline: 3px solid var(--blue-ring); outline-offset: 2px; }
.btn-primary { color: #fff; background: linear-gradient(180deg, #1284cf 0%, var(--blue) 100%); border-color: var(--blue); box-shadow: 0 4px 10px rgba(8, 120, 201, .18); }
.btn-primary:hover { color: #fff; background: linear-gradient(180deg, #0875bd, var(--blue-dark)); border-color: var(--blue-dark); box-shadow: 0 7px 16px rgba(8, 120, 201, .22); }
.btn-secondary { color: #fff; background: linear-gradient(180deg, #11554e, var(--teal)); border-color: var(--teal); box-shadow: 0 4px 10px rgba(6, 47, 43, .14); }
.btn-secondary:hover { color: #fff; background: var(--teal-deep); border-color: var(--teal-deep); box-shadow: 0 7px 16px rgba(6, 47, 43, .18); }
.btn-outline { color: var(--teal-deep); background: #fff; border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-outline:hover { color: var(--teal-deep); background: #f6f9f7; border-color: #9dafaa; box-shadow: 0 4px 11px rgba(3, 36, 33, .07); }
.btn-danger { color: #fff; background: linear-gradient(180deg, #c83c49, var(--red)); border-color: var(--red); box-shadow: 0 4px 10px rgba(185, 47, 60, .16); }
.btn-danger:hover { color: #fff; background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { color: var(--blue-dark); background: transparent; }
.btn-ghost:hover { color: var(--blue-dark); background: var(--blue-soft); }
.btn-small { min-height: 36px; padding: 7px 11px; border-radius: 8px; font-size: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .52; box-shadow: none; cursor: not-allowed; pointer-events: none; transform: none; }

.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 21px; padding: 14px 16px; border: 1px solid; border-left-width: 4px; border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-xs); font-size: 13px; }
.alert-success { color: var(--green); border-color: #a5d2bb; background: var(--green-soft); }
.alert-error, .alert-danger { color: var(--red); border-color: #e4abb1; background: var(--red-soft); }
.alert-warning { color: var(--amber); border-color: #e8ca84; background: var(--amber-soft); }
.alert-info { color: var(--blue-dark); border-color: #a6cee7; background: var(--blue-soft); }
.alert-close { display: grid; width: 28px; height: 28px; flex: 0 0 auto; padding: 0; place-items: center; border: 0; border-radius: 7px; color: inherit; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
.alert-close:hover { background: rgba(255, 255, 255, .5); }
.alert-stack { display: grid; gap: 10px; margin-bottom: 21px; }
.alert-stack .alert { margin-bottom: 0; }
.alert.is-leaving { opacity: 0; transform: translateY(-5px); transition: opacity .15s ease, transform .15s var(--ease); }

.badge { display: inline-flex; min-height: 26px; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid transparent; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
.badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); content: ""; }
.badge-blue { color: var(--blue-dark); background: var(--blue-soft); border-color: #d4eaf7; }
.badge-teal { color: var(--teal); background: var(--teal-soft); border-color: #d5e6e2; }
.badge-green { color: var(--green); background: var(--green-soft); border-color: #d6eadf; }
.badge-amber { color: var(--amber); background: var(--amber-soft); border-color: #f0dfb8; }
.badge-red { color: var(--red); background: var(--red-soft); border-color: #efd5d8; }
.badge-violet { color: var(--violet); background: var(--violet-soft); border-color: #e2ddf5; }
.badge-slate { color: var(--slate); background: var(--slate-soft); border-color: #dfe5e7; }

.table-wrap { width: 100%; overflow-x: auto; scrollbar-color: #bfcbc7 transparent; scrollbar-width: thin; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th { padding: 12px 15px; border-bottom: 1px solid var(--line-strong); color: var(--muted); background: #f7faf8; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table th:first-child { padding-left: 20px; }
.data-table th:last-child { padding-right: 20px; }
.data-table td { padding: 15px; border-bottom: 1px solid #e8eeeb; vertical-align: middle; transition: background .15s ease; }
.data-table td:first-child { padding-left: 20px; }
.data-table td:last-child { padding-right: 20px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #f9fbfa; }
.data-table .cell-primary { color: var(--teal-deep); font-weight: 700; }
.data-table .cell-secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.data-table .cell-actions { width: 1%; text-align: right; white-space: nowrap; }
.table-link { color: var(--teal-deep); font-weight: 700; }
.table-link:hover { color: var(--blue); text-decoration: underline; }
.table-card { overflow: hidden; }
.table-row-action { gap: 5px; }
.table-row-action .ui-icon, .link-arrow .ui-icon { width: 15px; height: 15px; transition: transform .16s var(--ease); }
.table-row-action:hover .ui-icon, .link-arrow:hover .ui-icon { transform: translateX(2px); }
.table-entity { gap: 10px; }
.table-entity .avatar { width: 36px; height: 36px; }

.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(180deg, #fff, #fbfcfb); }
.toolbar-group { display: flex; flex: 1; flex-wrap: wrap; align-items: flex-end; gap: 11px; }
.toolbar .field { margin: 0; }
.toolbar .search-field { flex: 1 1 270px; max-width: 430px; }
.toolbar select { min-width: 158px; }
.toolbar :is(input:not([type]), input[type="text"], input[type="search"], select) { min-height: 42px; padding-top: 8px; padding-bottom: 8px; background-color: #fff; }
.filter-label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.list-toolbar { align-items: flex-end; }
.toolbar-primary { min-width: 0; }
.toolbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.result-summary { display: inline-flex; min-height: 30px; align-items: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #f7faf8; font-size: 11px; font-weight: 600; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 21px 20px; }
.form-grid > .field { margin-bottom: 0; }
.col-12 { grid-column: span 12; }
.col-9 { grid-column: span 9; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }
.field { min-width: 0; margin-bottom: 19px; }
.field:last-child { margin-bottom: 0; }
.field label:not(.checkbox):not(.radio):not(.checkbox-card):not(.choice-card), .field-label { display: block; margin-bottom: 7px; color: var(--teal-deep); font-size: 12px; font-weight: 700; letter-spacing: .005em; }
.field.is-focused > label:not(.checkbox):not(.radio):not(.checkbox-card):not(.choice-card), .field:focus-within > label:not(.checkbox):not(.radio):not(.checkbox-card):not(.choice-card) { color: var(--blue-dark); }
.field-required::after { margin-left: 4px; color: var(--red); content: "*"; }
.field-help { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.field-error { display: block; margin-top: 7px; color: var(--red); font-size: 11px; font-weight: 500; line-height: 1.45; }
.form-field-group { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafcfb; }
.form-field-group > .field:last-child { margin-bottom: 0; }
.form-required-note { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.form-required-note::before { color: var(--red); content: "*"; font-weight: 700; }
.form-empty-note { margin: 0; padding: 15px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); background: #fafcfb; font-size: 12px; }

input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], input[type="url"], select, textarea {
    width: 100%;
    min-height: var(--control-height);
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    outline: 0;
    color: var(--ink);
    background-color: #fbfcfb;
    box-shadow: inset 0 1px 1px rgba(3, 36, 33, .025), var(--shadow-xs);
    caret-color: var(--blue);
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, color .16s ease;
}

select { padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f716d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 16px; appearance: none; }
select[multiple], select[size] { padding-right: 13px; background-image: none; }
textarea { min-height: 124px; line-height: 1.55; resize: vertical; }

input:not([type]):hover, input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover, input[type="tel"]:hover, input[type="number"]:hover, input[type="date"]:hover, input[type="time"]:hover, input[type="datetime-local"]:hover, input[type="search"]:hover, input[type="url"]:hover, select:hover, textarea:hover { border-color: #97aba4; background-color: #fff; }
input:not([type]):focus, input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="tel"]:focus, input[type="number"]:focus, input[type="date"]:focus, input[type="time"]:focus, input[type="datetime-local"]:focus, input[type="search"]:focus, input[type="url"]:focus, select:focus, textarea:focus { border-color: var(--blue); background-color: #fff; box-shadow: 0 0 0 4px var(--blue-ring), inset 0 1px 1px rgba(3, 36, 33, .02); }
input::placeholder, textarea::placeholder { color: #93a19d; opacity: 1; }
input[readonly] { color: #4f5e5a; background: #f3f6f4; }
input[disabled], select[disabled], textarea[disabled] { border-color: #d7dfdc; color: #74817d; background-color: #eef2f0; box-shadow: none; cursor: not-allowed; opacity: 1; }
.field.is-invalid :is(input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], input[type="url"], select, textarea), :is(input, select, textarea)[aria-invalid="true"], :is(input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], input[type="url"], select, textarea):user-invalid { border-color: var(--red); background-color: #fffafb; box-shadow: 0 0 0 4px rgba(185, 47, 60, .1); }

input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 1000px #f8fcfa inset, 0 0 0 4px var(--blue-ring); transition: background-color 9999s ease-out; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator, input[type="datetime-local"]::-webkit-calendar-picker-indicator { padding: 5px; border-radius: 5px; cursor: pointer; opacity: .63; }
input[type="date"]::-webkit-calendar-picker-indicator:hover, input[type="time"]::-webkit-calendar-picker-indicator:hover, input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { background: var(--blue-soft); opacity: .9; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

input[type="file"] { width: 100%; min-height: var(--control-height); padding: 5px; border: 1px dashed #aabbb5; border-radius: var(--radius-sm); color: var(--muted); background: #fbfcfb; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
input[type="file"]:hover { border-color: var(--blue); background: #f7fbfe; }
input[type="file"]:focus-visible { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-ring); }
input[type="file"]::file-selector-button { min-height: 36px; margin-right: 11px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--teal-deep); background: #fff; font-weight: 700; cursor: pointer; }
input[type="color"], .color-swatch { width: 48px; min-width: 48px; height: 48px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }

.input-group, .input-with-affix, .color-input-group { display: flex; align-items: stretch; }
.input-group > *, .input-with-affix > *, .color-input-group > * { border-radius: 0; }
.input-group > *:first-child, .input-with-affix > *:first-child, .color-input-group > *:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group > *:last-child, .input-with-affix > *:last-child, .color-input-group > *:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group > * + *, .input-with-affix > * + *, .color-input-group > * + * { margin-left: -1px; }
.input-affix, .input-prefix, .input-suffix, .color-preview { display: inline-flex; min-width: 47px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line-strong); color: var(--muted); background: #f1f5f3; font-size: 12px; font-weight: 700; white-space: nowrap; }
.color-preview { min-width: 49px; padding: 0; border-color: var(--line-strong); background: var(--preview-color, var(--blue)); box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 7px rgba(0, 0, 0, .08); }
.input-with-affix:focus-within, .color-input-group:focus-within { position: relative; z-index: 1; border-radius: var(--radius-sm); box-shadow: 0 0 0 4px var(--blue-ring); }
.input-with-affix:focus-within > input, .color-input-group:focus-within > input { border-color: var(--blue); box-shadow: none; }

.checkbox, .radio { display: inline-flex; align-items: flex-start; gap: 10px; color: var(--ink); font-size: 13px; cursor: pointer; }
.checkbox input[type="checkbox"], .radio input[type="radio"], .checkbox-card input[type="checkbox"], .choice-card input[type="checkbox"], .choice-card input[type="radio"] { position: relative; width: 20px; height: 20px; flex: 0 0 auto; margin: 1px 0 0; border: 1.5px solid #9baba6; border-radius: 6px; outline: 0; background: #fff; box-shadow: inset 0 1px 1px rgba(3, 36, 33, .04); cursor: pointer; appearance: none; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s var(--ease); }
.radio input[type="radio"], .choice-card input[type="radio"] { border-radius: 50%; }
.checkbox input[type="checkbox"]::after, .checkbox-card input[type="checkbox"]::after, .choice-card input[type="checkbox"]::after { position: absolute; top: 3px; left: 6px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; content: ""; opacity: 0; transform: rotate(45deg) scale(.6); transition: opacity .12s ease, transform .15s var(--ease); }
.radio input[type="radio"]::after, .choice-card input[type="radio"]::after { position: absolute; inset: 4px; border-radius: 50%; background: #fff; content: ""; opacity: 0; transform: scale(.45); transition: opacity .12s ease, transform .15s var(--ease); }
.checkbox input[type="checkbox"]:checked, .radio input[type="radio"]:checked, .checkbox-card input[type="checkbox"]:checked, .choice-card input:checked { border-color: var(--blue); background: var(--blue); box-shadow: 0 2px 7px rgba(8, 120, 201, .22); }
.checkbox input[type="checkbox"]:checked::after, .checkbox-card input[type="checkbox"]:checked::after, .choice-card input[type="checkbox"]:checked::after { opacity: 1; transform: rotate(45deg) scale(1); }
.radio input[type="radio"]:checked::after, .choice-card input[type="radio"]:checked::after { opacity: 1; transform: scale(1); }
.checkbox input:focus-visible, .radio input:focus-visible, .checkbox-card input:focus-visible, .choice-card input:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--blue-ring); }
.checkbox input:disabled, .radio input:disabled, .checkbox-card input:disabled, .choice-card input:disabled { border-color: #c5cfcc; background-color: #e8edeb; box-shadow: none; cursor: not-allowed; }

.checkbox-card, .choice-card { display: flex; width: 100%; min-height: 76px; align-items: flex-start; gap: 11px; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfcfb; box-shadow: var(--shadow-xs); cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s var(--ease); }
.checkbox-card:hover, .choice-card:hover { border-color: #a9bcb5; background: #fff; box-shadow: 0 4px 13px rgba(3, 36, 33, .055); transform: translateY(-1px); }
.checkbox-card > span, .choice-copy { min-width: 0; line-height: 1.35; }
.checkbox-card strong, .choice-copy strong { color: var(--teal-deep); font-size: 13px; }
.choice-copy > strong, .choice-copy > span { display: block; }
.checkbox-card.is-selected, .choice-card.is-selected { border-color: #83badd; background: #f4faff; box-shadow: 0 0 0 1px rgba(8, 120, 201, .06), 0 5px 15px rgba(8, 120, 201, .07); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
@supports selector(label:has(input:checked)) {
    .checkbox-card:has(input:checked), .choice-card:has(input:checked) { border-color: #83badd; background: #f4faff; box-shadow: 0 0 0 1px rgba(8, 120, 201, .06), 0 5px 15px rgba(8, 120, 201, .07); }
}

.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 27px; padding-top: 21px; border-top: 1px solid var(--line); }
.form-actions .btn { min-width: 112px; }
.form-actions-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; }
.form-actions-copy { max-width: 580px; margin: 0 auto 0 0; color: var(--muted); font-size: 12px; }
.form-actions-copy strong { display: block; margin-bottom: 2px; color: var(--teal-deep); font-size: 13px; }
.form-card-wide { width: min(1280px, 100%) !important; }
.form-card-compact { width: min(840px, 100%) !important; }
.form-header-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.form-section + .form-section { margin-top: 31px; padding-top: 28px; border-top: 1px solid var(--line); }
.form-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.form-section-heading h2, .form-section-heading h3 { margin: 0 0 5px; }
.form-section-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: 12px; }
.form-section-eyebrow { display: block; margin: 0 0 5px; color: var(--blue-dark); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.form-subsection { padding: 17px 18px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafcfb; }
.form-subsection + .form-subsection { margin-top: 13px; }
.form-subsection-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.form-subsection-heading h4 { margin: 0; color: var(--teal-deep); font-size: 14px; }
.form-subsection-heading > span { color: var(--muted); font-size: 11px; }
.form-subsection .form-grid { gap: 16px; }
.form-field-narrow { max-width: 570px; }
.form-status-choice { max-width: 680px; margin-top: 20px; }
.choice-card-compact { min-height: var(--control-height); align-items: center; padding: 10px 13px; }
.choice-card-compact .choice-copy strong { display: block; }
.choice-copy > span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
@supports selector(.field:has(> .choice-card-compact)) {
    .field:has(> .choice-card-compact) { align-self: end; }
}
.form-context-note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin-bottom: 20px; padding: 13px 15px; border: 1px solid #cbe1ee; border-left: 3px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--blue-deep); background: #f3f9fd; }
.form-context-note::before { grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; color: #fff; background: var(--blue); content: "i"; font-family: Georgia, serif; font-size: 15px; font-weight: 700; line-height: 26px; text-align: center; }
.form-context-note strong { font-size: 12px; }
.form-context-note > span { color: #546d7b; font-size: 11px; line-height: 1.45; }
.form-danger-zone { margin-top: 28px; padding: 18px; border: 1px solid #edc9cd; border-radius: var(--radius-sm); background: #fffafb; }
.card.form-danger-zone { padding: 0; }
.form-danger-zone h3 { margin-bottom: 4px; color: var(--red-dark); }
.form-danger-zone p { margin: 0; color: #7d5b5f; font-size: 12px; }
.form-danger-zone-body { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px; }
.form-disclosure { margin-top: 21px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafcfb; }
.form-disclosure-summary { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; border-radius: var(--radius-sm); color: var(--teal-deep); font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.form-disclosure-summary::-webkit-details-marker { display: none; }
.form-disclosure-summary:hover { background: #f4f8f6; }
.form-disclosure[open] .form-disclosure-summary { border-bottom: 1px solid var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: #f6f9f7; }
.form-disclosure-summary span span, .form-disclosure-summary small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.form-disclosure-action { display: inline-flex !important; min-height: 28px; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 7px; color: var(--blue-dark) !important; background: var(--blue-soft); font-size: 10px !important; font-weight: 700 !important; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
.form-disclosure-action::after { display: inline-block; color: var(--blue-dark); content: "⌄"; font-size: 14px; line-height: 1; transition: transform .18s var(--ease); }
.form-disclosure[open] .form-disclosure-action::after { transform: rotate(180deg); }
.form-disclosure-body { padding: 18px 16px; }

.subnav { display: flex; gap: 5px; margin-bottom: 22px; padding: 5px; border: 1px solid var(--line); border-radius: 11px; overflow-x: auto; background: rgba(255, 255, 255, .9); box-shadow: var(--shadow-xs); scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: 0 0 auto; min-height: 38px; padding: 9px 15px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; transition: color .15s ease, background .15s ease, box-shadow .15s ease; }
.subnav a:hover { color: var(--teal); background: #eff5f2; }
.subnav a.active { color: #fff; background: linear-gradient(180deg, var(--teal-mid), var(--teal)); box-shadow: 0 3px 9px rgba(6, 47, 43, .15); }
.record-subnav, .settings-subnav { position: sticky; top: calc(var(--topbar-height) + 10px); z-index: 35; }
.anchor-section { scroll-margin-top: calc(var(--topbar-height) + 76px); }

.ui-icon { display: block; width: 19px; height: 19px; flex: 0 0 auto; }
.btn .ui-icon { width: 17px; height: 17px; }
.card-header .card-kicker, .record-hero-header .card-kicker { margin: 0 0 4px; color: var(--blue-dark); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.section-heading { display: flex; min-width: 0; align-items: center; gap: 13px; }
.section-heading-icon, .detail-card-icon, .report-period-icon, .export-link-icon, .action-module-icon { display: inline-grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 1px solid #d5e9f5; border-radius: 10px; color: var(--blue-dark); background: linear-gradient(145deg, #f6fbfe, var(--blue-soft)); }
.section-heading-icon .ui-icon, .detail-card-icon .ui-icon, .report-period-icon .ui-icon, .export-link-icon .ui-icon, .action-module-icon .ui-icon { width: 19px; height: 19px; }

.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.summary-strip-item { position: relative; display: flex; min-height: 86px; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; }
.summary-strip-item + .summary-strip-item { border-left: 1px solid var(--line); }
.summary-strip-item span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .065em; text-transform: uppercase; }
.summary-strip-item strong { color: var(--teal-deep); font-family: "Roboto Condensed", sans-serif; font-size: 29px; font-weight: 600; line-height: 1; }

.record-hero { overflow: hidden; background: linear-gradient(145deg, #fff 70%, #f1f8f5); }
.record-hero-header { background: transparent; }
.record-hero .entity-mark { width: 56px; height: 56px; border-color: #cce0da; border-radius: 14px; font-size: 19px; }
.detail-list-comfortable .detail-row { padding-top: 15px; padding-bottom: 15px; }
.danger-zone { border-color: #e8c6ca; background: #fffafb; box-shadow: var(--shadow-xs); }
.danger-zone h3 { color: var(--red-dark); }
.danger-zone form { margin-top: 13px; }

.detail-list { margin: 0; }
.detail-row { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr); gap: 19px; padding: 13px 0; border-bottom: 1px solid #e8eeeb; }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.detail-row dd { margin: 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.section-label { margin: 0 0 13px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.entity-heading { display: flex; align-items: center; gap: 15px; }
.entity-mark { display: grid; width: 50px; height: 50px; flex: 0 0 auto; place-items: center; border: 1px solid #d2e4df; border-radius: 12px; color: var(--teal); background: linear-gradient(145deg, #eef6f4, #dfece9); font-family: "Roboto Condensed", sans-serif; font-size: 17px; font-weight: 700; }
.entity-heading h2 { margin: 0 0 3px; }
.entity-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.record-count { display: inline-grid; min-width: 25px; height: 25px; margin-left: 6px; padding: 0 7px; place-items: center; border: 1px solid #d5e7e2; border-radius: 999px; color: var(--teal); background: var(--teal-soft); font-family: "Roboto", sans-serif; font-size: 11px; }

.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before { position: absolute; top: 12px; bottom: 12px; left: 14px; width: 1px; background: var(--line-strong); content: ""; }
.timeline-item { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 13px; padding-bottom: 19px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: relative; z-index: 1; width: 29px; height: 29px; border: 6px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px #a8cee7, 0 3px 8px rgba(8, 120, 201, .16); }
.timeline-content { padding-top: 3px; }
.timeline-content strong { display: block; color: var(--teal-deep); font-size: 13px; }
.timeline-content p { margin: 3px 0 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.timeline-meta { display: block; margin-top: 6px; color: var(--muted-light); font-size: 10px; }

.note { padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #fbfcfb; box-shadow: var(--shadow-xs); }
.note + .note { margin-top: 12px; }
.note-internal { border-left-color: var(--amber); background: #fffdf8; }
.note-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.note-head strong { color: var(--teal-deep); font-size: 12px; }
.note-head time { color: var(--muted-light); font-size: 10px; }
.note p { margin: 0; font-size: 13px; white-space: pre-wrap; }
.note-label { display: inline-block; margin-top: 9px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }

.empty-state { display: flex; min-height: 260px; align-items: center; justify-content: center; flex-direction: column; padding: 42px 22px; text-align: center; }
.empty-state-icon { display: grid; width: 56px; height: 56px; margin-bottom: 16px; place-items: center; border: 1px solid #d4eaf7; border-radius: 14px; color: var(--blue); background: linear-gradient(145deg, #f5fbff, var(--blue-soft)); }
.empty-state-icon svg { width: 26px; height: 26px; }
.empty-state h3 { margin: 0 0 7px; }
.empty-state p { max-width: 420px; margin: 0 0 18px; color: var(--muted); font-size: 13px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 20px; border-top: 1px solid var(--line); color: var(--muted); background: #fcfdfc; font-size: 11px; }
.pagination-links { display: flex; gap: 6px; }
.pagination a, .pagination span.page-current { display: grid; min-width: 34px; height: 34px; padding: 0 9px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--teal); background: #fff; font-weight: 600; transition: border-color .15s ease, background .15s ease; }
.pagination a:hover { border-color: #a8b9b3; background: #f4f7f5; }
.pagination span.page-current { color: #fff; background: var(--teal); border-color: var(--teal); box-shadow: 0 3px 8px rgba(6, 47, 43, .15); }
.pagination .disabled { opacity: .42; pointer-events: none; }

.ticket-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ticket-title h2 { margin: 0; }
.ticket-number { color: var(--blue); font-family: "Roboto Condensed", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ticket-description { margin: 18px 0 0; color: #30413d; line-height: 1.72; white-space: pre-wrap; }
.status-progress { display: grid; grid-template-columns: repeat(7, minmax(60px, 1fr)); margin: 5px 0 0; padding: 0; overflow-x: auto; list-style: none; scrollbar-width: thin; }
.status-step { position: relative; min-width: 76px; padding: 25px 4px 0; color: var(--muted-light); font-size: 9px; font-weight: 700; letter-spacing: .03em; text-align: center; text-transform: uppercase; }
.status-step::before { position: absolute; top: 7px; right: 0; left: 0; height: 2px; background: var(--line); content: ""; }
.status-step::after { position: absolute; top: 1px; left: calc(50% - 7px); width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 1px var(--line-strong); content: ""; }
.status-step.done, .status-step.current { color: var(--teal); }
.status-step.done::before, .status-step.current::before { background: #69a79f; }
.status-step.done::after { background: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.status-step.current::after { background: var(--blue); box-shadow: 0 0 0 2px var(--blue), 0 0 0 5px var(--blue-ring); }

.ticket-hero { overflow: hidden; border-color: #bdd6d0; background: linear-gradient(135deg, #fff 62%, #eff8f5); }
.ticket-hero::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--blue), var(--teal-mid)); content: ""; }
.ticket-hero-body { padding: 25px 27px; }
.ticket-title { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; align-items: center; column-gap: 13px; row-gap: 8px; }
.ticket-title h2 { min-width: 0; }
.ticket-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.ticket-sidebar { position: sticky; top: calc(var(--topbar-height) + 18px); }
.action-modules { display: grid; gap: 13px; }
.action-module { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafcfb; }
.action-module-primary { border-color: #cfe3ee; background: linear-gradient(145deg, #f8fcfe, #f3f9fc); }
.action-module-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; }
.action-module-heading h3 { margin: 0 0 3px; }
.action-module-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.action-module-icon { width: 38px; height: 38px; }
.action-disclosure { margin-top: 0; background: #fff; }
.action-disclosure .form-disclosure-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; justify-content: normal; }
.action-disclosure .form-disclosure-summary > span:nth-child(2) { min-width: 0; }
.disclosure-chevron { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: var(--blue-dark); background: var(--blue-soft); font-size: 15px; transition: transform .18s var(--ease); }
.disclosure[open] .disclosure-chevron { transform: rotate(180deg); }
.disclosure-panel { background: #fbfcfb; }
.compact-disclosure .form-disclosure-summary { padding: 11px 12px; }
.compact-disclosure .form-disclosure-body { padding: 14px 12px; }
.compact-form-grid { gap: 14px; }
.form-actions-compact { margin-top: 15px; padding-top: 14px; }
.label-optional { margin-left: 4px; color: var(--muted-light); font-size: 9px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.compact-empty { display: flex; min-height: 84px; align-items: center; gap: 12px; padding: 15px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); background: #fafcfb; }
.compact-empty > .ui-icon { width: 22px; height: 22px; color: var(--blue); }
.compact-empty > span, .compact-empty strong, .compact-empty small { display: block; }
.compact-empty strong { color: var(--teal-deep); font-size: 12px; }
.compact-empty small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.detail-card-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.detail-card-heading h3 { margin: 1px 0 3px; font-size: 16px; }
.detail-card-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 13px; }
.photo-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-xs); transition: border-color .18s ease, box-shadow .18s ease, transform .18s var(--ease); }
.photo-card:hover { border-color: #aebfba; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-card figcaption { padding: 9px 10px; color: var(--muted); font-size: 10px; }
.photo-card figcaption strong, .photo-card figcaption span { display: block; }
.photo-card figcaption strong { overflow: hidden; color: var(--teal-deep); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.photo-card figcaption span { margin-top: 2px; }

.color-dot { display: inline-block; width: 11px; height: 11px; margin-right: 7px; border: 1px solid rgba(0, 0, 0, .09); border-radius: 50%; box-shadow: 0 0 0 2px #fff; vertical-align: -1px; }
.kpi-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #e7ece9; }
.kpi-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #42a3df); }
.report-stat { padding: 17px 0; border-bottom: 1px solid var(--line); }
.report-stat:last-child { border-bottom: 0; }
.report-stat-head { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 8px; font-size: 12px; }
.report-stat-head strong { color: var(--teal-deep); }
.report-stat-head span { color: var(--muted); }
.stat-list { display: grid; gap: 0; margin: 0; }
.stat-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.stat-item:first-child { padding-top: 0; }
.stat-item:last-child { padding-bottom: 0; border-bottom: 0; }
.stat-item dt { color: var(--teal-deep); font-size: 12px; font-weight: 700; }
.stat-item dd { margin: 0; color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; }
.report-period { overflow: hidden; }
.report-period .toolbar { border-bottom: 0; }
.report-period-icon { width: 42px; height: 42px; margin-bottom: 1px; }
.report-period-label { display: inline-flex; min-height: 36px; align-items: center; padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--teal); background: #f6f9f7; font-size: 11px; font-weight: 700; white-space: nowrap; }
.report-card .card-body { min-height: 220px; }
.workload-bar { width: min(240px, 100%); }
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 11px; }
.export-link { display: grid; min-height: 76px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); background: #fbfcfb; box-shadow: var(--shadow-xs); transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s var(--ease); }
.export-link:hover { border-color: #9fbcb2; color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.export-link-icon { width: 39px; height: 39px; }
.export-link > span:nth-child(2), .export-link strong, .export-link small { display: block; min-width: 0; }
.export-link strong { color: var(--teal-deep); font-size: 12px; }
.export-link small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.export-link > .ui-icon { width: 17px; height: 17px; color: var(--muted-light); transition: color .16s ease, transform .16s var(--ease); }
.export-link:hover > .ui-icon { color: var(--blue); transform: translateY(2px); }
.system-code { display: inline-flex; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: #40514d; background: #f4f7f5; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; }
.settings-aside .card { overflow: hidden; }

.error-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 85% 10%, rgba(8, 120, 201, .1), transparent 25rem), linear-gradient(145deg, #f7faf8, #edf3f0); }
.error-shell { width: min(520px, 100%); padding: 45px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-lg); text-align: center; }
.error-mark { display: grid; width: 52px; height: 52px; margin: 0 auto 22px; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(145deg, var(--teal-mid), var(--teal-deep)); box-shadow: 0 8px 22px rgba(6, 47, 43, .2); font-family: "Roboto Condensed", sans-serif; font-weight: 700; }
.error-shell h1 { margin-bottom: 10px; }
.error-shell > p:not(.eyebrow) { margin: 0 auto 24px; color: var(--muted); }

.auth-body { display: grid; min-height: 100vh; place-items: center; padding: 28px; background: radial-gradient(circle at 82% 16%, rgba(58, 154, 216, .14), transparent 26rem), linear-gradient(145deg, #062f2b, #021e1c); }
.auth-shell { display: grid; width: min(980px, 100%); min-height: 600px; grid-template-columns: 1.06fr .94fr; overflow: hidden; border: 1px solid rgba(255, 255, 255, .11); border-radius: var(--radius-lg); background: #fff; box-shadow: 0 28px 100px rgba(0, 0, 0, .35); }
.auth-brand { position: relative; display: flex; justify-content: space-between; flex-direction: column; padding: 48px; overflow: hidden; color: #fff; background: linear-gradient(145deg, var(--teal), #073430); }
.auth-brand::before, .auth-brand::after { position: absolute; border: 34px solid rgba(255, 255, 255, .04); border-radius: 50%; content: ""; }
.auth-brand::before { right: -140px; bottom: -180px; width: 410px; height: 410px; }
.auth-brand::after { right: -20px; bottom: -55px; width: 190px; height: 190px; }
.auth-logo { position: relative; z-index: 1; width: 265px; }
.auth-logo img { width: 100%; }
.auth-brand-copy { position: relative; z-index: 1; max-width: 395px; }
.auth-brand-copy span { color: #91cff5; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.auth-brand-copy h1 { margin: 13px 0; color: #fff; font-size: 41px; }
.auth-brand-copy p { margin: 0; color: rgba(255, 255, 255, .66); font-size: 14px; line-height: 1.72; }
.auth-brand-footer { position: relative; z-index: 1; color: rgba(255, 255, 255, .43); font-size: 10px; }
.auth-panel { display: flex; align-items: center; padding: 53px; background: #fff; }
.auth-form { width: 100%; }
.auth-form-header { margin-bottom: 29px; }
.auth-form .eyebrow { margin-bottom: 10px; }
.auth-form h2 { margin-bottom: 8px; font-size: 32px; }
.auth-intro { margin: 0; color: var(--muted); font-size: 13px; }
.auth-field { margin-bottom: 18px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 62px; }
.password-toggle { position: absolute; top: 5px; right: 5px; bottom: 5px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--blue-dark); background: #f3f8fb; font-size: 11px; font-weight: 700; cursor: pointer; }
.password-toggle:hover { background: var(--blue-soft); }
.password-toggle:focus-visible { outline: 3px solid var(--blue-ring); outline-offset: 1px; }
.auth-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 19px 0 23px; }
.auth-submit { min-height: 49px; font-size: 14px; }
.auth-security-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 21px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f8faf9; }
.auth-security-mark { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 700; }
.auth-security-note p { margin: 0; line-height: 1.4; }
.auth-security-note strong { display: block; color: var(--teal-deep); font-size: 11px; }
.auth-security-note p span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.auth-help { margin: 23px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.muted { color: var(--muted); }
.text-small { font-size: 12px; }
.text-right { text-align: right; }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.hidden { display: none !important; }

@media (max-width: 1180px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-detail { grid-template-columns: minmax(0, 1.4fr) minmax(270px, .8fr); }
    .content { padding-right: 26px; padding-left: 26px; }
    .topbar { padding: 0 26px; }
}

@media (max-width: 920px) {
    .sidebar { width: min(326px, calc(100vw - 28px)); transform: translateX(-105%); box-shadow: 20px 0 60px rgba(0, 0, 0, .22); transition: transform .24s var(--ease); }
    .sidebar-scrim { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(2, 28, 26, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-scrim { display: block; animation: scrim-in .18s ease-out; }
    .app-main { margin-left: 0; }
    .mobile-menu { display: inline-grid; }
    .topbar-wordmark { display: none; }
    .grid-main-aside, .grid-detail { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ticket-sidebar { position: static; }
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 680px) {
    :root { --topbar-height: 62px; --control-height: 48px; }
    .topbar { padding: 0 14px; }
    .content { padding: 23px 14px 40px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 20px; }
    .page-heading h1 { font-size: 30px; }
    .page-actions { width: 100%; justify-content: flex-start; }
    .page-actions .btn { flex: 1 1 auto; }
    .quick-add { width: 42px; padding: 5px; font-size: 0; }
    .quick-add span { width: 31px; height: 31px; font-size: 21px; }
    .user-menu-identity { display: none; }
    .user-menu summary { padding-right: 6px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .card-header, .form-card-header, .toolbar { align-items: flex-start; flex-direction: column; }
    .card-header, .form-card-header { padding: 17px 18px; }
    .toolbar-group, .toolbar .search-field { width: 100%; max-width: none; }
    .toolbar .field { width: 100%; }
    .toolbar select { min-width: 0; }
    .toolbar-actions { width: 100%; justify-content: space-between; padding-top: 2px; }
    .col-9, .col-8, .col-6, .col-4, .col-3, .col-2 { grid-column: span 12; }
    .form-grid { gap: 18px; }
    .card-body, .form-card-body { padding: 19px 17px; }
    .card-footer { padding: 15px 17px; }
    .form-section + .form-section { margin-top: 27px; padding-top: 24px; }
    .form-section-heading { flex-direction: column; gap: 9px; }
    .form-subsection-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
    .form-actions { align-items: stretch; flex-wrap: wrap; }
    .form-actions-copy { width: 100%; margin: 0 0 3px; }
    .form-actions-buttons { width: 100%; margin-left: 0; }
    .form-actions-buttons .btn { flex: 1 1 0; }
    .data-table { min-width: 620px; }
    .data-table th, .data-table td { padding: 12px; }
    .data-table th:first-child, .data-table td:first-child { padding-left: 16px; }
    .data-table th:last-child, .data-table td:last-child { padding-right: 16px; }
    .hide-mobile { display: none; }
    .pagination { align-items: flex-start; flex-direction: column; }
    .pagination-links { max-width: 100%; overflow-x: auto; }
    .detail-row { grid-template-columns: 1fr; gap: 4px; }
    .choice-grid { grid-template-columns: 1fr; }
    .form-danger-zone-body { align-items: stretch; flex-direction: column; }
    .form-danger-zone-body .btn { width: 100%; }
    .summary-strip-item { align-items: flex-start; flex-direction: column-reverse; justify-content: center; gap: 7px; padding: 14px; }
    .summary-strip-item strong { font-size: 25px; }
    .summary-strip-item span { font-size: 9px; }
    .ticket-title { grid-template-columns: 1fr; }
    .ticket-badges { justify-content: flex-start; }
    .action-disclosure .form-disclosure-summary { grid-template-columns: auto minmax(0, 1fr) auto; }
    .report-period-icon { display: none; }
    .report-period-label { align-self: stretch; justify-content: center; }
    .dashboard-overview.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-overview .metric-card { min-height: 122px; padding: 18px; }
    .app-footer { align-items: flex-start; flex-direction: column; padding: 15px; }
    .auth-body { padding: 0; background: #fff; }
    .auth-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; box-shadow: none; }
    .auth-brand { min-height: 235px; padding: 28px; }
    .auth-logo { width: 210px; }
    .auth-brand-copy h1 { margin: 8px 0; font-size: 30px; }
    .auth-brand-copy p { display: none; }
    .auth-brand-footer { display: none; }
    .auth-panel { align-items: flex-start; padding: 36px 28px; }
}

@media (max-width: 480px) {
    .page-actions { flex-direction: column; }
    .page-actions .btn { width: 100%; }
    .card { border-radius: 11px; }
    .card-header, .form-card-header { border-radius: 11px 11px 0 0; }
    .form-actions .btn { flex: 1 1 calc(50% - 5px); min-width: 0; }
    .form-actions-copy { flex-basis: 100%; }
    .section-heading { align-items: flex-start; }
    .section-heading-icon { width: 36px; height: 36px; }
    .record-subnav, .settings-subnav { top: calc(var(--topbar-height) + 6px); }
    .action-module { padding: 15px; }
    .action-disclosure .form-disclosure-summary { grid-template-columns: auto minmax(0, 1fr); }
    .action-disclosure .disclosure-chevron { display: none; }
    .export-grid { grid-template-columns: 1fr; }
    .auth-panel { padding-right: 22px; padding-left: 22px; }
    .auth-meta { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
