/* ============================================
   MODERN DESIGN SYSTEM - SideviewPOS
   Glassmorphism • Smooth Animations • Modern UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Modern Color Palette */
    --primary: #1A4D2E;
    --primary-dark: #0F2D1A;
    --primary-light: #4CAF50;
    --success: #FFD700;
    --success-dark: #FFA000;
    --success-light: #FFF59D;
    --danger: #FF5252;
    --danger-dark: #D32F2F;
    --danger-light: #FFCDD2;
    --warning: #FF9800;
    --warning-dark: #F57C00;
    --warning-light: #FFE0B2;
    --info: #2196F3;
    --info-dark: #1976D2;
    --info-light: #BBDEFB;

    /* Gray Scale */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Background & Surface Colors */
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #ffffff;

    /* Text Colors */
    --text-primary: #1A1A2E;
    --text-secondary: #555555;
    --text-muted: #666666;
    --text-light: #888888;

    /* Border Colors */
    --border-color: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.12);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
    --gradient-success: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
    --gradient-danger: linear-gradient(135deg, #FF5252 0%, #D32F2F 100%);
    --gradient-hero: linear-gradient(135deg, #1A4D2E 0%, #2E7D32 50%, #4CAF50 100%);
    --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FFC107 50%, #FF9800 100%);
    --gradient-dark: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-bg-light: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(76, 175, 80, 0.3);
    --shadow-glow-gold: 0 0 40px rgba(255, 215, 0, 0.3);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE RESET & BODY
   ============================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 17px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0F2027 0%, #203A43 50%, #2C5364 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

/* Animated Background Particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(76, 175, 80, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(33, 150, 243, 0.08) 0%, transparent 50%);
    animation: bgShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes bgShift {
    0%, 100% { opacity: 1; transform: scale(1) translate(0, 0); }
    33% { opacity: 0.8; transform: scale(1.05) translate(10px, -10px); }
    66% { opacity: 0.9; transform: scale(1.02) translate(-10px, 10px); }
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    padding: 30px 0;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

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

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; color: var(--gray-700); }

.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-base);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #E8E8E0;
}

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

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.5);
}

.btn-success {
    background: var(--gradient-success);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(26, 77, 46, 0.3);
    color: var(--primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(26, 77, 46, 0.1);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ============================================
   NAVIGATION (legacy — header.php has its own nav styles)
   ============================================ */

.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    border-bottom: 1px solid var(--glass-border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gray-900);
    flex-shrink: 0;
}

.nav-brand .logo {
    height: 60px !important;
    width: auto !important;
    max-width: 250px !important;
    object-fit: contain;
}

/* Legacy nav-links class (used in some pages) */
.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 77, 46, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
}

.nav-links::-webkit-scrollbar {
    height: 6px;
}

.nav-links::-webkit-scrollbar-track {
    background: transparent;
}

.nav-links::-webkit-scrollbar-thumb {
    background: rgba(26, 77, 46, 0.3);
    border-radius: 3px;
}

.nav-links::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 77, 46, 0.5);
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    font-weight: 500;
    font-size: 14px;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

.nav-links a:hover::before,
.nav-links a.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-links a:hover {
    background: rgba(26, 77, 46, 0.1);
}

.nav-links a.active {
    background: rgba(26, 77, 46, 0.15);
    color: var(--primary);
}

.nav-links a.quick-clock-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white !important;
    font-weight: 600;
}

.nav-links a.quick-clock-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.nav-links a.quick-clock-btn::before {
    background: rgba(255, 255, 255, 0.5);
}

.nav-links a.logout-btn {
    color: #dc3545;
}

.nav-links a.logout-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

.nav-links a i {
    font-size: 16px;
    width: 20px;
}

/* Mobile Menu Button (legacy) */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 15px rgba(26, 77, 46, 0.3);
    flex-shrink: 0;
}

.user-info i {
    color: white;
    font-size: 18px;
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th {
    background: var(--gradient-primary);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(26, 77, 46, 0.05);
}

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

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #FFD54F 0%, #FFC107 100%);
    color: #5D4E0A;
}

.badge-danger {
    background: linear-gradient(135deg, #EF5350 0%, #E53935 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #FFA726 0%, #FB8C00 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 100%);
    color: white;
}

.badge-primary {
    background: linear-gradient(135deg, #66BB6A 0%, #43A047 100%);
    color: white;
}

.badge-secondary {
    background: #E5E7EB;
    color: #374151;
}

.badge-neutral {
    background: #E5E7EB;
    color: #374151;
}

.badge-category {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-paid {
    background: #D1FAE5;
    color: #065F46;
}

.badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-900);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition-smooth);
    background: white;
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.15);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(255, 82, 82, 0.15);
}

.invalid-feedback {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #C62828;
    font-weight: 500;
}

/* ============================================
   STATS GRID
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: #FFFFFF;
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(26, 77, 46, 0.3);
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--gradient-primary); }
.stat-icon.success { background: var(--gradient-success); color: var(--text-primary); }
.stat-icon.warning { background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%); }
.stat-icon.info { background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%); }

.stat-content h3 {
    font-size: 2rem;
    margin-bottom: 4px;
    color: var(--gray-900);
    font-weight: 800;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #FFF59D 0%, #FFD54F 100%);
    color: #8B7500;
    border-left: 4px solid #FFA000;
}

.alert-danger {
    background: linear-gradient(135deg, #FFCDD2 0%, #EF9A9A 100%);
    color: #C62828;
    border-left: 4px solid #D32F2F;
}

.alert-warning {
    background: linear-gradient(135deg, #FFE0B2 0%, #FFCC80 100%);
    color: #E65100;
    border-left: 4px solid #F57C00;
}

.alert-info {
    background: linear-gradient(135deg, #BBDEFB 0%, #90CAF9 100%);
    color: #0D47A1;
    border-left: 4px solid #1976D2;
}

/* ============================================
   GRID LAYOUT
   ============================================ */

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   ROOM STATUS
   ============================================ */

.room-available {
    background: linear-gradient(135deg, #C8E6C9 0%, #A5D6A7 100%);
    color: #0f172a;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.room-occupied {
    background: linear-gradient(135deg, #EF9A9A 0%, #E57373 100%);
    color: #C62828;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.room-maintenance {
    background: linear-gradient(135deg, #FFE082 0%, #FFCA28 100%);
    color: #E65100;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 0 40px rgba(76, 175, 80, 0.6); }
}

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

.animate-in { animation: fadeInUp 0.6s ease-out forwards; }
.slide-in { animation: slideInLeft 0.5s ease-out forwards; }
.pulse { animation: pulse 2s infinite; }
.spin { animation: spin 1s linear infinite; }

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(26, 77, 46, 0.2);
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   MISC COMPONENTS
   ============================================ */

code, pre {
    color: var(--gray-900);
    background: #F5F5F0;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active,
.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease-out;
}

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

.modal-header h3 {
    margin-bottom: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    font-weight: 500;
    font-size: 14px;
    pointer-events: auto;
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    max-width: 450px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.toast-exit {
    animation: toastOut 0.3s ease-in forwards;
}

.toast-success {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #065F46;
    border-left: 4px solid #059669;
}

.toast-error {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
    border-left: 4px solid #DC2626;
}

.toast-warning {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
    border-left: 4px solid #D97706;
}

.toast-info {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #1E40AF;
    border-left: 4px solid #2563EB;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px;
    color: inherit;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: toastProgress linear forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(100px) scale(0.95); }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================
   CONFIRM DIALOG
   ============================================ */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

.confirm-dialog {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    animation: confirmIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-header {
    padding: 24px 24px 0;
    text-align: center;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.confirm-icon.danger {
    background: #FEE2E2;
    color: #DC2626;
}

.confirm-icon.warning {
    background: #FEF3C7;
    color: #D97706;
}

.confirm-icon.info {
    background: #DBEAFE;
    color: #2563EB;
}

.confirm-icon.success {
    background: #D1FAE5;
    color: #059669;
}

.confirm-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.confirm-message {
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0;
}

.confirm-body {
    padding: 20px 24px;
    text-align: center;
}

.confirm-footer {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border-color);
}

.confirm-footer .btn {
    flex: 1;
    border-radius: 0;
    padding: 14px;
    font-size: 15px;
    border: none;
    background: none;
}

.confirm-footer .btn-cancel {
    color: var(--gray-600);
    font-weight: 500;
}

.confirm-footer .btn-cancel:hover {
    background: var(--gray-50);
}

.confirm-footer .btn-confirm {
    font-weight: 600;
}

.confirm-footer .btn-confirm.danger {
    color: #DC2626;
}

.confirm-footer .btn-confirm.danger:hover {
    background: #FEE2E2;
}

.confirm-footer .btn-confirm.warning {
    color: #D97706;
}

.confirm-footer .btn-confirm.warning:hover {
    background: #FEF3C7;
}

.confirm-footer .btn-confirm.success {
    color: #059669;
}

.confirm-footer .btn-confirm.success:hover {
    background: #D1FAE5;
}

@keyframes confirmIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

/* ============================================
   LOADING & SKELETON STATES
   ============================================ */

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
.spinner-white { border-color: rgba(255, 255, 255, 0.3); border-top-color: white; }

/* Button loading state */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-outline.loading::after {
    border-color: rgba(26, 77, 46, 0.2);
    border-top-color: var(--primary);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #E5E7EB 25%, #F3F4F6 50%, #E5E7EB 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.shorter { width: 40%; }

.skeleton-heading {
    height: 24px;
    margin-bottom: 12px;
    width: 50%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg);
}

.skeleton-stat {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-radius: var(--radius-xl);
    background: white;
    border: 1px solid var(--border-color);
}

.skeleton-stat .skeleton-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
}

.skeleton-stat .skeleton-lines {
    flex: 1;
}

/* Page loading overlay */
.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--gray-500);
}

.page-loading .spinner {
    width: 40px;
    height: 40px;
}

/* ============================================
   RESPONSIVE - TABLET (max 1024px)
   ============================================ */

@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

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

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group select {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 10px 12px;
    }

    .navbar {
        padding: 0 16px;
    }

    .nav-links a {
        padding: 10px 12px;
        font-size: 13px;
    }

    .user-info {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (max 768px)
   ============================================ */

@media (max-width: 768px) {
    /* Toast responsive */
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    /* Confirm responsive */
    .confirm-dialog {
        max-width: calc(100% - 20px);
    }

    .container {
        padding: 0 10px;
    }

    .main-content {
        padding: 15px 0;
    }

    .card {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 12px;
    }

    .card-header {
        padding: 15px;
        flex-direction: column;
        gap: 8px;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .card-body {
        padding: 15px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

    .stat-card {
        padding: 18px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }

    .stat-content h3 {
        font-size: 1.5rem;
    }

    .stat-content p {
        font-size: 12px;
    }

    /* Tables - Horizontal Scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    /* Forms */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 1rem;
        border-radius: 10px;
    }

    /* Buttons */
    .btn {
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .btn-lg {
        padding: 14px 20px;
        font-size: 1rem;
    }

    /* Alerts */
    .alert {
        padding: 12px 15px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    /* Badges */
    .badge {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    /* Modal */
    .modal-content {
        padding: 20px;
        margin: 10px;
        max-width: calc(100% - 20px);
        border-radius: 16px;
    }

    /* Navbar mobile */
    .navbar {
        height: auto;
        min-height: 70px;
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-brand {
        flex: 1;
        justify-content: flex-start;
    }

    .nav-brand .logo {
        height: 45px !important;
        max-width: 150px !important;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 80px 20px 20px;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
        transition: right 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links .user-info {
        width: 100%;
        justify-content: center;
        margin-bottom: 20px;
    }

    .nav-links a {
        width: 100%;
        padding: 14px 16px;
        font-size: 15px;
        border-radius: var(--radius-md);
        margin-bottom: 4px;
    }

    .nav-links a i {
        width: 24px;
        font-size: 18px;
    }

    .navbar.menu-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (max 480px)
   ============================================ */

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .container {
        padding: 0 8px;
    }

    .card {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .card-header {
        padding: 12px;
    }

    .card-title {
        font-size: 1.2rem;
    }

    h1 { font-size: 1.3rem; }
    h2 { font-size: 1.1rem; }
    h3 { font-size: 1rem; }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 15px;
        flex-direction: row;
        text-align: left;
        gap: 15px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .stat-content h3 {
        font-size: 1.3rem;
    }

    .stat-content p {
        font-size: 11px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    table {
        font-size: 0.8rem;
        min-width: 500px;
    }

    th, td {
        padding: 6px 8px;
    }
}

/* ============================================
   REPORTS PAGE STYLES
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--text-primary);
}

.data-table td.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
    }

    body::before {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .navbar {
        display: none !important;
    }

    .mobile-overlay {
        display: none !important;
    }
}
