/* ============================================================
   ORMOC CITY PUBLIC MARKET — GLOBAL DESIGN SYSTEM
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[x-cloak] {
    display: none !important;
}

:root {
    --navy-950: #060d1f;
    --navy-900: #0a1628;
    --navy-800: #0f1f3d;
    --navy-700: #152b52;
    --navy-600: #1a3a6b;
    --navy-500: #1e4d8c;
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --blue-100: #dbeafe;
    --blue-50: #eff6ff;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --green-600: #16a34a;
    --green-100: #dcfce7;
    --green-50: #f0fdf4;
    --yellow-600: #854d0e;
    --yellow-100: #fef9c3;
    --yellow-50: #fefce8;
    --orange-600: #ea580c;
    --orange-100: #ffedd5;
    --red-600: #dc2626;
    --red-100: #fee2e2;
    --red-50: #fef2f2;
    --purple-600: #9333ea;
    --purple-100: #f3e8ff;
    --teal-600: #0d9488;
    --teal-100: #ccfbf1;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;
    --control-height: 38px;
    --control-height-sm: 32px;
    --control-height-lg: 44px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.14);
    --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    font-size: 14px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

p {
    color: var(--gray-700);
}

a {
    color: var(--blue-600);
    text-decoration: none;
}

a:hover {
    color: var(--blue-500);
}

/* ── APP LAYOUT ─────────────────────────────────────────────────────────────── */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────────── */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--navy-900);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.sidebar-logo-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.sidebar-logo-subtitle {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.45);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 0.85rem 1.25rem 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255,255,255,0.65);
    font-size: 0.825rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: rgba(37,99,235,0.15);
    color: white;
    border-left-color: var(--blue-500);
    font-weight: 600;
}

.nav-item-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: white;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ── COLLAPSIBLE NAV DROPDOWNS ── */

.nav-group {
    margin-bottom: 0.2rem;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    border-left: 3px solid transparent;
    transition: all var(--transition);
    background: transparent;
    width: 100%;
    border-top: none;
    border-right: none;
    border-bottom: none;
    text-align: left;
}

.nav-group-header:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-group-header.active-group {
    color: #93c5fd;
    background: rgba(37,99,235,0.1);
    border-left-color: var(--blue-500);
}

.nav-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.nav-chevron.rotated {
    transform: rotate(90deg);
    opacity: 1;
}

.nav-sub-menu {
    padding: 0.25rem 0 0.4rem 0.85rem;
    background: rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border-left: 2px solid rgba(255,255,255,0.1);
    margin-left: 1.85rem;
    margin-top: 0.15rem;
    margin-bottom: 0.25rem;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.85rem;
    color: rgba(255,255,255,0.65);
    font-size: 0.775rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    margin-right: 0.65rem;
    transition: all var(--transition);
}

.nav-sub-item:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.nav-sub-item.active {
    background: rgba(37,99,235,0.25);
    color: #bfdbfe;
    font-weight: 600;
}

.nav-sub-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    flex-shrink: 0;
}

.nav-sub-item.active .nav-sub-dot {
    background: #60a5fa;
    box-shadow: 0 0 6px rgba(96,165,250,0.8);
}

.sidebar-user {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
}

.sidebar-user:hover {
    background: rgba(255,255,255,0.04);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--blue-600);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: background var(--transition);
}

.dropdown-item:hover {
    background: var(--gray-50);
}

.dropdown-item.danger {
    color: var(--red-600);
}

.dropdown-item.danger:hover {
    background: var(--red-50);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.25rem 0;
}

/* ── MAIN CONTENT ────────────────────────────────────────────────────────────── */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
}

/* ── TOPBAR ──────────────────────────────────────────────────────────────────── */

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-breadcrumb {
    flex: 1;
    min-width: 0;
}

.breadcrumb-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb-subtitle {
    font-size: 0.72rem;
    color: var(--gray-400);
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-100);
    border-radius: 20px;
    padding: 0.4rem 0.85rem;
    max-width: 220px;
    width: 220px;
    font-size: 0.78rem;
    color: var(--gray-400);
    cursor: pointer;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
    border: none;
    color: var(--gray-600);
}

.icon-btn:hover {
    background: var(--gray-200);
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

.topbar-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--gray-100);
    border-radius: 20px;
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
}

/* ── PAGE CONTENT ────────────────────────────────────────────────────────────── */

.page-content {
    padding: 1.75rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gray-900);
}

.page-subtitle {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.2rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: var(--control-height);
    padding: 0 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    box-sizing: border-box;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    height: var(--control-height-sm);
    padding: 0 0.75rem;
    font-size: 0.76rem;
    border-radius: 6px;
}

.btn-lg {
    height: var(--control-height-lg);
    padding: 0 1.5rem;
    font-size: 0.92rem;
    border-radius: 8px;
}

.btn-primary {
    background: var(--blue-600);
    color: white;
    border-color: var(--blue-600);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

.btn-success {
    background: var(--green-600);
    color: white;
    border-color: var(--green-600);
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
    color: white;
}

.btn-danger {
    background: var(--red-600);
    color: white;
    border-color: var(--red-600);
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: white;
}

.btn-warning {
    background: var(--yellow-600);
    color: white;
    border-color: var(--yellow-600);
}

.btn-warning:hover {
    background: #a16207;
    border-color: #a16207;
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* ── CARDS ───────────────────────────────────────────────────────────────────── */

.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--gray-900);
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.15rem;
}

.card-body {
    padding: 1.25rem;
}

/* ── STAT CARDS ──────────────────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 1rem;
}

.stats-grid-3 {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 1rem;
}

.stats-grid-2 {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 1rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.stat-card-left {
    flex: 1;
    min-width: 0;
}

.stat-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.35rem;
}

.stat-card-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.15;
}

.stat-card-sub {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 0.35rem;
}

.stat-card-sub.positive {
    color: var(--green-600);
}

.stat-card-sub.negative {
    color: var(--red-600);
}

.stat-card-sub.neutral {
    color: var(--gray-500);
}

.stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-clickable {
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative;
}

.stat-card-clickable:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 28px -6px rgba(15, 31, 61, 0.12), 0 4px 10px -2px rgba(15, 31, 61, 0.06);
    border-color: var(--blue-400);
}

.stat-card-clickable:active {
    transform: translateY(-1px) scale(1.005);
}

/* ── DASHBOARD GRIDS ─────────────────────────────────────────────────────────── */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 1rem;
}

/* ── CHART CARDS ──────────────────────────────────────────────────────────────── */

.chart-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.chart-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-900);
}

.chart-card-subtitle {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* ── TABLE CONTAINER ─────────────────────────────────────────────────────────── */

.table-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.filter-bar, .filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    gap: 0.75rem;
    flex-wrap: wrap;
    background: white;
}

.search-input {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    padding: 0 0.75rem;
    height: var(--control-height);
    max-width: 320px;
    flex: 1;
    box-sizing: border-box;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.search-input:focus-within {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    background: #ffffff;
}

.search-input input {
    background: none;
    border: none;
    outline: none;
    font-size: 0.82rem;
    color: var(--gray-800);
    width: 100%;
    font-family: inherit;
}

.filter-select {
    height: var(--control-height);
    padding: 0 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: white;
    font-size: 0.82rem;
    color: var(--gray-700);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
    font-family: inherit;
}

.filter-select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.table-overflow {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table, .data-table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--gray-50);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
    height: 40px;
    box-sizing: border-box;
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.82rem;
    color: var(--gray-700);
    vertical-align: middle;
    transition: background 0.15s ease;
}

tr:hover td {
    background: var(--gray-50);
}

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

.stall-tag {
    display: inline-block;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    background: var(--navy-800);
    color: white;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.table-id {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--blue-600);
    font-weight: 600;
}

/* ── INFO ITEMS ──────────────────────────────────────────────────────────────── */

.info-item {
    margin-bottom: 0.75rem;
}

.info-item-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.2rem;
}

.info-item-value {
    font-size: 0.85rem;
    color: var(--gray-800);
    font-weight: 500;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.25rem;
}

/* ── MODALS ──────────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.modal {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
}

.modal.modal-lg {
    max-width: 720px;
}

.modal.modal-xl {
    max-width: 900px;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: background var(--transition);
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* ── FORMS ───────────────────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.required {
    color: var(--red-600);
    font-size: 0.85em;
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 0 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    color: var(--gray-800);
    background: white;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-control:disabled, .form-control[readonly] {
    background: var(--gray-50);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.form-text {
    font-size: 0.72rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.72rem;
    color: var(--red-600);
    margin-top: 0.25rem;
}

textarea.form-control {
    height: auto;
    min-height: 84px;
    padding: 0.65rem 0.85rem;
    resize: vertical;
    line-height: 1.5;
}

select.form-control {
    height: 40px;
    cursor: pointer;
}

input::placeholder, textarea::placeholder {
    color: var(--gray-400);
}

/* ── LOGIN PAGE ──────────────────────────────────────────────────────────────── */

.login-split-page {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--navy-950), var(--navy-900), var(--navy-800));
    position: relative;
}

.login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.35;
}

.blob-1 {
    top: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #1d4ed8, transparent 70%);
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, #0ea5e9, transparent 70%);
}

.blob-3 {
    top: 40%;
    left: 30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #4338ca, transparent 70%);
}

.login-left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    position: relative;
    z-index: 1;
}

.login-brand-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.login-seal-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    object-fit: contain;
}

.login-republic-text {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.login-city-text {
    font-size: 0.9rem;
    color: white;
    font-weight: 800;
}

.login-hero-content {
    max-width: 520px;
}

.login-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(37,99,235,0.2);
    border: 1px solid rgba(37,99,235,0.4);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.72rem;
    color: #93c5fd;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.login-badge-dot {
    width: 6px;
    height: 6px;
    background: #60a5fa;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.login-hero-title {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 1000;
    color: white;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}

.login-hero-gradient {
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-hero-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 440px;
}

.login-feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.login-feature-pill {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.login-footer-credit {
    margin-top: auto;
    padding-top: 3rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
}

.login-right-panel {
    width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(24px);
    border-left: 1px solid rgba(255,255,255,0.08);
    position: relative;
    z-index: 1;
    overflow-y: auto;
}

.login-form-box {
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
}

.login-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-form-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: white;
    margin: 0 auto 1.25rem;
    padding: 3px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-form-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.login-form-header h2 {
    font-size: 1.375rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.login-form-header p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
}

.login-alert-error {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    color: #fca5a5;
    font-size: 0.82rem;
}

.login-alert-success {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    color: #86efac;
    font-size: 0.82rem;
}

.login-form-body {
    margin-bottom: 1.5rem;
}

.login-form-field {
    margin-bottom: 1rem;
}

.login-form-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.5rem;
}

.login-input-wrapper {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.3);
    z-index: 1;
    pointer-events: none;
}

.login-input-wrapper input {
    width: 100%;
    padding: 0 0.9rem 0 2.3rem;
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.07);
    color: white;
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition), background-color var(--transition);
}

.login-input-wrapper input:focus {
    border-color: #3b82f6;
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}

.login-input-wrapper:focus-within .login-input-icon {
    color: #60a5fa;
}

.login-split-page input, .login-input-wrapper input {
    color-scheme: dark;
}

.login-split-page input:-webkit-autofill, .login-split-page input:-webkit-autofill:hover, .login-split-page input:-webkit-autofill:focus, .login-split-page input:-webkit-autofill:active, .login-input-wrapper input:-webkit-autofill, .login-input-wrapper input:-webkit-autofill:hover, .login-input-wrapper input:-webkit-autofill:focus, .login-input-wrapper input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
    box-shadow: 0 0 0 1000px #1e293b inset !important;
    transition: background-color 50000s ease-in-out 0s, color 50000s ease-in-out 0s !important;
    caret-color: #ffffff !important;
    border-color: rgba(96,165,250,0.6) !important;
}

.login-split-page input:autofill, .login-split-page input:autofill:hover, .login-split-page input:autofill:focus, .login-split-page input:autofill:active, .login-input-wrapper input:autofill, .login-input-wrapper input:autofill:hover, .login-input-wrapper input:autofill:focus, .login-input-wrapper input:autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
    box-shadow: 0 0 0 1000px #1e293b inset !important;
    transition: background-color 50000s ease-in-out 0s, color 50000s ease-in-out 0s !important;
    caret-color: #ffffff !important;
    border-color: rgba(96,165,250,0.6) !important;
}

.login-input-wrapper input::placeholder {
    color: rgba(255,255,255,0.3);
}

.login-pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    background: none;
    border: none;
    padding: 0;
}

.login-row-remember {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.login-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
}

.login-checkbox-label input {
    accent-color: #3b82f6;
    width: 16px;
    height: 16px;
}

.login-forgot-link {
    font-size: 0.78rem;
    color: #60a5fa;
    text-decoration: none;
}

.login-submit-btn {
    width: 100%;
    height: 48px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 700;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(37,99,235,0.4);
    transition: all var(--transition);
}

.login-submit-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
}

.login-submit-btn:disabled {
    background: rgba(37,99,235,0.5);
    box-shadow: none;
    transform: none;
}

.login-loading-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-spinner {
    display: inline-block;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── BADGES / STATUS ─────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-active, .badge-valid, .badge-approved, .badge-compliant, .badge-paid {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-expiring, .badge-expiring_soon, .badge-warning, .badge-overdue {
    background: var(--yellow-100);
    color: var(--yellow-600);
}

.badge-expired, .badge-non_compliant, .badge-rejected, .badge-terminated, .badge-inactive, .badge-not_submitted {
    background: var(--red-100);
    color: var(--red-600);
}

.badge-pending, .badge-pending_review, .badge-pending_verification {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-vacant {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-occupied {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-under_maintenance {
    background: var(--orange-100);
    color: var(--orange-600);
}

.badge-scheduled {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-in_progress {
    background: var(--yellow-100);
    color: var(--yellow-600);
}

.badge-completed {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-cancelled {
    background: var(--gray-100);
    color: var(--gray-500);
}

.badge-passed {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-passed_with_remarks {
    background: var(--yellow-100);
    color: var(--yellow-600);
}

.badge-failed {
    background: var(--red-100);
    color: var(--red-600);
}

.badge-legit {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-suspicious {
    background: var(--red-100);
    color: var(--red-600);
}

.badge-inconclusive {
    background: var(--yellow-100);
    color: var(--yellow-600);
}

.badge-draft {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-published {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-archived {
    background: var(--gray-100);
    color: var(--gray-500);
}

.badge-open {
    background: var(--red-100);
    color: var(--red-600);
}

.badge-resolved {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-minor {
    background: var(--yellow-100);
    color: var(--yellow-600);
}

.badge-major {
    background: var(--orange-100);
    color: var(--orange-600);
}

.badge-critical {
    background: var(--red-100);
    color: var(--red-600);
}

.badge-under_review {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ── ALERTS ──────────────────────────────────────────────────────────────────── */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background: var(--red-50);
    border: 1px solid #fca5a5;
    color: var(--red-600);
}

.alert-warning {
    background: var(--yellow-50);
    border: 1px solid #fde68a;
    color: var(--yellow-600);
}

.alert-success {
    background: var(--green-50);
    border: 1px solid #86efac;
    color: var(--green-600);
}

.alert-info {
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    color: var(--blue-600);
}

/* ── AVATAR ──────────────────────────────────────────────────────────────────── */

.avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    color: white;
    background: var(--blue-600);
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.68rem;
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: 0.88rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.1rem;
}

/* ── EMPTY STATE ─────────────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-400);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 0.35rem;
}

.empty-state p {
    font-size: 0.82rem;
}

/* ── PAGINATION ──────────────────────────────────────────────────────────────── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagination-info {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.pagination-btns {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    background: white;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.page-btn:hover:not(:disabled) {
    background: var(--gray-100);
}

.page-btn.active {
    background: var(--blue-600);
    color: white;
    border-color: var(--blue-600);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── TOAST ───────────────────────────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
    max-width: 360px;
    width: calc(100vw - 2rem);
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.82rem;
    font-weight: 500;
    animation: slideInRight 0.3s ease;
}

.toast.success {
    background: #052e16;
    color: #bbf7d0;
    border: 1px solid #15803d;
}

.toast.error {
    background: #450a0a;
    color: #fecaca;
    border: 1px solid #b91c1c;
}

.toast.warning {
    background: #451a03;
    color: #fed7aa;
    border: 1px solid #c2410c;
}

.toast.info {
    background: #0c1d3e;
    color: #bfdbfe;
    border: 1px solid #1d4ed8;
}

/* ── AI SCANNER ──────────────────────────────────────────────────────────────── */

.scanner-panel {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.25rem;
}

.scanner-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.scanner-upload-area:hover, .scanner-upload-area.dragover {
    border-color: var(--blue-500);
    background: var(--blue-50);
}

.scanner-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid;
}

.scanner-result.legit {
    background: var(--green-50);
    border-color: var(--green-100);
}

.scanner-result.suspicious {
    background: var(--red-50);
    border-color: var(--red-100);
}

.scanner-result.inconclusive {
    background: var(--yellow-50);
    border-color: var(--yellow-100);
}

.scanner-confidence {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

.scanner-verdict {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.scanner-flags {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.scanner-flag-item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--red-600);
}

.scanner-ocr-data {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 6px;
}

.scanner-ocr-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin-bottom: 0.35rem;
}

.scanner-ocr-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
}

.scanning-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(37,99,235,0.2);
    border-top-color: var(--blue-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 1rem auto;
}

/* ── CHAT / MESSAGES ─────────────────────────────────────────────────────────── */

.chat-layout {
    display: flex;
    height: calc(100vh - 64px - 3.5rem);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow-sm);
}

.chat-sidebar {
    width: 280px;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.chat-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.convo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all var(--transition);
}

.convo-item:hover {
    background: var(--gray-50);
}

.convo-item.active {
    background: var(--blue-50);
    border-left-color: var(--blue-600);
}

.convo-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-800);
}

.convo-preview {
    font-size: 0.72rem;
    color: var(--gray-400);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 160px;
}

.convo-meta {
    font-size: 0.65rem;
    color: var(--gray-400);
}

.convo-unread {
    background: var(--red-600);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-main-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.chat-mobile-back {
    display: none;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50, #f8fafc);
    color: var(--gray-700, #334155);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-bubble {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.chat-bubble.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-bubble.received {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble-text {
    padding: 0.65rem 0.875rem;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.chat-bubble.sent .chat-bubble-text {
    background: var(--blue-600);
    color: white;
    border-radius: 12px 12px 4px 12px;
}

.chat-bubble.received .chat-bubble-text {
    background: var(--gray-100);
    color: var(--gray-800);
    border-radius: 12px 12px 12px 4px;
}

.chat-bubble-meta {
    font-size: 0.65rem;
    color: var(--gray-400);
}

.chat-input-area {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}

.chat-input:focus {
    border-color: var(--blue-500);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--blue-600);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition);
}

.chat-send-btn:hover {
    background: #1d4ed8;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--gray-400);
    padding: 2rem;
}

/* ── PROGRESS BAR ────────────────────────────────────────────────────────────── */

.progress-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--gray-100);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    background: var(--blue-600);
}

.progress-fill.green {
    background: var(--green-600);
}

.progress-fill.yellow {
    background: var(--yellow-600);
}

.progress-fill.red {
    background: var(--red-600);
}

/* ── MISC ────────────────────────────────────────────────────────────────────── */

.w-full {
    width: 100% !important;
}

.text-center {
    text-align: center;
}

.compliance-matrix {
    min-width: 560px;
}

.chart-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ── MOBILE OVERLAY / MENU ───────────────────────────────────────────────────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gray-100);
    cursor: pointer;
    flex-shrink: 0;
    color: var(--gray-700);
    transition: background var(--transition);
    border: none;
}

.mobile-menu-btn:hover {
    background: var(--gray-200);
}

/* ── KEYFRAMES ───────────────────────────────────────────────────────────────── */

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid, .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .page-content {
        padding: 1.25rem;
    }
    .stats-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .login-split-page {
        flex-direction: column;
        min-height: 100vh;
    }
    .login-left-panel {
        flex: none;
        padding: 2rem 1.25rem 1rem;
        align-items: center;
        text-align: center;
    }
    .login-brand-header {
        margin-bottom: 0.5rem;
        justify-content: center;
    }
    .login-hero-content, .login-footer-credit {
        display: none;
    }
    .login-right-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.08);
        padding: 1.5rem 1rem 2.5rem;
        background: rgba(255,255,255,0.02);
    }
    .login-form-box {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
        width: 260px !important;
    }
    .sidebar.open {
        transform: translateX(0) !important;
    }
    .sidebar-overlay.open {
        display: block;
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .topbar {
        padding: 0 0.85rem;
        gap: 0.5rem;
    }
    .topbar-search, .topbar-date {
        display: none !important;
    }
    .mobile-menu-btn {
        display: flex !important;
    }
    .page-content {
        padding: 0.85rem 0.75rem;
    }
    .page-header-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }
    .page-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .stats-grid, .stats-grid-3, .stats-grid-2 {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .info-grid {
        grid-template-columns: 1fr !important;
    }
    .filter-bar, .filters-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.85rem;
        gap: 0.65rem;
    }
    .search-input {
        max-width: 100% !important;
    }
    .filter-select {
        width: 100% !important;
    }
    .table-overflow {
        overflow-x: auto;
    }
    table, .data-table {
        min-width: 580px;
        font-size: 0.78rem;
    }
    th, td {
        padding: 0.6rem 0.65rem;
    }
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
        overflow-y: auto;
    }
    .modal-header {
        padding: 1rem 1.15rem;
    }
    .modal-body {
        padding: 1rem 1.15rem;
    }
    .modal-footer {
        padding: 0.85rem 1.15rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .modal-footer .btn {
        flex: 1;
        justify-content: center;
        min-width: 100px;
    }
    .stat-card {
        padding: 0.85rem 1rem;
    }
    .stat-card-value {
        font-size: 1.4rem;
    }
    .chat-layout.has-sidebar:not(.has-active-chat) .chat-sidebar {
        display: flex;
        width: 100%;
        border-right: none;
    }

    .chat-layout.has-sidebar:not(.has-active-chat) .chat-main {
        display: none;
    }

    .chat-layout.has-sidebar.has-active-chat .chat-sidebar {
        display: none;
    }

    .chat-layout.has-sidebar.has-active-chat .chat-main {
        display: flex;
        width: 100%;
    }

    .chat-mobile-back {
        display: inline-flex;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    .stats-grid, .stats-grid-3, .stats-grid-2 {
        grid-template-columns: 1fr;
    }
    .page-content {
        padding: 0.65rem 0.5rem;
    }
    .card-header, .card-body {
        padding: 0.75rem;
    }
    .modal-body {
        padding: 0.85rem;
    }
    .topbar {
        height: 56px;
    }
    .stat-card-value {
        font-size: 1.3rem;
    }
    .btn {
        font-size: 0.78rem;
        padding: 0 0.75rem;
        height: 34px;
    }
    .toast-container {
        bottom: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        max-width: 100%;
    }
    .pagination {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (min-width: 769px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* ── DATE LEGIBILITY & FONT STANDARDIZATION ── */

.topbar-date {
    color: var(--gray-900) !important;
}

.date-text, .date-display, table td.date-cell, table td[style*="color:var(--gray-500)"], table td[style*="color:var(--gray-400)"] {
    color: #0f172a !important;
    font-weight: 500;
}

textarea.form-control, input.form-control, select.form-control {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
