/* ==========================================================================
   CEPS-CMD  •  UI design system
   Loaded LAST on every page (see layouts/partials/head.blade.php).
   Selectors are prefixed with `body` where they must beat the older
   page-level <style> blocks and the legacy public/css/style.css.
   ========================================================================== */

:root {
    /* Surfaces */
    --ui-bg: #f3f5f9;
    --ui-surface: #ffffff;
    --ui-surface-2: #f8fafc;
    --ui-line: #e3e8f0;
    --ui-line-strong: #cfd7e3;

    /* Ink */
    --ui-ink: #0c1b2e;          /* nav + headings */
    --ui-text: #1f2d3d;
    --ui-muted: #64748b;
    --ui-faint: #94a3b8;

    /* Brand */
    --ui-brand: #0a6a94;
    --ui-brand-600: #085a7d;
    --ui-brand-50: #e8f3f8;
    --ui-heat: #f5a524;         /* foundry-heat accent: active nav, open items */
    --ui-heat-50: #fff4de;

    /* Status */
    --ui-ok: #047857;
    --ui-ok-50: #dcfce9;
    --ui-warn: #b45309;
    --ui-warn-50: #fef0cf;
    --ui-bad: #c62828;
    --ui-bad-50: #fde8e8;

    /* Shape + depth */
    --ui-r-sm: 8px;
    --ui-r: 12px;
    --ui-r-lg: 18px;
    --ui-shadow-1: 0 1px 2px rgba(12, 27, 46, .06), 0 1px 3px rgba(12, 27, 46, .05);
    --ui-shadow-2: 0 8px 24px rgba(12, 27, 46, .10);
    --ui-shadow-3: 0 24px 60px rgba(12, 27, 46, .28);

    --ui-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --ui-nav-h: 60px;
    --ui-safe-b: env(safe-area-inset-bottom, 0px);
    --ui-safe-t: env(safe-area-inset-top, 0px);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }

body.ui-body {
    font-family: var(--ui-font);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ui-text);
    background: var(--ui-bg) !important;
    padding-top: calc(var(--ui-nav-h) + var(--ui-safe-t));
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.ui-body h1, body.ui-body h2, body.ui-body h3,
body.ui-body h4, body.ui-body h5, body.ui-body h6 {
    font-family: var(--ui-font);
    color: var(--ui-ink);
    font-weight: 700;
    letter-spacing: -.01em;
}

body.ui-body a { text-decoration: none; }
body.ui-body a:focus-visible,
body.ui-body button:focus-visible,
body.ui-body input:focus-visible,
body.ui-body select:focus-visible,
body.ui-body textarea:focus-visible {
    outline: 3px solid rgba(10, 106, 148, .35);
    outline-offset: 2px;
}

body.ui-body .container { max-width: 100% !important; }

/* Page wrapper used by the redesigned views */
.ui-page {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px clamp(14px, 3vw, 32px) 48px;
}

/* ---------- Top navigation ---------- */
.ui-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1040;
    height: calc(var(--ui-nav-h) + var(--ui-safe-t));
    padding-top: var(--ui-safe-t);
    background: var(--ui-ink);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.ui-nav-inner {
    height: var(--ui-nav-h);
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 clamp(14px, 3vw, 32px);
    display: flex;
    align-items: center;
    gap: 20px;
}
.ui-brand {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 5px 10px;
    flex-shrink: 0;
}
.ui-brand img { height: 32px; width: auto; display: block; }

.ui-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
body .ui-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    color: #c8d3e1;
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    transition: background .15s, color .15s;
}
body .ui-link:hover { background: rgba(255, 255, 255, .08); color: #fff; transform: none; }
body .ui-link.active { color: #fff; background: rgba(255, 255, 255, .1); animation: none; font-weight: 700; }
body .ui-link.active::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px; bottom: 3px;
    height: 3px;
    border-radius: 3px;
    background: var(--ui-heat);
}

.ui-nav-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ui-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 4px;
    background: rgba(255, 255, 255, .08);
    border: 0;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    box-shadow: none;
}
body .ui-user:hover { background: rgba(255, 255, 255, .15); transform: none; box-shadow: none; }
.ui-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ui-heat);
    color: #1a1204;
    font-weight: 800;
    font-size: 13px;
}
.ui-user-name { padding-right: 8px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ui-menu {
    position: absolute;
    right: clamp(14px, 3vw, 32px);
    top: calc(var(--ui-nav-h) - 4px);
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r);
    box-shadow: var(--ui-shadow-2);
    padding: 6px;
    display: none;
}
.ui-menu.open { display: block; }
.ui-menu a, .ui-menu button {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 10px 12px;
    color: var(--ui-text);
    font-weight: 600; font-size: 14px;
    background: none; border: 0; border-radius: 8px;
    text-align: left;
    box-shadow: none;
}
body .ui-menu a:hover, body .ui-menu button:hover { background: var(--ui-surface-2); transform: none; box-shadow: none; color: var(--ui-ink); }
.ui-menu i { width: 18px; color: var(--ui-muted); }
.ui-menu .danger, .ui-menu .danger i { color: var(--ui-bad); }

.ui-burger {
    display: none;
    width: 42px; height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    border: 0;
    color: #fff;
    font-size: 18px;
    box-shadow: none;
}
body .ui-burger:hover { transform: none; box-shadow: none; background: rgba(255, 255, 255, .15); }

@media (max-width: 767.98px) {
    :root { --ui-nav-h: 56px; }
    .ui-brand img { height: 28px; }
    .ui-burger { display: inline-grid; place-items: center; }
    .ui-user-name { display: none; }
    .ui-nav-end { margin-left: auto; }
    .ui-links {
        position: absolute;
        left: 0; right: 0;
        top: var(--ui-nav-h);
        margin: 0;
        padding: 10px 14px 14px;
        flex-direction: column;
        align-items: stretch;
        background: var(--ui-ink);
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        box-shadow: 0 18px 30px rgba(0, 0, 0, .3);
        display: none;
    }
    .ui-links.open { display: flex; }
    body .ui-link { padding: 13px 14px; font-size: 15px; }
    body .ui-link.active::after { left: 0; right: auto; width: 4px; top: 10px; bottom: 10px; height: auto; }
    .ui-menu { left: 14px; right: 14px; }
}

/* ---------- Page header ---------- */
.ui-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.ui-title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); margin: 0; line-height: 1.15; }
.ui-sub { margin: 4px 0 0; color: var(--ui-muted); font-size: 13.5px; }

/* ---------- Buttons ---------- */
body .ui-btn,
body .btn-new,
body .btn-apply,
body .btn-submit,
body .btn-pnpp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    font-family: var(--ui-font);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: var(--ui-r-sm);
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
    text-decoration: none;
    white-space: nowrap;
}
body .ui-btn:active, body .btn-new:active, body .btn-apply:active,
body .btn-submit:active, body .btn-pnpp:active { transform: scale(.98); }

body .ui-btn-primary,
body .btn-new,
body .btn-apply,
body .btn-submit,
body .btn-pnpp-primary {
    background: var(--ui-brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(10, 106, 148, .35), inset 0 1px 0 rgba(255, 255, 255, .14);
}
body .ui-btn-primary:hover,
body .btn-new:hover,
body .btn-apply:hover,
body .btn-submit:hover,
body .btn-pnpp-primary:hover {
    background: var(--ui-brand-600);
    color: #fff;
    transform: none;
    box-shadow: 0 6px 16px rgba(10, 106, 148, .3);
    opacity: 1;
}
body .ui-btn-ghost,
body .btn-pnpp-secondary,
body .btn-cancel,
body .btn-reset {
    background: #fff;
    color: var(--ui-text);
    border-color: var(--ui-line-strong);
    box-shadow: none;
}
body .ui-btn-ghost:hover,
body .btn-pnpp-secondary:hover,
body .btn-cancel:hover,
body .btn-reset:hover { background: var(--ui-surface-2); color: var(--ui-ink); transform: none; }

/* Neutralise the legacy gradient on bare <button> from style.css */
body.ui-body button:not([class]),
body.ui-body .btn:not([class*="btn-"]) { font-family: var(--ui-font); }

/* Bootstrap buttons -> same visual language */
body .btn { border-radius: var(--ui-r-sm); font-weight: 700; font-size: 14px; box-shadow: none; transition: background .15s, box-shadow .15s; }
body .btn:hover { transform: none; }
body .btn-primary { background: var(--ui-brand); border-color: var(--ui-brand); color: #fff; }
body .btn-primary:hover { background: var(--ui-brand-600); border-color: var(--ui-brand-600); }
body .btn-success { background: var(--ui-ok); border-color: var(--ui-ok); color: #fff; }
body .btn-danger { background: var(--ui-bad); border-color: var(--ui-bad); color: #fff; }
body .btn-secondary { background: #fff; border-color: var(--ui-line-strong); color: var(--ui-text); }

/* ---------- Floating download button (old .download-icon) ---------- */
body .download-icon {
    position: fixed;
    right: 18px;
    bottom: calc(18px + var(--ui-safe-b));
    width: 52px; height: 52px;
    padding: 0;
    display: grid; place-items: center;
    background: var(--ui-ink);
    color: #fff;
    border-radius: 16px;
    font-size: 18px;
    box-shadow: var(--ui-shadow-2);
    z-index: 1030;
    transition: transform .15s, background .15s;
}
body .download-icon:hover { background: var(--ui-brand); color: #fff; transform: translateY(-2px); }

/* ---------- Cards / stats ---------- */
.ui-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-lg);
    box-shadow: var(--ui-shadow-1);
}

.ui-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.ui-stat {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-lg);
    box-shadow: var(--ui-shadow-1);
    overflow: hidden;
}
.ui-stat::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--tone, var(--ui-brand));
}
.ui-stat-label { font-size: 12.5px; font-weight: 600; color: var(--ui-muted); margin-bottom: 4px; }
.ui-stat-value { font-size: 1.7rem; font-weight: 800; color: var(--ui-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ui-stat-value.sm { font-size: 1.25rem; }
.ui-stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 18px;
    color: var(--tone, var(--ui-brand));
    background: var(--ui-brand-50);
    background: color-mix(in srgb, var(--tone, var(--ui-brand)) 12%, #fff);
    flex-shrink: 0;
}
.ui-stat.t-blue   { --tone: #0a6a94; }
.ui-stat.t-amber  { --tone: #d98a0b; }
.ui-stat.t-green  { --tone: #0f9d6b; }
.ui-stat.t-indigo { --tone: #5b5fd6; }

/* ---------- Filter panel ---------- */
.ui-filter {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-lg);
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: var(--ui-shadow-1);
}
.ui-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px 14px;
    align-items: end;
}
.ui-field label,
body .pnpp-filter-field label {
    display: block;
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ui-muted);
    text-transform: none;
    letter-spacing: 0;
}
.ui-field select, .ui-field input,
body .pnpp-filter-field select, body .pnpp-filter-field input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    font-family: var(--ui-font);
    font-size: 14px;
    color: var(--ui-text);
    background-color: #fff;
    border: 1px solid var(--ui-line-strong);
    border-radius: var(--ui-r-sm);
    transition: border-color .15s, box-shadow .15s;
}
.ui-field select:focus, .ui-field input:focus,
body .pnpp-filter-field select:focus, body .pnpp-filter-field input:focus {
    outline: none;
    border-color: var(--ui-brand);
    box-shadow: 0 0 0 3px rgba(10, 106, 148, .15);
}
body .pnpp-filter-actions { display: flex; gap: 8px; }
body .pnpp-btn-filter {
    flex: 1; min-height: 42px; padding: 9px 14px;
    font-family: var(--ui-font); font-size: 14px; font-weight: 700;
    border-radius: var(--ui-r-sm); border: 1px solid transparent; box-shadow: none;
}
body .pnpp-btn-filter-apply { background: var(--ui-brand); color: #fff; }
body .pnpp-btn-filter-apply:hover { background: var(--ui-brand-600); transform: none; box-shadow: none; }
body .pnpp-btn-filter-reset { background: #fff; color: var(--ui-text); border-color: var(--ui-line-strong); }
body .pnpp-btn-filter-reset:hover { background: var(--ui-surface-2); transform: none; box-shadow: none; }

/* ---------- Badges ---------- */
body .pnpp-badge,
body .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-family: var(--ui-font);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    border-radius: 999px;
    letter-spacing: 0;
    text-transform: none;
    background: var(--ui-brand-50);
    color: var(--ui-brand);
    margin: 1px 2px;
    white-space: nowrap;
}
body .pnpp-status-open, body .pnpp-badge.open, body .b-open { background: var(--ui-warn-50); color: var(--ui-warn); }
body .pnpp-status-closed, body .pnpp-badge.closed, body .b-clos { background: var(--ui-ok-50); color: var(--ui-ok); }
body .pnpp-status-open::before, body .pnpp-status-closed::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
body .pnpp-closure-immediate { background: var(--ui-ok-50); color: var(--ui-ok); }
body .pnpp-closure-further { background: var(--ui-warn-50); color: var(--ui-warn); }
body .pnpp-closure-other, body .pnpp-badge-more { background: #eef1f6; color: #4b5b70; }
body .b-int { background: #e6ecff; color: #3f4fc4; }
body .b-ext { background: #fde7f0; color: #b02a62; }
.pnpp-cell-wrap { white-space: normal; max-width: 240px; }

/* ---------- Alerts ---------- */
body .alert {
    border: 1px solid transparent;
    border-radius: var(--ui-r);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
}
body .alert-success, body .flash { background: var(--ui-ok-50); color: #065f46; border-color: #b6ecd0; border-radius: var(--ui-r); padding: 12px 16px; font-weight: 600; }
body .alert-danger { background: var(--ui-bad-50); color: #8f1d1d; border-color: #f6c4c4; }

/* ---------- Tables / DataTables ---------- */
.ui-table-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-lg);
    box-shadow: var(--ui-shadow-1);
    overflow: hidden;
}
body .table { color: var(--ui-text); margin-bottom: 0; }
body .table thead, body .table tbody { font-size: inherit; }
body .table thead th,
body table.dataTable thead th {
    background: var(--ui-surface-2);
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: none;
    padding: 13px 16px;
    border-top: 0;
    border-bottom: 1px solid var(--ui-line) !important;
    white-space: nowrap;
}
body .table tbody td,
body table.dataTable tbody td {
    padding: 13px 16px;
    font-size: 13.5px;
    border-top: 1px solid #eef1f6;
    vertical-align: middle;
}
body table.dataTable { border-collapse: collapse !important; }
body .table-hover tbody tr:hover,
body table.dataTable tbody tr:hover,
body #data-table tbody tr:hover { background: #f6fafc !important; }
body table.dataTable.no-footer { border-bottom: 0; }

.dataTables_wrapper { font-size: 13.5px; color: var(--ui-muted); }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { padding: 12px 16px; }
body .dataTables_wrapper .dataTables_filter input,
body .dataTables_wrapper .dataTables_length select {
    min-height: 38px;
    padding: 6px 12px;
    font-family: var(--ui-font);
    border: 1px solid var(--ui-line-strong);
    border-radius: var(--ui-r-sm);
    background: #fff;
    color: var(--ui-text);
    outline: none;
}
body .dataTables_wrapper .dataTables_filter input:focus { border-color: var(--ui-brand); box-shadow: 0 0 0 3px rgba(10, 106, 148, .15); }
body .dataTables_wrapper .dataTables_paginate .paginate_button {
    min-width: 36px;
    padding: 6px 12px !important;
    margin: 0 2px !important;
    font-weight: 700;
    color: var(--ui-text) !important;
    background: #fff !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: var(--ui-r-sm) !important;
    box-shadow: none !important;
}
body .dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--ui-surface-2) !important; color: var(--ui-ink) !important; }
body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--ui-brand) !important; border-color: var(--ui-brand) !important; color: #fff !important;
}
body .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .45; cursor: not-allowed; }
body .dataTables_wrapper .dataTables_processing {
    border: 1px solid var(--ui-line); border-radius: var(--ui-r); box-shadow: var(--ui-shadow-2);
    background: #fff; color: var(--ui-ink); font-weight: 700;
}

/* Row action icons returned by the controller (fa-2x) */
body #data-table td a i.fa-2x,
body #data-table td a svg.fa-2x { font-size: 17px; width: 1em; height: 1em; }
body #data-table td a.edit-btn,
body #data-table td a[href*="/download"] {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--ui-brand-50); color: var(--ui-brand);
    transition: background .15s, color .15s;
}
body #data-table td a[href*="/download"] { background: var(--ui-ok-50); color: var(--ui-ok); }
body #data-table td a.edit-btn:hover { background: var(--ui-brand); color: #fff; }
body #data-table td a[href*="/download"]:hover { background: var(--ui-ok); color: #fff; }
body #data-table td a svg, body #data-table td a i { color: inherit !important; }

/* Legacy action buttons (CEPS register) */
body .act-btn {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--ui-surface-2); color: var(--ui-muted);
    border: 1px solid var(--ui-line);
    transition: background .15s, color .15s;
}
body .act-btn.v:hover { background: var(--ui-brand); border-color: var(--ui-brand); color: #fff; }
body .act-btn.e:hover { background: var(--ui-heat); border-color: var(--ui-heat); color: #1a1204; }

/* Open / Closed pills (desktop PNPP) */
body .status-filter-box { display: inline-flex; gap: 8px; margin: 0 16px 0 8px; vertical-align: middle; }
body .status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0; padding: 7px 14px;
    font-weight: 700; font-size: 13px;
    border-radius: 999px; border: 1px solid var(--ui-line-strong);
    background: #fff; color: var(--ui-text);
    cursor: pointer; user-select: none;
}
body .status-pill input { width: auto; margin: 0; accent-color: var(--ui-brand); }
body .status-pill.open:has(input:checked) { background: var(--ui-warn-50); border-color: #f2c76b; color: var(--ui-warn); }
body .status-pill.closed:has(input:checked) { background: var(--ui-ok-50); border-color: #8fdcb4; color: var(--ui-ok); }

/* ---------- Generic form controls (Bootstrap + plain) ---------- */
body .form-control, body .form-select {
    min-height: 42px;
    font-family: var(--ui-font);
    font-size: 14px;
    color: var(--ui-text);
    border: 1px solid var(--ui-line-strong);
    border-radius: var(--ui-r-sm);
}
body .form-control:focus, body .form-select:focus {
    border-color: var(--ui-brand);
    box-shadow: 0 0 0 3px rgba(10, 106, 148, .15);
}
body .card { border-radius: var(--ui-r-lg); border: 1px solid var(--ui-line); box-shadow: var(--ui-shadow-1); }
body .rounded-4 { border-radius: var(--ui-r-lg) !important; }
body .shadow-sm { box-shadow: var(--ui-shadow-1) !important; }

/* ---------- Modal: dialog on desktop, bottom sheet on phones ---------- */
body .modal-backdrop.show { opacity: .55; background: #0a1626; }
.pnpp-modal .modal-content {
    border: 0;
    border-radius: var(--ui-r-lg);
    overflow: hidden;
    box-shadow: var(--ui-shadow-3);
    background: var(--ui-surface-2);
}
.pnpp-modal .modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px;
    background: #fff;
    border-bottom: 1px solid var(--ui-line);
    color: var(--ui-ink);
}
.pnpp-modal .modal-title { font-size: 17px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 10px; color: var(--ui-ink); }
.pnpp-modal .modal-title i { color: var(--ui-brand); }
.pnpp-modal .modal-header .close {
    float: none; margin: 0; padding: 0;
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--ui-surface-2); color: var(--ui-muted);
    border: 1px solid var(--ui-line);
    font-size: 22px; font-weight: 400; line-height: 1;
    opacity: 1; text-shadow: none; box-shadow: none;
}
body .pnpp-modal .modal-header .close:hover { background: var(--ui-bad-50); color: var(--ui-bad); transform: none; box-shadow: none; }
.pnpp-modal .modal-body { padding: 18px 22px; max-height: 68vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--ui-bg); }
.pnpp-modal .modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 22px;
    background: #fff;
    border-top: 1px solid var(--ui-line);
}

/* ---------- Pagination (Laravel / BS) ---------- */
body .page-link { border-radius: var(--ui-r-sm) !important; margin: 0 2px; color: var(--ui-text); border-color: var(--ui-line); font-weight: 700; }
body .page-item.active .page-link { background: var(--ui-brand); border-color: var(--ui-brand); color: #fff; }

/* ==========================================================================
   Legacy CEPS register / form / show pages — harmonise their older markup
   ========================================================================== */
body .ncr-wrap, body .show-page, body .ncr-page { font-family: var(--ui-font); }

/* Register page */
body .pg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px !important; flex-wrap: wrap; }
body .pg-title { font-family: var(--ui-font); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); font-weight: 800; color: var(--ui-ink); letter-spacing: -.01em; margin: 0; }
body .stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
body .scard {
    position: relative; overflow: hidden;
    background: var(--ui-surface); border: 1px solid var(--ui-line) !important;
    border-radius: var(--ui-r-lg); box-shadow: var(--ui-shadow-1) !important;
    transition: box-shadow .2s;
}
body .scard:hover { transform: none; box-shadow: var(--ui-shadow-2) !important; }
body .scard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone, var(--ui-brand)); }
body .scard.c-blue { --tone: #0a6a94; } body .scard.c-amber { --tone: #d98a0b; }
body .scard.c-green { --tone: #0f9d6b; } body .scard.c-indigo { --tone: #5b5fd6; } body .scard.c-rose { --tone: #d6336c; }
body .scard-body { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; }
body .scard-label { font-family: var(--ui-font); font-size: 12.5px; font-weight: 600; color: var(--ui-muted); text-transform: none; letter-spacing: 0; margin-bottom: 4px; }
body .scard-val { font-family: var(--ui-font); font-size: 1.7rem; font-weight: 800; color: var(--ui-ink) !important; line-height: 1.1; font-variant-numeric: tabular-nums; }
body .scard-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; color: var(--tone, var(--ui-brand)) !important; background: var(--ui-brand-50) !important; background: color-mix(in srgb, var(--tone, var(--ui-brand)) 12%, #fff) !important; }

body .filter-row {
    display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end;
    background: var(--ui-surface); border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-lg); padding: 16px 18px; box-shadow: var(--ui-shadow-1);
}
body .filter-row .fg { flex: 1 1 170px; min-width: 150px; }
body .filter-row .fg label { display: block; margin: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ui-muted); text-transform: none; letter-spacing: 0; }
body .filter-row .fg input, body .filter-row .fg select {
    width: 100%; min-height: 42px; padding: 9px 12px;
    font-family: var(--ui-font); font-size: 14px; color: var(--ui-text);
    border: 1px solid var(--ui-line-strong); border-radius: var(--ui-r-sm); background: #fff;
}
body .filter-row .fg input:focus, body .filter-row .fg select:focus { outline: none; border-color: var(--ui-brand); box-shadow: 0 0 0 3px rgba(10, 106, 148, .15); }
body .filter-row .fg[style*="flex:0.1"] { flex: 0 0 auto !important; }

/* Register: clickable rows */
body #ncrTable tbody tr { cursor: pointer; }

/* Show page */
body .breadcrumb-nav a { color: var(--ui-brand); font-weight: 700; }
body .ncr-hero {
    border-radius: var(--ui-r-lg) !important;
    background: linear-gradient(135deg, #0c1b2e 0%, #12345a 100%) !important;
    box-shadow: var(--ui-shadow-2) !important;
}
body .hero-trace { font-family: var(--ui-font) !important; font-weight: 800; letter-spacing: -.01em; }
body .info-section { border-radius: var(--ui-r-lg) !important; border: 1px solid var(--ui-line) !important; box-shadow: var(--ui-shadow-1) !important; background: #fff; }
body .info-label { font-family: var(--ui-font); color: var(--ui-muted); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
body .info-value { font-family: var(--ui-font); color: var(--ui-ink); font-weight: 600; }
body .section-title { font-family: var(--ui-font); font-weight: 800; color: var(--ui-ink); }
body .btn-edit { background: #fff; color: var(--ui-text); border: 1px solid var(--ui-line-strong); border-radius: var(--ui-r-sm); font-weight: 700; }
body .btn-edit:hover { background: var(--ui-surface-2); }
body .btn-delete { border-radius: var(--ui-r-sm); font-weight: 700; }
body .tl-dot.done { background: var(--ui-ok); border-color: var(--ui-ok); }

/* Create / edit NCR form */
body .ncr-page-header { border-radius: var(--ui-r-lg) !important; }
body .ncr-form-card { border-radius: var(--ui-r-lg) !important; border: 1px solid var(--ui-line) !important; box-shadow: var(--ui-shadow-1) !important; background: #fff; }
body .ncr-section-title { font-family: var(--ui-font); font-weight: 800; color: var(--ui-ink); text-transform: none; letter-spacing: 0; }
body .ncr-label { font-family: var(--ui-font); font-weight: 700; color: var(--ui-text); font-size: 13px; text-transform: none; letter-spacing: 0; }
body .ncr-input, body .ncr-select, body .ncr-textarea {
    font-family: var(--ui-font); font-size: 14px;
    min-height: 44px;
    border: 1px solid var(--ui-line-strong) !important;
    border-radius: var(--ui-r-sm) !important;
    background-color: #fff;
}
body .ncr-input:focus, body .ncr-select:focus, body .ncr-textarea:focus {
    outline: none; border-color: var(--ui-brand) !important; box-shadow: 0 0 0 3px rgba(10, 106, 148, .15) !important;
}
body .ncr-textarea { min-height: 90px; }
body .ncr-actions { gap: 10px; flex-wrap: wrap; }
body .ncr-type-card, body .ncr-checkbox-item, body .ncr-radio-pill { border-radius: var(--ui-r) !important; font-family: var(--ui-font); }
body .ncr-type-card.selected { border-color: var(--ui-brand) !important; }

/* ---------- Auth (password / register / verify) ---------- */
body.ui-body .card-header { background: #fff; border-bottom: 1px solid var(--ui-line); font-weight: 800; color: var(--ui-ink); border-radius: var(--ui-r-lg) var(--ui-r-lg) 0 0 !important; padding: 16px 20px; }
body.ui-body .card-body { padding: 22px; }

/* ---------- Utilities ---------- */
.ui-hide-mobile { display: initial; }
@media (max-width: 767.98px) {
    .ui-hide-mobile { display: none !important; }
    .ui-page { padding-top: 18px; }
    .ui-head { flex-direction: column; align-items: stretch; }
    body .pg-head { flex-direction: column; align-items: stretch; }
    body .ui-btn, body .btn-new { width: 100%; }
    body .filter-row .fg { flex: 1 1 100%; }
    body .download-icon { bottom: calc(86px + var(--ui-safe-b)); width: 46px; height: 46px; }
}

/* Modal -> bottom sheet on phones */
@media (max-width: 767.98px) {
    .pnpp-modal .modal-dialog {
        position: fixed; inset: auto 0 0 0;
        width: 100%; max-width: none; margin: 0;
        display: flex; align-items: flex-end;
        pointer-events: none;
    }
    .pnpp-modal.fade .modal-dialog { transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
    .pnpp-modal.show .modal-dialog { transform: translateY(0); }
    .pnpp-modal .modal-content {
        width: 100%;
        max-height: 94vh; max-height: 94dvh;
        border-radius: 22px 22px 0 0;
        pointer-events: auto;
        display: flex; flex-direction: column;
    }
    .pnpp-modal .modal-content > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
    .pnpp-modal .modal-header { padding: 14px 16px 12px; position: relative; }
    .pnpp-modal .modal-header::before {
        content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
        width: 42px; height: 4px; border-radius: 4px; background: var(--ui-line-strong);
    }
    .pnpp-modal .modal-header { padding-top: 22px; }
    .pnpp-modal .modal-title { font-size: 16px; }
    .pnpp-modal .modal-body { padding: 14px 14px 18px; max-height: none; flex: 1 1 auto; min-height: 0; }
    .pnpp-modal .modal-footer { padding: 12px 14px calc(12px + var(--ui-safe-b)); }
    .pnpp-modal .modal-footer .btn-pnpp { flex: 1; min-height: 48px; }
}

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