/* ============================================================
   FatPipe Partner Portal — Main Stylesheet
   Clean, modern, fully responsive design system
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #EFF6FF;
    --secondary: #7C3AED;
    --accent: #059669;
    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;
    --cyan: #0891B2;
    --orange: #EA580C;

    --bg-base: #F8FAFC;
    --bg-card: #FFFFFF;
    --sidebar-bg: #0F172A;
    --sidebar-text: #CBD5E1;
    --sidebar-active: #2563EB;

    --text-primary: #0F172A;
    --text-secondary: #0F172A;
    --text-muted: #0F172A;
    --placeholder: #64748B;

    --border: #94A3B8;
    --border-hover: #7C8CA1;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);

    --sidebar-width: 240px;
    --header-height: 58px;
    --transition: 0.18s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ---- Portal Layout ---- */
.portal-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.sidebar-logo-icon {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white; flex-shrink: 0;
}
.sidebar-logo-text {
    display: block; font-size: 18px; font-weight: 800; color: white; line-height: 1.1;
}
.sidebar-logo-sub {
    display: block; font-size: 12px; color: var(--sidebar-text); font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex; flex-direction: column; gap: 2px;
}
.nav-section-label {
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: #475569;
    padding: 10px 8px 4px;
    margin-top: 4px;
}
.nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}
.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: white;
    text-decoration: none;
}
.nav-item.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}
.nav-item i { font-size: 15px; flex-shrink: 0; }
.nav-badge {
    margin-left: auto;
    background: #EF4444;
    color: white;
    font-size: 10px; font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.user-avatar {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white;
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-tier { font-size: 12px; color: #FCD34D; display: flex; align-items: center; gap: 3px; }
.user-tier i { font-size: 10px; }
.sidebar-logout {
    background: none; border: none;
    color: #64748B; font-size: 17px;
    padding: 4px; border-radius: 4px;
    transition: color var(--transition);
    flex-shrink: 0;
}
.sidebar-logout:hover { color: #EF4444; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ---- Top Header ---- */
.top-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    padding: 0 20px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-menu-btn {
    display: none;
    background: none; border: none;
    font-size: 25px; color: var(--text-secondary);
    padding: 4px; border-radius: 6px;
    transition: color var(--transition);
    flex-shrink: 0;
}
.header-menu-btn:hover { color: var(--primary); }
.header-search {
    flex: 1; max-width: 400px;
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
}
.header-search i { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }
.header-search input {
    flex: 1; border: none; background: none;
    font-size: 15px; color: var(--text-primary);
    outline: none;
}
.header-search input::placeholder { color: var(--placeholder); }
.header-actions {
    display: flex; align-items: center; gap: 8px;
    margin-left: auto;
}
.header-btn {
    position: relative;
    background: none; border: none;
    font-size: 21px; color: var(--text-secondary);
    padding: 6px; border-radius: 8px;
    transition: all var(--transition);
}
.header-btn:hover { background: var(--bg-base); color: var(--primary); }
.header-btn .badge {
    position: absolute; top: 2px; right: 2px;
    background: #EF4444; color: white;
    font-size: 10px; font-weight: 700;
    width: 14px; height: 14px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.header-user {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition);
}
.header-user:hover { background: var(--bg-base); }
.header-user-avatar {
    width: 30px; height: 30px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white;
    flex-shrink: 0;
}
.header-user-name {
    font-size: 15px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap;
}

/* ---- Page Content ---- */
.page-content {
    padding: 22px 24px;
    flex: 1;
}
.page-title {
    font-size: 25px; font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 15px; color: var(--text-muted);
}
.page-header { margin-bottom: 20px; }

/* ---- Breadcrumb ---- */
.breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; color: var(--text-muted);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb i { font-size: 12px; }

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    flex-wrap: wrap;
}
.card-title {
    font-size: 16px; font-weight: 700;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 7px;
}
.card-body { padding: 18px; }
.card-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
    background: #FAFBFC;
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 23px; flex-shrink: 0;
}
.stat-icon.blue { background: #EFF6FF; color: #2563EB; }
.stat-icon.green { background: #ECFDF5; color: #059669; }
.stat-icon.yellow { background: #FFFBEB; color: #D97706; }
.stat-icon.purple { background: #F5F3FF; color: #7C3AED; }
.stat-icon.cyan { background: #ECFEFF; color: #0891B2; }
.stat-icon.orange { background: #FFF7ED; color: #EA580C; }
.stat-icon.red { background: #FEF2F2; color: #DC2626; }
.stat-info { min-width: 0; }
.stat-value { font-size: 25px; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stat-change { font-size: 13px; color: var(--text-muted); margin-top: 3px; display: flex; align-items: center; gap: 2px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ---- Quick Actions ---- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}
.quick-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.quick-action-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.quick-action-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 21px;
}
.quick-action-card h4 { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.quick-action-card p { font-size: 12px; color: var(--text-muted); line-height: 1.3; }

/* ---- Grid Layouts ---- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
thead th {
    padding: 10px 14px;
    font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted);
    background: #FAFBFC;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
tbody td {
    padding: 11px 14px;
    font-size: 15px; color: var(--text-secondary);
    border-bottom: 1px solid #F1F5F9;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F8FAFC; }

/* ---- Badges ---- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 13px; font-weight: 600;
    white-space: nowrap;
}
.badge-primary { background: #EFF6FF; color: #2563EB; }
.badge-success { background: #ECFDF5; color: #059669; }
.badge-warning { background: #FFFBEB; color: #D97706; }
.badge-danger { background: #FEF2F2; color: #DC2626; }
.badge-secondary { background: #F1F5F9; color: #64748B; }
.badge-purple { background: #F5F3FF; color: #7C3AED; }
.badge-cyan { background: #ECFEFF; color: #0891B2; }
.badge-orange { background: #FFF7ED; color: #EA580C; }
.badge-red { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }

/* ---- Buttons ---- */
.btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); text-decoration: none; color: white; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* Gold "Credit FatPoints" button — same dimensions as .btn-primary, pale-gold fill.
   Used wherever an admin sends/credits fatpoints (deals + partner pages). */
.btn-credit {
    display: inline-flex; align-items: center; gap: 6px;
    background: #e9c46a;
    color: #4a3800;
    border: none;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-credit .bi { color: #4a3800; }
.btn-credit:hover { background: #dfb44a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(233,196,106,0.35); color: #4a3800; }
.btn-credit:active { transform: translateY(0); }
.btn-credit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* Money / FatPoints accent — pale gold, readable on both themes. */
.fp-gold { color: #c79a2e; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); text-decoration: none; }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-sm { padding: 5px 10px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 6px 8px; }

/* ---- Forms ---- */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.form-group small { font-size: 13px; color: var(--text-muted); }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px; color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--placeholder); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-section-title {
    font-size: 14px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 10px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
    margin-top: 6px;
}
.form-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    padding-top: 14px; flex-wrap: wrap;
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 6px;
}
.checkbox-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 14px; color: var(--text-secondary);
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 14px; height: 14px; flex-shrink: 0; accent-color: var(--primary); }
.radio-group { display: flex; gap: 16px; margin-top: 6px; }
.radio-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 15px; color: var(--text-secondary);
    cursor: pointer;
}
.radio-label input[type="radio"] { accent-color: var(--primary); }
.input-wrapper {
    position: relative; display: flex; align-items: center;
}
.input-wrapper > i:first-child {
    position: absolute; left: 10px;
    color: var(--text-muted); font-size: 16px;
    pointer-events: none;
}
.input-wrapper input {
    padding-left: 34px !important;
}
.toggle-password {
    position: absolute; right: 10px;
    background: none; border: none;
    color: var(--text-muted); font-size: 16px;
    cursor: pointer; padding: 2px;
}

/* ---- Progress Bars ---- */
.progress-bar-wrapper {
    background: #F1F5F9;
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
}
.progress-bar {
    height: 100%; border-radius: 10px;
    transition: width 0.5s ease;
    background: var(--primary);
}
.progress-bar.blue { background: linear-gradient(90deg, #2563EB, #60A5FA); }
.progress-bar.green { background: linear-gradient(90deg, #059669, #34D399); }
.progress-bar.yellow { background: linear-gradient(90deg, #D97706, #FCD34D); }
.progress-bar.cyan { background: linear-gradient(90deg, #0891B2, #22D3EE); }
.progress-bar.orange { background: linear-gradient(90deg, #EA580C, #FB923C); }

/* ---- Tabs ---- */
.tabs {
    display: flex; gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 14px;
    background: none; border: none;
    font-size: 15px; font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filter-select {
    padding: 7px 28px 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; color: var(--text-secondary);
    background: var(--bg-card);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--primary); }
.search-input-wrapper {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    flex: 1;
}
.search-input-wrapper i { color: var(--text-muted); font-size: 15px; flex-shrink: 0; }
.search-input-wrapper input {
    flex: 1; border: none; background: none;
    font-size: 15px; color: var(--text-primary);
    outline: none;
}
.search-input-wrapper input::placeholder { color: var(--placeholder); }

/* ---- Announcement Banner ---- */
.announcement-banner {
    background: linear-gradient(135deg, #1E40AF, #2563EB);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.announcement-icon { font-size: 27px; flex-shrink: 0; }
.announcement-content { flex: 1; min-width: 0; }
.announcement-content h3 { font-size: 16px; font-weight: 700; color: white; margin-bottom: 3px; }
.announcement-content p { font-size: 14px; color: rgba(255,255,255,0.85); }
.announcement-close {
    background: rgba(255,255,255,0.15); border: none;
    color: white; font-size: 18px;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: background var(--transition);
}
.announcement-close:hover { background: rgba(255,255,255,0.25); }

/* ---- Alerts ---- */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 15px;
}
.alert-info { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.alert-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert-danger { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.alert i { flex-shrink: 0; margin-top: 1px; }

/* ---- Modals ---- */
.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: 16px;
}
.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 460px; width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: modalIn 0.2s ease;
}
.modal-box.modal-large { max-width: 600px; text-align: left; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.modal-close {
    background: none; border: none;
    font-size: 18px; color: var(--text-muted);
    cursor: pointer; padding: 4px;
    border-radius: 4px;
    transition: color var(--transition);
}
.modal-close:hover { color: var(--danger); }
.modal-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin: 0 auto 16px;
}
.modal-icon.success { background: #ECFDF5; color: var(--success); }
.modal-icon.warning { background: #FFFBEB; color: var(--warning); }
.modal-icon.danger { background: #FEF2F2; color: var(--danger); }
.modal-box h3 { font-size: 21px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
.modal-box p { font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed; bottom: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 2000;
    max-width: 340px; width: calc(100% - 40px);
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 15px; color: var(--text-primary);
    animation: slideIn 0.3s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.success i { color: var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.error i { color: var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning i { color: var(--warning); }
.toast.info { border-left: 3px solid var(--primary); }
.toast.info i { color: var(--primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 55px; margin-bottom: 14px; display: block; opacity: 0.4; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 15px; margin-bottom: 16px; }

/* ---- Fade In Animation ---- */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Large tablets / small desktops */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: repeat(3, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Tablets */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* Mobile / Tablet breakpoint */
@media (max-width: 900px) {
    :root { --sidebar-width: 0px; }

    .sidebar {
        transform: translateX(-240px);
        width: 240px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .header-menu-btn {
        display: flex;
    }
    .header-user-name {
        display: none;
    }
    .page-content {
        padding: 16px;
    }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .quick-actions { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .checkbox-grid { grid-template-columns: 1fr; }
}

/* Small mobile */
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .grid-3 { grid-template-columns: 1fr; }
    .page-title { font-size: 21px; }
    .stat-value { font-size: 21px; }
    .card-header { flex-direction: column; align-items: flex-start; }
    .announcement-banner { flex-direction: column; }
    .form-actions { flex-direction: column; }
    .form-actions .btn-primary,
    .form-actions .btn-secondary { width: 100%; justify-content: center; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-select { width: 100%; }
    .search-input-wrapper { width: 100%; }
    .tabs { gap: 0; }
    .tab-btn { padding: 8px 10px; font-size: 14px; }
    .header-search { display: none; }
    .toast-container { bottom: 10px; right: 10px; left: 10px; max-width: none; width: auto; }
}

/* Extra small */
@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 12px; }
    .card-body { padding: 14px; }
}

/* ============================================================
   Shared numbered pagination (admin list pages)
   Rendered by fpRenderPagination() in js/main.js. On pages whose
   .admin-main is a flex column, `margin-top:auto` keeps the pager
   pinned to the bottom so it sits in the same spot on every page.
   ============================================================ */
.fp-pagination { display: flex; justify-content: center; align-items: center; gap: 14px;
    flex-wrap: wrap; margin-top: auto; padding-top: 32px; }
.fp-pagination:empty { padding-top: 0; }
.fp-page { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary);
    font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .15s ease, color .15s ease, background .15s ease; }
.fp-page:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.fp-page.active { background: var(--primary); border-color: var(--primary); color: #fff; cursor: default; }
.fp-page:disabled { opacity: .4; cursor: not-allowed; }
.fp-page-gap { min-width: 16px; text-align: center; color: var(--text-muted); user-select: none; }

/* ============================================================
   Info tip — a small ⓘ button that reveals helper text on
   hover/focus. Anchor it inline right after a label, heading,
   or action, and put the guidance inside .info-pop. Replaces
   always-visible hint subtext across the portal.

   Markup:
     <span class="info-tip">
       <button type="button" class="info-tip-btn" aria-label="More info"><i class="bi bi-info-circle-fill"></i></button>
       <span class="info-pop" role="tooltip">Helper text…</span>
     </span>

   Add .info-tip-right when the tip sits near a container's right
   edge so the popover flips to align on the right instead.
   ============================================================ */
.info-tip { position: relative; display: inline-flex; align-items: center; vertical-align: middle; margin-left: 6px; top: -2px; }
.info-tip > .info-tip-btn {
    border: none; background: none; padding: 0; margin: 0; cursor: pointer;
    color: var(--text-muted); font-size: 16px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.info-tip > .info-tip-btn:hover, .info-tip > .info-tip-btn:focus-visible { color: var(--primary); }
.info-pop {
    position: absolute; left: 0; top: calc(100% + 8px); z-index: 40;
    width: 260px; max-width: min(260px, 80vw); padding: 10px 12px; border-radius: 8px;
    background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    font-size: 14px; font-weight: 400; color: var(--text-muted); line-height: 1.5; text-align: left;
    /* Reset inherited heading styling so the popover reads as body text no matter
       what it's anchored to (uppercase section titles, letter-spaced labels, etc.). */
    white-space: normal; text-transform: none; letter-spacing: normal; font-style: normal;
    opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none;
    transition: opacity .12s ease, transform .12s ease, visibility .12s;
}
.info-tip:hover .info-pop, .info-tip:focus-within .info-pop { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.info-tip.info-tip-right .info-pop { left: auto; right: 0; }
