/*
 * SOREPCO V2 — Design System (consolidated)
 * ------------------------------------------------------------------
 * Layer 1: complete component base (visual structure: layout, surfaces,
 *          borders, shadows, states).
 * Layer 2: R31 typography and ergonomics overrides (larger type scale,
 *          drawer accordion, compatibility layer, responsive rules).
 *
 * Both layers are maintained in this single file so a component can never
 * lose its structural styles when only its typography is tuned.
 */

/* ================================================================== */
/* LAYER 1 — Component base                                           */
/* ================================================================== */

/*
 * SOREPCO Platform — unified enterprise UI layer
 * Loaded after app.css. Keeps every module visually consistent.
 */

:root {
    --ui-green-950: #052e23;
    --ui-green-900: #064e3b;
    --ui-green-800: #065f46;
    --ui-green-700: #047857;
    --ui-green-600: #059669;
    --ui-green-500: #10b981;
    --ui-green-100: #d1fae5;
    --ui-green-50: #ecfdf5;

    --ui-ink: #0f2b23;
    --ui-ink-soft: #35544a;
    --ui-muted: #64748b;
    --ui-line: #e2e8e5;
    --ui-line-soft: #edf2f0;
    --ui-surface: #ffffff;
    --ui-canvas: #f6f9f7;

    --ui-amber: #b45309;
    --ui-amber-bg: #fffbeb;
    --ui-red: #b42318;
    --ui-red-bg: #fef3f2;
    --ui-blue: #1d4ed8;
    --ui-blue-bg: #eff6ff;

    --ui-radius: 16px;
    --ui-radius-sm: 11px;
    --ui-shadow: 0 1px 2px rgba(16, 43, 34, .05), 0 10px 30px rgba(16, 43, 34, .05);
}

/* ------------------------------------------------------------------ */
/* Page shell                                                          */
/* ------------------------------------------------------------------ */

.ui-page {
    display: grid;
    gap: 18px;
    color: var(--ui-ink);
    font-size: 15px;
}

.ui-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 26px 30px;
    border-radius: 20px;
    background: linear-gradient(118deg, #053f2e 0%, #086b4e 62%, #0a8a60 100%);
    color: #fff;
    box-shadow: 0 14px 34px rgba(5, 71, 51, .16);
}

.ui-hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -190px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    pointer-events: none;
}

.ui-hero h1 {
    margin: 0 0 6px;
    font-size: 27px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.015em;
}

.ui-hero p {
    margin: 0;
    max-width: 72ch;
    font-size: 14.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .84);
}

.ui-eyebrow {
    display: block;
    margin-bottom: 8px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
}

.ui-hero-pill {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(0, 46, 33, .28);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.ui-grid-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.ui-kpi {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
}

.ui-kpi-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ui-muted);
}

.ui-kpi-value {
    font-size: 26px;
    font-weight: 850;
    letter-spacing: -.02em;
    color: var(--ui-green-900);
    font-variant-numeric: tabular-nums;
}

.ui-kpi-hint {
    font-size: 12.5px;
    font-weight: 600;
    color: #7f918b;
}

.ui-kpi.is-warn .ui-kpi-value { color: var(--ui-amber); }
.ui-kpi.is-danger .ui-kpi-value { color: var(--ui-red); }
.ui-kpi.is-info .ui-kpi-value { color: var(--ui-blue); }

.ui-panel {
    padding: 22px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
}

.ui-panel h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 800;
}

.ui-note {
    display: flex;
    gap: 12px;
    padding: 13px 16px;
    border: 1px solid #cfe9dd;
    border-radius: 13px;
    background: #f0fbf6;
    color: #2f5a4b;
    font-size: 13.5px;
    line-height: 1.55;
    font-weight: 550;
}

.ui-note.is-warn {
    border-color: #f2d7a6;
    background: var(--ui-amber-bg);
    color: #8a5306;
}

.ui-note.is-danger {
    border-color: #f5c2bd;
    background: var(--ui-red-bg);
    color: #912018;
}

/* ------------------------------------------------------------------ */
/* Data table                                                          */
/* ------------------------------------------------------------------ */

.dt {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
}

.dt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.dt-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--ui-ink);
}

.dt-sub {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 550;
    color: var(--ui-muted);
}

.dt-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dt-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    background: #fff;
    color: var(--ui-ink-soft);
    font-size: 13px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.dt-btn:hover {
    border-color: var(--ui-green-500);
    background: var(--ui-green-50);
    color: var(--ui-green-800);
}

.dt-btn.is-primary {
    border-color: var(--ui-green-700);
    background: var(--ui-green-700);
    color: #fff;
}

.dt-btn.is-primary:hover {
    background: var(--ui-green-800);
    color: #fff;
}

.dt-btn.is-danger {
    border-color: #f1b7b2;
    background: #fff;
    color: var(--ui-red);
}

.dt-btn.is-danger:hover {
    background: var(--ui-red-bg);
}

.dt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--ui-line-soft);
    border-radius: 13px;
    background: #f8fbfa;
}

.dt-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 140px;
}

.dt-field.is-search {
    flex: 1 1 280px;
    min-width: 220px;
}

.dt-field label {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6b7f77;
}

.dt-input,
.dt-select {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid #d7e0dc;
    border-radius: 10px;
    background: #fff;
    color: var(--ui-ink);
    font-size: 14px;
    font-weight: 550;
    outline: none;
}

.dt-input:focus,
.dt-select:focus {
    border-color: var(--ui-green-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .13);
}

.dt-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted);
}

.dt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--ui-green-50);
    border: 1px solid #cdeee0;
    color: var(--ui-green-800);
    font-size: 12.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.dt-scroll {
    min-width: 0;
    overflow-x: auto;
    border: 1px solid var(--ui-line-soft);
    border-radius: 13px;
}

.dt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

.dt-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 13px;
    border-bottom: 1px solid var(--ui-line);
    background: #f3f8f5;
    color: #4c635b;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.dt-table thead th.is-right { text-align: right; }
.dt-table thead th.is-center { text-align: center; }

.dt-table thead th a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    text-decoration: none;
}

.dt-table thead th a:hover { color: var(--ui-green-700); }

.dt-sort-mark {
    font-size: 10px;
    opacity: .75;
}

.dt-table tbody td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--ui-line-soft);
    vertical-align: middle;
    color: var(--ui-ink);
}

.dt-table tbody tr:last-child td { border-bottom: 0; }
.dt-table tbody tr:nth-child(even) { background: #fbfdfc; }
.dt-table tbody tr:hover { background: #f3fbf7; }

.dt-table td.is-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dt-table td.is-center { text-align: center; }
.dt-table td.is-nowrap { white-space: nowrap; }

.dt-cell-strong { font-weight: 750; color: var(--ui-green-900); }
.dt-cell-sub { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 600; color: #8798a1; }

.dt-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef2f0;
    color: #43625a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dt-badge.is-ok { background: #e7f9ef; color: #0a6b45; }
.dt-badge.is-warn { background: #fff4de; color: #92520a; }
.dt-badge.is-danger { background: #fdeceb; color: #a32017; }
.dt-badge.is-info { background: #e9f1ff; color: #1b4ba3; }
.dt-badge.is-muted { background: #f1f4f3; color: #7a8c86; }

.dt-empty {
    padding: 46px 20px;
    text-align: center;
}

.dt-empty-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--ui-green-50);
    color: var(--ui-green-700);
    font-size: 22px;
    font-weight: 900;
}

.dt-empty strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: var(--ui-ink);
}

.dt-empty span {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 550;
    color: var(--ui-muted);
}

.dt-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dt-range {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--ui-muted);
}

.dt-pager {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.dt-pager a,
.dt-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--ui-line);
    border-radius: 9px;
    background: #fff;
    color: var(--ui-ink-soft);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.dt-pager a:hover {
    border-color: var(--ui-green-500);
    color: var(--ui-green-800);
    background: var(--ui-green-50);
}

.dt-pager .is-current {
    border-color: var(--ui-green-700);
    background: var(--ui-green-700);
    color: #fff;
}

.dt-pager .is-disabled {
    opacity: .45;
}

.dt-loading {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 750;
    color: var(--ui-green-700);
}

.dt.is-loading .dt-loading { display: inline-flex; }
.dt.is-loading .dt-table { opacity: .55; transition: opacity .15s; }

.dt-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #bfe9d8;
    border-top-color: var(--ui-green-600);
    border-radius: 50%;
    animation: dt-spin .7s linear infinite;
}

@keyframes dt-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/* Forms & actions                                                     */
/* ------------------------------------------------------------------ */

.ui-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.ui-field { display: flex; flex-direction: column; gap: 6px; }
.ui-field > label { font-size: 12.5px; font-weight: 800; color: #47605a; }

.ui-field input,
.ui-field select,
.ui-field textarea {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d7e0dc;
    border-radius: 11px;
    background: #fff;
    font-size: 14px;
    font-weight: 550;
    color: var(--ui-ink);
    outline: none;
}

.ui-field input:focus,
.ui-field select:focus,
.ui-field textarea:focus {
    border-color: var(--ui-green-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .13);
}

.ui-hint { font-size: 12px; font-weight: 550; color: #7d8f89; }
.ui-error { font-size: 12.5px; font-weight: 700; color: var(--ui-red); }

.ui-alert {
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #cfe9dd;
    background: #f0fbf6;
    color: #22614c;
    font-size: 13.5px;
    font-weight: 650;
}

.ui-alert.is-error {
    border-color: #f2c4bf;
    background: var(--ui-red-bg);
    color: #9d2b21;
}

@media (max-width: 900px) {
    .ui-hero { flex-direction: column; align-items: flex-start; padding: 22px; }
    .ui-hero h1 { font-size: 23px; }
    .dt { padding: 14px; }
    .dt-toolbar { flex-direction: column; align-items: stretch; }
    .dt-field { min-width: 0; }
    .dt-table { font-size: 13px; }
    .dt-table thead th,
    .dt-table tbody td { padding: 10px; }
}

@media (max-width: 640px) {
    .dt-hide-mobile { display: none; }
    .ui-kpi-value { font-size: 22px; }
}


/* ------------------------------------------------------------------ */
/* Sidebar icon slot (the legacy dot is a 6px round marker)            */
/* ------------------------------------------------------------------ */

.sp-nav-ico {
    flex: 0 0 18px;
    width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    color: rgba(255, 255, 255, .62);
    transition: color .18s;
}

.sp-nav-item:hover .sp-nav-ico,
.sp-nav-item.is-active .sp-nav-ico {
    color: #6ee7b7;
}

.sp-nav-item span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ================================================================== */
/* LAYER 2 — R31 typography & ergonomics overrides                    */
/* ================================================================== */

/*
 * SOREPCO V2 — Design System
 * ------------------------------------------------------------------
 * Single source of truth for typography, color, spacing, components.
 * Loaded after the compiled Tailwind bundle, so it owns the final word
 * on the platform's visual language.
 */

/* ================================================================== */
/* 1. Design tokens                                                    */
/* ================================================================== */

:root {
    /* Typography */
    --ui-font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --ui-fs-page-title: 30px;
    --ui-fs-section: 21px;
    --ui-fs-card: 17px;
    --ui-fs-kpi: 32px;
    --ui-fs-kpi-label: 15px;
    --ui-fs-body: 15.5px;
    --ui-fs-table: 14.5px;
    --ui-fs-table-head: 14px;
    --ui-fs-small: 13.5px;
    --ui-fs-tiny: 12.5px;
    --ui-lh-body: 1.55;
    --ui-lh-tight: 1.3;

    /* Colors */
    --ui-green-950: #04261d;
    --ui-green-900: #064e3b;
    --ui-green-800: #065f46;
    --ui-green-700: #047857;
    --ui-green-600: #059669;
    --ui-green-500: #10b981;
    --ui-green-200: #a7f3d0;
    --ui-green-100: #d1fae5;
    --ui-green-50: #ecfdf5;

    --ui-ink: #0d2620;
    --ui-ink-soft: #2f4a42;
    --ui-muted: #556b64;          /* AA on white (≥ 4.5:1) */
    --ui-muted-strong: #41574f;
    --ui-line: #d9e4df;
    --ui-line-soft: #e8efec;
    --ui-surface: #ffffff;
    --ui-canvas: #f5f8f6;

    --ui-amber: #8a4b06;
    --ui-amber-bg: #fff8e8;
    --ui-red: #a11d14;
    --ui-red-bg: #fdf0ef;
    --ui-blue: #1b4ba3;
    --ui-blue-bg: #eef4ff;

    /* Shape & depth */
    --ui-radius: 16px;
    --ui-radius-sm: 11px;
    --ui-radius-pill: 999px;
    --ui-shadow: 0 1px 2px rgba(10, 38, 30, .05), 0 10px 28px rgba(10, 38, 30, .06);
    --ui-shadow-soft: 0 1px 2px rgba(10, 38, 30, .04);

    /* Motion */
    --ui-transition: 200ms cubic-bezier(.2, .7, .3, 1);
    --ui-transition-fast: 160ms cubic-bezier(.2, .7, .3, 1);

    /* Layout */
    --sp-sidebar: 292px;
    --sp-header: 82px;
    --ui-sidebar-bg: linear-gradient(180deg, #075943 0%, #064434 55%, #043326 100%);
    --ui-sidebar-text: #d8e8e2;
    --ui-sidebar-muted: #b7cfc6;

    --ui-focus: 0 0 0 3px rgba(16, 185, 129, .30);
}

/* ================================================================== */
/* 2. Base & application shell                                        */
/* ================================================================== */

.sp-body {
    font-family: var(--ui-font);
    font-size: var(--ui-fs-body);
    line-height: var(--ui-lh-body);
    color: var(--ui-ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.sp-content {
    padding: 34px 36px 56px;
    font-size: var(--ui-fs-body);
    line-height: var(--ui-lh-body);
    color: var(--ui-ink);
}

.sp-page-heading {
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 26px;
}

.sp-page-heading h1 {
    margin: 6px 0 0;
    font-size: var(--ui-fs-page-title);
    line-height: var(--ui-lh-tight);
    font-weight: 750;
    letter-spacing: -.015em;
    color: var(--ui-ink);
}

.sp-release {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-green-50);
    border: 1px solid #cfeade;
    color: var(--ui-green-800);
    font-size: var(--ui-fs-tiny);
    font-weight: 650;
    letter-spacing: .02em;
}

.sp-page-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--ui-radius-pill);
    border: 1px solid var(--ui-line);
    background: #fff;
    color: var(--ui-muted-strong);
    font-size: var(--ui-fs-small);
    font-weight: 600;
    white-space: nowrap;
}

.sp-page-state span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ui-green-500);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .14);
}

/* Header */

.sp-header {
    height: var(--sp-header);
    padding: 0 28px;
}

.sp-header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-ink);
}

.sp-header-subtitle {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ui-muted);
}

.sp-icon-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--ui-line);
    background: #fff;
    color: var(--ui-ink-soft);
    font-size: 16px;
    text-decoration: none;
    transition: border-color var(--ui-transition), background var(--ui-transition), color var(--ui-transition);
}

.sp-icon-button:hover {
    border-color: var(--ui-green-200);
    background: var(--ui-green-50);
    color: var(--ui-green-800);
}

.sp-profile-button {
    min-height: 46px;
    padding: 5px 10px;
    border-radius: 13px;
    border: 1px solid transparent;
    background: transparent;
    transition: background var(--ui-transition), border-color var(--ui-transition);
}

.sp-profile-button:hover {
    background: #f4f8f6;
    border-color: var(--ui-line);
}

.sp-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 750;
}

.sp-profile-copy strong {
    font-size: 14.5px;
    font-weight: 650;
    color: var(--ui-ink);
}

.sp-profile-copy span {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ui-muted);
}

.sp-profile-menu {
    border-radius: 14px;
    box-shadow: var(--ui-shadow);
    border: 1px solid var(--ui-line);
    padding: 8px;
}

.sp-profile-menu-head strong {
    font-size: 14.5px;
}

.sp-profile-menu-head span {
    font-size: 12.5px;
    color: var(--ui-muted);
}

.sp-dropdown-item {
    font-size: 14px;
    font-weight: 550;
    padding: 10px 11px;
    border-radius: 9px;
}

/* ================================================================== */
/* 3. Sidebar drawer — hierarchical accordion                         */
/* ================================================================== */

.sp-sidebar {
    width: var(--sp-sidebar);
    background: var(--ui-sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 12px 0 40px rgba(4, 38, 29, .10);
}

.sp-brand {
    height: 84px;
    padding: 0 18px 0 20px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.sp-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, #12b981, #047857);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 19px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(4, 120, 87, .35);
}

.sp-brand-copy {
    min-width: 0;
}

.sp-brand-name {
    font-size: 17.5px;
    font-weight: 800;
    letter-spacing: .02em;
    color: #fff;
}

.sp-brand-sub {
    margin-top: 1px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ui-sidebar-muted);
    white-space: nowrap;
}

.sp-sidebar-close {
    margin-left: auto;
    color: #cfe6dd;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 9px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: none;
}

.sp-space {
    padding: 12px 20px 6px;
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ui-sidebar-muted);
}

.sp-nav {
    flex: 1;
    min-height: 0;
    padding: 6px 12px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-top: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(167, 243, 208, .35) transparent;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sp-nav::-webkit-scrollbar {
    width: 7px;
}

.sp-nav::-webkit-scrollbar-thumb {
    background: rgba(167, 243, 208, .28);
    border-radius: 999px;
}

.sp-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sp-nav-group {
    border-radius: 12px;
    margin: 0;
    scroll-margin-top: 14px;
    transition: background var(--ui-transition), box-shadow var(--ui-transition);
}

.sp-nav-group.is-open {
    background: rgba(255, 255, 255, .035);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .045);
}

.sp-nav-parent {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--ui-sidebar-text);
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: background var(--ui-transition), color var(--ui-transition);
}

.sp-nav-parent:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.sp-nav-parent:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(110, 231, 183, .7);
}

.sp-nav-group.has-active > .sp-nav-parent {
    color: #fff;
    background: rgba(255, 255, 255, .06);
    box-shadow: inset 3px 0 0 #34d399;
}

.sp-nav-group.is-open > .sp-nav-parent {
    background: rgba(255, 255, 255, .10);
    color: #fff;
}

.sp-nav-group.is-open > .sp-nav-parent .sp-nav-chevron {
    opacity: 1;
}

.sp-nav-parent-icon {
    flex: 0 0 22px;
    width: 22px;
    text-align: center;
    font-size: 15px;
    color: #7fd6b6;
    transition: color var(--ui-transition);
}

.sp-nav-group.is-open .sp-nav-parent-icon,
.sp-nav-group.has-active .sp-nav-parent-icon {
    color: #a7f3d0;
}

.sp-nav-parent-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-nav-chevron {
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    margin-right: 3px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg);
    opacity: .55;
    transition: transform var(--ui-transition), opacity var(--ui-transition);
}

.sp-nav-group.is-open .sp-nav-chevron {
    transform: rotate(-135deg);
    opacity: .9;
}

/* Collapsible body: animates without measuring heights. */
.sp-nav-children {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--ui-transition);
}

.sp-nav-group.is-open > .sp-nav-children {
    grid-template-rows: 1fr;
}

.sp-nav-children-inner {
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 4px 6px 0;
}

.sp-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    margin: 1px 4px 1px 6px;
    padding: 9px 12px 9px 26px;
    border-radius: 9px;
    color: #c6d9d2;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    position: relative;
    transition: background var(--ui-transition), color var(--ui-transition);
}

.sp-nav-bullet {
    flex: 0 0 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .32);
    transition: background var(--ui-transition), transform var(--ui-transition);
}

.sp-nav-item:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.sp-nav-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(110, 231, 183, .65);
}

.sp-nav-item.is-active {
    background: #0c7a58;
    color: #fff;
    font-weight: 650;
    box-shadow: inset 3px 0 0 #6ee7b7, 0 4px 14px rgba(3, 31, 24, .16);
}

.sp-nav-item.is-active .sp-nav-bullet {
    background: #bdf5df;
    transform: scale(1.2);
}

.sp-nav-item-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-sidebar-footer {
    padding: 15px 20px 18px;
    border-top: 1px solid rgba(255, 255, 255, .09);
}

.sp-sidebar-footer strong {
    font-size: 12.5px;
    font-weight: 700;
    color: #e6f4ee;
}

.sp-sidebar-footer span {
    font-size: 12px;
    font-weight: 500;
    color: var(--ui-sidebar-muted);
}

/* ================================================================== */
/* 4. Page building blocks                                            */
/* ================================================================== */

.ui-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    color: var(--ui-ink);
    font-size: var(--ui-fs-body);
    min-width: 0;
    max-width: 100%;
}

/* Grid/flex children must never force the page wider than the viewport. */
.ui-page > *,
.sp-content > * {
    min-width: 0;
}

.ui-hero,
.ui-panel,
.ui-grid-kpi,
.dt,
.dash-split,
.dt-scroll {
    min-width: 0;
    max-width: 100%;
}

.ui-hero {
    padding: 28px 32px;
    border-radius: 20px;
    background: linear-gradient(118deg, #054232 0%, #076c4f 62%, #0a8a60 100%);
    box-shadow: 0 14px 34px rgba(5, 71, 51, .16);
}

.ui-hero h1 {
    font-size: var(--ui-fs-page-title);
    font-weight: 750;
    letter-spacing: -.015em;
    line-height: var(--ui-lh-tight);
}

.ui-hero p {
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .90);
}

.ui-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    color: rgba(255, 255, 255, .78);
}

.ui-hero-pill {
    padding: 9px 15px;
    font-size: 13px;
    font-weight: 650;
}

.ui-grid-kpi {
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.ui-kpi {
    gap: 7px;
    padding: 20px 22px;
}

.ui-kpi-label {
    font-size: var(--ui-fs-kpi-label);
    font-weight: 600;
    color: var(--ui-muted-strong);
}

.ui-kpi-value {
    white-space: nowrap;
    font-size: var(--ui-fs-kpi);
    font-weight: 750;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.ui-kpi-hint {
    font-size: var(--ui-fs-small);
    font-weight: 500;
    color: var(--ui-muted);
}

.ui-panel {
    padding: 24px;
}

.ui-panel h2 {
    font-size: var(--ui-fs-section);
    font-weight: 700;
    color: var(--ui-ink);
}

.ui-panel h3 {
    font-size: var(--ui-fs-card);
    font-weight: 650;
}

.ui-note {
    display: block;
    padding: 14px 17px;
    border-radius: 13px;
    font-size: 14.5px;
    line-height: 1.55;
    font-weight: 500;
    color: #2b5447;
}

.ui-note > span {
    display: block;
}

.ui-note strong {
    margin-right: .3em;
}

.ui-note code,
.dt-cell-sub code {
    overflow-wrap: anywhere;
}

.ui-note strong {
    font-weight: 700;
}

.ui-alert {
    padding: 13px 16px;
    font-size: 14.5px;
    font-weight: 550;
    line-height: 1.5;
}

/* ================================================================== */
/* 5. Data table                                                      */
/* ================================================================== */

.dt {
    gap: 16px;
    padding: 22px;
}

.dt-title {
    font-size: var(--ui-fs-card);
    font-weight: 700;
}

.dt-sub {
    font-size: var(--ui-fs-small);
    font-weight: 500;
    color: var(--ui-muted);
}

.dt-btn {
    min-height: 40px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
}

.dt-toolbar {
    gap: 12px;
    padding: 14px;
    border-radius: 13px;
    background: #f7faf8;
}

.dt-field > label {
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: .02em;
    color: var(--ui-muted-strong);
}

.dt-input,
.dt-select {
    min-height: 44px;
    padding: 10px 13px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
}

.dt-input::placeholder {
    color: #8798a1;
}

.dt-meta {
    gap: 12px;
    font-size: var(--ui-fs-small);
    font-weight: 500;
    color: var(--ui-muted);
}

.dt-chip {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 650;
}

.dt-table {
    font-size: var(--ui-fs-table);
    line-height: 1.45;
}

.dt-table thead th {
    padding: 12px 14px;
    font-size: var(--ui-fs-table-head);
    font-weight: 700;
    letter-spacing: .03em;
    color: #3f574f;
    background: #f2f7f4;
}

.dt-table tbody td {
    padding: 13px 14px;
    color: var(--ui-ink);
}

.dt-cell-strong {
    font-weight: 650;
    color: var(--ui-ink);
    font-size: 14.5px;
}

.dt-cell-sub {
    margin-top: 2px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ui-muted);
}

.dt-table td.is-right,
.dt-table th.is-right {
    font-variant-numeric: tabular-nums;
}

.dt-table td.is-right {
    font-weight: 600;
}

.dt-badge {
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .02em;
}

.dt-empty {
    padding: 52px 20px;
}

.dt-empty strong {
    font-size: 16px;
    font-weight: 700;
}

.dt-empty span {
    font-size: 14px;
    font-weight: 500;
    color: var(--ui-muted);
}

.dt-empty-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
    border-radius: 17px;
}

.dt-foot {
    padding-top: 4px;
}

.dt-range {
    font-size: 13.5px;
    font-weight: 550;
    color: var(--ui-muted-strong);
}

.dt-pager a,
.dt-pager span {
    min-width: 38px;
    height: 38px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 9px;
}

.dt-loading {
    font-size: 13px;
    font-weight: 650;
}

/* ================================================================== */
/* 6. Forms                                                           */
/* ================================================================== */

.ui-field > label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-ink-soft);
}

.ui-field input,
.ui-field select,
.ui-field textarea {
    min-height: 46px;
    padding: 11px 13px;
    font-size: 15.5px;
    font-weight: 500;
    border-radius: 11px;
}

.ui-field textarea {
    min-height: 110px;
}

.ui-hint {
    font-size: 13px;
    font-weight: 500;
    color: var(--ui-muted);
}

.ui-error {
    font-size: 13.5px;
    font-weight: 600;
}

/* ================================================================== */
/* 7. Compatibility layer for legacy detail screens                   */
/* ================================================================== */

/* Tables rendered by older screens (still using their own classes). */
.sp-content table:not(.dt-table) {
    font-size: 15px;
    line-height: 1.45;
}

.sp-content table:not(.dt-table) th {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .03em;
    color: #3f574f;
    padding: 11px 12px;
}

.sp-content table:not(.dt-table) td {
    padding: 11px 12px;
    color: var(--ui-ink);
}

.sp-content table:not(.dt-table) small {
    font-size: 12.5px;
    color: var(--ui-muted);
}

/* Body copy from older screens. */
.sp-content p,
.sp-content li {
    font-size: 15px;
    line-height: 1.6;
}

.sp-content p small,
.sp-content li small {
    font-size: 13px;
}

/* Forms rendered by older screens. */
.sp-content input:not([type="checkbox"]):not([type="radio"]):not(.dt-input),
.sp-content select:not(.dt-select),
.sp-content textarea {
    font-size: 15px;
    min-height: 42px;
    color: var(--ui-ink);
}

.sp-content input:not([type="checkbox"]):not([type="radio"]):not(.dt-input):focus,
.sp-content select:not(.dt-select):focus,
.sp-content textarea:focus {
    outline: none;
    border-color: var(--ui-green-500);
    box-shadow: var(--ui-focus);
}

.sp-content label {
    font-size: 13.5px;
    font-weight: 550;
    color: var(--ui-ink-soft);
}

.sp-content small {
    font-size: 12.5px;
    color: var(--ui-muted);
}

/* Buttons from older screens. */
.sp-content .cp-btn,
.sp-content .c-btn,
.sp-content .op-btn,
.sp-content .rs-btn,
.sp-content .t0-tag {
    min-height: 40px;
    font-size: 14px;
    font-weight: 600;
}

/* Legacy cards must not force horizontal scrolling on small screens. */
.sp-content .c360-card,
.sp-content .t0-panel,
.sp-content .r18-card,
.sp-content .op-panel,
.sp-content .rs-card,
.sp-content .cp-card,
.sp-content .c-card {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

.sp-content .c360-grid,
.sp-content .dash-split,
.sp-content [class$="-grid"] {
    min-width: 0;
}

.sp-content .c360-table,
.sp-content .t0-table,
.sp-content .r18-table,
.sp-content .op-table,
.sp-content .rs-table,
.sp-content .cp-table,
.sp-content .c-table,
.sp-content .r17-table {
    max-width: 100%;
}

/* Dashboard chart: horizontal scroll instead of page overflow. */
.dash-chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
}

.dash-chart-scroll .dash-flow,
.dash-chart-scroll .dash-xlabels {
    min-width: 680px;
}

/* Mobile: legacy two-column blocks collapse cleanly. */
@media (max-width: 900px) {
    .sp-content .c360-grid,
    .sp-content [class$="-split"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* Legacy hero blocks keep their identity but gain breathing room. */
.sp-content .cp-hero,
.sp-content .c-hero,
.sp-content .r18-hero,
.sp-content .t0-hero,
.sp-content .c360-hero,
.sp-content .rs-hero {
    border-radius: 20px;
}

.sp-content .cp-hero h1,
.sp-content .c-hero h1,
.sp-content .c360-hero h1,
.sp-content .rs-hero h1 {
    font-size: 27px;
    font-weight: 750;
    line-height: 1.2;
}

/* ================================================================== */
/* 8. Dashboard specifics                                             */
/* ================================================================== */

.dash-legend,
.dash-xlabels span {
    font-size: 12.5px;
    font-weight: 600;
}

.dash-rank-row {
    font-size: 14px;
    padding: 11px 13px;
}

.dash-feed-ref {
    font-size: 14px;
    font-weight: 650;
}

.dash-feed-meta {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ui-muted);
}

.dash-feed-amount {
    font-size: 14.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.dash-health-row {
    font-size: 13.5px;
    font-weight: 550;
}

.dash-health-pill {
    font-size: 12px;
    font-weight: 700;
}

/* ================================================================== */
/* 9. Accessibility & responsive                                      */
/* ================================================================== */

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--ui-green-600);
    outline-offset: 2px;
}

.dt-btn:focus-visible,
.sp-nav-parent:focus-visible,
.sp-nav-item:focus-visible {
    outline: none;
    box-shadow: var(--ui-focus);
}

/* Tablets: the drawer becomes an overlay before the content gets cramped. */
@media (max-width: 1024px) {
    .sp-sidebar {
        transition: transform var(--ui-transition);
        transform: translate(-102%);
    }

    body.sp-sidebar-open .sp-sidebar {
        transform: translate(0);
    }

    body.sp-sidebar-open .sp-sidebar-overlay {
        display: block;
        background: rgba(4, 38, 29, .46);
        backdrop-filter: blur(2px);
    }

    .sp-main {
        margin-left: 0;
    }

    .sp-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        font-size: 18px;
        color: var(--ui-ink);
    }

    .sp-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 1280px) {
    .sp-content {
        padding: 28px 26px 48px;
    }
}

@media (max-width: 900px) {
    :root {
        --ui-fs-page-title: 25px;
        --ui-fs-kpi: 27px;
        --ui-fs-section: 19px;
        --ui-fs-body: 15px;
    }

    .sp-header {
        padding: 0 16px;
    }

    .sp-header-title {
        font-size: 15px;
    }

    .ui-hero {
        padding: 22px;
        border-radius: 17px;
    }

    .ui-hero h1 {
        font-size: 24px;
    }

    .sp-content {
        padding: 20px 16px 44px;
    }

    .dt {
        padding: 15px;
    }

    .dt-table {
        font-size: 14px;
    }

    .dt-table thead th,
    .dt-table tbody td {
        padding: 11px 11px;
    }

    .sp-nav-parent {
        min-height: 48px;
        font-size: 15px;
    }
}

@media (max-width: 640px) {
    .dt-hide-mobile {
        display: none;
    }

    .ui-kpi-value {
        font-size: 24px;
    }

    .dt-table thead th {
        font-size: 12.5px;
    }
}


/* ================================================================== */
/* 10. Right Content Drawer (isolated component)                      */
/* ================================================================== */

body.cd-open {
    overflow: hidden;
}

.cd-root {
    position: fixed;
    inset: 0;
    z-index: 120;
}

.cd-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 32, 24, .42);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity var(--ui-transition);
}

.cd-root.is-open .cd-backdrop {
    opacity: 1;
}

.cd-shell {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(780px, 94vw);
    height: 100dvh;
    background: var(--ui-canvas);
    border-left: 1px solid rgba(6, 78, 59, .10);
    box-shadow: -24px 0 60px rgba(4, 32, 24, .22);
    transform: translateX(102%);
    transition: transform 260ms cubic-bezier(.22, .7, .25, 1);
    outline: none;
}

.cd-root.is-open .cd-shell {
    transform: translateX(0);
}

.cd-header {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    background: #fff;
    border-bottom: 1px solid var(--ui-line);
    position: sticky;
    top: 0;
    z-index: 2;
}

.cd-heading {
    min-width: 0;
}

.cd-eyebrow {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ui-green-700);
}

.cd-title {
    margin: 6px 0 2px;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -.01em;
    color: var(--ui-ink);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cd-subtitle {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--ui-muted);
    min-height: 20px;
}

.cd-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.cd-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--ui-line);
    background: #fff;
    color: var(--ui-ink-soft);
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background var(--ui-transition), border-color var(--ui-transition), color var(--ui-transition);
}

.cd-icon-btn:hover:not(:disabled) {
    background: var(--ui-green-50);
    border-color: var(--ui-green-200);
    color: var(--ui-green-800);
}

.cd-icon-btn:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.cd-close {
    font-size: 20px;
}

.cd-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cd-body > * {
    flex: 0 0 auto;
    min-width: 0;
}

.cd-footer {
    flex: 0 0 auto;
    padding: 14px 24px;
    background: #fff;
    border-top: 1px solid var(--ui-line);
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.cd-footer .cd-actions {
    margin: 0;
}

.cd-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-line);
    background: #fff;
    box-shadow: var(--ui-shadow-soft);
}

.cd-avatar {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #d7f7e8, #b7ecd7);
    color: var(--ui-green-800);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .01em;
}

.cd-identity-copy {
    min-width: 0;
    flex: 1;
}

.cd-identity-name {
    font-size: 18px;
    font-weight: 750;
    color: var(--ui-ink);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cd-identity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 4px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ui-muted);
}

.cd-identity-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cd-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.cd-kpis-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cd-kpi {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid var(--ui-line);
    background: #fff;
}

.cd-kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted-strong);
}

.cd-kpi-value {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -.015em;
    color: var(--ui-green-900);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cd-kpi-value.cd-kpi-text {
    font-size: 15px;
    font-weight: 650;
    white-space: normal;
}

.cd-kpi-hint {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ui-muted);
}

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

.cd-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-ink);
}

.cd-fields {
    display: grid;
    gap: 11px;
}

.cd-fields-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
}

.cd-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--ui-line-soft);
}

.cd-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ui-muted);
}

.cd-value {
    font-size: 14.5px;
    font-weight: 550;
    color: var(--ui-ink);
    overflow-wrap: anywhere;
}

.cd-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ui-line-soft);
    border-radius: 11px;
}

.cd-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.cd-table thead th {
    padding: 9px 11px;
    background: #f3f8f5;
    border-bottom: 1px solid var(--ui-line);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #3f574f;
    text-align: left;
    white-space: nowrap;
}

.cd-table tbody td {
    padding: 9px 11px;
    border-bottom: 1px solid var(--ui-line-soft);
    color: var(--ui-ink);
    vertical-align: middle;
}

.cd-table tbody tr:last-child td {
    border-bottom: 0;
}

.cd-table td.is-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.cd-empty {
    margin: 4px 0;
    padding: 18px;
    border-radius: 11px;
    background: #f7faf8;
    font-size: 14px;
    font-weight: 500;
    color: var(--ui-muted);
    text-align: center;
}

.cd-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 4px;
}

/* Tabs */
.cd-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--ui-line);
    background: #fff;
}

.cd-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 13px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ui-muted-strong);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--ui-transition), color var(--ui-transition);
}

.cd-tab:hover {
    background: var(--ui-green-50);
    color: var(--ui-green-800);
}

.cd-tab.is-active {
    background: var(--ui-green-700);
    color: #fff;
}

.cd-panels {
    display: grid;
    gap: 14px;
}

.cd-panel {
    display: none;
    gap: 14px;
}

.cd-panel.is-active {
    display: grid;
}

/* Skeleton */
.cd-skeleton {
    display: grid;
    gap: 12px;
}

.cd-skel-line,
.cd-skel-box {
    border-radius: 10px;
    background: linear-gradient(90deg, #eef4f1 25%, #f7fbf9 37%, #eef4f1 63%);
    background-size: 400% 100%;
    animation: cd-shimmer 1.25s ease-in-out infinite;
}

.cd-skel-line {
    height: 14px;
}

.cd-skel-line.cd-skel-lg {
    height: 26px;
    width: 42%;
}

.cd-skel-line.cd-skel-sm {
    width: 68%;
}

.cd-skel-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 8px 0;
}

.cd-skel-box {
    height: 78px;
}

@keyframes cd-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* Error state */
.cd-error {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 34px 20px;
    text-align: center;
}

.cd-error-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--ui-red-bg);
    color: var(--ui-red);
    font-size: 22px;
    font-weight: 800;
}

.cd-error h3 {
    margin: 4px 0 0;
    font-size: 17px;
    font-weight: 700;
}

.cd-error p {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ui-muted);
}

/* Active table row while its detail is open */
.dt-table tbody tr.is-drawer-active {
    background: #eaf8f1 !important;
    box-shadow: inset 3px 0 0 var(--ui-green-600);
}

@media (max-width: 900px) {
    .cd-shell {
        width: 94vw;
    }
}

@media (max-width: 640px) {
    .cd-shell {
        width: 100vw;
        border-left: 0;
    }

    .cd-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .cd-identity {
        flex-wrap: wrap;
        row-gap: 10px;
        padding: 14px 15px;
    }

    .cd-avatar {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .cd-identity-copy {
        flex: 1 1 calc(100% - 60px);
    }

    .cd-identity-name {
        white-space: normal;
        overflow: visible;
    }

    .cd-identity-badges {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .cd-footer .cd-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .cd-footer .dt-btn {
        width: 100%;
        justify-content: center;
    }

    .cd-header {
        padding: 16px 16px 13px;
    }

    .cd-title {
        font-size: 19px;
    }

    .cd-body {
        padding: 16px 16px 26px;
    }

    .cd-footer {
        padding: 12px 16px;
    }

    .cd-fields-2,
    .cd-kpis-3 {
        grid-template-columns: minmax(0, 1fr);
    }
}


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* ================================================================== */
/* 11. Loyalty components                                             */
/* ================================================================== */

.loy-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.loy-chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
}

.loy-chart-scroll .loy-chart,
.loy-chart-scroll .loy-x {
    min-width: 660px;
}

@media (max-width: 900px) {
    .loy-split {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

.loyalty-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
}

.loyalty-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: #e6efeb;
    overflow: hidden;
}

.loyalty-progress-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #047857);
}

.loyalty-progress-text {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ui-muted);
    font-variant-numeric: tabular-nums;
}

/* Loyalty layout & charts */
.loy-hint {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted);
}

.loy-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    padding: 12px 4px 0;
    border-bottom: 1px solid var(--ui-line);
}

.loy-col {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    gap: 3px;
}

.loy-bar {
    flex: 1;
    border-radius: 4px 4px 1px 1px;
    min-height: 3px;
}

.loy-bar.g { background: linear-gradient(180deg, #0ca678, #047857); }
.loy-bar.b { background: linear-gradient(180deg, #60a5fa, #1d4ed8); }
.loy-bar.r { background: linear-gradient(180deg, #f87171, #dc2626); }

.loy-x {
    display: flex;
    gap: 8px;
    padding-top: 7px;
}

.loy-x span {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted);
}

.loy-legend {
    display: flex;
    gap: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted-strong);
}

.loy-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    margin-right: 5px;
}

.loy-dot.g { background: #047857; }
.loy-dot.b { background: #1d4ed8; }
.loy-dot.r { background: #dc2626; }

.loy-split-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.loy-inline-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.loy-run-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.loy-check-grid {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--ui-ink);
}

.loy-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
}

.loy-confirm {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-ink);
}

.loy-rank { display: grid; gap: 8px; }

.loy-rank-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #f7faf9;
    font-size: 14px;
}

.loy-rank-track {
    grid-column: 1 / -1;
    height: 5px;
    border-radius: 999px;
    background: #e6efeb;
    overflow: hidden;
}

.loy-rank-fill {
    height: 100%;
    background: var(--ui-green-600);
    border-radius: 999px;
}

.loy-period {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.loy-period .dt-field { min-width: 150px; }
.loy-period .dt-field label { color: rgba(255, 255, 255, .85); }
.loy-period .dt-btn { min-height: 44px; }

.loy-job-schedule {
    font-size: 18px;
    line-height: 1.35;
}

.loy-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.loy-toolbar {
    display: flex;
    justify-content: flex-end;
}

.loy-form-note {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted);
}

.dt-btn.is-compact {
    padding: 6px 10px;
    font-size: 13px;
}

/* ================================================================== */
/* 12. POS laboratory and virtual terminal                            */
/* ================================================================== */

.pos-scope {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
    z-index: 1;
}

.pos-scope a,
.pos-scope span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .35);
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.pos-scope a.is-active {
    background: #fff;
    color: var(--ui-green-800);
    border-color: #fff;
}

.pos-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 170px;
    padding-top: 12px;
    border-bottom: 1px solid var(--ui-line);
    overflow-x: auto;
}

.pos-chart-col {
    flex: 1;
    min-width: 14px;
    height: 100%;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.pos-bar {
    flex: 1;
    min-height: 3px;
    border-radius: 4px 4px 1px 1px;
}

.pos-bar.ok { background: linear-gradient(180deg, #10b981, #047857); }
.pos-bar.ko { background: linear-gradient(180deg, #f87171, #dc2626); }

.pos-chart-x {
    display: flex;
    gap: 6px;
    padding-top: 6px;
    overflow-x: auto;
}

.pos-chart-x span {
    flex: 1;
    min-width: 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted);
}

.pos-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.pos-flow-step {
    padding: 11px 12px;
    border-radius: 12px;
    background: #f7faf9;
    border: 1px solid var(--ui-line);
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted-strong);
}

.pos-flow-step strong {
    display: block;
    color: var(--ui-ink);
    font-size: 14px;
    margin-bottom: 3px;
}

.pos-terminal-shell {
    max-width: 520px;
    margin: 0 auto;
    border-radius: 26px;
    padding: 18px;
    background: linear-gradient(160deg, #0b1f19, #123b2e 55%, #0b1f19);
    box-shadow: 0 18px 40px rgba(8, 40, 30, .28);
    color: #eafaf3;
}

.pos-terminal-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #9fe3c9;
}

.pos-screen {
    margin-top: 14px;
    border-radius: 18px;
    background: #04120d;
    border: 1px solid rgba(159, 227, 201, .25);
    padding: 16px;
    min-height: 156px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-screen-label {
    font-size: 13px;
    font-weight: 700;
    color: #85b8a5;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pos-amount {
    font-size: 36px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    color: #ffffff;
    line-height: 1.1;
}

.pos-amount small {
    font-size: 15px;
    font-weight: 700;
    color: #9fe3c9;
    margin-left: 5px;
}

.pos-screen-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #b7d9cc;
}

.pos-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #d7f5e9;
}

.pos-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .18);
}

.pos-status.is-error .pos-status-dot { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .2); }
.pos-status.is-wait .pos-status-dot { background: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, .2); }

.pos-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.pos-key {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(159, 227, 201, .28);
    background: rgba(255, 255, 255, .06);
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
}

.pos-key:hover { background: rgba(255, 255, 255, .14); }
.pos-key:active { transform: scale(.97); }
.pos-key.is-action { background: rgba(16, 185, 129, .25); border-color: rgba(52, 211, 153, .5); }
.pos-key.is-clear { background: rgba(248, 113, 113, .18); border-color: rgba(248, 113, 113, .4); }

.pos-terminal-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pos-terminal-actions .dt-btn { flex: 1; justify-content: center; }

.pos-result {
    margin-top: 14px;
    border-radius: 14px;
    border: 1px solid var(--ui-line);
    background: #fff;
    padding: 14px;
    font-size: 14px;
    color: var(--ui-ink);
}

.pos-result.is-error { border-color: #fecaca; background: #fff7f7; }
.pos-result.is-ok { border-color: #bbf7d0; background: #f2fdf7; }

.pos-result pre {
    margin: 10px 0 0;
    padding: 10px;
    border-radius: 10px;
    background: #0b1f19;
    color: #d1fae5;
    font-size: 12.5px;
    overflow-x: auto;
}

.pos-lab-category {
    margin-top: 18px;
}

.pos-lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

.pos-lab-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px;
    border-radius: 12px;
    border: 1px solid var(--ui-line);
    background: #fff;
}

.pos-lab-card strong { font-size: 14px; color: var(--ui-ink); }
.pos-lab-card small { font-size: 13px; color: var(--ui-muted); font-weight: 600; }

.pos-lab-card form { margin-top: auto; }

.pos-lab-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 4px;
}

.pos-doc-table code {
    font-size: 13px;
    background: #f1f7f4;
    border-radius: 6px;
    padding: 2px 6px;
}

.pos-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.pos-inline .dt-field { min-width: 140px; }

.pos-note {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted);
    margin: 0;
}

/* ================================================================== */
/* 13. POS deployment center                                          */
/* ================================================================== */

.dep-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.dep-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-soft);
}

.dep-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--ui-muted-strong);
    font-size: 14px;
    font-weight: 750;
    letter-spacing: .02em;
    text-decoration: none;
    transition: background var(--ui-transition-fast), color var(--ui-transition-fast);
}

.dep-tab:hover {
    background: var(--ui-green-50);
    color: var(--ui-green-800);
}

.dep-tab:focus-visible {
    outline: none;
    box-shadow: var(--ui-focus);
}

.dep-tab.is-active {
    background: var(--ui-green-900);
    color: #fff;
}

.dep-tab.is-active.is-test {
    background: #9a5a08;
}

.dep-tab.is-active.is-prod {
    background: var(--ui-green-800);
}

.dep-tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: .65;
}

.dep-scope {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    background: var(--ui-surface);
}

.dep-scope a {
    min-height: 34px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    border-radius: 9px;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.dep-scope a.is-active {
    background: var(--ui-green-50);
    color: var(--ui-green-800);
}

.dep-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dep-empty {
    text-align: center;
    align-items: center;
}

.dep-empty h2 {
    margin: 0;
}

.dep-empty p {
    max-width: 640px;
    margin: 0 auto;
    color: var(--ui-muted);
    font-size: 14.5px;
}

.dep-release-head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dep-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(4, 38, 29, .18);
}

.dep-release-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 260px;
}

.dep-version {
    margin: 0;
    font-size: 23px;
    font-weight: 850;
    letter-spacing: -.02em;
    color: var(--ui-green-900);
}

.dep-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dep-release-download {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-left: auto;
}

.dep-release-download span {
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 650;
}

.dep-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.dep-meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border: 1px solid var(--ui-line-soft);
    border-radius: 12px;
    background: #fbfdfc;
}

.dep-meta-item span {
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 650;
}

.dep-meta-item strong {
    color: var(--ui-ink);
    font-size: 14px;
    font-weight: 750;
    word-break: break-word;
}

.dep-notes {
    padding: 14px 16px;
    border: 1px solid var(--ui-line-soft);
    border-radius: 12px;
    background: var(--ui-green-50);
}

.dep-notes span {
    display: block;
    margin-bottom: 4px;
    color: var(--ui-green-800);
    font-size: 13px;
    font-weight: 800;
}

.dep-notes p {
    margin: 0;
    color: var(--ui-ink-soft);
    font-size: 14px;
    line-height: 1.55;
}

.dep-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dep-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.dep-card-head h2 {
    margin: 2px 0 0;
    font-size: 18px;
    font-weight: 800;
}

.dep-help {
    margin: 0;
    color: var(--ui-muted);
    font-size: 13px;
    line-height: 1.5;
}

.dep-qr {
    display: grid;
    place-items: center;
    padding: 18px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: #fff;
    min-height: 220px;
}

.dep-qr svg {
    width: 100%;
    max-width: 260px;
    height: auto;
    display: block;
}

.dep-qr-fallback {
    color: var(--ui-muted);
    font-size: 13.5px;
    text-align: center;
}

.dep-field-label {
    display: block;
    margin-bottom: -8px;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 700;
}

.dep-link-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.dep-link-row .dt-input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dep-link-row .dt-btn {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
}

.dep-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dep-actions .dt-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.dep-tech-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dep-tech-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--ui-line-soft);
    border-radius: 12px;
    background: #fbfdfc;
}

.dep-tech-item > span:first-child {
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 700;
}

.dep-tech-item strong {
    font-size: 14.5px;
    font-weight: 750;
}

.dep-code {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f3f8f5;
    color: var(--ui-ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    line-height: 1.5;
    word-break: break-all;
}

.dep-ok { color: var(--ui-green-700); }
.dep-ko { color: var(--ui-red); }

.dep-source-wrap {
    overflow-x: auto;
    border: 1px solid var(--ui-line-soft);
    border-radius: 12px;
}

.dep-source-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.dep-source-table th {
    padding: 10px 14px;
    background: #f6faf8;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 750;
    text-align: left;
    white-space: nowrap;
}

.dep-source-table td {
    padding: 10px 14px;
    border-top: 1px solid var(--ui-line-soft);
    color: var(--ui-ink-soft);
    vertical-align: top;
}

.dep-source-table td strong {
    display: block;
    color: var(--ui-ink);
    font-size: 13.5px;
    font-weight: 750;
}

.dep-source-table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
}

.dep-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.dep-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dep-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.dep-section-head h2 {
    margin: 2px 0 0;
    font-size: 20px;
    font-weight: 850;
}

.dep-source-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.dep-mini {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    background: var(--ui-surface);
}

.dep-mini strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--ui-green-900);
}

.dep-mini span:not(.dt-badge) {
    color: var(--ui-muted);
    font-size: 13px;
}

@media (max-width: 1100px) {
    .dep-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .dep-tech-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dep-release-download {
        align-items: flex-start;
        margin-left: 0;
    }

    .dep-link-row {
        flex-direction: column;
    }

    .dep-link-row .dt-btn {
        width: 100%;
        justify-content: center;
    }
}
