/* ================================================================
   JCI Baguio MIS — Stylesheet
   ================================================================
   STRUCTURE:
   1. CSS Variables & Reset
   2. Layout (sidebar, header, content)
   3. Components (cards, tables, buttons, badges, forms)
   4. Module-specific styles
   5. Utility classes (use these in new views)
   6. View toggle & grid
   ================================================================ */

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

:root {
    --primary: #2262ad;
    --primary-dark: #04295f;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --info: #0891b2;
    --info-light: #ecfeff;
    --orange: #ea580c;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --sidebar-bg: #04295f;
    --sidebar-text: #94a3b8;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 5px;
    --radius-lg: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: #04295f;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width 0.3s ease;
    overflow-x: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 50px; height: 50px;
    padding: 5px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px;
    flex-shrink: 0;
}


.brand-icon img {
    height: auto;
    width: 100%;
}

.brand-logo { width: 36px; height: 36px; object-fit: contain; border-radius: var(--radius); }

.brand-name {
    color: white;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}
.brand-name_builder { font-weight: 500; font-size: 8px; color:var(--text-muted); text-transform: uppercase;
    letter-spacing: 1px;}

.sidebar-toggle {
    background: none; border: none; color: var(--sidebar-text);
    cursor: pointer; padding: 4px; font-size: 16px;
    display: none;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-section { margin-bottom: 4px; }

.nav-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3);
    padding: 12px 20px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    font-size: 13.5px;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
    text-decoration: none;
}

.nav-item.active {
    background: rgba(37,99,235,0.15);
    color: #ffffff !important;
    border-left-color: var(--primary);
}

.nav-item i { width: 18px; text-align: center; font-size: 14px; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.user-info { display: flex; align-items: center; gap: 10px; }

.user-avatar {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600; font-size: 12px;
    flex-shrink: 0;
}
.user-avatar-name {
    font-size: 13px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 480px) {
   .user-avatar-name { display: none; }
}

.user-details { flex: 1; min-width: 0; }
.user-name { color: white; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--sidebar-text); font-size: 11px; }

.logout-btn { color: var(--sidebar-text); transition: color 0.15s; }
.logout-btn:hover { color: var(--danger); text-decoration: none; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow);
}

.header-left { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 18px; font-weight: 600; color: var(--text); }

.mobile-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    color: var(--text); font-size: 18px; padding: 4px;
}

.header-right { display: flex; align-items: center; gap: 16px; }
.header-user { font-size: 13px; color: var(--text-secondary); }

.content-area { padding: 24px; flex: 1; }

/* ===== FLASH MESSAGES ===== */
.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 12px 24px 0;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
}

.flash-success { background: var(--success-light); color: var(--success); border: 1px solid #bbf7d0; }
.flash-error   { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.flash-info    { background: var(--info-light); color: var(--info); border: 1px solid #a5f3fc; }
.flash-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }

.flash-close {
    margin-left: auto; background: none; border: none;
    cursor: pointer; color: inherit; opacity: 0.6;
    padding: 0 4px;
}
.flash-close:hover { opacity: 1; }

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

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i { color: var(--primary); }
.card-body { padding: 20px; }

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-flex {
    display: flex;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    min-width: min-content;
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: #fff7ed; color: var(--orange); }
.stat-icon.red    { background: var(--danger-light); color: var(--danger); }
.stat-icon.teal   { background: var(--info-light); color: var(--info); }

.stat-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover { text-decoration: none; opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary   { background: #2262ad; color: white; border-color: #2262ad; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text-secondary); border-color: var(--border-dark); }
.btn-secondary:hover { background: var(--bg); }
.btn-success   { background: var(--success); color: white; }
.btn-danger    { background: var(--danger); color: white; }
.btn-warning   { background: var(--warning); color: white; }
.btn-ghost     { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 15px 20px; font-size: 16px; }
.btn-icon { padding: 7px; min-width: 32px; justify-content: center; }

.btn-center {justify-content: center;}

/* ===== TABLES ===== */
.table-container { overflow-x: auto; }

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

.table th {
    background: var(--bg);
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.table tbody tr:hover { background: var(--primary-light); }
.table tbody tr:last-child td { border-bottom: none; }

.table .actions { display: flex; gap: 4px; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge-success   { background: var(--success-light); color: var(--success); }
.badge-danger    { background: var(--danger-light); color: var(--danger); }
.badge-warning   { background: var(--warning-light); color: var(--warning); }
.badge-info      { background: var(--info-light); color: var(--info); }
.badge-primary   { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-orange    { background: #fff7ed; color: var(--orange); }

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text); }
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    padding: 9px 12px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-control[readonly] { background: var(--bg); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-muted); }
.form-error { font-size: 12px; color: var(--danger); }

/* ===== FILTERS BAR ===== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filters-bar .form-control { width: auto; }
.search-input { min-width: 220px; }

/* ===== BULK ACTIONS ===== */
.bulk-actions-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 13.5px;
}

.bulk-actions-bar.visible { display: flex; }
.bulk-count { font-weight: 600; color: var(--primary); }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 16px 0 4px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.15s;
}

.page-btn:hover { background: var(--bg); text-decoration: none; }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i { color: var(--danger); }

.modal-body { padding: 20px 24px; color: var(--text-secondary); line-height: 1.6; }
.modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== DETAIL VIEW ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.detail-item { }
.detail-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.detail-value { font-size: 13px; color: var(--text); font-weight: 500; }
.detail-value a { color: var(--primary); }

/* ===== UPDATE CARDS ===== */
.update-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.update-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.update-card-title { font-weight: 600; font-size: 15px; color: var(--text); }
.update-card-meta { font-size: 12px; color: var(--text-muted); }

.update-card-body { padding: 16px 18px; }
.update-card-image { width: 100%; max-height: 300px; object-fit: cover; border-bottom: 1px solid var(--border); }

.comment-thread { border-top: 1px solid var(--border); padding: 14px 18px; }
.comment-thread-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }

.comment {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.comment-avatar {
    width: 30px; height: 30px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 11px; font-weight: 600;
    flex-shrink: 0;
}

.comment-content { flex: 1; }
.comment-author { font-weight: 600; font-size: 13px; }
.comment-time { font-size: 11px; color: var(--text-muted); margin-left: 8px; }
.comment-text { font-size: 13.5px; color: var(--text-secondary); margin-top: 4px; }

.comment-input-area { display: flex; gap: 10px; margin-top: 12px; }
.comment-input-area textarea { resize: none; min-height: 60px; }

.comment-delete-btn {
    opacity:0.85;
    padding:2px 6px;
    font-size:12px;
    flex-shrink:0"
}

/* ===== ATTACHMENT CARD ===== */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: background 0.15s;
}

.attachment-item:hover { background: var(--bg); }
.attachment-icon { font-size: 22px; color: var(--primary); flex-shrink: 0; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-meta { font-size: 11px; color: var(--text-muted); }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-header-left h2 { font-size: 20px; font-weight: 700; color: var(--text); }
.page-header-left p { color: var(--text-secondary); font-size: 13.5px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.page-bannercover { margin-bottom:16px;border-radius:var(--radius-lg);overflow:hidden; border:1px solid var(--border);box-shadow:var(--shadow); }
.page-bannercover img { width: 100%; height: auto; object-fit: contain; display: block; }

.client-logo {
    height: 75px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    background: white;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb i { font-size: 10px; }
.breadcrumb .current { color: var(--text-secondary); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 40px; margin-bottom: 0; opacity: 0.3; }
.empty-state p { font-size: 15px; margin-bottom: 16px; }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    padding: 20px;
    flex-direction: column;
    gap: 10px;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo .brand-icon {
    width: 52px; height: 52px;
    font-size: 22px;
    margin: 0 auto 12px;
}

.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.login-built_by {color: #ccc;font-size: 8px;text-transform: uppercase;letter-spacing: 2px;font-weight: 600;}

/* ===== CHECKBOX ===== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

/* ===== SECTION DIVIDER ===== */
.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ===== PRIORITY & STATUS DOTS ===== */
.priority-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.dot-low    { background: var(--text-muted); }
.dot-medium { background: var(--info); }
.dot-high   { background: var(--warning); }
.dot-urgent { background: var(--danger); }

/* ===== INVOICE ITEMS ===== */
.invoice-items-table th, .invoice-items-table td { padding: 8px 12px; }
.invoice-totals { max-width: 320px; margin-left: auto; }
.invoice-total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.invoice-total-row.grand { font-weight: 700; font-size: 16px; border-top: 2px solid var(--border); padding-top: 10px; margin-top: 6px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width:100%; }
    .mobile-toggle { display: block; }
    .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .content-area { padding: 16px; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .search-input { min-width: 0; width: 100%; }
    .table th, .table td { padding: 8px 10px; }
}

/* ===== UTILITIES ===== */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.fw-bold      { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hide { display: none !important; }

/* ===== DASHBOARD SPECIFIC ===== */
.recent-table th { font-size: 11px; }
.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    color: white;
    margin-bottom: 24px;
}
.welcome-banner h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.welcome-banner p { opacity: 0.85; font-size: 14px; }

/* ===== SETTINGS ===== */
.settings-tabs { display: flex; gap: 0; flex-direction: row; min-width: 200px; }
.settings-tab { padding: 10px 16px; border-radius: var(--radius); cursor: pointer; font-size: 13.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px;}
.settings-tab:hover { background: var(--bg); color: var(--text); }
.settings-tab.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.settings-layout { display: grid; grid-template-columns: 1fr; gap: 20px; }

@media (max-width: 768px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-tabs { flex-direction: row; overflow-x: auto; }
}

/* ===== BRAND COLORS UPDATE ===== */
:root {
    --primary: #243474;
    --primary-dark: #10267D;
    --primary-light: #eef1fb;
    --primary-mid: #3a4f9e;
}

/* ===== NOTIFICATIONS ===== */
.notif-dropdown {
    position: relative;
    display: inline-flex;
}

.notif-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 18px;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-btn:hover { background: var(--bg); color: var(--primary); }

.notif-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    overflow: hidden;
}

.notif-panel.open { display: block; }

.notif-panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-panel-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.notif-list { max-height: 380px; overflow-y: auto; }

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.notif-item:hover { background: var(--bg); text-decoration: none; }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #dde5f8; }

.notif-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    color: white;
}

.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.notif-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-unread-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; flex-shrink: 0; margin-top: 6px; }

.notif-panel-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
}

.notif-empty i { font-size: 32px; margin-bottom: 10px; opacity: 0.3; }
.notif-empty p { font-size: 13px; }

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

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px 6px 8px;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text);
}

.user-dropdown-btn:hover { background: var(--bg); }

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 245px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    overflow: hidden;
}

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

.user-dropdown-info {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.user-dropdown-name { font-weight: 600; font-size: 14px; color: var(--text); }
.user-dropdown-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dropdown-role { display: inline-block; margin-top: 6px; }

.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 13.5px;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-menu-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.dropdown-menu-item i { width: 16px; text-align: center; }
.dropdown-menu-item.danger { color: var(--danger); }
.dropdown-menu-item.danger:hover { background: var(--danger-light); }
.dropdown-menu-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* ===== PROJECT PHASE ===== */
.phase-timeline {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 20px;
}

.phase-step {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.phase-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--border-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
    transition: all 0.2s;
    position: relative;
    z-index: 1;
}

.phase-step.active .phase-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.phase-step.done .phase-dot {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.phase-line {
    height: 2px;
    width: 32px;
    background: var(--border);
    flex-shrink: 0;
}

.phase-step.done + .phase-step .phase-line,
.phase-step.done .phase-line { background: var(--success); }

.phase-label {
    font-size: 10px;
    text-align: center;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
}

.phase-step.active .phase-label { color: var(--primary); font-weight: 600; }
.phase-step.done .phase-label { color: var(--success); }

/* ===== CHAT / MESSAGES ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 425px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
}

.chat-bubble-wrap {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-bubble-wrap.mine { flex-direction: row-reverse; }

.chat-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 11px; font-weight: 600;
    flex-shrink: 0;
}

.chat-bubble {
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
}

.chat-bubble.theirs {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    color: var(--text);
}

.chat-bubble.mine {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
}

.chat-sender { font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.chat-bubble.theirs .chat-sender { color: var(--primary); }
.chat-bubble.mine .chat-sender { color: rgba(255,255,255,0.8); }

.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--surface);
}

.chat-input {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    overflow-y: auto;
}

.chat-attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px 0;
}

/* ===== ACTIVITY LOG ===== */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    color: white;
}

.activity-content { flex: 1; }
.activity-text { font-size: 13.5px; color: var(--text); line-height: 1.4; }
.activity-text strong { color: var(--primary); }
.activity-time { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.activity-module { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 2px; }

/* ===== PROJECT MINI DASHBOARD ===== */
.project-stats-mini {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.project-stat-mini {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border);
}

.project-stat-mini .value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.project-stat-mini .label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== PASSWORD RESET / ACCOUNT ===== */
.show-password-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    font-size: 14px;
}

.show-password-btn:hover { color: var(--primary); }

.password-field-wrap {
    position: relative;
}

.password-field-wrap .form-control {
    padding-right: 38px;
}

/* ===== INVOICE PAYMENTS ===== */
.payment-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--success-light);
}

.payment-icon { font-size: 20px; color: var(--success); flex-shrink: 0; }
.payment-info { flex: 1; }
.payment-amount { font-weight: 700; font-size: 15px; color: var(--success); }
.payment-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== INVOICE STATS ===== */
.invoice-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.invoice-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}

.invoice-stat-label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.invoice-stat-value {
    font-size: 22px;
    font-weight: 700;
}

/* ===== CLIENT PORTAL DASHBOARD ===== */
.portal-welcome {
    background: linear-gradient(135deg, #243474 0%, #10267D 100%);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    color: white;
    margin-bottom: 20px;
}

.portal-welcome h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.portal-welcome p  { opacity: 0.8; font-size: 13.5px; }

/* ===== IMPROVED SIDEBAR ===== */
.sidebar { background: #0d1b3e; }

.nav-item.active {
    background: rgba(36,52,116,0.5);
    color: #7b9ef8;
    border-left-color: #243474;
}

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

/* ===== HEADER IMPROVEMENTS ===== */
.top-header {
    background: white;
    border-bottom: 2px solid var(--primary-light);
}

/* ===== MISC ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 7px;
}

.section-title i { color: var(--primary); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--primary-light); color: var(--primary); }

@media (max-width: 640px) {
    .notif-panel { width: 320px; right: -60px; }
    .project-stats-mini { grid-template-columns: repeat(2, 1fr); }
    .invoice-stats-grid { grid-template-columns: 1fr 1fr; }
}

.notif-item[data-notif-id] {
    cursor: pointer;
    user-select: none;
}

.notif-item[data-notif-id]:hover {
    background: var(--bg);
}

.notif-item[data-notif-id].unread:hover {
    background: #dde5f8;
}

/* ===== TOAST ===== */
.toast-msg {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    transition: opacity 0.4s ease;
    opacity: 1;
    max-width: 360px;
}

.toast-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.toast-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.toast-info {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.msg-delete-btn {
    background:none;
    border:none;
    cursor:pointer;
    font-size:12px;
    font-weight: 500;
    color:var(--danger);
    margin-top:4px;padding:2px 6px;
    display:flex;align-items:center;gap:4px;
    opacity:1 !important;
    align-self:flex-end;
}

/* ===== QUILL RICH TEXT CONTENT ===== */
.ql-content p { margin-bottom: 8px; }
.ql-content h1, .ql-content h2, .ql-content h3 {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.ql-content h1 { font-size: 20px; }
.ql-content h2 { font-size: 17px; }
.ql-content h3 { font-size: 15px; }
.ql-content ul, .ql-content ol {
    padding-left: 20px;
    margin-bottom: 8px;
}
.ql-content li { margin-bottom: 4px; }
.ql-content a {
    color: var(--primary);
    text-decoration: underline;
}
.ql-content strong { font-weight: 700; }
.ql-content em { font-style: italic; }
.ql-content blockquote {
    border-left: 3px solid var(--border-dark);
    padding-left: 12px;
    color: var(--text-secondary);
    margin: 8px 0;
}
.ql-content pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 12.5px;
    overflow-x: auto;
}
.ql-content code {
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12.5px;
}

/* Quill toolbar styling to match app */
.ql-toolbar.ql-snow {
    border-color: var(--border-dark) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    background: var(--bg) !important;
}

.ql-container.ql-snow {
    border-color: var(--border-dark) !important;
    border-radius: 0 0 var(--radius) var(--radius) !important;
}

.ql-editor {
    min-height: 120px !important;
    font-family: var(--font) !important;
    font-size: 13.5px !important;
    color: var(--text) !important;
}

.ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
    font-style: normal !important;
}

/* ===== COMPREHENSIVE RESPONSIVE OVERHAUL ===== */

/* ── Tablet (max 1024px) ─────────────────────── */
@media (max-width: 1024px) {

    /* Sidebar */
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .mobile-toggle { display: block; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    /* Settings */
    .settings-layout { grid-template-columns: 1fr; }
    .settings-tabs {
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 4px;
    }
    .settings-tab { white-space: nowrap; }

    /* Forms */
    .form-grid-3 { grid-template-columns: repeat(2, 1fr); }

    /* Invoice totals */
    .invoice-totals { max-width: 100%; }

    /* Tables — allow horizontal scroll */
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Mobile (max 768px) ──────────────────────── */
@media (max-width: 768px) {
    
    .main-content { width: 100% !important; }

    /* Content padding */
    .content-area { padding: 14px; }

    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .page-header-left h2 { font-size: 18px; }
    .page-actions { width: 100%; flex-wrap: wrap; }
    .page-actions .btn { flex: 1; justify-content: center; min-width: 120px; }
    
    .page-bannercover { margin-bottom:16px;border-radius:var(--radius-lg);overflow:hidden; border:1px solid var(--border);box-shadow:var(--shadow); }
    .page-bannercover img { width: 100%; height: auto; object-fit: contain; display: block; }

    /* Breadcrumb */
    .breadcrumb { flex-wrap: wrap; }

    /* Cards */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .card-header .btn { align-self: flex-start; }

    /* Stats grid */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-value { font-size: 20px; }
    .stat-icon { width: 40px; height: 40px; font-size: 16px; }

    /* Forms */
    .form-grid { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr; }
    .form-full { grid-column: 1; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .search-input { min-width: 0; width: 100%; }
    .filters-bar .form-control { width: 100%; }
    .filters-bar .btn { width: 100%; justify-content: center; }

    /* Tables */
    .table th, .table td { padding: 8px 10px; font-size: 12.5px; }
    .table th { font-size: 10.5px; }

    /* Hide less important columns on mobile */
    .table .hide-mobile { display: none; }

    /* Tabs */
    .tabs { overflow-x: auto; gap: 0; padding-bottom: 0; flex-wrap: nowrap; }
    .tab-btn { padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }

    /* Detail grid */
    .detail-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

    /* Project stats mini */
    .project-stats-mini { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .project-stat-mini .value { font-size: 18px; }

    /* Chat */
    .chat-container { height: 420px; }

    /* Invoice */
    .invoice-totals { max-width: 100%; }
    .invoice-total-row { font-size: 13px; }
    .invoice-total-row.grand { font-size: 15px; }
    .invoice-items-table th,
    .invoice-items-table td { padding: 6px 8px; font-size: 12.5px; }

    /* Notifications panel */
    .notif-panel { width: 300px; right: -10px; }

    /* Modal */
    .modal { margin: 10px; }
    .modal-footer { flex-direction: column-reverse; }
    .modal-footer .btn { width: 100%; justify-content: center; }

    /* Settings */
    .settings-layout { grid-template-columns: 1fr; }
    .settings-tabs {
        flex-direction: row;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 4px;
    }
    .settings-tab { flex-shrink: 0; font-size: 12.5px; padding: 8px 12px; }

    /* Activity */
    .activity-item { gap: 8px; }
    .activity-icon { width: 28px; height: 28px; font-size: 11px; }

    /* Welcome banner */
    .welcome-banner { padding: 18px 20px; }
    .welcome-banner h2 { font-size: 18px; }

    /* Bulk actions */
    .bulk-actions-bar {
        flex-wrap: wrap;
        gap: 6px;
    }
    .bulk-actions-bar .btn { font-size: 12px; }

    /* Buttons in action columns */
    .actions { gap: 2px; }
    .btn-icon { padding: 5px; min-width: 28px; }

    /* Top header */
    .top-header { padding: 0 14px; }
    .page-title { font-size: 15px; }
    .header-right { gap: 8px; }

    /* Login */
    .login-card { padding: 28px 20px; }

    /* Two column grids → single column */
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* ── Small mobile (max 480px) ────────────────── */
@media (max-width: 480px) {

    /* Stats grid */
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card { padding: 12px; gap: 8px; }
    .stats-label {font-size:10px;}
    .stat-value { font-size: 16px; }
    .stat-icon { width: 25px; height: 25px; font-size: 13px; }
    .stats-flex { display: grid !important;grid-template-columns: repeat(2, 1fr); }

    /* Detail grid → single col */
    .detail-grid { grid-template-columns: 1fr; }

    /* Project stats → 2 col */
    .project-stats-mini { grid-template-columns: repeat(2, 1fr); }

    /* Notif panel full width */
    .notif-panel {
        width: 295px;
        right: -50px;
    }

    /* User dropdown */
    .user-dropdown-menu { width: 250px; }

    /* Hide username in header */
    .header-user { display: none; }

    /* Full width buttons */
    .page-actions .btn { min-width: 100px; }

    /* Table font size */
    .table th, .table td { font-size: 12px; padding: 6px 8px; }

    /* Chat */
    .chat-container { height: 360px; }
    .chat-bubble { font-size: 13px; padding: 8px 10px; }

    /* Invoice items table — stack on small screens */
    .invoice-items-table thead { display: none; }
    .invoice-items-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 10px;
        padding: 10px;
    }
    .invoice-items-table tbody td {
        display: block;
        border: none;
        padding: 4px 0;
        font-size: 13px;
    }
    .invoice-items-table tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--text-muted);
        display: block;
        margin-bottom: 2px;
    }

    /* Phase timeline scroll */
    .phase-timeline { overflow-x: auto; padding-bottom: 8px; }

    /* Sidebar footer user details */
    .user-details { display: none; }

    /* Toast */
    .toast-msg {
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: 100%;
    }
}

/* ── Overlay when sidebar is open on mobile ──── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.visible { display: block; }


/* ===== PROJECT CARDS ===== */
.project-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.project-card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.95);
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.project-card-checkbox input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Banner */
.project-card-banner {
    height: 160px;
    position: relative;
    overflow: hidden;
    background-size:cover;
    background-position: center;
    
}

.project-card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card-banner:hover img {
    transform: scale(1.03);
}

.project-card-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 30%, rgba(0,0,0,0.65) 100%);
}

/* No banner gradient header */
.project-card-header {
    height: 100px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.project-card-header-circle-lg {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}

.project-card-header-circle-sm {
    position: absolute;
    bottom: -30px;
    right: 40px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}

/* Status pill */
.project-card-status {
    position: absolute;
    bottom: 12px;
    left: 12px;
}

.project-card-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: white;
}

.project-card-status-pill .dot {
    width: 5px;
    height: 5px;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
}

.project-card-status-pill.solid {
    /* used on banner images */
}

.project-card-status-pill.glass {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Action buttons on card header */
.project-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
}

.project-card-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: opacity 0.15s;
}

.project-card-action-btn:hover { opacity: 0.85; text-decoration: none; }

.project-card-action-btn.light {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.project-card-action-btn.glass {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    color: white;
}

.project-card-action-btn.edit   { color: var(--primary); }
.project-card-action-btn.trash  { color: var(--danger); }
.project-card-action-btn.restore { color: var(--success); }
.project-card-action-btn.delete { color: var(--danger); }

/* Card body */
.project-card-body {
    padding: 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: block;
    line-height: 1.4;
    margin-bottom: 4px;
    text-decoration: none;
    transition: color 0.15s;
}

.project-card-title:hover {
    color: var(--primary);
    text-decoration: none;
}

.project-card-client {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.project-card-client-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.project-card-client-initial {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 8px;
    font-weight: 700;
}

.project-card-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.project-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.project-card-tag.phase {
    background: var(--primary-light);
    color: var(--primary);
}

/* ── Phase Tag Color Palettes ── */
.project-card-tag.phase[data-phase="contract_signed"] {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.project-card-tag.phase[data-phase="onboarding"] {
    background: #ecfeff;
    color: #0891b2;
    border: 1px solid #a5f3fc;
}
.project-card-tag.phase[data-phase="implementation"] {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}
.project-card-tag.phase[data-phase="review_testing"] {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}
.project-card-tag.phase[data-phase="deployment"] {
    background: #f0fdf4;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.project-card-tag.phase[data-phase="support"] {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}
.project-card-tag.phase[data-phase="retainer"] {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.project-card-tag.phase[data-phase="on_hold"] {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}
.project-card-tag.phase[data-phase="completed"] {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #86efac;
}

.project-card-dates {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.project-card-dates .overdue {
    color: var(--danger);
    font-weight: 600;
}

.project-card-budget {
    font-size: 12px;
    color: var(--text-muted);
}

.project-card-budget strong {
    color: var(--text);
}

/* Card footer */
.project-card-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-card-stats {
    display: flex;
    gap: 14px;
}

.project-card-stat {
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-card-stat i {
    font-size: 10px;
    color: var(--primary);
}

.project-card-open {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: gap 0.15s;
}

.project-card-open:hover {
    gap: 8px;
    text-decoration: none;
}

.project-card-open i { font-size: 10px; }

/* Card grid */
.project-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .project-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .project-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* View toggle */
.view-toggle {
    display: flex;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    overflow: hidden;
}

.view-toggle-btn {
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.view-toggle-btn.active {
    background: var(--primary);
    color: white;
}

.view-toggle-btn:not(.active) {
    background: var(--surface);
    color: var(--text-secondary);
}

.view-toggle-btn:not(.active):hover {
    background: var(--bg);
}
/* ── VIEW TOGGLE ─────────────────────────────────────────────────────────────── */
#viewContainer.view-grid .table-container { display: none; }
#viewContainer.view-grid .grid-view       { display: grid !important; }
#viewContainer.view-list .table-container { display: block; }
#viewContainer.view-list .grid-view       { display: none !important; }

.grid-view {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 20px;
}

.grid-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.grid-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.grid-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    margin: 0 auto 12px;
}

.grid-card-name {
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    margin-bottom: 4px;
}

.grid-card-sub {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 8px;
}

.grid-card-badges {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── MODERN GRID CARDS ───────────────────────────────────────────────────────── */
.modern-grid-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.modern-grid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.modern-grid-card .mgc-header {
    padding: 20px 20px 16px;
    position: relative;
}

.modern-grid-card .mgc-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.modern-grid-card .mgc-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--text);
}

.modern-grid-card .mgc-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.modern-grid-card .mgc-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.modern-grid-card .mgc-footer {
    padding: 12px 20px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.modern-grid-card .mgc-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.modern-grid-card.locked {
    opacity: 0.65;
    cursor: default;
    pointer-events: none;
}

.modern-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

#viewContainer.view-grid .table-container { display: none; }
#viewContainer.view-grid .modern-grid     { display: grid !important; }
#viewContainer.view-list .table-container { display: block; }
#viewContainer.view-list .modern-grid     { display: none !important; }

/* ── CLICKABLE TABLE ROWS ─────────────────────────────────────────────────── */
.table tbody tr.clickable-row {
    cursor: pointer;
    transition: background 0.15s;
}
.table tbody tr.clickable-row:hover {
    background: var(--primary-light) !important;
}

/* ── QUILL EDITOR ─────────────────────────────────────────────────────────── */
.ql-toolbar {
    border: 1px solid var(--border) !important;
    border-bottom: none !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    background: var(--bg) !important;
}

.ql-container {
    border: 1px solid var(--border) !important;
    border-radius: 0 0 var(--radius) var(--radius) !important;
    font-size: 13px !important;
    font-family: inherit !important;
}

.ql-editor {
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    color: var(--text) !important;
}

.ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
    font-style: normal !important;
}

/* ── UTILITY LAYOUT ──────────────────────────────────────────────────────────── */
.d-flex            { display: flex; }
.d-grid            { display: grid; }
.d-block           { display: block; }
.d-none            { display: none; }
.align-center      { align-items: center; }
.align-start       { align-items: flex-start; }
.justify-between   { justify-content: space-between; }
.justify-center    { justify-content: center; }
.justify-end       { justify-content: flex-end; }
.flex-1            { flex: 1; }
.flex-wrap         { flex-wrap: wrap; }
.gap-4             { gap: 4px; }
.gap-6             { gap: 6px; }
.gap-8             { gap: 8px; }
.gap-10             { gap:10px; }
.gap-12            { gap: 12px; }
.gap-16            { gap: 16px; }
.gap-20            { gap: 20px; }
.gap-24            { gap: 24px; }
.flex-col          { flex-direction: column; }
.text-center       { text-align: center; }
.text-right        { text-align: right; }
.w-100             { width: 100%; }
.h-100             { height: 100%; }
.position-relative { position: relative; }

/* ── UTILITY SPACING ─────────────────────────────────────────────────────────── */
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px; }
.mb-6  { margin-bottom: 6px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.p-0   { padding: 0; }
.p-12  { padding: 12px; }
.p-16  { padding: 16px; }
.p-20  { padding: 20px; }
.p-24  { padding: 24px; }

/* ── UTILITY TYPOGRAPHY ──────────────────────────────────────────────────────── */
.text-xs     { font-size: 11px; }
.text-sm     { font-size: 13px; }
.text-base   { font-size: 14px; }
.text-lg     { font-size: 16px; }
.text-xl     { font-size: 20px; }
.text-2xl    { font-size: 24px; }
.text-3xl    { font-size: 30px; }
.font-500    { font-weight: 500; }
.font-600    { font-weight: 600; }
.font-700    { font-weight: 700; }
.font-800    { font-weight: 800; }
.font-900    { font-weight: 900; }
.text-muted  { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-xp      { color: #f59e0b; }
.text-coins   { color: #10b981; }
.italic       { font-style: italic; }
.uppercase    { text-transform: uppercase; }
.letter-wide  { letter-spacing: 0.05em; }
.no-underline { text-decoration: none; }
.line-height-relaxed { line-height: 1.7; }

/* ── UTILITY COLORS & BACKGROUNDS ────────────────────────────────────────────── */
.bg-surface  { background: var(--surface); }
.bg-base     { background: var(--bg); }
.border-base { border: 1px solid var(--border); }
.rounded     { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }
.rounded-lg  { border-radius: 12px; }

/* ── AVATAR COMPONENT ────────────────────────────────────────────────────────── */
.avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    object-fit: cover;
}
.avatar-xs  { width: 28px; height: 28px; font-size: 10px; }
.avatar-sm  { width: 36px; height: 36px; font-size: 13px; }
.avatar-md  { width: 48px; height: 48px; font-size: 16px; }
.avatar-lg  { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl  { width: 84px; height: 84px; font-size: 28px; }

/* ── PAGE HEADER ─────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-header-left h2  { margin: 0; }
.page-header-left p   { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.page-actions         { display: flex; gap: 8px; align-items: center; }

/* ── META DISPLAY (label + value pairs) ──────────────────────────────────────── */
.meta-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.meta-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.meta-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.meta-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* ── TIER BADGE ──────────────────────────────────────────────────────────────── */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

/* ── PROGRESS BAR ────────────────────────────────────────────────────────────── */
.progress-bar-track {
    background: var(--border);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s ease;
}

/* ── EMPTY STATE ─────────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 40px;
    opacity: 0.2;
    display: block;
    margin-bottom: 12px;
}
.empty-state p { margin: 0; font-size: 14px; }

/* ── FILTER BAR ──────────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 16px;
}

/* ── INFO CARD (key-value display) ───────────────────────────────────────────── */
.info-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

/* ── LOCK OVERLAY BADGE ──────────────────────────────────────────────────────── */
.lock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    background: rgba(0,0,0,0.75);
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
}

/* ── GRID SORT BAR ───────────────────────────────────────────────────────────── */
.grid-sort-bar {
    display: none;
    margin-bottom: 12px;
    align-items: center;
    gap: 8px;
}
.grid-sort-bar.visible { display: flex; }
.grid-sort-bar select  { max-width: 200px; padding: 6px 10px; }

/* ── STAT NUMBER COLORS ──────────────────────────────────────────────────────── */
.stat-xp    { color: #f59e0b; font-weight: 700; }
.stat-coins { color: #10b981; font-weight: 700; }
.stat-blue  { color: #243474; font-weight: 700; }

/* ── NOTIFICATION BELL POLISH ─────────────────────────────────────────────── */
.notif-panel {
    animation: notifSlideIn 0.2s ease;
}

@keyframes notifSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Allow message to wrap to 2 lines instead of truncating */
.notif-msg {
    white-space: normal !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pulse animation on unread badge */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}
.notif-badge {
    animation: badgePulse 2s ease-in-out infinite;
}

/* Richer unread item style */
.notif-item.unread {
    border-left: 3px solid var(--primary);
}
.notif-item:not(.unread) {
    border-left: 3px solid transparent;
}

/* Better notif icon sizing */
.notif-icon {
    margin-top: 2px;
}

/* Scroll styling for notif list */
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── DASHBOARD & HERO COMPONENTS ─────────────────────────────────────────────── */

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1a3a6e 100%);
    padding: 28px 32px;
    position: relative;
    overflow: hidden;
}
.hero-banner::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.01);
}
.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -50px; right: 80px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.01);
}
.hero-title {
    margin: 0 0 6px;
    color: #fff;
    font-size: 22px;
}
.hero-sub {
    margin: 0;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}
.hero-meta {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-bottom: 8px;
}
.hero-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
    object-fit: cover;
}
.hero-avatar-initials {
    width: 72px; height: 72px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
    border: 3px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
}
.hero-avatar-sm {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
    object-fit: cover;
}
.hero-avatar-initials-sm {
    width: 80px; height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
    border: 3px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
}

/* Alert pills inside hero */
.hero-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}
.hero-pill-warning {
    background: rgba(245,158,11,0.2);
    color: #fcd34d;
    border-color: rgba(245,158,11,0.3);
}
.hero-pill-info {
    background: rgba(59,130,246,0.2);
    color: #93c5fd;
    border-color: rgba(59,130,246,0.3);
}
.hero-pill-success {
    background: rgba(16,185,129,0.2);
    color: #6ee7b7;
    border-color: rgba(16,185,129,0.3);
}
.hero-pill-muted {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    border-color: rgba(255,255,255,0.2);
}

/* Status pills in hero */
.hero-status {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

/* Tier box in hero */
.tier-box {
    text-align: center;
    border-radius: 12px;
    padding: 14px 24px;
    flex-shrink: 0;
}
.tier-box-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}
.tier-box-name {
    font-weight: 700;
    font-size: 15px;
}
.tier-box-level {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
}
.tier-box-rank {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    margin-top: 2px;
}

/* Stats bar below hero */
.stats-bar {
    display: grid;
    border-top: 1px solid var(--border);
}
.stats-bar-4  { grid-template-columns: repeat(4, 1fr); }
.stats-bar-5  { grid-template-columns: repeat(5, 1fr); }
.stats-bar-item {
    padding: 16px 20px;
    border-right: 1px solid var(--border);
}
.stats-bar-item:last-child { border-right: none; }
.stats-bar-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    margin-right: 15px;
}
.stats-bar-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}
.stats-bar-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}
.stats-bar-sub {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Grid layouts */
.grid-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3    { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-2-1  { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-1-2  { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }

/* Activity list rows */
.activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.activity-row:hover { background: var(--bg); }
.activity-row:last-child { border-bottom: none; }

/* Date badge (calendar-style) */
.date-badge {
    width: 44px; height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.date-badge-day {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.date-badge-month {
    font-size: 9px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
}

/* Truncated text */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mini XP/Coins display */
.points-mini { text-align: right; flex-shrink: 0; }
.points-mini-xp    { font-size: 12px; color: #f59e0b; font-weight: 600; }
.points-mini-coins { font-size: 12px; color: #10b981; font-weight: 600; }

/* Member type progress rows */
.type-bar-row { margin-bottom: 0; }
.type-bar-row + .type-bar-row { margin-top: 16px; }

/* ── EXTENDED UTILITY CLASSES ────────────────────────────────────────────────── */

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* Border */
.border-top    { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.border-left   { border-left: 1px solid var(--border); }
.border-right  { border-right: 1px solid var(--border); }

/* Flex shrink */
.flex-shrink-0 { flex-shrink: 0; }

/* Min width */
.min-w-0 { min-width: 0; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Pointer events */
.pointer-events-none { pointer-events: none; }

/* Object fit */
.object-cover { object-fit: cover; }

/* Z-index */
.z-1 { z-index: 1; }

/* Opacity */
.opacity-30 { opacity: 0.3; }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }

/* Line height */
.leading-none    { line-height: 1; }
.leading-tight   { line-height: 1.3; }
.leading-normal  { line-height: 1.5; }
.leading-relaxed { line-height: 1.7; }

/* Margin auto */
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Padding shortcuts */
.px-16 { padding-left: 16px; padding-right: 16px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.py-8  { padding-top: 8px;  padding-bottom: 8px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }
.py-24 { padding-top: 24px; padding-bottom: 24px; }
.py-40 { padding-top: 40px; padding-bottom: 40px; }
.py-60 { padding-top: 60px; padding-bottom: 60px; }

/* Grid columns */
.grid-4    { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ── CARD VARIANTS ───────────────────────────────────────────────────────────── */
.card-flush .card-body { padding: 0; }
.card-hover { transition: box-shadow 0.2s, transform 0.2s; }
.card-hover:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }

/* ── PAGE HEADER VARIANTS ────────────────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h2 { margin: 0; }
.page-header p  { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }

/* ── SECTION HEADERS ─────────────────────────────────────────────────────────── */
.section-title {
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ── DETAIL ROWS (label + value) ─────────────────────────────────────────────── */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    column-gap: 10px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { font-weight: 500; text-align: right; }

/* ── INVOICE / DOCUMENT STYLES ───────────────────────────────────────────────── */
.amount-display {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}
.amount-display-lg {
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}

/* ── STATUS VARIANTS ─────────────────────────────────────────────────────────── */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot-success { background: var(--success); }
.status-dot-warning { background: var(--warning); }
.status-dot-danger  { background: var(--danger); }
.status-dot-info    { background: #0891b2; }
.status-dot-muted   { background: var(--text-muted); }

/* ── WATERMARK ───────────────────────────────────────────────────────────────── */
.watermark {
    position: absolute;
    top: 20px; right: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 4px 12px;
    border-radius: 4px;
    opacity: 0.15;
    transform: rotate(-15deg);
    pointer-events: none;
}
.watermark-paid    { border: 3px solid var(--success); color: var(--success); }
.watermark-overdue { border: 3px solid var(--danger);  color: var(--danger); }

/* ── PROFILE TABS ────────────────────────────────────────────────────────────── */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    white-space: nowrap;
}
.tab-btn:hover  { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content    { display: none; }
.tab-content.active { display: block; }

/* ── POINTS / TIER COMPONENTS ────────────────────────────────────────────────── */
.xp-value    { color: #f59e0b; font-weight: 700; }
.coins-value { color: #10b981; font-weight: 700; }

.tier-journey {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 8px;
    position: relative;
}
.tier-step {
    flex: 1;
    min-width: 70px;
    text-align: center;
    position: relative;
}
.tier-step-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: box-shadow 0.2s;
}
.tier-step-line {
    position: absolute;
    top: 16px;
    height: 2px;
    z-index: 0;
}
.tier-step-line-left  { left: 0; right: 50%; }
.tier-step-line-right { left: 50%; right: 0; }
.tier-step-name  { font-size: 10px; font-weight: 600; }
.tier-step-range { font-size: 9px;  color: var(--text-muted); }

/* ── MARKETPLACE ─────────────────────────────────────────────────────────────── */
.item-card {
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.item-card.locked  { opacity: 0.7; }
.item-card-image {
    height: 160px;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}
.item-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.item-card-image.no-image {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.item-price-coins { font-weight: 700; color: #10b981; }
.item-price-cash  { font-weight: 700; color: var(--primary); }

/* ── LEADERBOARD ─────────────────────────────────────────────────────────────── */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 32px;
}
.podium-item        { text-align: center; flex: 1; max-width: 200px; }
.podium-platform    { border-radius: 8px 8px 0 0; display: flex; align-items: center; justify-content: center; margin-top: 8px; }
.podium-platform-1  { background: linear-gradient(135deg, #f59e0b, #d97706); height: 110px; font-size: 36px; font-weight: 900; color: #fff; }
.podium-platform-2  { background: #e2e8f0; height: 80px; font-size: 28px; font-weight: 900; color: #64748b; }
.podium-platform-3  { background: #fcd9a0; height: 60px; font-size: 24px; font-weight: 900; color: #b45309; }

/* ── MEMBER CARD (directory) ─────────────────────────────────────────────────── */
.member-card {
    text-align: center;
    padding: 20px;
    transition: box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.member-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

/* ── FILTER BAR ──────────────────────────────────────────────────────────────── */
.filter-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 16px;
}

/* ── BULK ACTIONS ────────────────────────────────────────────────────────────── */
.bulk-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.bulk-bar.visible { display: flex; }
.bulk-count { font-weight: 600; color: var(--primary); }

/* ── FLASH MESSAGES ──────────────────────────────────────────────────────────── */
.flash-message {
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: flashIn 0.3s ease;
}
@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.flash-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.flash-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.flash-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Flash close button */
.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.6;
    font-size: 14px;
    transition: opacity 0.15s;
    color: inherit;
}
.flash-close:hover { opacity: 1; }

/* Validation errors */
.validation-errors {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #b91c1c;
}
.validation-errors ul { margin: 6px 0 0 16px; }
.validation-errors li { margin-bottom: 2px; }

/* Back link pattern */
.back-link { margin-bottom: 24px; }

/* Disable clickable row hover since we use title links instead */
.table tbody tr.clickable-row { cursor: default; }
.table tbody tr.clickable-row:hover { background: inherit !important; }

/* ── ADDITIONAL MISSING UTILITIES ───────────────────────────────────────────── */
.page-header-left p { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.form-group-inline  { margin: 0; }
.filter-select-sm   { max-width: 200px; padding: 6px 10px; }
.opacity-60         { opacity: 0.6; }
.text-warning       { color: var(--warning); }
.text-info          { color: #0891b2; }
.w-auto             { width: auto; }

/* View toggle buttons */
.view-toggle { display: flex; gap: 4px; }

/* Grid sort bar */
.grid-sort-select { max-width: 200px; padding: 6px 10px; }

/* Table wrapper with border */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Align-items start for grids */
.align-start-grid { align-items: start; }

/* Form group with no margin */
.fg-0 { margin: 0; }
.fg-0-flex { margin: 0; flex: 1; min-width: 200px; }

/* Compact badge */
.badge-xs { font-size: 10px; padding: 2px 6px; }

/* Text colors */
.text-white         { color: #fff; }
.text-white-60      { color: rgba(255,255,255,0.6); }
.text-white-50      { color: rgba(255,255,255,0.5); }
.text-white-40      { color: rgba(255,255,255,0.4); }

/* ── LEADERBOARD SPECIFIC ────────────────────────────────────────────────────── */
.my-rank-card {
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #1a2a6c 100%);
    border: none;
    color: #fff;
}
.my-rank-card .card-body { padding: 20px; }
.my-rank-number  { font-size: 36px; font-weight: 900; opacity: 0.9; }
.my-rank-label   { font-weight: 600; font-size: 16px; }
.my-rank-sub     { opacity: 0.8; font-size: 13px; }
.my-rank-stats   { display: flex; gap: 24px; }
.my-rank-stat-val { font-size: 22px; font-weight: 700; }
.my-rank-stat-lbl { font-size: 11px; opacity: 0.7; }

.podium-wrap     { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin-bottom: 32px; }
.podium-slot     { text-align: center; flex: 1; max-width: 200px; }
.podium-medal    { font-size: 24px; margin-bottom: 4px; }
.podium-medal-lg { font-size: 28px; margin-bottom: 4px; }
.podium-name     { font-weight: 600; font-size: 14px; }
.podium-name-lg  { font-weight: 700; font-size: 15px; }
.podium-score    { font-size: 13px; font-weight: 600; color: #f59e0b; }
.podium-score-lg { font-size: 14px; font-weight: 700; color: #f59e0b; }

/* ── FINAL MISSING UTILITIES ─────────────────────────────────────────────────── */
.align-items-start  { align-items: start; }
.flex-wrap-wrap     { flex-wrap: wrap; }
.gap-4-wrap         { gap: 4px; flex-wrap: wrap; }

/* Specific widths used in forms */
.min-w-130 { min-width: 130px; }
.min-w-150 { min-width: 150px; }
.min-w-160 { min-width: 160px; }
.min-w-180 { min-width: 180px; }
.min-w-200 { min-width: 200px; }
.min-w-220 { min-width: 220px; }
.max-w-200 { max-width: 200px; }
.max-w-500 { max-width: 500px; }
.max-w-800 { max-width: 800px; }

/* Padding combinations */
.px-20-py-12 { padding: 12px 20px; }
.p-16-bt     { padding: 16px; border-top: 1px solid var(--border); }

/* Transition */
.transition-bg { transition: background 0.15s; }

/* Hover states */
.hover-bg:hover { background: var(--bg); }

/* Inline flex */
.inline-flex { display: inline-flex; }
.inline-flex-center { display: inline-flex; align-items: center; }

/* Modern grid card overrides */
.mgc-header-center { text-align: center; }

/* Settings tab specific */
.settings-info-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.8;
}

/* Marketplace item grid */
.item-price-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.stock-info      { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* Events locked indicator */
.locked-indicator {
    text-align: center;
    padding: 8px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-muted);
}
.locked-indicator.warning { color: var(--warning); }

/* Directory card */
.dir-card-stat { text-align: center; margin-top: 8px; font-size: 12px; }

/* BOD card */
.bod-position {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 6px;
}

/* Points history item */
.points-tx-row {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.points-tx-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.points-tx-icon.earned  { background: #10b98118; }
.points-tx-icon.spent   { background: #ef444418; }
.points-tx-icon.expired { background: #ef444418; }

/* ── STATUS PILLS (used in grid cards) ───────────────────────────────────────── */
.pill { padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; display: inline-block; }
.pill-primary  { background: #24347418; color: #243474; }
.pill-success  { background: #10b98118; color: #10b981; }
.pill-info     { background: #0891b218; color: #0891b2; }
.pill-danger   { background: #ef444418; color: #ef4444; }
.pill-warning  { background: #f59e0b18; color: #f59e0b; }
.pill-muted    { background: #64748b18; color: #64748b; }

/* Icon width fixed */
.icon-w { width: 14px; display: inline-block; text-align: center; }

/* XP/coins with size */
.xp-sm    { color: #f59e0b; font-weight: 600; font-size: 12px; }
.coins-sm { color: #10b981; font-weight: 600; font-size: 12px; }
.xp-md    { color: #f59e0b; font-weight: 700; font-size: 12px; }

/* Warning text sizes */
.text-warning-sm { color: var(--warning); font-size: 11px; }
.text-warning-xs { color: var(--warning); font-size: 11px; }

/* Grid sort bar hidden by default */
.grid-sort-hidden { display: none; margin-bottom: 12px; align-items: center; gap: 8px; }

/* Flex gap wrap combo */
.d-flex-wrap-6  { display: flex; gap: 6px; flex-wrap: wrap; }
.d-flex-wrap-8  { display: flex; gap: 8px; flex-wrap: wrap; }
.d-flex-wrap-12 { display: flex; gap: 12px; flex-wrap: wrap; }

/* Card header row between */
.mgc-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* Meta flex col gap 4 */
.d-flex-col-4 { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }

/* ── REGISTRATION PAGE ───────────────────────────────────────────────────────── */
.register-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1b3e 0%, #1a3a6e 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.register-container {
    width: 100%;
    max-width: 900px;
}

.register-header {
    text-align: center;
    margin-bottom: 32px;
    color: #fff;
}

.register-header .brand-icon {
    margin: 0 auto 16px;
    width: 56px;
    height: 56px;
    font-size: 22px;
}

.register-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
}

.register-header p {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin: 0;
}

.register-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.register-section {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}

.register-section:last-child { border-bottom: none; }

.register-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.register-section-title i {
    width: 28px;
    height: 28px;
    background: var(--primary-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--primary);
}

.register-footer {
    padding: 20px 28px;
    background: var(--bg);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.register-built-by {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    margin-top: 20px;
}

/* ── REGISTER PAGE RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .register-page {
        padding: 20px 16px;
        align-items: flex-start;
    }

    .register-container {
        max-width: 100%;
    }

    .register-header {
        margin-bottom: 20px;
    }

    .register-header h1 { font-size: 20px; }
    .register-header p  { font-size: 13px; }

    .register-section {
        padding: 18px 16px;
    }

    .register-section-title {
        font-size: 11px;
        margin-bottom: 14px;
    }

    .register-footer {
        padding: 16px;
    }

    .register-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    /* Stack all 2-column grids on mobile */
    .register-card .meta-grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .register-card .form-group {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .register-page { padding: 0; }

    .register-header {
        padding: 24px 16px 0;
    }

    .register-card {
        border-radius: 0;
        box-shadow: none;
    }

    .register-built-by {
        padding: 16px;
    }
}

/* ── AUTH/LOGIN RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-page {
        padding: 0;
        align-items: flex-start;
    }

    .login-card {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
        padding: 32px 20px;
    }
}

/* ── ADMIN/MEMBER LAYOUT RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Stack 2-col grids */
    .grid-2     { grid-template-columns: 1fr; }
    .grid-3     { grid-template-columns: 1fr; }
    .grid-2-1   { grid-template-columns: 1fr; }
    .grid-1-2   { grid-template-columns: 1fr; }
    .grid-4     { grid-template-columns: 1fr 1fr; }
    .meta-grid-2 { grid-template-columns: 1fr; }
    .meta-grid-3 { grid-template-columns: 1fr; }

    /* Stats bars stack */
    .stats-bar-4 { grid-template-columns: 1fr 1fr; }
    .stats-bar-5 { grid-template-columns: 1fr 1fr; }

    /* Page header stacks */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    /* Hero banner */
    .hero-banner .d-flex.justify-between {
        flex-direction: column;
        gap: 16px;
    }

    .tier-box { 
        justify-content: center;
        width: 100%;
        display: flex;
        column-gap: 10px;
        align-items: center;
    }
    .tier-box-icon {
        margin-bottom: 0;;
    }

    /* Podium stacks */
    .podium-wrap {
        flex-direction: column;
        align-items: center;
    }

    .podium-slot { max-width: 100%; width: 200px; }
}

@media (max-width: 480px) {
    .grid-4     { grid-template-columns: 1fr; }
    .stats-bar-4 { grid-template-columns: 1fr 1fr; }
    .stats-bar-5 { grid-template-columns: 1fr 1fr; }

    .stats-bar-item { padding: 12px 14px; }
    .stats-bar-value { font-size: 15px; }

    .hero-banner { padding: 20px 16px; }

    /* Tables scroll horizontally */
    .table-container { overflow-x: auto; }

    /* Filter forms stack */
    .filter-form { flex-direction: column; }
    .filter-form .form-group { width: 100%; }

    /* Card padding reduces */
    .card-body { padding: 14px; }
}

/* ── ITEM CARDS (Marketplace) ────────────────────────────────────────────── */
.item-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}
.item-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.item-card-accent { height: 4px; }
.item-card-image { height: 180px; overflow: hidden; position: relative; }
.item-card-image img { width: 100%; height: 100%; object-fit: cover; }
.item-card-image-placeholder {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-card-image-placeholder i { font-size: 48px; opacity: 0.3; }
.item-card-body { padding: 16px; }
.item-card-category {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.item-card-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--text);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.item-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}
.item-card-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.item-card-price-coins {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #10b98112;
    border-radius: 8px;
    padding: 6px 10px;
}
.item-card-price-coins .amount { font-weight: 800; color: #10b981; font-size: 15px; }
.item-card-price-coins .unit   { font-size: 11px; color: #10b981; opacity: 0.7; }
.item-card-price-coins .short  { font-size: 10px; color: var(--danger); font-weight: 600; }
.item-card-price-cash {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--primary-light);
    border-radius: 8px;
    padding: 6px 10px;
}
.item-card-price-cash .amount { font-weight: 800; color: var(--primary); font-size: 15px; }
.item-card-price-sep { color: var(--text-muted); font-size: 12px; }
.item-card-stock {
    font-size: 11px;
    margin-bottom: 12px;
    color: var(--text-muted);
}
.item-card-stock.low { color: var(--danger); }
.item-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.item-card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
}
.item-card-action:hover { opacity: 0.9; }
.item-card-unavailable {
    text-align: center;
    padding: 10px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}
.item-card-badge {
    position: absolute;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}
.item-card-badge-top-left  { top: 12px; left: 12px; }
.item-card-badge-top-right { top: 12px; right: 12px; }
.item-card-badges-left {
    position: absolute;
    top: 16px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
}
.item-card-unavailable-overlay { opacity: 0.7; }
.item-card-grayscale img { filter: grayscale(40%); }

/* ── PROJECT / EVENT CARDS ───────────────────────────────────────────────── */
.content-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.2s;
}
.content-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.content-card-accent { height: 4px; }
.content-card-image  { height: 160px; overflow: hidden; position: relative; }
.content-card-image img  { width: 100%; height: 100%; object-fit: cover; }
.content-card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.6));
}
.content-card-image-footer {
    position: absolute;
    bottom: 10px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.content-card-body { padding: 16px; }
.content-card-badges { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.content-card-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 6px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.content-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.content-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}
.content-card-footer-item { font-size: 12px; color: var(--text-muted); }

/* Status pills */
.status-pill {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}
.status-pill-sm {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
}

/* ── SHOW PAGE HERO WITH PUBMAT ──────────────────────────────────────────── */
.pubmat-hero          { position: relative; height: 320px; }
.pubmat-hero img      { width: 100%; height: 100%; object-fit: cover; }
.pubmat-hero-overlay  {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.75));
}
.pubmat-hero-content  { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px 28px; }
.pubmat-hero-title    { color: #fff; font-size: 22px; font-weight: 800; margin: 0; }
.pubmat-hero-badges   { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pubmat-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
.pubmat-badge-muted {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ── PARTICIPATION STATUS CARD ───────────────────────────────────────────── */
.participation-status {
    text-align: center;
    padding: 16px 0;
}
.participation-status-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.participation-status-icon i { font-size: 28px; }
.participation-status-title  { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.participation-status-sub    { font-size: 13px; color: var(--text-muted); }
.participation-points-box {
    border-radius: 10px;
    padding: 12px;
    margin-top: 16px;
    text-align: center;
}
.participation-points-box i { font-size: 20px; display: block; margin-bottom: 4px; }
.participation-points-box .label { font-weight: 600; font-size: 13px; }
.participation-points-box .sub   { font-size: 11px; color: var(--text-muted); }

/* My role emoji box */
.role-emoji { font-size: 48px; margin-bottom: 8px; }
.role-status-box {
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
}
.role-status-box i { font-size: 20px; display: block; margin-bottom: 4px; }
.role-status-box .label { font-weight: 600; font-size: 13px; }
.role-status-box .sub   { font-size: 11px; color: var(--text-muted); }

/* Balance box in marketplace hero */
.balance-box {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 16px 24px;
    text-align: center;
}
.balance-box-label  { font-size: 11px; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.balance-box-amount { font-size: 24px; font-weight: 800; color: #10b981; }
.balance-box-sub    { font-size: 11px; color: rgba(255,255,255,0.6); }

/* Content cards grid */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.item-grid    { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

@media (max-width: 640px) {
    .content-grid { grid-template-columns: 1fr; }
    .item-grid    { grid-template-columns: 1fr; }
    .pubmat-hero  { height: 220px; }
}

/* ── ADDITIONAL UTILITY CLASSES ──────────────────────────────────────────── */
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.line-height-relaxed { line-height: 1.7; }
.opacity-30 { opacity: 0.3; }
.flex-shrink-0 { flex-shrink: 0; }
.w-100 { width: 100%; }
.mt-20 { margin-top: 20px; }
.mb-4  { margin-bottom: 4px; }
.mb-6  { margin-bottom: 6px; }
.mb-8  { margin-bottom: 8px; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

/* ── BOARD OF DIRECTORS ──────────────────────────────────────────────────── */
.term-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    text-align: center;
    padding: 28px 20px;
}
.term-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.term-card-year {
    font-size: 40px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
}
.term-card-theme {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.term-card-accent {
    height: 4px;
    background: var(--primary);
    margin: -28px -20px 20px;
}
.term-card.current-term {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.term-card-badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* BOD Member Card */
.bod-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    text-align: center;
    padding: 24px 16px;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}
.bod-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.bod-card-accent { height: 4px; margin: -24px -16px 20px; }
.bod-card-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    border: 3px solid;
    overflow: hidden;
}
.bod-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bod-card-position {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    margin-bottom: 6px;
}
.bod-card-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.bod-card-regnum { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.bod-card-tier {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
}

/* BOD Hero */
.bod-hero-year {
    font-size: 64px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    opacity: 0.15;
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.bod-hero-content { position: relative; z-index: 1; }

/* Terms grid */
.terms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.bod-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }

@media (max-width: 640px) {
    .terms-grid { grid-template-columns: repeat(2, 1fr); }
    .bod-grid   { grid-template-columns: repeat(2, 1fr); }
    .bod-hero-year { display: none; }
}

/* ── NOTIFICATION MODAL ──────────────────────────────────────────────────── */
.notif-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.notif-modal-backdrop.active { display: flex; }

.notif-modal {
    background: var(--surface);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: notif-modal-in 0.2s ease;
}

@keyframes notif-modal-in {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.notif-modal-header {
    padding: 32px 28px 20px;
    text-align: center;
}
.notif-modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}
.notif-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}
.notif-modal-message {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}
.notif-modal-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}
.notif-modal-confetti {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    top: 0;
    left: 0;
}
.notif-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.notif-modal-btn {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: opacity 0.2s;
}
.notif-modal-btn:hover { opacity: 0.9; }
.notif-modal-btn-primary { color: #fff; }
.notif-modal-btn-secondary {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

/* Confetti particles */
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confetti-fall 1s ease-in forwards;
}
@keyframes confetti-fall {
    0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(300px) rotate(720deg); opacity: 0; }
}

.notif-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    align-self: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   COMPREHENSIVE RESPONSIVE SYSTEM
   Breakpoints: 1024px (tablet), 768px (mobile-lg), 480px (mobile-sm)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── TABLET (≤1024px) ────────────────────────────────────────────────────── */
@media (max-width: 1024px) {

    /* Sidebar collapses — handled by existing sidebar toggle */
    .admin-sidebar,
    .member-sidebar { width: 240px; }

    /* Grid adjustments */
    .grid-3    { grid-template-columns: 1fr 1fr; }
    .grid-4    { grid-template-columns: 1fr 1fr; }
    .grid-2-1  { grid-template-columns: 1fr 1fr; }
    .grid-1-2  { grid-template-columns: 1fr 1fr; }

    /* Stats bars compress */
    .stats-bar-5 { grid-template-columns: repeat(3, 1fr); }

    /* Item/content grids */
    .item-grid    { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .bod-grid     { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .terms-grid   { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

    /* Pubmat hero height */
    .pubmat-hero  { height: 260px; }
}

/* ── MOBILE LARGE (≤768px) ───────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* ── Layout ── */
    .admin-layout,
    .member-layout { flex-direction: column; }

    .main-content  { padding: 16px; }

    /* ── Grids collapse to single column ── */
    .grid-2    { grid-template-columns: 1fr; gap: 16px; }
    .grid-3    { grid-template-columns: 1fr; gap: 16px; }
    .grid-4    { grid-template-columns: 1fr 1fr; gap: 12px; }
    .grid-2-1  { grid-template-columns: 1fr; gap: 16px; }
    .grid-1-2  { grid-template-columns: 1fr; gap: 16px; }
    .meta-grid-2 { grid-template-columns: 1fr; gap: 12px; }
    .meta-grid-3 { grid-template-columns: 1fr; gap: 12px; }

    /* ── Stats bars ── */
    .stats-bar-4 { grid-template-columns: 1fr 1fr; }
    .stats-bar-5 { grid-template-columns: 1fr 1fr; }
    .stats-bar-item { padding: 12px 14px; }
    .stats-bar-value { font-size: 16px; }
    .stats-bar-sub   { font-size: 10px; }

    /* ── Page header ── */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .page-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .page-actions .btn { flex: 1; justify-content: center; }

    /* ── Cards ── */
    .card-body { padding: 14px; }
    .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }

    /* ── Hero banner ── */
    .hero-banner { padding: 20px 16px; }
    .hero-title  { font-size: 18px; }
    .hero-meta   { font-size: 12px; }
    .pubmat-hero { height: 200px; }
    .pubmat-hero-title { font-size: 18px; }
    .pubmat-hero-content { padding: 16px 18px; }
    .bod-hero-year { display: none; }

    /* ── Tables ── */
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table th,
    .table td { white-space: nowrap; font-size: 13px; padding: 10px 12px; }

    /* ── Forms ── */
    .filter-form,
    .d-flex.flex-wrap { gap: 8px; }
    .form-group.fg-0-flex { min-width: 100%; }
    .form-group.fg-0 { min-width: 140px; }

    /* ── Item/content grids ── */
    .item-grid    { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
    .bod-grid     { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .terms-grid   { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .directory-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

    /* ── BOD cards ── */
    .bod-card { padding: 16px 10px; }
    .bod-card-avatar { width: 52px; height: 52px; font-size: 16px; }
    .bod-card-name { font-size: 12px; }
    .bod-card-position { font-size: 9px; }

    /* ── Term cards ── */
    .term-card { padding: 18px 12px; }
    .term-card-year { font-size: 28px; }

    /* ── Tier journey ── */
    .tier-journey { gap: 4px; }
    .tier-step-name { font-size: 9px; }
    .tier-step-range { font-size: 8px; }

    /* ── Podium ── */
    .podium-wrap { gap: 6px; }
    .podium-slot { padding: 12px 8px; }
    .podium-name { font-size: 11px; }

    /* ── Leaderboard table ── */
    .leaderboard-table th:nth-child(4),
    .leaderboard-table td:nth-child(4) { display: none; }

    /* ── Notification modal ── */
    .notif-modal { max-width: 100%; margin: 0 10px; }
    .notif-modal-backdrop { padding: 10px; }

    /* ── Balance box in marketplace ── */
    .balance-box { padding: 12px 16px; }
    .balance-box-amount { font-size: 18px; }

    /* ── Progress bar ── */
    .progress-bar-track { height: 8px; }

    /* ── Activity rows ── */
    .activity-row { padding: 10px 0; gap: 10px; }

    /* ── View toggle ── */
    .view-toggle { display: flex; gap: 4px; }

    /* ── Tab nav ── */
    .tab-nav { gap: 4px; flex-wrap: wrap; }
    .tab-btn { padding: 8px 12px; font-size: 12px; }

    /* ── Detail rows ── */
    .detail-row { padding: 10px 12px; flex-wrap: wrap; gap: 4px; }
    .detail-label { min-width: 100%; color: var(--text-muted); }

    /* ── Bulk bar ── */
    .bulk-bar { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }

    /* ── Admin items index ── */
    .item-card-body { padding: 12px; }
    .item-card-title { font-size: 14px; }

    /* ── Registration page ── */
    .register-page { padding: 0; }
    .register-card { border-radius: 0; }
    .register-section { padding: 16px; }
    .register-header { padding: 20px 16px 0; }

    /* ── Sidebar hidden on mobile ── */
    .admin-sidebar,
    .member-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100vh;
        z-index: 500;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    .admin-sidebar.open,
    .member-sidebar.open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 499;
    }
    .sidebar-overlay.active { display: block; }

    /* ── Top header ── */
    .admin-header,
    .member-header { padding: 0 16px; }

    /* ── Main content margin adjustment ── */
    .admin-main,
    .member-main { margin-left: 0 !important; }
}

/* ── MOBILE SMALL (≤480px) ───────────────────────────────────────────────── */
@media (max-width: 480px) {

    /* ── Typography ── */
    h2 { font-size: 18px; }
    h3 { font-size: 15px; }

    /* ── Grids ── */
    .grid-4    { grid-template-columns: 1fr; }
    .stats-bar-4 { grid-template-columns: 1fr 1fr; }
    .stats-bar-5 { grid-template-columns: 1fr 1fr; }
    .bod-grid    { grid-template-columns: repeat(1, 1fr); }
    .terms-grid  { grid-template-columns: repeat(2, 1fr); }
    .item-grid   { grid-template-columns: 1fr; gap: 10px; }
    .content-grid { grid-template-columns: 1fr; }

    /* ── Card body ── */
    .card-body { padding: 12px; }

    /* ── Hero ── */
    .hero-banner { padding: 16px 14px; }
    .hero-title  { font-size: 16px; }
    .pubmat-hero { height: 180px; }

    /* ── Stats bar single column for very small ── */
    .stats-bar-item { padding: 10px 12px; }
    .stats-bar-value { font-size: 14px; }

    /* ── Buttons ── */
    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-sm { padding: 5px 10px; font-size: 12px; }

    /* ── Tables hide less important columns ── */
    .table th:last-child,
    .table td:last-child { padding-right: 8px; }

    /* ── Notification modal full screen ── */
    .notif-modal-backdrop { padding: 0; align-items: flex-end; }
    .notif-modal {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
        margin: 0;
    }

    /* ── Page header actions stack ── */
    .page-actions { flex-direction: column; }
    .page-actions .btn { width: 100%; }

    /* ── Forms full width ── */
    .form-control { font-size: 16px; } /* Prevents iOS zoom */
    .form-group.fg-0 { min-width: 100%; }

    /* ── Admin login card ── */
    .login-card { border-radius: 0; min-height: 100vh; padding: 28px 16px; }

    /* ── Tab nav scrollable ── */
    .tab-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .tab-btn  { white-space: nowrap; flex-shrink: 0; }

    /* ── BOD cards ── */
    .bod-card-avatar { width: 44px; height: 44px; font-size: 14px; }

    /* ── Balance box stacks ── */
    .balance-box { width: 100%; }

    /* ── Marketplace item card ── */
    .item-card-image  { height: 130px; }
    .item-card-image-placeholder { height: 100px; }

    /* ── Content card image ── */
    .content-card-image { height: 120px; }
}

/* ── SIDEBAR MOBILE TOGGLE ───────────────────────────────────────────────── */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
    font-size: 18px;
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; align-items: center; }
}

/* ── LOGIN PAGE REDESIGN ─────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}

/* Left panel - branding */
.auth-panel-left {
    flex: 1;
    background: linear-gradient(145deg, #0d1b3e 0%, #1a3a6e 60%, #243474 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

.auth-panel-left::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    top: -100px;
    right: -100px;
}

.auth-panel-left::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    bottom: -80px;
    left: -80px;
}

.auth-brand {
    text-align: center;
    position: relative;
    z-index: 1;
}

.auth-brand-icon {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin: 0 auto 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
}

.auth-brand h1 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
}

.auth-brand p {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    margin: 0 0 40px;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    width: 100%;
    max-width: 280px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-features li i {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    color: #fff;
}

/* Right panel - form */
.auth-panel-right {
    width: 440px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 40px;
    background: var(--surface);
    position: relative;
}

.auth-panel-right-inner { max-width: 360px; width: 100%; margin: 0 auto; }

.auth-form-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-form-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.auth-submit-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
    border-radius: 10px;
}

.auth-footer {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

/* ── AUTH RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-page { flex-direction: column; }

    .auth-panel-left {
        padding: 32px 24px;
        min-height: auto;
        flex: none;
    }

    .auth-brand h1    { font-size: 22px; }
    .auth-brand p     { margin-bottom: 20px; }
    .auth-features    { display: none; }
    .auth-brand-icon  { width: 60px; height: 60px; font-size: 24px; border-radius: 14px; }

    .auth-panel-right {
        width: 100%;
        padding: 32px 24px 60px;
        flex: 1;
    }

    .auth-footer { bottom: 16px; }
}

@media (max-width: 480px) {
    .auth-panel-left  { padding: 24px 20px; }
    .auth-panel-right { padding: 24px 20px 56px; }
    .auth-form-title  { font-size: 20px; }
    .form-control     { font-size: 16px; } /* Prevents iOS zoom on focus */
}

/* ── SIDEBAR MOBILE FIX ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 260px !important;
        z-index: 500;
        transition: left 0.3s ease;
        box-shadow: none;
        /* Keep existing sidebar background color */
        overflow-y: auto;
    }

    .sidebar.open {
        left: 0 !important;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    }

    /* Main content takes full width */
    .main-content,
    .admin-main,
    .member-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Hide sidebar toggle that may exist inside sidebar */
    .sidebar-toggle { display: none; }
}

/* ── HEADER QUICK STATS ──────────────────────────────────────────────────── */
.header-right { display: flex; align-items: center; gap: 10px; }

.header-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

.header-stat-xp     { color: #f59e0b; }
.header-stat-points { color: #10b981; }

@media (max-width: 768px) {
    .header-stats { display: none; }
    .header-right { gap: 6px; }
}

/* ── RESPONSIVE TABLE WRAPPERS ───────────────────────────────────────────── */
/* All tables should scroll horizontally on mobile */
.card-body .table,
.card .table { display: table; } /* ensure block display not overridden */

@media (max-width: 768px) {
    /* Wrap any table inside card-body */
    .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 500px; }
    .table-sm { min-width: 380px; }

    /* Profile tabs */
    .tab-content .table { min-width: 480px; }

    /* Points history table */
    #tab-dues .table,
    #tab-projects .table,
    #tab-files .table { min-width: 420px; }

    /* Leaderboard */
    .leaderboard-table { min-width: 500px; }

    /* Podium responsive */
    .podium-wrap {
        gap: 8px;
        align-items: flex-end;
    }
    .podium-slot {
        flex: 1;
        min-width: 0;
        padding: 10px 6px;
    }
    .podium-avatar {
        width: 44px !important;
        height: 44px !important;
        font-size: 14px !important;
    }
    .podium-name   { font-size: 10px !important; }
    .podium-xp     { font-size: 10px !important; }
    .podium-medal  { font-size: 18px !important; }
    .podium-bar    { min-height: 40px !important; }

    /* My rank stats */
    .my-rank-stats { gap: 8px; }
    .my-rank-stat  { padding: 10px 8px; }
    .my-rank-stat-val { font-size: 18px; }

    /* Points page filter */
    .points-filter { flex-direction: column; }

    /* Directory show grid */
    .grid-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .table { min-width: 400px; font-size: 12px; }
    .table th, .table td { padding: 8px 10px; }

    /* Podium even smaller */
    .podium-slot  { padding: 8px 4px; }
    .podium-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 12px !important;
    }
    .podium-name { font-size: 9px !important; }
}

/* ── PROFILE TABS RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tab-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 0;
        padding-bottom: 2px;
        border-bottom: 2px solid var(--border);
    }
    .tab-btn {
        flex-shrink: 0;
        border-radius: 0;
        padding: 10px 14px;
        font-size: 12px;
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
    }
    .tab-btn.active {
        border-bottom-color: var(--primary);
        background: transparent;
        color: var(--primary);
    }
}

/* ── ADMIN TABLES RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* All admin tables scroll */
    .admin-main .table-container,
    .admin-main .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-main .table { min-width: 600px; }

    /* Hide less important columns on mobile */
    .admin-main .table .hide-mobile { display: none; }

    /* Actions column stays visible */
    .admin-main .table .actions { min-width: 80px; }

    /* Members index */
    .admin-main #membersTable { min-width: 700px; }

    /* Invoices */
    .admin-main #invoicesTable { min-width: 650px; }

    /* Projects/Events */
    .admin-main #projectsTable,
    .admin-main #eventsTable { min-width: 600px; }
}

/* ── PODIUM AVATARS ──────────────────────────────────────────────────────── */
.podium-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    overflow: hidden;
    border: 2px solid;
    flex-shrink: 0;
}
.podium-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.podium-avatar-lg {
    width: 68px;
    height: 68px;
    font-size: 24px;
    border-width: 3px;
}

/* ── LEADERBOARD TABLE ROW ───────────────────────────────────────────────── */
.lb-row-me { background: var(--primary-light); }
.lb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid;
    overflow: hidden;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── MY RANK STATS ───────────────────────────────────────────────────────── */
.my-rank-stat-xp     { color: #f59e0b; }
.my-rank-stat-coins  { color: #10b981; }

/* ── TIER PILL ───────────────────────────────────────────────────────────── */
.tier-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

/* ── LEADERBOARD RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .podium-wrap { gap: 6px; padding: 0 4px; }
    .podium-slot { padding: 10px 4px; }
    .podium-avatar    { width: 44px; height: 44px; font-size: 14px; }
    .podium-avatar-lg { width: 54px; height: 54px; font-size: 18px; }
    .podium-name, .podium-name-lg { font-size: 10px; }
    .podium-score, .podium-score-lg { font-size: 10px; }
    .podium-medal    { font-size: 18px; }
    .podium-medal-lg { font-size: 24px; }
    .podium-platform { font-size: 11px; padding: 6px; }

    /* hide reg number in leaderboard table */
    .lb-regnum { display: none; }
}

@media (max-width: 480px) {
    .podium-avatar    { width: 36px; height: 36px; font-size: 12px; }
    .podium-avatar-lg { width: 46px; height: 46px; font-size: 16px; }
    .podium-name, .podium-name-lg { font-size: 9px; }
    .podium-score, .podium-score-lg { font-size: 9px; }
}

/* ── MEMBER PROFILE CARD (Directory Show) ────────────────────────────────── */
.member-profile-card {
    text-align: center;
    padding: 28px 20px;
    margin-bottom: 16px;
}

.member-profile-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    border: 3px solid;
    overflow: hidden;
}

.member-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-profile-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.member-profile-regnum {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.member-profile-tier {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
}

.member-profile-stats {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

.member-profile-stat-val {
    font-size: 20px;
    font-weight: 700;
}

.member-profile-stat-val.xp    { color: #f59e0b; }
.member-profile-stat-val.coins { color: #10b981; }

.member-profile-joined {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

/* Activity rows in directory show */
.activity-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 6px 0;
}
.activity-stat-row + .activity-stat-row {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 4px;
}

/* Points activity rows */
.points-activity-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.points-activity-row:last-child { border-bottom: none; }
.points-activity-note { font-size: 13px; font-weight: 500; }
.points-activity-date { font-size: 11px; color: var(--text-muted); }
.points-activity-xp   { font-size: 13px; color: #f59e0b; font-weight: 600; }
.points-activity-coins-pos { font-size: 12px; color: var(--success); }
.points-activity-coins-neg { font-size: 12px; color: var(--danger); }

/* Directory show layout */
.directory-show-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
}

/* BOD year cell */
.bod-year-cell {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary);
}

.bod-theme-cell {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 768px) {
    .directory-show-grid {
        grid-template-columns: 100%;
    }
    .member-profile-card { padding: 20px 16px; }
    .member-profile-avatar { width: 72px; height: 72px; font-size: 24px; }
    .member-profile-name { font-size: 18px; }
    .member-profile-stat-val { font-size: 16px; }
}

/* ── REGISTER PAGE ───────────────────────────────────────────────────────── */
.register-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.mb-28 { margin-bottom: 28px; }

@media (max-width: 768px) {
    .auth-page { flex-direction: column; }
    .auth-panel-left {
        position: relative !important;
        height: auto !important;
        min-height: auto;
        padding: 24px 20px;
    }
    .auth-panel-right {
        flex: 1;
        max-width: 100% !important;
        padding: 24px 20px 40px !important;
    }
    .auth-features { display: none; }
}
