/* =========================================================
   MicroLoanFin — Clean Light Corporate Theme
   ========================================================= */

/* ===== CSS VARIABLES ===== */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --ink: #1e293b;
    --ink-soft: #475569;
    --muted: #64748b;
    --accent: #3b82f6;
    --accent-deep: #2563eb;
    --accent-dark: #1d4ed8;
    --danger: #ef4444;
    --danger-deep: #dc2626;
    --success: #22c55e;
    --success-deep: #16a34a;
    --warning: #f59e0b;
    --warning-deep: #d97706;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --nav-bg: #1e293b;
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.14);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 4px rgba(15, 23, 42, 0.06);
    --radius: 8px;
    --radius-lg: 12px;
    --control-height: 38px;
    --control-pad-y: 8px;
    --control-pad-x: 12px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    font-size: 13px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
}

a {
    color: var(--accent-deep);
    text-decoration: none;
}

a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
    margin: 0 0 10px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}

p { margin: 0; }

code {
    padding: 2px 7px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: var(--accent-deep);
    font-size: 0.92em;
    border-radius: 4px;
}

ul {
    margin: 10px 0 0;
    padding-left: 18px;
}

.container {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
}

/* ===== NAVBAR ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.topbar-inner {
    display: flex;
    align-items: center;
    height: 58px;
    gap: 0;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: #fff;
    background: var(--accent);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* Nav menu links (integrated in topbar) */
.menu-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
    min-width: 0;
}

.menu-wrap::-webkit-scrollbar { display: none; }

.menu {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.menu-link {
    display: inline-flex;
    align-items: center;
    height: 58px;
    padding: 0 13px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    text-decoration: none;
}

.menu-link:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
    border-bottom-color: rgba(59, 130, 246, 0.45);
}

.menu-link.active {
    color: #ffffff;
    border-bottom-color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
}

/* User box */
.userbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.userbox-meta {
    display: grid;
    gap: 1px;
    text-align: right;
}

.userbox-meta strong {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.3;
}

.userbox-meta span {
    text-transform: capitalize;
    color: #94a3b8;
    font-size: 11px;
}

.guest-pill {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
}

/* ===== USER DROPDOWN ===== */
.user-dropdown {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    padding: 6px 10px 6px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    color: inherit;
}

.user-dropdown-trigger:hover,
.user-dropdown.open .user-dropdown-trigger {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
}

.user-dropdown-caret {
    color: #64748b;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.user-dropdown.open .user-dropdown-caret {
    transform: rotate(180deg);
    color: #94a3b8;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    z-index: 200;
    overflow: hidden;
}

.user-dropdown.open .user-dropdown-menu {
    display: block;
}

.user-dropdown-header {
    padding: 12px 16px 10px;
}

.user-dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}

.user-dropdown-role {
    font-size: 11px;
    color: var(--muted);
    text-transform: capitalize;
    margin-top: 2px;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--line);
    margin: 2px 0;
}

.user-dropdown-item {
    display: block;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.user-dropdown-item:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.user-dropdown-item.active {
    color: var(--accent-deep);
    background: #eff6ff;
    font-weight: 600;
}

.user-dropdown-logout {
    color: var(--danger-deep);
}

.user-dropdown-logout:hover {
    background: #fef2f2;
    color: var(--danger-deep);
}

.btn-nav {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #f1f5f9 !important;
    border-radius: var(--radius);
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff !important;
}

/* ===== MAIN CONTENT ===== */
.main-shell {
    padding: 24px 0 48px;
}

/* page-backdrop is now a no-op — kept for compat */
.page-backdrop { display: none; }

/* ===== CARDS ===== */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    overflow: hidden;
}

.card-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%);
    border: none;
    color: #f8fafc;
}

.card-hero h2, .card-hero h3, .card-hero p, .card-hero small {
    color: inherit;
}

/* ===== DASHBOARD HERO ===== */
.dash-hero {
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 40%, #1d4ed8 80%, #2563eb 100%);
    color: #f8fafc;
    border: none;
    position: relative;
    overflow: hidden;
}

.dash-hero::after {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.dash-hero h2 {
    color: #ffffff;
    margin: 0;
    font-size: 1.35rem;
}

.dash-hero p {
    margin-top: 6px;
    color: rgba(248, 250, 252, 0.8);
    font-size: 13px;
}

/* ===== KPI CARDS ===== */
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.15;
}

/* ===== TABLE SHELL ===== */
.table-shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* ===== STATS ===== */
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat h3 {
    font-size: 11px;
    margin-bottom: 8px;
    color: var(--muted);
    font-family: inherit;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}

.stat strong {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
}

/* ===== GRID ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.form-grid {
    display: grid;
    gap: 16px;
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    margin-top: 0;
    border-collapse: collapse;
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-striped-bg: #f8fafc;
    --bs-table-hover-bg: #eff6ff;
}

.table th {
    padding: 11px 16px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    vertical-align: middle;
}

.table td {
    padding: 11px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 13px;
}

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

.table tbody tr:hover td { background: #eff6ff; }

.table-small th,
.table-small td {
    padding: 9px 12px;
    font-size: 12px;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.table-actions-nowrap {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.table-actions-nowrap .btn { white-space: nowrap; }

.table-actions form {
    display: inline-flex;
    margin: 0;
    order: 10;
}

.table-actions .d-inline,
.table td .d-inline {
    display: inline-flex !important;
    vertical-align: middle;
}

/* ===== FORMS ===== */
label {
    display: grid;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

input, select, textarea { font: inherit; }

input,
select,
textarea,
.form-control,
.form-select {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: #fff;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input,
select,
.form-control,
.form-select {
    min-height: var(--control-height);
    height: var(--control-height);
    padding: var(--control-pad-y) var(--control-pad-x);
    line-height: 1.2;
    width: 100%;
    max-width: 100%;
    display: block;
}

textarea,
textarea.form-control {
    min-height: 90px;
    height: auto;
    padding: var(--control-pad-y) var(--control-pad-x);
    line-height: 1.4;
    resize: vertical;
    border-radius: var(--radius);
}

select,
.form-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: calc(var(--control-pad-x) + 20px);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-size: 14px;
    background-repeat: no-repeat;
}

select[multiple], select[size] {
    height: auto;
    min-height: 90px;
    padding-right: var(--control-pad-x);
    background-image: none;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

input:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: var(--line-strong);
}

/* ===== ALERTS ===== */
.alert {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 13px;
    font-weight: 500;
}

.alert:not(.success):not(.alert-success):not(.alert-warning):not(.alert-info) {
    background: #fef2f2;
    color: var(--danger-deep);
    border-color: #fecaca;
}

.alert.success,
.alert.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

.alert.alert-danger {
    background: #fef2f2;
    color: var(--danger-deep);
    border-color: #fecaca;
}

.alert.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert.alert-info {
    background: #eff6ff;
    color: var(--accent-deep);
    border-color: #bfdbfe;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    color: var(--accent-dark);
    background: #dbeafe;
    white-space: nowrap;
    border: none;
}

.badge.text-bg-light,
.badge.text-bg-light.border {
    background: var(--surface-soft) !important;
    color: var(--ink-soft) !important;
    border-color: var(--line) !important;
}

/* ===== BUTTONS (Bootstrap overrides) ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff !important;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    color: #ffffff !important;
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink-soft) !important;
    border-color: var(--line);
}

.btn-secondary:hover {
    background: var(--surface-soft);
    border-color: var(--line-strong);
    color: var(--ink) !important;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff !important;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-deep);
    border-color: var(--danger-deep);
    color: #ffffff !important;
}

.btn-success {
    background: var(--success-deep);
    color: #ffffff !important;
    border-color: var(--success-deep);
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
    color: #ffffff !important;
}

.btn-warning {
    background: var(--warning);
    color: #ffffff !important;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: var(--warning-deep);
    border-color: var(--warning-deep);
    color: #ffffff !important;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--ink-soft) !important;
    border-color: var(--line);
}

.btn-outline-secondary:hover {
    background: var(--surface-soft);
    border-color: var(--line-strong);
    color: var(--ink) !important;
}

.btn-outline-primary {
    background: transparent;
    color: var(--accent-deep) !important;
    border-color: #bfdbfe;
}

.btn-outline-primary:hover {
    background: #eff6ff;
    border-color: var(--accent);
    color: var(--accent-deep) !important;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ===== TOOLBAR ===== */
.toolbar {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.toolbar-head {
    margin-top: 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form,
.search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.inline-form label,
.search-row label {
    min-width: 180px;
    flex: 1 1 180px;
    font-size: 13px;
}

form.row.g-3.align-items-end > label {
    flex: 1 1 180px;
    min-width: 180px;
    margin-bottom: 0;
}

form.row.g-3.align-items-end > label > input,
form.row.g-3.align-items-end > label > select,
form.row.g-3.align-items-end > label > textarea {
    width: 100%;
}

.search-form { align-items: flex-end; }

.search-form .search-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

/* ===== PAGINATION ===== */
.pager {
    margin-top: 16px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.pager-info {
    font-size: 12px;
    color: var(--muted);
    margin: 0 4px;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 3000;
    backdrop-filter: blur(4px);
}

.modal.show { display: flex; }

.modal-card {
    position: relative;
    width: min(980px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 3001;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    position: sticky;
    top: -24px;
    z-index: 2;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

/* ===== MISC LAYOUT ===== */
.narrow { max-width: 520px; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #eff6ff;
    color: var(--accent-deep);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 12px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
}

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

.meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
    align-items: center;
}

.stack-list { display: grid; gap: 16px; }

.demo-box {
    margin-top: 16px;
    padding: 16px;
    border: 1px dashed #bfdbfe;
    background: #eff6ff;
    border-radius: var(--radius);
}

/* ===== PAGE TITLE HEADER ===== */
.page-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.page-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.page-title p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
}

/* ===== MEMBER / LOAN COMPONENTS ===== */
.member-card,
.loan-panel,
.member-form-wrap {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 18px;
    border-radius: var(--radius-lg);
}

.member-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.member-form-grid textarea { width: 100%; }

.member-nominee-grid {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 16px;
    border: 1px dashed #bfdbfe;
    background: #eff6ff;
    border-radius: var(--radius);
}

.loan-panel { margin-top: 12px; }

.member-summary {
    display: grid;
    gap: 4px;
    text-align: right;
}

/* ===== AUTH / LOGIN ===== */
.auth-hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 480px);
    gap: 20px;
    align-items: stretch;
    padding-top: 24px;
}

.auth-copy h2,
.auth-card h2 {
    font-size: clamp(1.7rem, 2.6vw, 2.5rem);
    line-height: 1.1;
}

.feature-list {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.feature-item {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
}

.feature-item strong {
    display: block;
    margin-bottom: 4px;
    color: #ffffff;
}

.feature-item span {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.5;
    font-size: 12px;
}

.auth-card { align-self: center; }

/* ===== PERMISSION MATRIX ===== */
.perm-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    min-width: 68px;
    border-radius: var(--radius);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    transition: background 0.2s, border-color 0.2s;
}

.perm-cell:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.perm-label {
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    color: var(--ink-soft);
    font-weight: 600;
}

input[type="checkbox"].perm-toggle {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    accent-color: var(--accent);
    border-radius: 3px;
}

/* ===== BOOTSTRAP TABLE OVERRIDES ===== */
.table-light > * > * {
    background: var(--surface-soft) !important;
    color: var(--muted) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 940px) {
    .auth-hero { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    html { font-size: 13px; }

    .topbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
        gap: 6px;
    }

    .brand-lockup {
        border-right: none;
        padding-right: 0;
    }

    .menu-wrap {
        width: 100%;
        order: 3;
        padding: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .menu-link {
        height: 40px;
        padding: 0 10px;
        font-size: 12px;
    }

    .userbox {
        border-left: none;
        padding-left: 0;
        margin-left: auto;
    }

    .member-summary { text-align: left; }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .card, .modal-card { padding: 16px; }

    form.row.g-3.align-items-end > label {
        min-width: 100%;
        flex-basis: 100%;
    }

    .search-form .search-actions { margin-left: 0; }
}
