/*
 * OmniAnt.css
 * Master stylesheet for the OmniAnt platform
 * Include on every page — use what you need, ignore what you don't
 * ─────────────────────────────────────────────────────────────────
 */

/* ══════════════════════════════════════════════════════════════
   CSS VARIABLES
   ══════════════════════════════════════════════════════════════ */
:root {
    /* Colours */
    --green:       #10b981;
    --green-dim:   rgba(16,185,129,0.12);
    --amber:       #f59e0b;
    --amber-dim:   rgba(245,158,11,0.12);
    --red:         #ef4444;
    --red-dim:     rgba(239,68,68,0.12);
    --indigo:      #4f46e5;
    --indigo-dim:  rgba(79,70,229,0.15);
    --indigo-dark: #4338ca;
    --blue:        #3b82f6;
    --purple:      #a78bfa;
    --purple-dim:  rgba(167,139,250,0.12);
    --cyan:        #06b6d4;

    /* Slate scale */
    --slate-400:   #94a3b8;
    --slate-500:   #64748b;
    --slate-600:   #475569;
    --slate-700:   #334155;
    --slate-800:   #1e293b;
    --slate-900:   #0f172a;

    /* Semantic text colours */
    --text-primary:   #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-muted:     #94a3b8;
    --text-faint:     #64748b;
}

/* ══════════════════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    background: var(--slate-900);
}

body {
    min-height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--slate-900);
    background-image:
        radial-gradient(circle at 15% 15%, rgba(79,70,229,0.1) 0%, transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(59,130,246,0.07) 0%, transparent 50%);
    color: var(--text-secondary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* ══════════════════════════════════════════════════════════════
   PAGE LAYOUTS
   ══════════════════════════════════════════════════════════════ */

/* Centred single-card layout (login, register, audit-logs, role-management) */
.oa-page-centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* Full-width scrolling layout (pages that use .main-container) */
.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

/* ══════════════════════════════════════════════════════════════
   PAGE CARDS
   ══════════════════════════════════════════════════════════════ */

/* Standard wide page card */
.page-card {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

/* Narrow auth card (login / register) */
.card {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.05) inset;
}

/* Fixed-height viewport-filling card (api-catalogue, reports-and-guides) */
.home-card {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

/* page-wrap used on scrolling pages */
.page-wrap {
    width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
.card-header-custom {
    background: rgba(0,0,0,0.3);
    border-bottom: 3px solid var(--indigo);
    padding: 1.1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    flex-shrink: 0;
    color: white;
    gap: 1rem;
}

/* Auth page card header (centred, taller) */
.card-header {
    background: rgba(0,0,0,0.25);
    border-bottom: 3px solid var(--indigo);
    padding: 2rem;
    text-align: center;
}

.card-header p {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Brand title inside headers */
.brand-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--blue);
    margin: 0;
    text-decoration: none;
}

.brand-title span { color: var(--indigo); }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--blue);
    letter-spacing: -0.5px;
    line-height: 1;
}

.brand h1 span { color: var(--indigo); }

.header-page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.01em;
}

/* ══════════════════════════════════════════════════════════════
   CARD BODY
   ══════════════════════════════════════════════════════════════ */
.card-body {
    padding: 1.5rem 2rem;
    background: transparent;
    color: var(--text-secondary);
}

/* Auth card body */
.card-body-auth { padding: 2rem; }

/* Flex body for sidebar+content layouts */
.card-body-custom {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Auth card footer */
.card-footer {
    padding: 1rem 2rem;
    background: rgba(0,0,0,0.15);
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    font-size: 0.82rem;
    color: var(--slate-400);
}

.card-footer a {
    color: #818cf8;
    font-weight: 600;
    text-decoration: none;
}

.card-footer a:hover { color: #a5b4fc; text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   TABS  (log-tabs / rpt-tabs share the same visual)
   ══════════════════════════════════════════════════════════════ */
.log-tabs, .rpt-tabs {
    display: flex;
    border-bottom: 2px solid rgba(255,255,255,0.08);
    margin-bottom: 1.5rem;
}

.log-tab, .rpt-tab {
    padding: 0.75rem 1.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--slate-400);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.rpt-tab { padding: 0.55rem 1.1rem; font-size: 0.82rem; gap: 6px; }

.log-tab:hover,  .rpt-tab:hover  { color: #818cf8; }
.log-tab.active, .rpt-tab.active { color: #818cf8; border-bottom-color: var(--indigo); }

.log-panel { display: none; }
.log-panel.active { display: block; }

.rpt-pane { display: none; }
.rpt-pane.active { display: block; }

/* ══════════════════════════════════════════════════════════════
   FILTER CARD
   ══════════════════════════════════════════════════════════════ */
.filter-card, .section-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 140px;
    flex: 1;
}

.filter-group.narrow { flex: 0 0 auto; min-width: 90px; }

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
    margin-bottom: 1rem;
}

/* ══════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════════════════════════ */
label, .form-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea,
.form-control,
.form-select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.2);
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder { color: var(--slate-500); }

select option, .form-select option { background: var(--slate-800); color: var(--text-primary); }

/* Section divider in auth forms */
.divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 1.5rem 0 1.25rem;
}

.section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
    margin-bottom: 1rem;
}

.form-group { margin-bottom: 1.1rem; }
.form-group .hint { margin-top: 0.35rem; font-size: 0.75rem; color: var(--slate-500); }

/* Shadow DOM input host (login page) */
.shadow-input-host,
.input-wrap {
    width: 100%;
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: rgba(255,255,255,0.06);
}

.shadow-input-host:focus-within,
.input-wrap:focus-within {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.2);
}

.input-wrap input {
    width: 100%;
    padding: 10px 12px;
    border: none;
    outline: none;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: var(--text-primary);
}

.input-wrap input::placeholder { color: var(--slate-500); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn, .btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 0.84rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled, .btn-submit:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary, .btn-submit {
    background: var(--indigo);
    color: white;
}

.btn-primary:hover:not(:disabled),
.btn-submit:hover {
    background: var(--indigo-dark);
    box-shadow: 0 4px 15px rgba(79,70,229,0.4);
}

.btn-submit:active { transform: scale(0.99); }
.btn-submit:disabled { opacity: 0.55; }

.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--slate-400);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text-secondary); }

.btn-danger { background: var(--red); color: white; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-success { background: var(--green); color: white; }
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-sm { padding: 4px 10px; font-size: 0.78rem; }
.btn-lg { padding: 10px 20px; font-size: 0.95rem; }
.btn-w-full { width: 100%; justify-content: center; }

/* Icon-only button */
.btn-icon {
    background: none;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    color: var(--slate-500);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.btn-icon:hover { color: #818cf8; background: rgba(79,70,229,0.12); }
.btn-icon.danger:hover { color: #f87171; background: var(--red-dim); }

/* Bootstrap compat aliases (for pages still using Bootstrap classes) */
.btn-outline-secondary { border: 1px solid rgba(255,255,255,0.15); color: var(--slate-400); background: transparent; }
.btn-outline-secondary:hover { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.btn-outline-primary { border: 1px solid rgba(79,70,229,0.5); color: #818cf8; background: transparent; }
.btn-outline-primary:hover { background: var(--indigo-dim); color: #a5b4fc; }
.btn-outline-danger { border: 1px solid rgba(239,68,68,0.5); color: #fca5a5; background: transparent; }
.btn-outline-danger:hover { background: var(--red-dim); }
.btn-secondary { background: var(--slate-800); border: 1px solid var(--slate-700); color: var(--slate-400); }
.btn-secondary:hover { background: var(--slate-700); color: var(--text-secondary); }
.btn-close { filter: invert(1); }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-block;
    font-size: 0.67rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
	width: 90px;
	text-justify: center:
    border-radius: 5px;
    white-space: nowrap;
}

.badge-primary   { background: rgba(79,70,229,0.2);   color: #818cf8;  border: 1px solid rgba(79,70,229,0.4); }
.badge-success   { background: var(--green-dim);       color: #6ee7b7;  border: 1px solid rgba(16,185,129,0.4); }
.badge-danger    { background: var(--red-dim);         color: #fca5a5;  border: 1px solid rgba(239,68,68,0.4); }
.badge-warning   { background: var(--amber-dim);       color: #fcd34d;  border: 1px solid rgba(245,158,11,0.4); }
.badge-secondary { background: rgba(255,255,255,0.07); color: var(--slate-400); border: 1px solid rgba(255,255,255,0.12); }
.badge-info      { background: rgba(6,182,212,0.12);   color: #67e8f9;  border: 1px solid rgba(6,182,212,0.3); }
.badge-indigo    { background: rgba(79,70,229,0.2);    color: #a5b4fc;  border: 1px solid rgba(79,70,229,0.4); }
.badge-locked    { background: rgba(255,255,255,0.06); color: var(--slate-400); border: 1px solid rgba(255,255,255,0.1); }

/* Capability badges (role-management) */
.cap-badge { font-size: 0.65rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 20px; white-space: nowrap; }
.cap-can_read    { background: rgba(59,130,246,0.15);  color: #93c5fd;  border: 1px solid rgba(59,130,246,0.3); }
.cap-can_edit    { background: var(--green-dim);        color: #6ee7b7;  border: 1px solid rgba(16,185,129,0.3); }
.cap-can_delete  { background: var(--red-dim);          color: #fca5a5;  border: 1px solid rgba(239,68,68,0.3); }
.cap-can_approve { background: var(--amber-dim);        color: #fcd34d;  border: 1px solid rgba(245,158,11,0.3); }
.cap-can_export  { background: var(--purple-dim);       color: #c4b5fd;  border: 1px solid rgba(167,139,250,0.3); }
.cap-can_import  { background: rgba(255,255,255,0.06);  color: var(--slate-400); border: 1px solid rgba(255,255,255,0.1); }
.cap-can_admin   { background: rgba(236,72,153,0.12);   color: #f9a8d4;  border: 1px solid rgba(236,72,153,0.3); }

/* Stat pills (import/trail logs) */
.stat-pill { font-size: 0.7rem; font-weight: 700; padding: 0.18rem 0.55rem; border-radius: 20px; }
.stat-pill.inserted    { background: var(--green-dim);             color: #6ee7b7;  border: 1px solid rgba(16,185,129,0.3); }
.stat-pill.updated     { background: rgba(59,130,246,0.12);        color: #93c5fd;  border: 1px solid rgba(59,130,246,0.3); }
.stat-pill.skipped     { background: rgba(255,255,255,0.06);       color: var(--slate-400); border: 1px solid rgba(255,255,255,0.1); }
.stat-pill.deactivated { background: var(--amber-dim);             color: #fcd34d;  border: 1px solid rgba(245,158,11,0.3); }
.stat-pill.error       { background: var(--red-dim);               color: #fca5a5;  border: 1px solid rgba(239,68,68,0.3); }
.stat-pill.polls       { background: rgba(59,130,246,0.12);        color: #93c5fd;  border: 1px solid rgba(59,130,246,0.3); }
.stat-pill.processed   { background: rgba(139,92,246,0.12);        color: #c4b5fd;  border: 1px solid rgba(139,92,246,0.3); }
.stat-pill.errors      { background: var(--red-dim);               color: #fca5a5;  border: 1px solid rgba(239,68,68,0.3); }

/* Action badges (import log) */
.action-badge { font-size: 0.67rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 5px; width: 300px; white-space: nowrap; }
.action-badge.inserted    { background: var(--green-dim);       color: #6ee7b7;  border: 1px solid rgba(16,185,129,0.3); }
.action-badge.updated     { background: rgba(59,130,246,0.12);  color: #93c5fd;  border: 1px solid rgba(59,130,246,0.3); }
.action-badge.skipped     { background: rgba(255,255,255,0.06); color: var(--slate-400); border: 1px solid rgba(255,255,255,0.1); }
.action-badge.deactivated { background: var(--amber-dim);       color: #fcd34d;  border: 1px solid rgba(245,158,11,0.3); }
.action-badge.error       { background: var(--red-dim);         color: #fca5a5;  border: 1px solid rgba(239,68,68,0.3); }

/* Event badges (trail activity log) */
.event-badge { font-size: 0.67rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 5px; white-space: nowrap; }
.event-badge.run_start        { background: var(--green-dim);       color: #6ee7b7;  border: 1px solid rgba(16,185,129,0.3); }
.event-badge.run_stop         { background: rgba(255,255,255,0.06); color: var(--slate-400); border: 1px solid rgba(255,255,255,0.1); }
.event-badge.poll             { background: rgba(59,130,246,0.12);  color: #93c5fd;  border: 1px solid rgba(59,130,246,0.3); }
.event-badge.record_processed { background: rgba(139,92,246,0.12);  color: #c4b5fd;  border: 1px solid rgba(139,92,246,0.3); }
.event-badge.error            { background: var(--red-dim);         color: #fca5a5;  border: 1px solid rgba(239,68,68,0.3); }

/* HTTP method badges (api-catalogue) */
.api-method { font-weight: 700; font-size: 0.75rem; padding: 4px 10px; border-radius: 4px; min-width: 60px; text-align: center; }
.method-get    { background: rgba(6,182,212,0.2);  color: #67e8f9; border: 1px solid rgba(6,182,212,0.4); }
.method-post   { background: rgba(16,185,129,0.2); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.4); }
.method-put    { background: rgba(245,158,11,0.2); color: #fcd34d; border: 1px solid rgba(245,158,11,0.4); }
.method-delete { background: rgba(239,68,68,0.2);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.method-patch  { background: rgba(139,92,246,0.2); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.4); }

/* ══════════════════════════════════════════════════════════════
   MESSAGES / ALERTS
   ══════════════════════════════════════════════════════════════ */
.msg-box, .alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.msg-info,    .alert-info    { background: rgba(59,130,246,0.1);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.25); }
.msg-danger,  .alert-danger  { background: rgba(239,68,68,0.1);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.msg-warning, .alert-warning { background: rgba(245,158,11,0.1);  color: #fcd34d; border: 1px solid rgba(245,158,11,0.25); }
.msg-success, .alert-success { background: var(--green-dim);      color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }

/* Auth form alert boxes */
.alert-box { display: none; padding: 0.75rem 1rem; margin-bottom: 1.25rem; border-radius: 8px; font-size: 0.84rem; font-weight: 500; }
.alert-box.danger  { display: block; background: rgba(239,68,68,0.1);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.alert-box.success { display: block; background: rgba(16,185,129,0.1);  color: #6ee7b7; border: 1px solid rgba(16,185,129,0.4); }
.error-box { display: none; padding: 0.75rem 1rem; margin-bottom: 1.25rem; border-radius: 8px; background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); font-size: 0.84rem; font-weight: 500; }
.error-box.show { display: block; }

/* ══════════════════════════════════════════════════════════════
   SPINNER / LOADING
   ══════════════════════════════════════════════════════════════ */
.spinner {
    display: inline-block;
    width: 28px; height: 28px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--indigo);
    border-radius: 50%;
    animation: oa-spin 0.75s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

@keyframes oa-spin { to { transform: rotate(360deg); } }

.loading-spinner, .loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--slate-400);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
}

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: var(--slate-500);
    gap: 0.75rem;
    text-align: center;
}

.empty-state i { font-size: 2.5rem; opacity: 0.25; display: block; }
.empty-state p { font-size: 0.88rem; margin: 0; }

/* ══════════════════════════════════════════════════════════════
   ITEM LISTS (role-management regions / users)
   ══════════════════════════════════════════════════════════════ */
.item-list { display: flex; flex-direction: column; gap: 0.4rem; }

.item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    font-size: 0.85rem;
    transition: border-color 0.15s;
}

.item-row:hover { border-color: rgba(79,70,229,0.5); }
.item-row .item-name { flex: 1; font-weight: 600; color: var(--text-secondary); }
.item-row .item-meta { font-size: 0.75rem; color: var(--slate-500); }
.item-row.child      { margin-left: 1.5rem; border-left: 3px solid var(--indigo); }
.item-row.grandchild { margin-left: 3rem;   border-left: 3px solid var(--slate-700); }

/* ══════════════════════════════════════════════════════════════
   ROLE CARDS (role-management)
   ══════════════════════════════════════════════════════════════ */
.role-card {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    transition: border-color 0.15s;
}

.role-card:hover { border-color: rgba(79,70,229,0.5); }

.role-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
}

.role-card-header .role-name { flex: 1; font-weight: 700; font-size: 0.9rem; color: var(--text-secondary); }

.role-card-body {
    display: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
    padding: 1.25rem;
}

.role-card-body.open { display: block; }

/* ══════════════════════════════════════════════════════════════
   USER ASSIGNMENT (role-management)
   ══════════════════════════════════════════════════════════════ */
.user-assignment-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--indigo);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}

.role-group-pill {
    font-size: 0.72rem; font-weight: 700;
    padding: 0.2rem 0.6rem; border-radius: 20px;
    background: rgba(79,70,229,0.2); color: #818cf8;
    border: 1px solid rgba(79,70,229,0.4);
}

.unassigned-pill {
    font-size: 0.72rem; font-weight: 700;
    padding: 0.2rem 0.6rem; border-radius: 20px;
    background: rgba(255,255,255,0.06); color: var(--slate-500);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ══════════════════════════════════════════════════════════════
   CAPABILITY MATRIX (role-management)
   ══════════════════════════════════════════════════════════════ */
.cap-matrix { width: 100%; border-collapse: collapse; font-size: 0.78rem; margin-top: 0.5rem; }

.cap-matrix thead th {
    background: rgba(0,0,0,0.3);
    color: rgba(255,255,255,0.7);
    padding: 6px 10px;
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    text-align: center;
}

.cap-matrix thead th:first-child { text-align: left; }

.cap-matrix tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: center; vertical-align: middle;
}

.cap-matrix tbody td:first-child { text-align: left; font-weight: 600; color: var(--text-secondary); }
.cap-matrix tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.cap-matrix tbody tr:hover td { background: rgba(79,70,229,0.08); }
.cap-matrix tbody tr:last-child td { border-bottom: none; }
.cap-matrix input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--indigo); }

/* ══════════════════════════════════════════════════════════════
   BATCH / TRAIL ROWS (audit-logs)
   ══════════════════════════════════════════════════════════════ */
.batch-row {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.15s;
}

.batch-row:hover    { border-color: rgba(79,70,229,0.5); background: rgba(79,70,229,0.06); }
.batch-row.expanded { border-color: rgba(79,70,229,0.5); background: rgba(79,70,229,0.06); border-radius: 10px 10px 0 0; margin-bottom: 0; }

.batch-detail {
    display: none;
    border: 1px solid rgba(79,70,229,0.4);
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.batch-detail.open { display: block; }

.batch-meta { flex: 1; }
.batch-meta strong { font-size: 0.85rem; color: var(--text-secondary); display: block; }
.batch-meta span   { font-size: 0.75rem; color: var(--slate-500); }
.batch-stats { display: flex; gap: 0.4rem; flex-shrink: 0; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════
   INNER TABLES (import/trail log detail)
   ══════════════════════════════════════════════════════════════ */
.import-row-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }

.import-row-table thead th {
    background: rgba(0,0,0,0.3);
    color: rgba(255,255,255,0.5);
    padding: 6px 12px;
    font-size: 0.67rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.import-row-table tbody td {
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary); vertical-align: top;
}

.import-row-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.import-row-table tbody tr:last-child td { border-bottom: none; }

/* Trail event expand/collapse */
.event-expandable { cursor: pointer; }
.event-expandable:hover td { background: rgba(79,70,229,0.08); }
.event-records-row td { background: rgba(0,0,0,0.15); }

/* Changes cell */
.changes-cell { font-size: 0.72rem; color: var(--slate-400); }
.changes-cell .field-change { margin-bottom: 2px; }
.changes-cell .from-val { color: #fca5a5; text-decoration: line-through; }
.changes-cell .to-val   { color: #6ee7b7; font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   PAGINATION BAR
   ══════════════════════════════════════════════════════════════ */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.75rem 0;
    padding: 0.6rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    font-size: 0.78rem;
    color: var(--slate-500);
}

.pagination-bar .pg-btns { display: flex; align-items: center; gap: 3px; }
.pagination-bar .pg-ellipsis { color: var(--slate-600); padding: 0 4px; }

.pagination-bar button {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    color: var(--slate-400);
    font-size: 0.78rem;
    padding: 3px 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.12s;
}

.pagination-bar button:hover:not(:disabled) { background: var(--indigo); border-color: var(--indigo); color: white; }
.pagination-bar button.active { background: var(--indigo); border-color: var(--indigo); color: white; font-weight: 700; }
.pagination-bar button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════
   MODAL (vanilla — no Bootstrap)
   ══════════════════════════════════════════════════════════════ */
.oa-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.oa-modal-backdrop.open { display: flex; }

.oa-modal {
    background: var(--slate-800);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    width: 100%;
    max-width: 780px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.oa-modal-sm  { max-width: 480px; }
.oa-modal-lg  { max-width: 1000px; }
.oa-modal-xl  { max-width: 1200px; }

.oa-modal-header {
    background: rgba(0,0,0,0.25);
    border-bottom: 3px solid var(--indigo);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
}

.oa-modal-header h5 {
    font-size: 1rem; font-weight: 700; color: white;
    display: flex; align-items: center; gap: 0.5rem; margin: 0;
}

.oa-modal-close {
    background: none; border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.2rem; cursor: pointer;
    padding: 2px 6px; border-radius: 5px;
    line-height: 1; transition: color 0.15s;
}

.oa-modal-close:hover { color: white; }

.oa-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    color: var(--text-secondary);
}

.oa-modal-footer {
    padding: 0.9rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 0.5rem;
}

/* Bootstrap modal compat (for pages still using Bootstrap modals) */
.modal-content {
    background: var(--slate-800);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    color: var(--text-secondary);
}

.modal-header { background: rgba(0,0,0,0.25); color: white; border-bottom: 3px solid var(--indigo); }
.modal-body   { background: var(--slate-800); color: var(--text-secondary); }
.modal-footer { background: var(--slate-800); border-top: 1px solid rgba(255,255,255,0.08); }
.modal-title  { font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════ */
#toastContainer {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.oa-toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    animation: oa-slideIn 0.2s ease;
}

@keyframes oa-slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.oa-toast.success { background: var(--green); }
.oa-toast.danger  { background: var(--red); }
.oa-toast.info    { background: var(--indigo); }
.oa-toast.warning { background: var(--amber); color: var(--slate-900); }

.oa-toast-close {
    background: none; border: none; color: inherit;
    cursor: pointer; opacity: 0.7; font-size: 1rem; margin-left: auto;
}

.oa-toast-close:hover { opacity: 1; }

/* Bootstrap toast compat */
.toast-container { z-index: 9999; }
.toast.bg-success { background: var(--green)  !important; }
.toast.bg-danger  { background: var(--red)    !important; }
.toast.bg-info    { background: var(--indigo) !important; }
.toast.bg-warning { background: var(--amber)  !important; color: var(--slate-900) !important; }

/* ══════════════════════════════════════════════════════════════
   CODE & PRE
   ══════════════════════════════════════════════════════════════ */
code {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.8em;
    color: #a5b4fc;
    background: rgba(79,70,229,0.12);
    padding: 1px 5px;
    border-radius: 4px;
}

pre {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    background: rgba(0,0,0,0.3);
    color: #a5b4fc;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    overflow-y: auto;
    max-height: 300px;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   REPORT TABLES (reports-and-guides)
   ══════════════════════════════════════════════════════════════ */
.report-table {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.report-table table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

.report-table thead th {
    background: rgba(0,0,0,0.35);
    color: rgba(255,255,255,0.7);
    font-weight: 700;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 9px 14px;
    font-size: 0.75rem;
    text-align: left;
}

.report-table tbody td {
    padding: 7px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
    vertical-align: middle;
}

.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.report-table tbody tr:hover td { background: rgba(79,70,229,0.08) !important; }

.account-code { color: var(--slate-500); font-size: 0.76rem; width: 55px; font-family: 'JetBrains Mono', monospace; }
.amount-col   { text-align: right; font-family: 'JetBrains Mono', monospace; width: 120px; }

/* Report row types */
.section-header td    { background: rgba(255,255,255,0.04) !important; font-weight: 700; color: var(--slate-400); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 5px 14px !important; }
.subtotal-row td      { background: rgba(255,255,255,0.06) !important; font-weight: 700; border-top: 1px solid rgba(255,255,255,0.12) !important; color: var(--text-secondary); }
.total-row td         { background: rgba(0,0,0,0.4) !important; color: var(--text-primary) !important; font-weight: 700; border-top: 2px solid rgba(255,255,255,0.2) !important; }
.gross-profit-row td  { background: rgba(79,70,229,0.25) !important; color: #a5b4fc !important; font-weight: 700; border-top: 1px solid rgba(79,70,229,0.4) !important; }
.net-profit-row td    { background: rgba(16,185,129,0.2) !important; color: #6ee7b7 !important; font-weight: 700; font-size: 0.92rem; border-top: 1px solid rgba(16,185,129,0.4) !important; }
.net-loss-row td      { background: rgba(239,68,68,0.2) !important;  color: #fca5a5 !important; font-weight: 700; font-size: 0.92rem; border-top: 1px solid rgba(239,68,68,0.4) !important; }
.balance-check-row td { background: rgba(16,185,129,0.2) !important; color: #6ee7b7 !important; font-weight: 700; border-top: 1px solid rgba(16,185,129,0.4) !important; }
.balance-fail-row td  { background: rgba(239,68,68,0.2) !important;  color: #fca5a5 !important; font-weight: 700; border-top: 1px solid rgba(239,68,68,0.4) !important; }
.calculated-row td    { font-style: italic; color: var(--slate-400); }

/* VAT summary cards */
.vat-cards { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.vat-card {
    flex: 1; min-width: 200px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.vat-card.payable     { background: rgba(239,68,68,0.12);    border-color: rgba(239,68,68,0.3); }
.vat-card.reclaimable { background: rgba(16,185,129,0.12);   border-color: rgba(16,185,129,0.3); }

.vat-card-label  { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate-400); margin-bottom: 0.3rem; }
.vat-card-amount { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); }
.vat-card-sub    { font-size: 0.78rem; color: var(--slate-500); margin-top: 0.2rem; }

.vat-card.payable     .vat-card-label  { color: #fca5a5; }
.vat-card.payable     .vat-card-amount { color: #fca5a5; }
.vat-card.payable     .vat-card-sub    { color: rgba(252,165,165,0.7); }
.vat-card.reclaimable .vat-card-label  { color: #6ee7b7; }
.vat-card.reclaimable .vat-card-amount { color: #6ee7b7; }
.vat-card.reclaimable .vat-card-sub    { color: rgba(110,231,183,0.7); }

/* ══════════════════════════════════════════════════════════════
   MARKDOWN BODY (reports-and-guides)
   ══════════════════════════════════════════════════════════════ */
.markdown-body { max-width: 820px; }
.markdown-body h1 { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.5rem; }
.markdown-body h2 { font-size: 1.15rem; font-weight: 700; color: var(--text-secondary); margin: 2rem 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.markdown-body h3 { font-size: 0.95rem; font-weight: 700; color: #cbd5e1; margin: 1.5rem 0 0.5rem; }
.markdown-body p  { font-size: 0.9rem; color: var(--slate-400); line-height: 1.75; margin-bottom: 1rem; }
.markdown-body ul, .markdown-body ol { font-size: 0.9rem; color: var(--slate-400); line-height: 1.75; padding-left: 1.5rem; margin-bottom: 1rem; }
.markdown-body li { margin-bottom: 0.25rem; }
.markdown-body code { background: rgba(79,70,229,0.15); border: 1px solid rgba(79,70,229,0.3); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.82rem; color: #a5b4fc; font-family: 'JetBrains Mono', monospace; }
.markdown-body pre { background: rgba(0,0,0,0.4); border-radius: 10px; padding: 1.25rem; overflow-x: auto; margin-bottom: 1.25rem; border: 1px solid rgba(255,255,255,0.08); }
.markdown-body pre code { background: none; border: none; color: #a5b4fc; padding: 0; }
.markdown-body blockquote { border-left: 3px solid var(--indigo); background: rgba(79,70,229,0.08); padding: 0.75rem 1rem; border-radius: 0 8px 8px 0; margin: 1rem 0; color: var(--slate-400); font-style: italic; }
.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; font-size: 0.85rem; }
.markdown-body th { background: rgba(0,0,0,0.35); color: rgba(255,255,255,0.7); padding: 0.6rem 1rem; text-align: left; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.markdown-body td { padding: 0.6rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); color: var(--slate-400); }
.markdown-body tr:hover td { background: rgba(79,70,229,0.06); }
.markdown-body a  { color: #818cf8; font-weight: 500; }
.markdown-body hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 2rem 0; }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR (reports-and-guides)
   ══════════════════════════════════════════════════════════════ */
.doc-sidebar {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: color 0.15s;
}

.sidebar-section-header:hover { color: var(--slate-400); }
.sidebar-section-header .chevron { font-size: 0.7rem; transition: transform 0.2s; }
.sidebar-section-header.collapsed .chevron { transform: rotate(-90deg); }

.sidebar-section-body { overflow: hidden; flex-shrink: 0; }
.sidebar-section-body.guides-body  { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.sidebar-section-body.guides-body.collapsed  { display: none; }
.sidebar-section-body.reports-body.collapsed { display: none; }

.sidebar-search { padding: 0.65rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }

.search-wrap { position: relative; }
.search-wrap i { position: absolute; left: 0.55rem; top: 50%; transform: translateY(-50%); color: var(--slate-500); font-size: 0.75rem; pointer-events: none; }

.search-input {
    width: 100%;
    padding: 0.3rem 0.65rem 0.3rem 1.75rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(79,70,229,0.2); }
.search-input::placeholder { color: var(--slate-500); }

.guide-list { flex: 1; overflow-y: auto; padding: 0.5rem; }
.guide-list::-webkit-scrollbar { width: 4px; }
.guide-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.guide-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    margin-bottom: 0.2rem;
    color: var(--slate-400);
    font-weight: 500;
}

.guide-item:hover  { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.08); color: var(--text-secondary); }
.guide-item.active { background: rgba(79,70,229,0.15); border-color: rgba(79,70,229,0.4); color: #818cf8; }

.guide-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 0.8rem;
    color: var(--slate-500); transition: all 0.15s;
}

.guide-item.active .guide-icon { background: var(--indigo); color: white; }
.guide-label { font-size: 0.82rem; line-height: 1.35; }
.guide-item.active .guide-label { font-weight: 600; }
.guide-empty { padding: 1.5rem 1rem; text-align: center; color: var(--slate-500); font-size: 0.8rem; }

.doc-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.content-toolbar {
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0.6rem 1.5rem;
    display: flex; align-items: center; gap: 0.5rem;
    flex-shrink: 0;
}

.content-toolbar i { color: #818cf8; font-size: 0.85rem; }
.content-toolbar-title { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }

.content-scroll { flex: 1; overflow-y: auto; padding: 1.5rem 2rem; }
.content-scroll::-webkit-scrollbar { width: 6px; }
.content-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 6px; }

/* ══════════════════════════════════════════════════════════════
   API CATALOGUE
   ══════════════════════════════════════════════════════════════ */
.category-filter-container {
    background: rgba(79,70,229,0.08);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(79,70,229,0.2);
}

.category-filter-container h5 { color: var(--slate-400); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }

.category-btn {
    margin-bottom: 6px;
    padding: 6px 8px;
    font-size: 0.8rem; font-weight: 600;
    border-radius: 6px; width: 100%; text-align: center;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--slate-400);
    transition: all 0.2s; cursor: pointer; font-family: 'Inter', sans-serif;
}

.category-btn:hover  { transform: translateY(-1px); background: rgba(79,70,229,0.15); border-color: rgba(79,70,229,0.4); color: #a5b4fc; }
.category-btn.active { background: var(--indigo); border-color: var(--indigo); color: white; box-shadow: 0 4px 12px rgba(79,70,229,0.4); transform: translateY(-1px); }

.api-panel { display: none; }
.api-panel.active { display: block; overflow-y: auto; height: 100%; padding-right: 8px; }
.api-panel h4 { color: #818cf8 !important; }

.panels-row { flex: 1; overflow: hidden; min-height: 0; }

.api-row {
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 16px;
    transition: all 0.2s;
}

.api-row:hover { border-color: rgba(79,70,229,0.5); background: rgba(79,70,229,0.06); }

.api-path { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; color: #a5b4fc; font-weight: 500; min-width: 250px; }
.api-description { flex: 1; color: var(--slate-400); font-size: 0.875rem; }

.response-container { max-height: 400px; overflow-y: auto; background: rgba(0,0,0,0.3); border-radius: 6px; padding: 15px; margin-top: 15px; font-size: 0.82rem; }
.response-success { border-left: 4px solid var(--green); }
.response-error   { border-left: 4px solid var(--red); }
.response-header  { font-weight: 600; margin-bottom: 10px; color: var(--slate-400); }

/* Boolean slider toggle */
.crud-switch { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; user-select: none; margin-top: 0.25rem; }
.crud-switch input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.crud-slider { display: inline-block; width: 34px; height: 18px; background: rgba(239,68,68,0.5); border-radius: 9px; position: relative; transition: background 0.25s; flex-shrink: 0; }
.crud-slider::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: transform 0.25s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.crud-switch input:checked ~ .crud-slider { background: var(--green); }
.crud-switch input:checked ~ .crud-slider::after { transform: translateX(16px); }
.crud-switch .slider-label { font-size: 0.8rem; min-width: 2rem; color: var(--slate-400); }

/* ══════════════════════════════════════════════════════════════
   GRID.JS DARK THEME (audit-logs)
   ══════════════════════════════════════════════════════════════ */
.gridjs-wrapper   { border: 1px solid rgba(255,255,255,0.08) !important; border-radius: 8px !important; overflow: hidden !important; background: transparent !important; }
.gridjs-container { background: transparent !important; color: var(--text-secondary) !important; font-size: 0.8rem !important; font-family: 'Inter', sans-serif !important; }
.gridjs-head, .gridjs-tbody { background: transparent !important; }

.gridjs-search { padding: 0.6rem 1rem !important; background: transparent !important; border-bottom: 1px solid rgba(255,255,255,0.08) !important; }
.gridjs-search-input { background: rgba(255,255,255,0.06) !important; border: 1.5px solid rgba(255,255,255,0.1) !important; border-radius: 6px !important; color: var(--text-primary) !important; padding: 6px 10px !important; font-size: 0.82rem !important; font-family: 'Inter', sans-serif !important; outline: none !important; width: 100% !important; box-shadow: none !important; }
.gridjs-search-input:focus { border-color: var(--indigo) !important; }

table.gridjs-table { width: 100% !important; border-collapse: collapse !important; background: transparent !important; }

th.gridjs-th { background: rgba(0,0,0,0.35) !important; color: var(--slate-400) !important; border: none !important; border-bottom: 1px solid rgba(255,255,255,0.08) !important; padding: 9px 12px !important; font-size: 0.7rem !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 0.06em !important; font-family: 'Inter', sans-serif !important; white-space: nowrap !important; text-align: left !important; }
td.gridjs-td { background: transparent !important; color: var(--text-secondary) !important; border: none !important; border-bottom: 1px solid rgba(255,255,255,0.05) !important; padding: 8px 12px !important; font-family: 'Inter', sans-serif !important; font-size: 0.82rem !important; }

tr.gridjs-tr:nth-child(even) td.gridjs-td { background: rgba(255,255,255,0.02) !important; }
tr.gridjs-tr:hover td.gridjs-td { background: rgba(79,70,229,0.08) !important; }
tr.gridjs-tr:last-child td.gridjs-td { border-bottom: none !important; }

.gridjs-footer { background: transparent !important; border-top: 1px solid rgba(255,255,255,0.08) !important; padding: 0.5rem 1rem !important; }
.gridjs-pagination { background: transparent !important; }
.gridjs-pagination .gridjs-summary { font-size: 0.78rem !important; color: var(--slate-500) !important; }

.gridjs-pages button { background: rgba(255,255,255,0.04) !important; border: 1px solid rgba(255,255,255,0.1) !important; border-radius: 5px !important; color: var(--slate-400) !important; font-family: 'Inter', sans-serif !important; padding: 3px 9px !important; margin: 0 2px !important; cursor: pointer !important; font-size: 0.78rem !important; transition: all 0.12s !important; }
.gridjs-pages button:hover:not(:disabled) { background: rgba(79,70,229,0.2) !important; color: #a5b4fc !important; border-color: rgba(79,70,229,0.4) !important; }
.gridjs-pages button[disabled] { opacity: 0.35 !important; cursor: not-allowed !important; }
.gridjs-pages button.gridjs-currentPage { background: var(--indigo) !important; border-color: var(--indigo) !important; color: white !important; font-weight: 700 !important; }
.gridjs-loading, .gridjs-notfound { color: var(--slate-400) !important; background: transparent !important; }

/* ══════════════════════════════════════════════════════════════
   DETAIL TABLE (audit-log modal)
   ══════════════════════════════════════════════════════════════ */
.detail-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.84rem; }
.detail-table th { width: 160px; white-space: nowrap; padding: 6px 12px; color: var(--slate-400); font-weight: 600; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.06); background: rgba(0,0,0,0.15); }
.detail-table td { padding: 6px 12px; color: var(--text-secondary); border-bottom: 1px solid rgba(255,255,255,0.06); }
.detail-table tr:last-child th, .detail-table tr:last-child td { border-bottom: none; }

.export-group { display: flex; align-items: center; gap: 0.4rem; }
.export-label { font-size: 0.78rem; color: var(--slate-500); }



/* ══════════════════════════════════════════════════════════════
   SCROLLBAR DEFAULTS
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════════════════════════
   UTILITY
   ══════════════════════════════════════════════════════════════ */
.hidden       { display: none !important; }
.text-muted   { color: var(--slate-500) !important; }
.text-primary { color: var(--text-primary) !important; }
.input-group-text { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: var(--slate-400); }

/* ══════════════════════════════════════════════════════════════
   USER MANAGEMENT (user-management.html)
   ══════════════════════════════════════════════════════════════ */

/* User card */
.user-card {
    cursor: pointer;
    transition: all 0.15s;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    margin-bottom: 0.4rem;
    color: #e2e8f0;
}

.user-card .card-body { padding: 0.5rem 0.75rem; }
.user-card:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.3); background: rgba(255,255,255,0.07); }
.user-card.selected { border-color: var(--indigo) !important; background: rgba(79,70,229,0.15); }
.user-card.inactive { opacity: 0.5; background: rgba(255,255,255,0.02); }

/* Role / status badges (user-management specific sizes) */
.role-badge   { font-size: 0.6rem; padding: 0.15rem 0.4rem; line-height: 1; width: 62px; text-align: center; display: inline-block; border-radius: 4px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.status-badge { font-size: 0.55rem; padding: 0.15rem 0.4rem; margin-left: 0.2rem; line-height: 1; width: 58px; text-align: center; display: inline-block; border-radius: 4px; font-weight: 700; white-space: nowrap; overflow: hidden; }

.role-badge.admin    { background: rgba(239,68,68,0.2);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.role-badge.editor   { background: rgba(79,70,229,0.2);   color: #818cf8; border: 1px solid rgba(79,70,229,0.4); }
.role-badge.trusted  { background: rgba(6,182,212,0.2);   color: #67e8f9; border: 1px solid rgba(6,182,212,0.4); }
.role-badge.read_only { background: rgba(255,255,255,0.07); color: var(--slate-400); border: 1px solid rgba(255,255,255,0.12); }

.status-badge.active   { background: var(--green-dim); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.4); }
.status-badge.inactive { background: rgba(255,255,255,0.06); color: var(--slate-400); border: 1px solid rgba(255,255,255,0.1); }

/* Role palette badges */
.role-palette-badge {
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid transparent;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.role-palette-badge:hover { transform: scale(1.05); box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
.role-palette-badge.active { box-shadow: 0 0 0 3px rgba(79,70,229,0.5); }
.role-palette-badge.admin    { background: rgba(239,68,68,0.2);   color: #fca5a5; border-color: rgba(239,68,68,0.4); }
.role-palette-badge.editor   { background: rgba(79,70,229,0.2);   color: #818cf8; border-color: rgba(79,70,229,0.4); }
.role-palette-badge.trusted  { background: rgba(6,182,212,0.2);   color: #67e8f9; border-color: rgba(6,182,212,0.4); }
.role-palette-badge.read_only { background: rgba(255,255,255,0.07); color: var(--slate-400); border-color: rgba(255,255,255,0.12); }

.role-palette-mini-badge {
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    margin: 0.25rem;
    border-radius: 6px;
    display: inline-block;
}

.user-name { font-size: 0.85rem; font-weight: 600; color: #e2e8f0; margin: 0; line-height: 1; }

/* Two-column layout */
.um-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.um-list   { flex: 1 1 0; min-width: 0; }
.um-panel  { width: 420px; flex-shrink: 0; position: sticky; top: 1rem; }

/* Panel cards */
.um-panel-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.um-panel-card h5, .um-panel-card h6 {
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.selected-user-info {
    background: rgba(79,70,229,0.12);
    border: 1px solid rgba(79,70,229,0.3);
    color: #e2e8f0;
    font-size: 0.88rem;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

/* Textarea */
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.2);
}

textarea::placeholder { color: var(--slate-500); }

/* Action button variants */
.btn-slate {
    background: var(--slate-700);
    color: #e2e8f0;
    border: 1px solid var(--slate-600);
    font-family: 'Inter', sans-serif;
}

.btn-slate:hover:not(:disabled) { background: var(--slate-600); }

.super-badge {
    background: var(--amber-dim);
    border: 1px solid var(--amber);
    color: var(--amber);
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tab bar */
.tab-bar {
    display: flex;
    border-bottom: 2px solid rgba(255,255,255,0.08);
    padding: 0 2.5rem;
    background: rgba(255,255,255,0.02);
    justify-content: space-between;
    align-items: center;
}

.tab-btn {
    padding: 1rem 1.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--slate-400);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.tab-btn:hover { color: #e2e8f0; }
.tab-btn.active { color: var(--indigo); border-bottom-color: var(--indigo); }

.tab-content { padding: 2rem 2.5rem; }
.tab-content.active { display: block; }

/* Org list */
.org-list {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.org-row {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.25rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    transition: background 0.15s;
}

.org-row:last-child { border-bottom: none; }
.org-row:hover { background: rgba(255,255,255,0.06); }
.org-row.is-inactive { opacity: 0.5; }

.org-name { flex: 1; font-weight: 600; font-size: 0.92rem; color: #e2e8f0; }
.org-meta  { font-size: 0.78rem; color: var(--slate-500); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.org-row-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* Status badges — shared with user-management (.status-badge defined in USER MANAGEMENT section above) */
.status-badge.active    { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }
.status-badge.inactive  { background: var(--red-dim);   color: var(--red);   border: 1px solid var(--red); }
.status-badge.developer { background: rgba(79,70,229,0.15); color: #818cf8;  border: 1px solid rgba(79,70,229,0.4); }

/* Small action buttons */
.btn-sm-action {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    border: 1.5px solid;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s;
    background: transparent;
    font-family: 'Inter', sans-serif;
}

.btn-sm-action:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm-action { color: #818cf8; border-color: rgba(79,70,229,0.5); }
.btn-sm-action:hover:not(:disabled) { background: var(--indigo-dim); color: #a5b4fc; border-color: rgba(79,70,229,0.8); }

/* Onboard / primary action button */
.btn-onboard {
    background: linear-gradient(135deg, var(--indigo), #4338ca);
    color: white;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.btn-onboard:hover:not(:disabled) { background: linear-gradient(135deg, #4338ca, #3730a3); transform: translateY(-1px); }
.btn-onboard:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Onboard form */
.onboard-form { max-width: 560px; }

.form-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-400);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.form-section-title:first-child { margin-top: 0; }

/* Result block */
.result-block {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 10px;
    border: 1.5px solid;
    display: none;
}

.result-block.success { background: var(--green-dim); border-color: var(--green); }
.result-block.error   { background: var(--red-dim);   border-color: var(--red); }
.result-block .result-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.75rem; }
.result-block.success .result-title { color: var(--green); }
.result-block.error   .result-title { color: var(--red); }

/* Credential display */
.credential-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; }
.credential-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--slate-500); width: 80px; flex-shrink: 0; }
.credential-value { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: #e2e8f0; background: rgba(255,255,255,0.06); padding: 0.2rem 0.6rem; border-radius: 4px; border: 1px solid rgba(255,255,255,0.1); flex: 1; }

/* State block */
.state-block { text-align: center; padding: 3rem 2rem; color: var(--slate-400); }
.state-block i { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }

/* Task table */
.task-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }

.task-table thead th {
    background: rgba(0,0,0,0.35);
    color: rgba(255,255,255,0.7);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: none;
    white-space: nowrap;
    padding: 10px 14px;
    text-align: left;
}

.task-table tbody tr { vertical-align: middle; cursor: pointer; transition: background 0.1s; }
.task-table tbody tr:hover td { background: rgba(79,70,229,0.1) !important; }
.task-table tbody td { font-size: 0.82rem; color: #cbd5e1; border-bottom: 1px solid rgba(255,255,255,0.06); padding: 8px 14px; background: rgba(255,255,255,0.02); }
.task-table tbody tr:last-child td { border-bottom: none; }

tr.selected-row td { background: rgba(79,70,229,0.15) !important; border-left: 3px solid var(--indigo); }
tr.locked-by-other { opacity: 0.55; }

/* Task table wrapper */
.task-table-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}

/* Inbox toolbar */
.inbox-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.badge-count {
    background: var(--indigo);
    color: white;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
}

/* Lock badges */
.lock-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: 600;
}

.lock-badge.mine  { background: rgba(79,70,229,0.2);  color: #818cf8; }
.lock-badge.other { background: rgba(245,158,11,0.2); color: #fcd34d; }
.lock-badge.exp   { background: rgba(255,255,255,0.06); color: var(--slate-400); }

/* Detail panel */
.detail-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
    font-weight: 700;
    margin-bottom: 0.6rem;
    margin-top: 1.25rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.detail-section-title:first-child { margin-top: 0; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
}

.detail-label { font-size: 0.68rem; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.1rem; }
.detail-value { font-size: 0.85rem; color: #e2e8f0; font-weight: 500; word-break: break-word; }
.detail-value.highlight { color: #818cf8; font-weight: 700; font-size: 1rem; }
.detail-value.status-pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: rgba(245,158,11,0.2); color: #fcd34d; }

/* Decision buttons */
.decision-btn {
    font-size: 0.85rem;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    flex: 1;
}

.decision-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.decision-btn.approve { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.decision-btn.approve:hover:not(:disabled) { background: rgba(16,185,129,0.25); transform: translateY(-1px); }
.decision-btn.reject  { background: rgba(239,68,68,0.15);  color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.decision-btn.reject:hover:not(:disabled)  { background: rgba(239,68,68,0.25);  transform: translateY(-1px); }
.decision-btn.generic { background: rgba(79,70,229,0.15);  color: #a5b4fc; border-color: rgba(79,70,229,0.3); }
.decision-btn.generic:hover:not(:disabled) { background: rgba(79,70,229,0.25);  transform: translateY(-1px); }

/* Session overlay */
.session-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15,23,42,0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-overlay-card {
    max-width: 420px;
    width: 100%;
    background: var(--slate-800);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
}

/* Centred glow background */
body::after {
    content: '';
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 900px; height: 600px;
    background: radial-gradient(ellipse, rgba(79,70,229,0.14) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

#homeContent {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1300px;
}

/* Nav button grid */
.nav-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.nav-row .btn-architect { flex: 1 1 140px; }

/* Nav section headings */
.nav-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #818cf8;
    text-align: center;
    margin: 0.75rem 0 0.6rem;
}

/* Nav card buttons */
.btn-architect {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
}

.btn-architect i { font-size: 1.3rem; color: #5b5bd6; }

.btn-architect:hover:not(.disabled) {
    border-color: var(--indigo);
    background: rgba(79,70,229,0.12);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
    color: #e2e8f0;
}

.btn-architect.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(255,255,255,0.02);
    pointer-events: none;
}

/* Header action buttons */
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.header-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

#admin-controls {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.btn-header {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.8);
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-header:hover { background: rgba(255,255,255,0.1); color: white; }
.btn-header.danger { border-color: rgba(239,68,68,0.5); color: #fca5a5; }
.btn-header.danger:hover { background: rgba(239,68,68,0.15); }

/* Session expired panel */
#sessionAlert {
    display: none;
    width: 100%; max-width: 1300px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    position: relative; z-index: 1;
}

/* ══════════════════════════════════════════════════════════════
   TRAIL MANAGER (trail-manager.html)
   ══════════════════════════════════════════════════════════════ */

.summary-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.summary-pill { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.85rem; border-radius: 20px; font-size: 0.78rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.summary-pill.running { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.summary-pill.idle    { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); color: var(--slate-400); }
.summary-pill.test    { background: var(--amber-dim); border-color: var(--amber); color: var(--amber); }

.card-body-custom { padding: 1.75rem 2.5rem; flex: 1; overflow-y: auto; min-height: 0; }

.tm-body { padding: 1.75rem 2.5rem; flex: 1; overflow-y: auto; min-height: 0; display: block; }

.section-header {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.9rem; cursor: pointer; user-select: none;
    border-radius: 8px; margin-bottom: 0.35rem; transition: background 0.15s;
}
.section-header:hover { background: rgba(255,255,255,0.05); }
.section-header-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate-500); flex: 1; }
.section-header-count { font-size: 0.72rem; font-weight: 600; color: var(--slate-400); }
.section-chevron { font-size: 0.7rem; color: var(--slate-400); transition: transform 0.2s; }
.section-chevron.collapsed { transform: rotate(-90deg); }
.section-body { overflow: hidden; transition: max-height 0.25s ease; }
.section-body.collapsed { max-height: 0 !important; }
.section-wrap { margin-bottom: 0.75rem; }

.trail-list { display: flex; flex-direction: column; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; overflow: hidden; }

.trail-row {
    display: flex; align-items: center; padding: 0.85rem 1.25rem; gap: 1rem;
    cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s; background: rgba(255,255,255,0.02);
    border-left: 3px solid transparent;
}
.trail-row:last-child { border-bottom: none; }
.trail-row:hover { background: rgba(255,255,255,0.05); }
.trail-row.is-running { border-left-color: var(--green); }
.trail-row.is-test    { border-left-color: var(--amber); }

.trail-row-icon { font-size: 1.4rem; width: 32px; text-align: center; flex-shrink: 0; }
.trail-row-name { flex: 1; font-weight: 600; font-size: 0.92rem; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trail-row-badges { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.trail-row-chevron { color: var(--slate-400); font-size: 0.85rem; flex-shrink: 0; }

.badge-version { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; font-weight: 600; padding: 0.18rem 0.5rem; border-radius: 4px; }
.badge-version.live { background: rgba(79,70,229,0.2); color: #818cf8; border: 1px solid rgba(79,70,229,0.5); }
.badge-version.test { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.5); }

.badge-unconfigured { font-size: 0.7rem; font-weight: 700; padding: 0.18rem 0.6rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em; background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid var(--red); }

.badge-status { font-size: 0.7rem; font-weight: 700; padding: 0.18rem 0.6rem; border-radius: 4px; display: flex; align-items: center; gap: 0.3rem; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-status.running { background: var(--green-dim); color: var(--green); }
.badge-status.idle    { background: rgba(255,255,255,0.08); color: #94a3b8; }

.detail-section { margin-bottom: 1.25rem; }
.detail-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate-400); margin-bottom: 0.35rem; }
.detail-value { font-size: 0.88rem; color: #e2e8f0; }

.last-run-block { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 0.85rem 1rem; }
.last-run-time  { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; font-weight: 600; color: #e2e8f0; margin-bottom: 0.2rem; }
.last-run-summary { font-size: 0.8rem; color: #94a3b8; }
.no-runs { font-size: 0.8rem; color: var(--slate-400); font-style: italic; }

/* ══════════════════════════════════════════════════════════════
   ANT DASH (ant-dash.html)
   ══════════════════════════════════════════════════════════════ */

.colony-badge { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: white; padding: 0.35rem 0.75rem; border-radius: 6px; font-weight: 600; font-size: 0.85rem; }

.content-wrapper { display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; }

.sidebar {
    width: 100%; flex-shrink: 0; background: #1e293b;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; flex-direction: row; flex-wrap: wrap;
    align-items: center; justify-content: center;
    padding: 8px; gap: 6px;
}

.ant-tile {
    width: 88px; cursor: grab; padding: 8px 6px;
    border: 2px solid transparent; border-radius: 10px;
    transition: 0.2s; text-align: center; user-select: none;
    display: flex; flex-direction: column; align-items: center;
}
.ant-tile:hover  { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.3); }
.ant-tile:active { cursor: grabbing; }
.ant-tile .ant-icon  { font-size: 1.4rem; display: block; margin-bottom: 3px; }
.ant-tile .ant-label { font-size: 0.62rem; font-weight: 600; display: block; line-height: 1.2; }
.ant-tile .ant-desc  { font-size: 0.55rem; display: block; line-height: 1.2; margin-top: 2px; opacity: 0.8; }

.ant-tile-decision   { background: rgba(21,128,61,0.2);   border-color: rgba(134,239,172,0.3); color: #86efac; }
.ant-tile-decision:hover { background: rgba(21,128,61,0.3);   border-color: rgba(134,239,172,0.5); }
.ant-tile-action     { background: rgba(217,119,6,0.2);   border-color: rgba(253,211,77,0.3);  color: #fcd34d; }
.ant-tile-action:hover   { background: rgba(217,119,6,0.3);   border-color: rgba(253,211,77,0.5); }
.ant-tile-rollup     { background: rgba(180,83,9,0.2);    border-color: rgba(253,186,116,0.3); color: #fdba74; }
.ant-tile-rollup:hover   { background: rgba(180,83,9,0.3);    border-color: rgba(253,186,116,0.5); }
.ant-tile-comms      { background: rgba(29,78,216,0.2);   border-color: rgba(147,197,253,0.3); color: #93c5fd; }
.ant-tile-comms:hover    { background: rgba(29,78,216,0.3);   border-color: rgba(147,197,253,0.5); }
.ant-tile-human      { background: rgba(124,58,237,0.2);  border-color: rgba(192,132,252,0.3); color: #c084fc; }
.ant-tile-human:hover    { background: rgba(124,58,237,0.3);  border-color: rgba(192,132,252,0.5); }
.ant-tile-accounting { background: rgba(29,78,216,0.2);   border-color: rgba(147,197,253,0.3); color: #93c5fd; }
.ant-tile-accounting:hover { background: rgba(29,78,216,0.3); border-color: rgba(147,197,253,0.5); }
.ant-tile-payment          { background: rgba(15,118,110,0.2);  border-color: rgba(94,234,212,0.3);  color: #5eead4; }
.ant-tile-payment:hover        { background: rgba(15,118,110,0.3);  border-color: rgba(94,234,212,0.5); }
.ant-tile-payment_complete     { background: rgba(15,118,110,0.2);  border-color: rgba(94,234,212,0.3);  color: #5eead4; }
.ant-tile-payment_complete:hover { background: rgba(15,118,110,0.3);  border-color: rgba(94,234,212,0.5); }

.main-content { flex: 1; display: flex; flex-direction: column; background: #1e293b; position: relative; }
.canvas-viewport { flex-grow: 1; overflow: hidden; position: relative; cursor: grab; }
canvas { display: block; background: #1e293b; }

.log-entry { margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 8px; background: rgba(255,255,255,0.04); border-radius: 4px; color: #e2e8f0; }

.spin { animation: oa-rotation 2s infinite linear; display: inline-block; }
@keyframes oa-rotation { from { transform: rotate(0deg); } to { transform: rotate(359deg); } }

#trail-status-banner { display:none; align-items:center; justify-content:space-between; padding:7px 20px; font-size:0.82rem; font-weight:600; letter-spacing:0.02em; border-bottom: 1px solid rgba(0,0,0,0.08); }
#trail-status-banner.state-test-idle    { background:rgba(217,119,6,0.15);  color:#fcd34d; border-bottom-color:rgba(217,119,6,0.3); }
#trail-status-banner.state-test-running { background:rgba(22,163,74,0.15);  color:#86efac; border-bottom-color:rgba(22,163,74,0.3); }
#trail-status-banner.state-live-idle    { background:rgba(100,116,139,0.15); color:#94a3b8; border-bottom-color:rgba(100,116,139,0.3); }
#trail-status-banner.state-live-running { background:rgba(22,163,74,0.15);  color:#86efac; border-bottom-color:rgba(22,163,74,0.3); }

.banner-pulse { display:inline-block; width:8px; height:8px; border-radius:50%; background:currentColor; margin-right:7px; animation:bannerPulse 1.4s ease-in-out infinite; }
@keyframes bannerPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.7)} }
.banner-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:currentColor; margin-right:7px; opacity:0.5; }
.btn-reset-banner { font-size:0.75rem; font-weight:600; padding:3px 12px; border-radius:6px; border:1.5px solid currentColor; background:transparent; color:inherit; cursor:pointer; }
.btn-reset-banner:hover { opacity:0.75; }

.tables-panel { position:absolute; top:56px; right:12px; width:320px; background:#1e293b; border:1px solid rgba(255,255,255,0.1); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,0.4); z-index:1000; display:none; }
.tables-panel.open { display:block; }
.tables-panel-header { padding:12px 16px; border-bottom:1px solid rgba(255,255,255,0.08); display:flex; justify-content:space-between; align-items:center; }
.tables-panel-header h6 { margin:0; font-size:0.85rem; font-weight:700; color:#e2e8f0; }
.tables-panel-actions { display:flex; gap:8px; }
.tables-panel-actions a { font-size:0.75rem; color:#818cf8; cursor:pointer; text-decoration:none; }
.tables-panel-actions a:hover { text-decoration:underline; }
.tables-panel-body { padding:10px 16px; max-height:360px; overflow-y:auto; }
.tables-panel-search { width:100%; padding:6px 10px; border:1px solid rgba(255,255,255,0.1); border-radius:6px; font-size:0.8rem; margin-bottom:10px; outline:none; background:rgba(255,255,255,0.06); color:#e2e8f0; }
.tables-panel-search:focus { border-color:#4f46e5; }
.table-check-item { display:flex; align-items:center; gap:8px; padding:4px 2px; border-radius:4px; }
.table-check-item:hover { background:rgba(255,255,255,0.06); }
.table-check-item input[type=checkbox] { width:14px; height:14px; cursor:pointer; accent-color:#4f46e5; flex-shrink:0; }
.table-check-item label { font-size:0.78rem; color:#94a3b8; cursor:pointer; font-family:monospace; flex:1; }
.table-check-item label.advisory { color:#818cf8; font-weight:600; }
.tables-badge { background:#4f46e5; color:white; font-size:0.6rem; font-weight:700; border-radius:10px; padding:1px 5px; margin-left:4px; vertical-align:middle; }
.btn-tables { background:rgba(255,255,255,0.15); border:1px solid rgba(255,255,255,0.3); color:white; padding:0.35rem 0.75rem; border-radius:6px; font-weight:600; font-size:0.85rem; cursor:pointer; transition:0.2s; white-space:nowrap; min-width:max-content; }
.btn-tables:hover { background:rgba(255,255,255,0.25); }

#page-loader { position:fixed; inset:0; z-index:9999; background:#0f172a; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1.25rem; transition:opacity 0.3s ease; }
#page-loader.fade-out { opacity:0; pointer-events:none; }
#page-loader .loader-logo { font-size:2rem; font-weight:800; letter-spacing:-1px; color:white; font-family:'Inter',sans-serif; }
#page-loader .loader-logo span { color:#4f46e5; }
#page-loader .loader-text { font-size:0.85rem; color:#94a3b8; font-family:'Inter',sans-serif; font-weight:500; letter-spacing:0.05em; }
.loader-ring { width:44px; height:44px; border:4px solid rgba(255,255,255,0.1); border-top-color:#4f46e5; border-radius:50%; animation:oa-spin 0.8s linear infinite; }

/* ══════════════════════════════════════════════════════════════
   API CATALOGUE (api-catalogue.html)
   ══════════════════════════════════════════════════════════════ */

.page-card-viewport { height: calc(100vh - 40px); display: flex; flex-direction: column; }


/* ══════════════════════════════════════════════════════════════
   RECORD VIEW (record-view.html)
   ══════════════════════════════════════════════════════════════ */

.page-wrapper { width: 100%; max-width: 1600px; position: relative; z-index: 1; }

.page-header { background: var(--slate-900); padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 4px solid var(--indigo); }
.header-brand { display: flex; align-items: center; gap: 1rem; }
.header-brand a { text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.btn-hdr { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25); color: white; padding: 0.45rem 1rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; transition: all 0.2s; text-decoration: none; font-family: 'Inter', sans-serif; }
.btn-hdr:hover       { background: rgba(255,255,255,0.2); color: white; transform: translateY(-1px); }
.btn-hdr.btn-save    { background: #16a34a; border-color: #16a34a; }
.btn-hdr.btn-save:hover   { background: #15803d; }
.btn-hdr.btn-edit    { background: var(--indigo); border-color: var(--indigo); }
.btn-hdr.btn-edit:hover   { background: var(--indigo-dark); }
.btn-hdr.btn-delete  { background: var(--red); border-color: var(--red); }
.btn-hdr.btn-delete:hover { background: #b91c1c; }
.btn-hdr.btn-cancel  { background: rgba(255,255,255,0.08); }

.record-card   { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.record-panel  { border-bottom: 1px solid rgba(255,255,255,0.08); }
.record-fields { padding: 1.25rem 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

.field-item  { display: flex; flex-direction: column; gap: 0.2rem; }
.field-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate-500); }
.field-value { font-size: 0.7rem; color: #e2e8f0; font-weight: 500; padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); min-height: 2rem; display: flex; align-items: center; }
.field-value.empty { color: var(--slate-500); font-style: italic; }

.field-input { font-size: 0.88rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 0.35rem 0.6rem; width: 100%; color: #f1f5f9; transition: border-color 0.2s, box-shadow 0.2s; background: rgba(255,255,255,0.06); font-family: 'Inter', sans-serif; }
.field-input:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); outline: none; }
.field-input[disabled] { background: rgba(255,255,255,0.02); color: var(--slate-500); cursor: not-allowed; }
.field-input.is-select { appearance: auto; }

.tabs-header { background: rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.08); padding: 0 1.5rem; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0; }
.tab-row-break { width: 100%; height: 0; border-top: 1px solid rgba(255,255,255,0.08); margin: 0 -1.5rem; flex-basis: 100%; }

.tab-btn { background: none; border: none; border-bottom: 3px solid transparent; padding: 0.65rem 0.9rem; font-size: 0.8rem; font-weight: 600; color: var(--slate-400); cursor: pointer; transition: all 0.2s; white-space: nowrap; display: flex; align-items: center; gap: 0.4rem; font-family: 'Inter', sans-serif; }
.tab-btn:hover  { color: #e2e8f0; }
.tab-btn.active { color: var(--indigo); border-bottom-color: var(--indigo); }

.tab-count { background: rgba(255,255,255,0.1); color: #94a3b8; border-radius: 10px; padding: 0.05rem 0.45rem; font-size: 0.7rem; font-weight: 700; }
.tab-btn.active .tab-count { background: rgba(79,70,229,0.15); color: #818cf8; }

.tab-content { padding: 1.25rem 1.5rem; }
.tab-pane        { display: none; }
.tab-pane.active { display: block; }

.child-toolbar     { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; gap: 0.5rem; }
.child-search-wrap { position: relative; flex: 1; max-width: 320px; }
.child-search-icon { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); color: var(--slate-400); font-size: 0.8rem; pointer-events: none; }
.child-search-input { width: 100%; padding: 0.35rem 0.75rem 0.35rem 1.9rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; font-size: 0.8rem; color: #f1f5f9; background: rgba(255,255,255,0.06); transition: border-color 0.2s, box-shadow 0.2s; }
.child-search-input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.child-search-input::placeholder { color: var(--slate-500); }

.btn-add-child { background: var(--indigo); border: none; color: white; padding: 0.4rem 0.9rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; transition: all 0.2s; white-space: nowrap; flex-shrink: 0; font-family: 'Inter', sans-serif; }
.btn-add-child:hover { background: var(--indigo-dark); transform: translateY(-1px); }

.child-grid-container .gridjs-wrapper  { border-radius: 10px !important; overflow: hidden !important; border: 1px solid rgba(255,255,255,0.08) !important; box-shadow: none !important; background: #1e293b !important; }
.child-grid-container .gridjs-container { font-size: 0.82rem; font-family: 'Inter', sans-serif; background: #1e293b !important; }
.child-grid-container .gridjs-table    { background: #1e293b !important; }
.child-grid-container .gridjs-tbody    { background: #1e293b !important; }
.child-grid-container .gridjs-thead th.gridjs-th { background: #0f172a !important; color: rgba(255,255,255,0.85) !important; font-size: 0.68rem !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 0.06em !important; padding: 8px 12px !important; border-bottom: none !important; border-right: 1px solid rgba(255,255,255,0.08) !important; }
.child-grid-container .gridjs-thead th.gridjs-th:last-child { border-right: none !important; }
.child-grid-container .gridjs-tbody td.gridjs-td { padding: 7px 12px !important; border-bottom: 1px solid rgba(255,255,255,0.06) !important; border-right: 1px solid rgba(255,255,255,0.06) !important; color: #cbd5e1 !important; background: #1e293b !important; vertical-align: middle; }
.child-grid-container .gridjs-tbody td.gridjs-td:last-child { border-right: none !important; }
.child-grid-container .gridjs-tbody tr.gridjs-tr:nth-child(even) td.gridjs-td { background: #243044 !important; }
.child-grid-container .gridjs-tbody tr.gridjs-tr:hover td.gridjs-td { background: rgba(79,70,229,0.1) !important; }
.child-grid-container .gridjs-tbody tr.gridjs-tr:last-child td.gridjs-td { border-bottom: none !important; }

/* Child grid action buttons — icon-only, no border */
.child-action-btn {
    background: none;
    border: none;
    padding: 2px 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.child-action-btn.view  { color: #818cf8; }
.child-action-btn.view:hover  { background: rgba(129,140,248,0.15); color: #a5b4fc; }
.child-action-btn.edit  { color: #fbbf24; }
.child-action-btn.edit:hover  { background: rgba(251,191,36,0.12); color: #fcd34d; }
.child-action-btn.del   { color: #fca5a5; }
.child-action-btn.del:hover   { background: rgba(239,68,68,0.12); color: #fca5a5; }

.child-pagination-panel { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; border-top: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); font-size: 0.76rem; }
.child-pagination-panel button { background: none; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 0.2rem 0.55rem; font-size: 0.76rem; cursor: pointer; color: #94a3b8; transition: background 0.15s; font-family: 'Inter', sans-serif; }
.child-pagination-panel button:hover:not(:disabled) { background: rgba(79,70,229,0.1); border-color: var(--indigo); }
.child-pagination-panel button.active   { background: var(--indigo); color: white; border-color: var(--indigo); }
.child-pagination-panel button:disabled { opacity: 0.4; cursor: default; }

.cascade-tree { background: rgba(255,255,255,0.04); border-radius: 10px; padding: 1rem; border-left: 4px solid var(--indigo); max-height: 300px; overflow-y: auto; text-align: left; font-size: 0.85rem; color: #ffffff; }
.form-label-small { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 0.25rem; }

.page-wrapper > * { animation: oa-fadeUp 0.25s ease both; }
.page-wrapper > *:nth-child(2) { animation-delay: 0.05s; }
.page-wrapper > *:nth-child(3) { animation-delay: 0.1s; }
.page-wrapper > *:nth-child(4) { animation-delay: 0.15s; }
@keyframes oa-fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════════════════════════════════
   DATA VIEW (data-view.html)
   ══════════════════════════════════════════════════════════════ */

.header-brand-section { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.header-brand-section a { text-decoration: none; color: inherit; }
.header-brand-section h1 { font-weight: 800; margin: 0; font-size: 1.8rem; letter-spacing: -1px; white-space: nowrap; color: var(--blue); }
.header-brand-section h1 span { color: var(--indigo); }

.header-page-title { position: absolute; left: 50%; transform: translateX(-50%); color: var(--blue); font-size: 1.4rem; font-weight: 700; margin: 0; pointer-events: none; white-space: nowrap; }
.header-right-section { margin-left: auto; display: flex; align-items: center; }

.header-select { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; border-radius: 12px; padding: 0.6rem 1rem; width: 100%; max-width: 400px; font-weight: 500; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.header-select:focus { background: rgba(255,255,255,0.15); color: white; outline: none; box-shadow: 0 0 0 4px rgba(79,70,229,0.2); }
.header-select option { background: #1e293b; color: white; }

.header-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); color: white; padding: 0.6rem 1.2rem; border-radius: 10px; font-weight: 600; font-size: 0.85rem; transition: all 0.2s; white-space: nowrap; display: flex; align-items: center; gap: 6px; cursor: pointer; font-family: 'Inter', sans-serif; }
.header-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); transform: translateY(-1px); }

.btn-home-nav { background: var(--indigo); border: none; padding: 0.5rem 1.2rem; border-radius: 10px; font-weight: 600; font-size: 0.85rem; text-decoration: none; color: white; transition: all 0.2s; display: flex; align-items: center; gap: 8px; font-family: 'Inter', sans-serif; }
.btn-home-nav:hover { background: var(--indigo-dark); color: white; transform: translateY(-1px); }

#displayArea { padding: 2.5rem; min-height: 400px; }
.welcome-state { text-align: center; padding: 6rem 2rem; color: #94a3b8; }
.welcome-icon  { font-size: 4rem; opacity: 0.2; margin-bottom: 1.5rem; display: block; }

.cascade-preview { max-height: 400px; overflow-y: auto; text-align: left; }

/* Grid overrides for data-view */
.gridjs-wrapper  { border-radius: 12px !important; border: 1px solid rgba(255,255,255,0.08) !important; box-shadow: none !important; background: #1e293b !important; overflow: hidden !important; }
.gridjs-container { font-size: 0.82rem; font-family: 'Inter', sans-serif; background: #1e293b !important; }
.gridjs-table  { background: #1e293b !important; }
.gridjs-tbody  { background: #1e293b !important; }
.gridjs-thead th.gridjs-th { background: var(--slate-900) !important; color: rgba(255,255,255,0.85) !important; font-size: 0.7rem !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 0.06em !important; padding: 10px 14px !important; border-bottom: none !important; border-right: 1px solid rgba(255,255,255,0.08) !important; white-space: nowrap; }
.gridjs-thead th.gridjs-th:last-child { border-right: none !important; }
.gridjs-thead th.gridjs-th-sort:hover { background: var(--slate-800) !important; }
.gridjs-sort { float: right; height: 1em; cursor: pointer; fill: rgba(255,255,255,0.25) !important; }
.gridjs-sort-neutral { fill: rgba(255,255,255,0.2) !important; }
.gridjs-sort-asc     { fill: #818cf8 !important; }
.gridjs-sort-desc    { fill: #818cf8 !important; }
button.gridjs-sort { background: none; border: none; padding: 0; margin-left: 4px; vertical-align: middle; }
.gridjs-tbody td.gridjs-td { padding: 8px 14px !important; border-bottom: 1px solid rgba(255,255,255,0.06) !important; border-right: 1px solid rgba(255,255,255,0.06) !important; color: #cbd5e1 !important; background: #1e293b !important; vertical-align: middle; }
.gridjs-tbody td.gridjs-td:last-child { border-right: none !important; }
.gridjs-tbody tr.gridjs-tr { cursor: pointer; }
.gridjs-tbody tr.gridjs-tr:hover td.gridjs-td { background: rgba(79,70,229,0.1) !important; color: #e2e8f0; }
.gridjs-tbody tr.gridjs-tr:last-child td.gridjs-td { border-bottom: none !important; }
.gridjs-tbody tr.gridjs-tr:nth-child(even) td.gridjs-td { background: #243044 !important; }
.gridjs-tbody tr.gridjs-tr:nth-child(even):hover td.gridjs-td { background: rgba(79,70,229,0.1) !important; }
.gridjs-search { margin-bottom: 0.75rem; }
.gridjs-search-input { border: 1px solid rgba(255,255,255,0.1) !important; border-radius: 8px !important; padding: 0.45rem 0.85rem !important; font-size: 0.82rem !important; color: #f1f5f9 !important; background: rgba(255,255,255,0.06) !important; }
.gridjs-search-input:focus { border-color: var(--indigo) !important; box-shadow: 0 0 0 3px rgba(79,70,229,0.12) !important; outline: none !important; }
.gridjs-notfound, .gridjs-empty { color: var(--slate-400) !important; font-style: italic; padding: 2rem !important; }

#pagination-panel { display: flex; align-items: center; justify-content: space-between; margin-top: 0.75rem; padding: 0.6rem 1rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; color: var(--slate-500); font-size: 0.78rem; }
#pagination-panel button { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: #94a3b8; font-size: 0.78rem; padding: 0.25rem 0.6rem; margin: 0 2px; cursor: pointer; transition: all 0.15s; font-family: 'Inter', sans-serif; }
#pagination-panel button:hover:not(:disabled) { background: var(--indigo); border-color: var(--indigo); color: white; }
#pagination-panel button.active   { background: var(--indigo); border-color: var(--indigo); color: white; font-weight: 700; }
#pagination-panel button:disabled { opacity: 0.4; cursor: not-allowed; }

#grid-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }

.search-wrap { position: relative; flex: 1; max-width: 360px; }
.search-icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--slate-400); font-size: 0.85rem; pointer-events: none; }
.grid-search-input { width: 100%; padding: 0.4rem 0.85rem 0.4rem 2rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; font-size: 0.82rem; color: #f1f5f9; background: rgba(255,255,255,0.06); transition: border-color 0.2s, box-shadow 0.2s; }
.grid-search-input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.grid-search-input::placeholder { color: var(--slate-500); }

.col-toggle-wrap { position: relative; }
.col-toggle-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #94a3b8; padding: 0.4rem 0.85rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; transition: all 0.15s; font-family: 'Inter', sans-serif; }
.col-toggle-btn:hover  { border-color: var(--indigo); color: var(--indigo); }
.col-toggle-btn.active { border-color: var(--indigo); color: #818cf8; background: rgba(79,70,229,0.1); }
.col-toggle-badge { background: var(--indigo); color: white; border-radius: 10px; padding: 0.05rem 0.4rem; font-size: 0.68rem; font-weight: 700; display: none; }
.col-toggle-badge.visible { display: inline; }

.col-dropdown { position: absolute; top: calc(100% + 6px); right: 0; background: #1e293b; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); min-width: 220px; z-index: 1000; display: none; overflow: hidden; }
.col-dropdown.open { display: block; }
.col-dropdown-header { padding: 0.6rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: space-between; }
.col-dropdown-header span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; }
.col-dropdown-reset { font-size: 0.75rem; color: var(--indigo); cursor: pointer; font-weight: 600; background: none; border: none; padding: 0; }
.col-dropdown-reset:hover { text-decoration: underline; }
.col-dropdown-list { max-height: 280px; overflow-y: auto; padding: 0.4rem 0; }
.col-dropdown-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 1rem; cursor: pointer; transition: background 0.1s; font-size: 0.82rem; color: #cbd5e1; }
.col-dropdown-item:hover { background: rgba(255,255,255,0.06); }
.col-dropdown-item input[type=checkbox] { accent-color: var(--indigo); width: 14px; height: 14px; cursor: pointer; flex-shrink: 0; }

.btn-row-open {
    background: rgba(79,70,229,0.15);
    border: 1px solid rgba(79,70,229,0.4);
    color: #818cf8;
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    transition: background 0.15s;
}