/* ======================================
   SuitsRental - نظام تأجير وبيع البدلات
   Gold & Cream Theme (matching insurance_final)
   ====================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
    --primary: #DAA520;
    --primary-dark: #B8860B;
    --primary-light: #FFD700;
    --primary-gradient: linear-gradient(135deg, #DAA520, #FFD700);
    --sidebar-bg: #FAF3E0;
    --sidebar-hover: #F0E4C8;
    --sidebar-active: #DAA520;
    --sidebar-collapsed-width: 70px;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --text-light: #ffffff;
    --border-color: #e9ecef;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --primary-rgb: 218, 165, 32;
}

/* Override Bootstrap defaults to gold */
.text-primary { color: var(--primary) !important; }
.bg-primary { background: var(--primary) !important; }

/* Nav tabs gold */
.nav-tabs .nav-link.active,
.nav-tabs .nav-link.active:focus,
.nav-tabs .nav-link.active:hover {
    color: var(--primary) !important;
    border-bottom: 3px solid var(--primary);
    font-weight: 700;
    background: transparent;
}
.nav-tabs .nav-link { color: var(--text-dark); font-weight: 500; }
.nav-tabs .nav-link:hover { color: var(--primary); border-bottom: 3px solid var(--primary-light); }

/* Links & focus */
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { font-family: 'Tajawal', sans-serif; background: var(--body-bg); color: var(--text-dark); margin: 0; min-height: 100vh; font-size: 14px; }

/* ======= SCROLLBAR ======= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

/* ======= LOGIN PAGE ======= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f0e1 0%, #faf6eb 40%, #f0ead6 70%, #faf3e0 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(var(--primary-rgb),0.08) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    border-radius: 50%;
    animation: floatGlow 12s ease-in-out infinite;
}
.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(var(--primary-rgb),0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: floatGlow 15s ease-in-out infinite reverse;
}
@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

/* Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(var(--primary-rgb),0.25), rgba(var(--primary-rgb),0.08));
    border: 1px solid rgba(var(--primary-rgb),0.2);
    animation: riseBubble linear infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes riseBubble {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-110vh) scale(0.5); opacity: 0; }
}

.login-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 45px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    border: 2px solid transparent;
    background-clip: padding-box;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 26px;
    background: conic-gradient(
        from var(--border-angle, 0deg),
        transparent 0%,
        rgba(var(--primary-rgb), 0.3) 8%,
        var(--primary) 15%,
        var(--primary-light) 22%,
        rgba(var(--primary-rgb), 0.3) 30%,
        transparent 40%,
        transparent 60%,
        rgba(var(--primary-rgb), 0.3) 70%,
        var(--primary) 78%,
        var(--primary-light) 85%,
        rgba(var(--primary-rgb), 0.3) 92%,
        transparent 100%
    );
    z-index: -1;
    animation: rotateBorder 6s linear infinite;
}
.login-card::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    border-radius: 23px;
    background: rgba(255, 255, 255, 0.95);
    z-index: -1;
}
@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
@keyframes rotateBorder { to { --border-angle: 360deg; } }
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .login-card { border: 2px solid rgba(var(--primary-rgb),0.3); }
    .login-card::before, .login-card::after { display: none; }
}

.login-icon-wrap {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--primary-gradient);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px rgba(var(--primary-rgb),0.3);
}
.login-icon-wrap i { color: #fff; font-size: 2rem; }
.login-title { color: var(--primary-dark); font-weight: 800; font-size: 1.7rem; margin-bottom: 5px; text-align: center; }
.login-subtitle { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 30px; text-align: center; }

.login-card .form-label { font-weight: 600; color: var(--text-dark); font-size: 0.9rem; margin-bottom: 6px; }
.login-card .input-group {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    background: #fff;
}
.login-card .input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.12);
}
.login-card .input-group-text {
    background: transparent; border: none;
    color: var(--primary); font-size: 1.1rem; padding: 12px 15px;
}
.login-card .form-control {
    border: none; padding: 12px 10px; font-size: 0.95rem;
    background: transparent; color: var(--text-dark);
}
.login-card .form-control:focus { box-shadow: none; }
.login-card .form-control::placeholder { color: var(--text-muted); }

.btn-login {
    background: var(--primary-gradient); border: none;
    border-radius: var(--radius); padding: 13px;
    font-size: 1.1rem; font-weight: 700; color: #fff;
    width: 100%; transition: var(--transition); letter-spacing: 0.5px;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb),0.3);
    color: #fff;
}
.btn-login:disabled { opacity: 0.8; transform: none; }
.btn-login .spinner {
    display: none; width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.6s linear infinite;
    margin-left: 8px; vertical-align: middle;
}
.btn-login.loading .spinner { display: inline-block; }
.btn-login.loading .btn-text { opacity: 0.7; }

.login-alert {
    display: none; border-radius: var(--radius-sm);
    font-size: 0.9rem; animation: fadeIn 0.3s ease;
}
.login-footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    text-align: center; padding: 12px;
    font-size: 0.85rem; color: var(--text-muted); z-index: 1;
}

/* ======= SIDEBAR ======= */
.sidebar {
    position: fixed; top: 0; right: 0; width: 260px; height: 100vh;
    background: var(--sidebar-bg); z-index: 1040;
    overflow-y: auto; transition: var(--transition);
    box-shadow: -5px 0 20px rgba(0,0,0,0.08);
    border-left: 1px solid #E8DAB2;
}
.sidebar-header {
    padding: 25px 20px; text-align: center; position: relative;
    border-bottom: 1px solid #E8DAB2;
}
.sidebar-header .sidebar-logo { max-height: 60px; border-radius: 8px; margin-bottom: 10px; }
.sidebar-header h5 { color: var(--primary); font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.sidebar-header small { color: #8B7D6B; font-size: 0.7rem; letter-spacing: 2px; }

.sidebar-menu { list-style: none; padding: 0 10px; margin: 0; }
.sidebar-menu .menu-header {
    padding: 15px 15px 5px; font-size: 0.7rem; text-transform: uppercase;
    color: #A0926B; letter-spacing: 1.5px; font-weight: 700;
}
.sidebar-menu a {
    display: flex; align-items: center; padding: 11px 15px; color: #4A4031;
    text-decoration: none; transition: var(--transition); gap: 12px;
    font-size: 0.9rem; font-weight: 500; border-radius: var(--radius-sm);
    margin-bottom: 3px;
}
.sidebar-menu a:hover { background: var(--sidebar-hover); color: #B8860B; }
.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(218,165,32,0.25), rgba(218,165,32,0.1));
    color: #B8860B; font-weight: 700;
    border-right: 3px solid var(--primary);
}
.sidebar-menu a i { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-menu .badge { margin-right: auto; font-size: 0.7rem; padding: 3px 8px; }

/* Sidebar Collapse Button */
.sidebar-collapse-btn {
    position: absolute; left: 10px; top: 18px;
    background: rgba(0,0,0,0.06); border: none; color: #A0926B;
    width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); z-index: 5; font-size: 12px;
}
.sidebar-collapse-btn:hover { background: rgba(0,0,0,0.1); color: var(--primary-dark); }

@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
    body.sidebar-collapsed .main-content { margin-right: var(--sidebar-collapsed-width); }
    body.sidebar-collapsed .top-navbar { right: var(--sidebar-collapsed-width); }
    body.sidebar-collapsed .sidebar .sidebar-header h5,
    body.sidebar-collapsed .sidebar .sidebar-header small,
    body.sidebar-collapsed .sidebar .menu-header,
    body.sidebar-collapsed .sidebar .sidebar-menu a span,
    body.sidebar-collapsed .sidebar .sidebar-menu a .badge { display: none; }
    body.sidebar-collapsed .sidebar .sidebar-header { padding: 15px 10px; }
    body.sidebar-collapsed .sidebar .sidebar-logo { width: 40px; height: 40px; font-size: 18px; margin-bottom: 0; }
    body.sidebar-collapsed .sidebar .sidebar-menu a { justify-content: center; padding: 12px 0; gap: 0; position: relative; display: flex; }
    body.sidebar-collapsed .sidebar .sidebar-menu a i { font-size: 17px; width: auto; margin: 0; }
    body.sidebar-collapsed .sidebar .sidebar-menu a.active { border-radius: 8px; margin: 2px 8px; }
    body.sidebar-collapsed .sidebar .sidebar-collapse-btn { position: static; margin: 8px auto 0; }
    body.sidebar-collapsed .sidebar .sidebar-menu a:hover::after {
        content: attr(data-title); position: absolute; right: calc(100% + 12px); top: 50%;
        transform: translateY(-50%); background: rgba(0,0,0,0.85); color: white;
        padding: 5px 12px; border-radius: 6px; font-size: 12px; white-space: nowrap;
        z-index: 9999; pointer-events: none;
    }
}
@media (max-width: 991px) { .sidebar-collapse-btn { display: none !important; } }

/* ======= MAIN CONTENT ======= */
.main-content { margin-right: 260px; margin-top: 65px; min-height: calc(100vh - 65px); transition: margin 0.3s; }
.content-wrapper { padding: 25px; }

/* ======= TOP NAVBAR ======= */
.top-navbar {
    position: fixed; top: 0; left: 0; right: 260px; height: 65px;
    background: var(--card-bg); box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 25px; z-index: 1030;
}
.top-navbar .btn-link { color: #555; font-size: 18px; text-decoration: none; }

/* Sidebar Toggle (mobile) */
.sidebar-toggle {
    display: none;
    background: var(--primary-gradient); border: none;
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    color: #fff; font-size: 1.2rem; cursor: pointer;
    align-items: center; justify-content: center;
}
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 1039;
}
.sidebar-overlay.show { display: block; }

/* Navbar Search */
.navbar-search { position: relative; width: 300px; }
.navbar-search input {
    width: 100%; border: 2px solid var(--border-color);
    border-radius: 25px; padding: 8px 45px 8px 20px;
    font-family: 'Tajawal'; font-size: 0.9rem;
    transition: var(--transition); background: var(--body-bg);
}
.navbar-search input:focus {
    border-color: var(--primary); outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.1);
}
.navbar-search .search-btn {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    background: var(--primary-gradient); border: none;
    width: 34px; height: 34px; border-radius: 50%;
    color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* DateTime Box */
.datetime-box {
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    padding: 4px 12px; gap: 8px; cursor: default;
}
.datetime-icon { color: #fff; font-size: 1rem; opacity: 0.85; }
.datetime-text { line-height: 1.15; direction: ltr; font-variant-numeric: tabular-nums; }
.datetime-time { font-size: 0.82rem; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.datetime-date { font-size: 0.68rem; color: rgba(255,255,255,0.8); }

/* Navbar Actions */
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.navbar-actions .nav-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--body-bg); display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); cursor: pointer; transition: var(--transition);
    position: relative; border: none; text-decoration: none;
}
.navbar-actions .nav-icon:hover { background: var(--primary); color: #fff; }
.navbar-actions .nav-icon .badge {
    position: absolute; top: -2px; right: -2px;
    font-size: 0.6rem; padding: 2px 5px;
}

/* User Avatar */
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary-gradient);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.9rem; cursor: pointer;
}

/* Topbar Clock (legacy) */
.topbar-clock { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); direction: ltr; }
.topbar-clock .clock-time { font-weight: 700; color: var(--primary); font-size: 14px; }
.topbar-clock .clock-date { font-size: 12px; }

/* Topbar Shortcuts */
.topbar-shortcuts { display: flex; align-items: center; gap: 3px; }
.topbar-shortcut { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-muted); text-decoration: none; transition: var(--transition); font-size: 15px; }
.topbar-shortcut:hover { background: var(--body-bg); color: var(--primary); }
.topbar-divider { width: 1px; height: 28px; background: var(--border-color); margin: 0 8px; }

/* ======= WELCOME BANNER ======= */
.welcome-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: var(--radius); padding: 30px; color: #fff;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; position: relative; overflow: hidden;
}
.welcome-banner::after {
    content: ''; position: absolute; left: -50px; top: -50px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(var(--primary-rgb),0.2) 0%, transparent 70%);
    border-radius: 50%;
}
.welcome-text h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 5px; }
.welcome-text p { opacity: 0.7; font-size: 0.9rem; margin: 0; }
.welcome-actions { display: flex; gap: 10px; z-index: 1; }
.welcome-actions .btn {
    border-radius: var(--radius-sm); padding: 8px 18px;
    font-size: 0.85rem; font-weight: 600;
    display: flex; align-items: center; gap: 6px; transition: var(--transition);
}

/* ======= CARDS ======= */
.card { border: none; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; border: 1px solid var(--border-color); }
.card-header { background: transparent; border-bottom: 1px solid var(--border-color); font-weight: 700; }

/* ======= STAT CARDS ======= */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px; margin-bottom: 25px;
}
.stat-card {
    background: var(--card-bg); border-radius: var(--radius); padding: 22px;
    box-shadow: var(--shadow); border: 1px solid var(--border-color);
    transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon { font-size: 1.3rem; margin-bottom: 3px; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text-dark); margin: 5px 0; }
.stat-card .stat-detail { font-size: 0.8rem; font-weight: 500; }

/* Legacy colored stat cards (dashboard backward compat) */
.stat-card-colored { border-radius: var(--radius); padding: 20px; color: #fff; position: relative; overflow: hidden; transition: transform 0.2s; }
.stat-card-colored:hover { transform: translateY(-3px); }
.stat-card-colored .stat-icon { font-size: 40px; opacity: 0.3; position: absolute; left: 20px; top: 20px; }
.stat-card-colored .stat-value { font-size: 28px; font-weight: 800; }
.stat-card-colored .stat-label { font-size: 13px; opacity: 0.9; }

/* ======= TABLES ======= */
.table th { font-weight: 700; font-size: 13px; background: var(--body-bg); white-space: nowrap; }
.table td { vertical-align: middle; font-size: 13px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    background: var(--body-bg); padding: 12px 15px;
    font-weight: 700; font-size: 0.8rem; color: var(--text-muted);
    border-bottom: 2px solid var(--border-color); white-space: nowrap;
}
.data-table tbody td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(var(--primary-rgb),0.04); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ======= BUTTONS ======= */
.btn-primary { background: var(--primary-gradient); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-gold { background: var(--primary-gradient); border: none; color: #fff; font-weight: 600; padding: 8px 20px; border-radius: var(--radius-sm); transition: var(--transition); }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 5px 15px rgba(var(--primary-rgb),0.3); color: #fff; }

/* Badge */
.badge { font-weight: 500; font-size: 12px; }

/* Status Badges */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 600;
}
.status-badge.pending { background: #fff3cd; color: #856404; }
.status-badge.active { background: #d4edda; color: #155724; }
.status-badge.completed { background: #d1ecf1; color: #0c5460; }
.status-badge.cancelled { background: #e2e3e5; color: #383d41; }
.status-badge.overdue { background: #f8d7da; color: #721c24; }

/* ======= SUIT CARD ======= */
.suit-card { border-radius: var(--radius); transition: transform 0.2s; overflow: hidden; }
.suit-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(var(--primary-rgb),0.15); }
.suit-card .suit-image { height: 200px; background: #faf6eb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.suit-card .suit-image img { width: 100%; height: 100%; object-fit: cover; }
.suit-card .suit-image .no-image { font-size: 60px; color: var(--primary-light); }

/* Calendar */
.calendar-event { border-radius: 4px; padding: 2px 6px; font-size: 11px; margin-bottom: 2px; display: block; }
.calendar-event.rental { background: rgba(var(--primary-rgb),0.15); color: var(--primary-dark); }
.calendar-event.reservation { background: #BBDEFB; color: #0D47A1; }

/* ======= FORMS ======= */
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb),0.15);
}
.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    font-family: 'Tajawal';
    font-size: 0.9rem;
    transition: var(--transition);
}

/* ======= MODALS ======= */
.modal-content { border-radius: var(--radius); border: none; box-shadow: var(--shadow-lg); }
.modal-header { background: var(--primary-gradient); color: #fff; border-bottom: 1px solid var(--border-color); padding: 18px 22px; }
.modal-header .btn-close { filter: invert(1); }
.modal-header .modal-title { font-weight: 700; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--border-color); padding: 15px 22px; }

/* ======= PAGE HEADER ======= */
.page-header { margin-bottom: 25px; }
.page-header h4 { color: var(--primary-dark); font-weight: 800; }

/* ======= NOTIFICATION DROPDOWN ======= */
.notification-dropdown {
    position: absolute; top: 50px; left: 0; width: 350px;
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border-color);
    z-index: 1001; display: none;
}
.notification-dropdown.show { display: block; }
.notification-dropdown .n-header {
    padding: 15px; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.notification-dropdown .n-item {
    padding: 12px 15px; border-bottom: 1px solid var(--border-color);
    cursor: pointer; transition: var(--transition);
}
.notification-dropdown .n-item:hover { background: var(--body-bg); }
.notification-dropdown .n-item.unread {
    background: rgba(var(--primary-rgb),0.05);
    border-right: 3px solid var(--primary);
}

/* ======= LOADING ======= */
.loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,0.85);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.spinner-gold {
    width: 50px; height: 50px;
    border: 4px solid var(--border-color); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* ======= EMPTY STATE ======= */
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state i { font-size: 4rem; color: var(--border-color); margin-bottom: 15px; }
.empty-state h5 { color: var(--text-muted); font-weight: 600; }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; }

/* ======= PAGINATION ======= */
.pagination-custom .page-link {
    border: 1px solid var(--border-color); color: var(--text-dark);
    padding: 8px 14px; font-weight: 500; border-radius: var(--radius-sm) !important; margin: 0 3px;
}
.pagination-custom .page-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-custom .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ======= ANIMATIONS ======= */
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Page Transition Loading Bar */
.page-loader { position: fixed; top: 0; right: 0; width: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--primary-light)); z-index: 999999; transition: none; pointer-events: none; }
.page-loader.active { animation: pageLoad 1.8s ease-out forwards; }
@keyframes pageLoad { 0% { width: 0; opacity: 1; } 20% { width: 40%; } 50% { width: 70%; } 80% { width: 88%; } 100% { width: 95%; opacity: 1; } }
.page-loader.done { width: 100% !important; opacity: 0; transition: opacity 0.3s ease 0.1s; }

/* ======= PRINT ======= */
@media print {
    .sidebar, .top-navbar, .sidebar-toggle, .no-print, .btn, .btn-group, .pagination-custom, .nav-tabs, form, .modal, .sidebar-overlay {
        display: none !important;
    }
    .no-print-col { display: none !important; }
    .print-only-header { display: block !important; }
    .print-only-stamp { display: block !important; }
    .main-content { margin: 0 !important; padding: 10px !important; }
    body { background: #fff !important; font-size: 12px; }
    @page { margin: 10mm; size: auto; }
    table thead { display: table-header-group; }
    table tr { page-break-inside: avoid; }
    .data-table th, .data-table td, table th, table td { border: 1px solid #333 !important; padding: 6px 8px; }
    .data-table th, table th { background: #f0f0f0 !important; font-weight: 700; }
    .card { page-break-inside: avoid; border: 1px solid #ccc !important; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
.print-only-header { display: none; }
.print-only-stamp { display: none; }

/* ======= RESPONSIVE ======= */
@media (max-width: 992px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-right: 0; }
    .top-navbar { right: 0; }
    .sidebar-toggle { display: flex; }
    .navbar-search { width: 200px; }
    .welcome-banner { flex-direction: column; text-align: center; gap: 15px; }
    .welcome-actions { flex-wrap: wrap; justify-content: center; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .stat-cards { grid-template-columns: 1fr; }
    .navbar-search { display: none; }
    .top-navbar { padding: 0 15px; }
    .main-content { padding: 15px; }
    .content-wrapper { padding: 15px; }
    .login-card { margin: 15px; padding: 30px 25px; }
}