/* ============================================================
   Susu Club — Main Stylesheet
   ============================================================ */

/* ─── Custom Properties ─────────────────────────────────── */
:root {
    --primary:          #4f46e5;
    --primary-dark:     #3730a3;
    --primary-light:    #eef2ff;
    --secondary:        #7c3aed;
    --success:          #059669;
    --success-light:    #d1fae5;
    --warning:          #d97706;
    --warning-light:    #fef3c7;
    --danger:           #dc2626;
    --danger-light:     #fee2e2;
    --info:             #0284c7;
    --info-light:       #e0f2fe;
    --dark:             #1e293b;
    --dark-2:           #0f172a;
    --gray-100:         #f8fafc;
    --gray-200:         #f1f5f9;
    --gray-300:         #e2e8f0;
    --gray-400:         #cbd5e1;
    --gray-500:         #94a3b8;
    --gray-600:         #64748b;
    --gray-700:         #475569;
    --gray-800:         #334155;
    --gray-900:         #1e293b;
    --text:             #334155;
    --text-muted:       #64748b;
    --border:           #e2e8f0;
    --bg:               #f1f5f9;
    --card-bg:          #ffffff;
    --sidebar-width:    260px;
    --topbar-height:    64px;
    --radius:           12px;
    --radius-sm:        8px;
    --shadow-sm:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow:           0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
    --shadow-lg:        0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
    --transition:       0.2s ease;
    --transition-s:     0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-b:     0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Keyframes ──────────────────────────────────────────── */
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp    { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDown  { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes scaleIn    { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes modalIn    { from { opacity: 0; transform: scale(.96) translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-8px); }
    40%     { transform: translateX(8px); }
    60%     { transform: translateX(-5px); }
    80%     { transform: translateX(5px); }
}
@keyframes pulse-glow {
    0%,100% { box-shadow: 0 0 0 0 rgba(79,70,229,.4); }
    50%     { box-shadow: 0 0 0 12px rgba(79,70,229,0); }
}
@keyframes float-orb {
    0%,100% { transform: translateY(0) scale(1); }
    50%     { transform: translateY(-40px) scale(1.05); }
}
@keyframes float-coin {
    0%   { transform: translateY(0) rotate(0deg); opacity: .12; }
    50%  { transform: translateY(-30px) rotate(180deg); opacity: .22; }
    100% { transform: translateY(0) rotate(360deg); opacity: .12; }
}
@keyframes gradientBG {
    0%,100% { background-position: 0% 50%; }
    50%     { background-position: 100% 50%; }
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(36px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes logoBounce {
    from { transform: scale(0) rotate(-15deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}
@keyframes spin-once {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}

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

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-s);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.sidebar-logo {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px; flex-shrink: 0;
}
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name  { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-role  { color: rgba(255,255,255,.45); font-size: 10px; text-transform: uppercase; letter-spacing: .8px; }

.sidebar-nav { flex: 1; padding: 14px 10px; }
.nav-section-label {
    color: rgba(255,255,255,.35);
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    padding: 12px 10px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.65);
    font-size: 14px; font-weight: 500;
    transition: background var(--transition), color var(--transition);
    position: relative;
    margin-bottom: 2px;
    min-height: 44px;
}
.nav-item:hover  { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(79,70,229,.35); color: #fff; }
.nav-item.active::before {
    content: ''; position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px; border-radius: 2px;
    background: var(--primary);
}
.nav-icon  { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-badge {
    margin-left: auto;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 10px;
    min-width: 18px; text-align: center;
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
}
.sidebar-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
img.sidebar-avatar { display: block; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    display: block; color: #fff; font-size: 13px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role { display: block; color: rgba(255,255,255,.4); font-size: 11px; }
.sidebar-logout {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.4);
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}
.sidebar-logout:hover { background: rgba(255,255,255,.08); color: var(--danger); }

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: fadeIn .2s ease;
}
.sidebar-overlay.active { display: block; }

/* ─── Content wrapper ────────────────────────────────────── */
.content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1; display: flex; flex-direction: column; min-width: 0;
}

/* ─── Top bar ────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px; gap: 16px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.sidebar-toggle {
    background: none; border: none;
    color: var(--gray-600); font-size: 20px;
    padding: 6px 8px; border-radius: var(--radius-sm);
    display: none;
    transition: background var(--transition);
    min-height: 44px; min-width: 44px;
    justify-content: center; align-items: center;
}
.sidebar-toggle:hover { background: var(--gray-200); }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--gray-800); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-icon-btn {
    width: 40px; height: 40px; min-width: 40px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-600); border-radius: var(--radius-sm);
    background: none; border: none; font-size: 16px; position: relative;
    transition: background var(--transition);
}
.topbar-icon-btn:hover { background: var(--gray-200); color: var(--gray-900); }
.topbar-badge {
    position: absolute; top: 4px; right: 4px;
    background: var(--danger); color: #fff;
    font-size: 9px; font-weight: 700;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.topbar-profile {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px; border-radius: var(--radius);
    cursor: pointer; position: relative;
    transition: background var(--transition);
}
.topbar-profile:hover { background: var(--gray-200); }
.topbar-profile:hover .topbar-dropdown { display: block; animation: slideDown .15s ease; }
.topbar-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
img.topbar-avatar { display: block; object-fit: cover; }
.topbar-username { font-size: 14px; font-weight: 500; color: var(--gray-800); white-space: nowrap; }
.topbar-dropdown {
    display: none;
    position: absolute; top: calc(100% + 4px); right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px; overflow: hidden; z-index: 200;
}
.topbar-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px;
    color: var(--gray-700); font-size: 14px;
    transition: background var(--transition);
    min-height: 44px;
}
.topbar-dropdown a:hover { background: var(--gray-100); }
.topbar-dropdown a i { width: 16px; color: var(--gray-500); }

/* ─── Main content ───────────────────────────────────────── */
.main-content { flex: 1; padding: 24px; }
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.page-header p  { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    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(--gray-900); }
.card-body   { padding: 20px; }
.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--gray-100);
    font-size: 13px; color: var(--text-muted);
}

/* ─── Stat cards ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex; align-items: flex-start; gap: 16px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    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.yellow { background: var(--warning-light);  color: var(--warning);   }
.stat-icon.red    { background: var(--danger-light);   color: var(--danger);    }
.stat-icon.purple { background: #f3e8ff;               color: var(--secondary); }
.stat-info  { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--gray-900); margin: 4px 0; line-height: 1.1; }
.stat-sub   { font-size: 12px; color: var(--text-muted); }
.stat-sub .up   { color: var(--success); font-weight: 600; }
.stat-sub .down { color: var(--danger);  font-weight: 600; }

/* ─── Grid layouts ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.col-span-2 { grid-column: span 2; }

/* ─── Tables ─────────────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
    background: var(--gray-100);
    padding: 10px 14px;
    text-align: left;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--gray-800);
    vertical-align: middle;
}
tbody tr:hover td { background: var(--gray-100); }
tbody tr:last-child td { border-bottom: none; }
.table-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 12px;
    margin-right: 8px; flex-shrink: 0; vertical-align: middle;
}
img.table-avatar { display: inline-block; object-fit: cover; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600; letter-spacing: .3px;
    white-space: nowrap;
}
.badge-success   { background: var(--success-light); color: var(--success); }
.badge-warning   { background: var(--warning-light); color: var(--warning); }
.badge-danger    { background: var(--danger-light);  color: var(--danger);  }
.badge-info      { background: var(--info-light);    color: var(--info);    }
.badge-secondary { background: var(--gray-200);      color: var(--gray-600); }
.badge-primary   { background: var(--primary-light); color: var(--primary); }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap; text-decoration: none;
    min-height: 44px;
    justify-content: center;
}
.btn:hover  { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger);  }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-outline { background: transparent; color: var(--gray-700); border-color: var(--border); }
.btn-outline:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-sm  { padding: 7px 14px; font-size: 12px; min-height: 36px; }
.btn-lg  { padding: 13px 28px; font-size: 16px; min-height: 50px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-sm); min-height: unset; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--gray-700); margin-bottom: 6px;
}
.form-label .required { color: var(--danger); }
.form-control {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    min-height: 44px;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
select.form-control {
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 16px;
    border: 1px solid transparent;
    position: relative;
    animation: fadeIn .3s ease;
}
.alert-icon  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-close { margin-left: auto; background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; opacity: .5; min-width: 28px; min-height: 28px; display: flex; align-items: center; justify-content: center; }
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--success-light); color: #065f46; border-color: #a7f3d0; }
.alert-error,
.alert-danger  { background: var(--danger-light);  color: #991b1b; border-color: #fca5a5; }
.alert-warning { background: var(--warning-light); color: #92400e; border-color: #fcd34d; }
.alert-info    { background: var(--info-light);    color: #075985; border-color: #bae6fd; }

/* ─── Modals ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: none; align-items: center; justify-content: center;
    z-index: 2000; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto;
    animation: modalIn .22s ease;
}
.modal-header {
    padding: 20px 24px 16px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--card-bg); z-index: 1;
}
.modal-title  { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.modal-close  { background: none; border: none; font-size: 24px; color: var(--gray-500); cursor: pointer; min-width: 36px; min-height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: background var(--transition); }
.modal-close:hover { background: var(--gray-100); color: var(--gray-800); }
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination-nav { margin-top: 20px; display: flex; justify-content: center; }
.pagination { display: flex; list-style: none; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pagination li a, .pagination li span {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    color: var(--gray-700);
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.pagination li a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination li.active a, .pagination li.active span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Chart containers ───────────────────────────────────── */
.chart-container    { position: relative; height: 280px; }
.chart-container-sm { position: relative; height: 200px; }

/* ─── Filters toolbar ────────────────────────────────────── */
.filters-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    padding: 12px 20px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--border);
}
.filters-bar .form-control { width: auto; padding: 8px 12px; font-size: 13px; min-height: 40px; }

/* ─── Progress bar ───────────────────────────────────────── */
.progress { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-bar {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width .5s ease;
}

/* ─── Login page ─────────────────────────────────────────── */
body.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    overflow: hidden; position: relative;
    background: linear-gradient(-45deg, #1e1b4b, #0f172a, #1a0030, #0c1445);
    background-size: 400% 400%;
    animation: gradientBG 14s ease infinite;
}

/* Blurred floating orbs */
.login-orb {
    position: absolute; border-radius: 50%; pointer-events: none;
    filter: blur(70px); opacity: .18;
}
.login-orb-1 { width: 480px; height: 480px; background: var(--primary);   top: -120px; left: -100px; animation: float-orb 8s  ease-in-out infinite; }
.login-orb-2 { width: 380px; height: 380px; background: var(--secondary); bottom: -80px; right: -60px; animation: float-orb 10s ease-in-out infinite reverse; }
.login-orb-3 { width: 260px; height: 260px; background: #0284c7;          top: 40%;  right: 5%;  animation: float-orb 7s  ease-in-out infinite 2s; }
.login-orb-4 { width: 200px; height: 200px; background: #7c3aed;          bottom: 20%; left: 5%;  animation: float-orb 9s  ease-in-out infinite 1s; }

/* Floating coin icons */
.login-floater {
    position: absolute; pointer-events: none;
    color: rgba(255,255,255,.14); font-size: 28px;
    animation: float-coin linear infinite;
}
.login-floater:nth-child(1) { top: 12%; left: 8%;  animation-duration: 9s;  font-size: 22px; }
.login-floater:nth-child(2) { top: 60%; left: 12%; animation-duration: 12s; font-size: 32px; animation-delay: -3s; }
.login-floater:nth-child(3) { top: 25%; right: 9%; animation-duration: 10s; font-size: 18px; animation-delay: -6s; }
.login-floater:nth-child(4) { top: 72%; right: 7%; animation-duration: 7s;  font-size: 26px; animation-delay: -2s; }
.login-floater:nth-child(5) { top: 45%; left: 45%; animation-duration: 11s; font-size: 20px; animation-delay: -4s; }

/* Login card */
.login-card {
    width: calc(100% - 32px); max-width: 430px;
    background: rgba(255,255,255,.97);
    border-radius: 20px;
    padding: 44px 40px;
    box-shadow: 0 30px 60px -12px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08);
    position: relative; z-index: 10;
    animation: cardIn .7s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
    backdrop-filter: blur(4px);
}
.login-logo {
    display: flex; align-items: center; gap: 14px; margin-bottom: 30px;
}
.login-logo-icon {
    width: 54px; height: 54px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff; flex-shrink: 0;
    animation: logoBounce .7s cubic-bezier(0.34, 1.56, 0.64, 1) .2s both;
    box-shadow: 0 8px 24px rgba(79,70,229,.4);
}
.login-logo-icon:hover { animation: spin-once .5s ease; }
.login-logo-text h1 { font-size: 22px; font-weight: 800; color: var(--gray-900); }
.login-logo-text p  { font-size: 13px; color: var(--text-muted); }
.login-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--gray-900); }
.login-card .subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* Input icon wrapper: color transitions on focus-within */
.input-icon-wrap { position: relative; }
.input-icon-wrap .input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 14px; pointer-events: none;
    transition: color var(--transition);
}
.input-icon-wrap:focus-within .input-icon { color: var(--primary); }
.input-icon-wrap .form-control { padding-left: 40px; }
.input-icon-wrap .form-control.has-right { padding-right: 44px; }
.input-icon-wrap .input-icon-right {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--gray-400); font-size: 14px;
    padding: 6px; cursor: pointer; transition: color var(--transition);
    min-height: 0;
}
.input-icon-wrap .input-icon-right:hover { color: var(--primary); }

/* Login submit button with shimmer */
.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-size: 200% auto;
    color: #fff; border: none;
    transition: background-position .4s ease, transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 4px 16px rgba(79,70,229,.4);
    position: relative; overflow: hidden;
}
.btn-login::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
    background-size: 200% 100%;
    background-position: -200% center;
    transition: background-position .5s ease;
}
.btn-login:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79,70,229,.5);
    color: #fff;
}
.btn-login:hover::after { background-position: 200% center; }
.btn-login:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(79,70,229,.4); }

/* Shake error */
.alert-login-error { animation: shake .4s ease; }

/* ─── Notification list ──────────────────────────────────── */
.notif-list { list-style: none; }
.notif-item {
    display: flex; gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    position: relative;
}
.notif-item:hover { background: var(--gray-100); }
.notif-item.unread { background: #f0f4ff; }
.notif-item.unread::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--primary);
}
.notif-icon {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.notif-icon.payment      { background: var(--success-light); color: var(--success); }
.notif-icon.reminder     { background: var(--warning-light); color: var(--warning); }
.notif-icon.announcement { background: var(--primary-light); color: var(--primary); }
.notif-icon.system       { background: var(--info-light);    color: var(--info);    }
.notif-body     { flex: 1; min-width: 0; }
.notif-title    { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.notif-message  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.notif-time     { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ─── Paystack pay card ──────────────────────────────────── */
.pay-card {
    max-width: 520px; margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.pay-header   { padding: 28px 28px 0; text-align: center; }
.pay-amount   { font-size: 42px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.pay-currency { font-size: 18px; color: var(--text-muted); margin-right: 4px; }
.pay-month    { font-size: 15px; color: var(--text-muted); margin-top: 6px; }
.pay-status-banner {
    margin: 20px 28px; padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
}
.pay-status-banner.paid    { background: var(--success-light); color: var(--success); }
.pay-status-banner.pending { background: var(--warning-light); color: var(--warning); }
.pay-body { padding: 0 28px 28px; }

/* ─── Empty state ────────────────────────────────────────── */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state i  { font-size: 48px; color: var(--gray-300); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 17px; font-weight: 600; color: var(--gray-500); }
.empty-state p  { font-size: 14px; color: var(--gray-400); margin-top: 6px; }

/* ─── Utilities ──────────────────────────────────────────── */
.text-muted   { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.fs-13        { font-size: 13px; }
.fs-12        { font-size: 12px; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.mb-0         { margin-bottom: 0; }
.mb-4         { margin-bottom: 4px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.p-20         { padding: 20px; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.w-100        { width: 100%; }
.d-none       { display: none; }
.separator    { height: 1px; background: var(--border); margin: 16px 0; }

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ================================================================
   RESPONSIVE — Mobile-first enhancements
   ================================================================ */

/* ── Large tablet (≤ 1024px) ─────────────────────────────── */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .col-span-2 { grid-column: span 1; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet / Mobile (≤ 768px) ───────────────────────────── */
@media (max-width: 768px) {
    /* Sidebar becomes a full overlay drawer */
    :root { --sidebar-width: 0px; }
    .sidebar {
        width: 280px;
        transform: translateX(-280px);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 6px 0 32px rgba(0,0,0,.35);
    }
    .content-wrapper { margin-left: 0; }
    .sidebar-toggle  { display: flex; }

    /* Topbar */
    .topbar { padding: 0 14px; gap: 10px; }
    .topbar-title { font-size: 15px; }

    /* Main content */
    .main-content { padding: 14px; }

    /* Page header */
    .page-header    { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header > div:last-child { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }

    /* Stats grid — 2 col on tablet */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
    .stat-value { font-size: 22px; }
    .stat-icon  { width: 42px; height: 42px; font-size: 18px; }

    /* Grids */
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 12px; }
    .col-span-2 { grid-column: span 1; }

    /* Forms */
    .form-row { grid-template-columns: 1fr; gap: 0; }

    /* Filters */
    .filters-bar { padding: 10px 14px; }
    .filters-bar .form-control { width: 100%; }
    .filters-bar > form { flex-direction: column; }

    /* Tables */
    thead th, tbody td { padding: 10px 12px; font-size: 13px; }

    /* Charts */
    .chart-container    { height: 220px; }
    .chart-container-sm { height: 160px; }

    /* Modals — bottom sheet */
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal {
        max-width: 100% !important;
        max-height: 85vh;
        border-radius: var(--radius) var(--radius) 0 0;
        animation: slideUp .3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .modal-footer { flex-direction: column-reverse; }
    .modal-footer .btn { width: 100%; }

    /* Pay card */
    .pay-card { margin: 0; border-radius: var(--radius); }
    .pay-body, .pay-header { padding-left: 20px; padding-right: 20px; }

    /* Topbar dropdown */
    .topbar-dropdown { right: -8px; }

    /* Cards */
    .card-body { padding: 16px; }
    .card-header { padding: 14px 16px; }

    /* Notif list */
    .notif-item { padding: 12px 16px; }

    /* Hide less-important columns in topbar */
    .d-none.d-md-inline { display: none !important; }
}

/* ── Small mobile (≤ 480px) ──────────────────────────────── */
@media (max-width: 480px) {
    :root { --topbar-height: 56px; }

    /* Stats — single column */
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card  { padding: 16px; }
    .stat-value { font-size: 24px; }

    /* Login card */
    .login-card { padding: 32px 24px; border-radius: 16px; }
    .login-logo-icon { width: 46px; height: 46px; font-size: 20px; }
    .login-logo-text h1 { font-size: 19px; }

    /* Pay card */
    .pay-amount  { font-size: 32px; }

    /* Main content */
    .main-content { padding: 12px; }

    /* Topbar */
    .topbar { padding: 0 12px; }

    /* Tables: tighter */
    thead th, tbody td { padding: 9px 10px; font-size: 12px; }

    /* Page header title */
    .page-header h2 { font-size: 19px; }

    /* Buttons */
    .btn-lg { padding: 12px 20px; font-size: 15px; }

    /* Statement doc */
    .statement-doc { padding: 20px 16px; }
    .statement-member-row { grid-template-columns: 1fr 1fr; }
}

/* ── Extra small (≤ 360px) ───────────────────────────────── */
@media (max-width: 360px) {
    .login-card { padding: 28px 18px; }
    .stats-grid { gap: 8px; }
    .stat-value { font-size: 20px; }
    .main-content { padding: 10px; }
    .btn { font-size: 13px; padding: 9px 14px; }
    .statement-member-row { grid-template-columns: 1fr; }
}

/* ── Touch: bigger tap targets ───────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    .nav-item { min-height: 48px; padding: 13px 14px; }
    .btn      { min-height: 48px; }
    .form-control { min-height: 48px; }
    .topbar-icon-btn { width: 44px; height: 44px; }
}

/* ─── Print ──────────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .btn, .filters-bar, .no-print { display: none !important; }
    .content-wrapper { margin: 0; }
    .main-content    { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}
