/* =========================================
   SmartAdmin Clinic Theme Variables
   ========================================= */
:root {
    --brand-color: #2b334a; 
    --sidebar-bg: #232a3f;
    --sidebar-text: #a4b4cb;
    --sidebar-hover: #ffffff;
    --sidebar-active-bg: rgba(0,0,0,0.1);
    
    --bg-main: #f3f4f6;
    --white: #ffffff;
    --text-dark: #334155;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    
    /* Theme Colors */
    --success-green: #10b981;
    --danger-red: #ef4444;
    --info-blue: #0ea5e9;
    --primary-blue: #6366f1;
    --warning-yellow: #f59e0b;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Nunito', system-ui, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-dark); display: flex; min-height: 100vh; overflow-x: hidden; }

/* =========================================
   Dashboard Layouts & Cards
   ========================================= */
/* FIX: Forces full width and overrides any framework constraints */
.container { 
    width: 100% !important; 
    max-width: 100% !important; 
    padding: 25px; 
}
.main-content { 
    flex: 1; /* This forces it to take up ALL remaining space */
    min-width: 0; 
    display: flex; 
    flex-direction: column; 
    background-color: var(--bg-main);
}

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; width: 100%; }
.page-title { font-size: 1.4rem; font-weight: 800; color: var(--text-dark); display: flex; align-items: center; }
.breadcrumb { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-top: 5px; }

.row { display: flex; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; width: 100%; }
.col { flex: 1; min-width: 200px; }

.appzia-card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
    width: 100%;
}

/* =========================================
   Sidebar Submenus (Bulletproof classes)
   ========================================= */
.submenu { 
    display: none; /* Hidden by default */
    background: rgba(0,0,0,0.1); 
    padding-bottom: 5px; 
}
.submenu.open { 
    display: block; /* Shown when JS adds this class */
}

/* =========================================
   Forms, Buttons & Alerts
   ========================================= */
.form-group { margin-bottom: 15px !important; text-align: left; width: 100%; }
.form-group label { display: block; margin-bottom: 6px !important; font-size: 0.8rem !important; font-weight: 700; color: #64748b; text-transform: uppercase; }
.form-control {
    width: 100%;
    padding: 10px 15px !important;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-dark);
    background-color: #f8fafc;
    transition: 0.2s ease;
    outline: none;
}
.form-control:focus { border-color: var(--primary-blue); background-color: var(--white); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
.btn-primary { background-color: var(--primary-blue); color: var(--white); }
.btn-primary:hover { background-color: #4f46e5; transform: translateY(-1px); }
.btn-success { background-color: var(--success-green); color: var(--white); }
.btn-success:hover { background-color: #059669; }
.btn-outline-dark { border: 1px solid #cbd5e1; color: #475569; background: transparent; }
.btn-outline-dark:hover { background: #f1f5f9; color: #0f172a; }

.alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.alert-success { background-color: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* =========================================
   Data Tables & Export Buttons
   ========================================= */
.table-responsive { width: 100%; overflow-x: auto; text-align: left; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 15px 18px; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
.table-hover tbody tr:hover { background-color: #f8fafc; transition: 0.2s; }

.table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.export-buttons { display: flex; gap: 4px; align-items: center; }
.export-btn { 
    background: #ffffff; border: 1px solid #cbd5e1; border-radius: 6px; 
    padding: 6px 16px; font-size: 0.8rem; font-weight: 700; cursor: pointer; 
    color: #475569; transition: 0.2s; 
}
.export-btn:hover { background: #f1f5f9; color: var(--primary-blue); border-color: var(--primary-blue); }

.table-search input { padding: 10px 15px; border: 1px solid var(--border-color); border-radius: 6px; outline: none; width: 250px; font-size: 0.9rem; }
.table-search input:focus { border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

/* UPDATED DARK BLUE TABLE HEADER */
.table-header-blue { background-color: var(--brand-color) !important; color: #ffffff !important; }
.table-header-blue th { color: #ffffff !important; font-weight: 700 !important; border: none !important; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.8rem; }
.table-header-blue th i { color: rgba(255, 255, 255, 0.5) !important; margin-left: 5px; }

/* Table Icon Buttons */
.btn-icon { padding: 8px 12px; border-radius: 6px; border: none; cursor: pointer; transition: 0.2s; font-size: 0.9rem; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-edit { background-color: #e0e7ff; color: #4f46e5; }
.btn-edit:hover { background-color: #c7d2fe; }
.btn-view { background-color: #dcfce7; color: #16a34a; }
.btn-view:hover { background-color: #bbf7d0; }
.btn-delete { background-color: #fee2e2; color: #dc2626; }
.btn-delete:hover { background-color: #fecaca; }

/* =========================================
   Audit Log Badges
   ========================================= */
.badge { padding: 6px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; }
.badge-success { background-color: #dcfce7; color: #16a34a; }
.badge-danger { background-color: #fee2e2; color: #dc2626; }
.badge-info { background-color: #e0f2fe; color: #0284c7; }
.badge-primary { background-color: #e0e7ff; color: #4f46e5; }
.badge-warning { background-color: #fef9c3; color: #d97706; }

/* =========================================
   Modals (Popups)
   ========================================= */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.active { display: flex; }
.modal-container { background: var(--white); width: 100%; max-width: 800px; border-radius: 12px; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); transform: translateY(-20px); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.modal-overlay.active .modal-container { transform: translateY(0); }
.modal-header { background: var(--brand-color); color: white; padding: 20px 25px; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.modal-close { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; line-height: 1; opacity: 0.7; transition: 0.2s; }
.modal-close:hover { opacity: 1; }
.modal-body { padding: 25px; max-height: 80vh; overflow-y: auto; background: white; }
.modal-footer { padding: 15px 25px; border-top: 1px solid var(--border-color); background: #f8fafc; display: flex; justify-content: flex-end; gap: 10px; }