/* SETUP GUUD & VARIABLES */
:root {
    --primary-blue: #3f51b5;
    --success-green: #27ae60;
    --warning-yellow: #f39c12;
    --danger-red: #e74c3c;
    --sidebar-bg: #1e1e2d;
    --bg-light: #f4f7fa;
    --table-header: #1a1d2e; 
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
}

body { 
    background: var(--bg-light); 
    display: flex; 
    height: 100vh; 
    overflow: hidden; 
}

/* SIDEBAR & CONTAINER */
.app-container { display: flex; width: 100%; height: 100vh; }

.sidebar { 
    width: 260px; 
    background: var(--sidebar-bg); 
    color: white; 
    padding: 20px; 
    flex-shrink: 0; 
}

.logo { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 1.1rem; 
    font-weight: bold; 
    margin-bottom: 30px; 
    color: #3498db; 
}

.menu-label { 
    font-size: 10px; 
    color: #6c7293; 
    margin: 20px 0 10px; 
    font-weight: bold; 
    text-transform: uppercase; 
}

.sidebar-menu ul { list-style: none; }

.sidebar-menu li { 
    padding: 12px; 
    border-radius: 8px; 
    cursor: pointer; 
    color: #a2a3b7; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 5px; 
    transition: 0.3s; 
}

.sidebar-menu li:hover, .sidebar-menu li.active { 
    background: #2c2c3d; 
    color: white; 
}

/*  MAIN AREA & TOP BAR */
.main-content { 
    flex: 1; 
    padding: 20px; 
    overflow-y: auto; 
}

.top-bar { 
    background: white; 
    padding: 15px 25px; 
    border-radius: 10px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
}

.user-profile { 
    background: #0095e8; 
    color: white; 
    width: 35px; 
    height: 35px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 12px; 
    font-weight: bold; 
}

/* DASHBOARD STATS */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 15px; 
    margin-bottom: 25px; 
}

.card { 
    padding: 20px; 
    border-radius: 12px; 
    color: white; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.card h3 { font-size: 11px; opacity: 0.8; }
.card p { font-size: 1.6rem; font-weight: bold; }
.card i { font-size: 2rem; opacity: 0.3; }

.blue { background: var(--primary-blue); } 
.green { background: var(--success-green); } 
.yellow { background: var(--warning-yellow); } 
.red { background: var(--danger-red); }

/* JADWALKA (TABLE STYLES*/
.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--table-header);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

tr:hover { background-color: #fcfcfc; }

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-badge.success { background: #e8f5e9; color: #2e7d32; }
.status-badge.warning { background: #fff3e0; color: #ef6c00; }

.dept-tag {
    background: #00d1ea;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
}

/* FOOMAMKA  DESIGN */
.form-card { 
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.08); 
    max-width: 650px; 
    margin: 0 auto; 
}

.input-group { display: flex; flex-direction: column; margin-bottom: 15px; }
.input-group label { font-size: 12px; font-weight: 600; margin-bottom: 5px; color: #444; }
.input-group input, .input-group select, .input-group textarea { 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    outline: none; 
}

/* BUTTONS & ACTIONS  */
.btn-blue {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.delete-btn {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    transition: 0.2s;
}

.delete-btn:hover { color: var(--danger-red); }

/* Quick Action Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.action-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* QUICK ACCESS ICONS FIX  */
.icon-circle {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex !important;
    align-items: center !important; 
    justify-content: center !important;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    color: white;
}

/* Midabada Background-ka u gaarka ah Quick Access */
.yellow-bg { background-color: #f39c12 !important; }
.green-bg  { background-color: #27ae60 !important; }
.purple-bg { background-color: #8e44ad !important; }
.blue-bg   { background-color: #3498db !important; }
.red-bg    { background-color: #e74c3c !important; }
.cyan-bg   { background-color: #00d1ea !important; }
.gray-bg   { background-color: #95a5a6 !important; }
.orange-bg { background-color: #e67e22 !important; }

/*  ANIMATIONS & FONT FIX */
.fade-in { animation: fadeIn 0.4s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.fa-solid, .fas {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}
/* Medical Service Form Styles */
.form-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.form-card {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
}

.form-header {
    background: #198754; /* Cagaarka sawirkaaga */
    color: white;
    padding: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.form-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #198754;
    outline: none;
}

.btn-save {
    width: 100%;
    padding: 14px;
    background: #198754;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-save:hover {
    background: #146c43;
}
/* --- Medical Services List Styles --- */

.page-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
}

.add-service-btn { 
    background-color: #198754; /* Cagaarka sawirkaaga */
    color: white; 
    border: none; 
    padding: 10px 18px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 500; 
    font-size: 14px; 
    transition: background 0.3s ease;
}

.add-service-btn:hover {
    background-color: #146c43;
}

.table-container { 
    background: white; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    overflow: hidden; 
}

table { 
    width: 100%; 
    border-collapse: collapse; 
}

thead tr { 
    background-color: #1a1d21; /* Madowga Header-ka */
    color: white; 
    text-align: left; 
}

th, td { 
    padding: 15px 20px; 
    border-bottom: 1px solid #f2f2f2; 
    font-size: 15px; 
}

.dept-badge { 
    background-color: #0dcaf0; /* Buluugga furan (Cyan) */
    color: #000; 
    padding: 4px 12px; 
    border-radius: 15px; 
    font-size: 12px; 
    font-weight: 600; 
    display: inline-block;
}

.action-btn { 
    color: #dc3545; 
    border: none; 
    background: none; 
    cursor: pointer; 
    font-size: 16px;
    transition: transform 0.2s ease;
}

.action-btn:hover {
    transform: scale(1.1);
}
/* --- BILLING LIST STYLES --- */
.billing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.billing-header h2 {
    font-size: 24px;
    color: #444;
}

.table-wrapper {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th {
    text-align: left;
    padding: 15px;
    background-color: #f8f9fa;
    color: #333;
    font-size: 14px;
    border-bottom: 2px solid #eee;
}

.invoice-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
    color: #555;
}

/* Status Badges */
.status-paid {
    background-color: #28a745;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.status-unpaid {
    background-color: #ffc107;
    color: #000;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

/* Print Button */
.btn-print {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-print:hover {
    background-color: #138496;
}
/* --- INVOICE FORM DYNAMIC LAYOUT --- */
.invoice-card {
    display: flex;
    max-width: 850px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 500px;
}

/* Bidix: Blue/Grey Sidebar */
.invoice-sidebar {
    background-color: #747d8c; /* Midabka sawirkaaga */
    color: white;
    width: 40%;
    padding: 50px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.invoice-sidebar h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

/* Midig: Form Body */
.invoice-form-body {
    width: 60%;
    padding: 40px;
}

.invoice-form-body .form-group {
    margin-bottom: 20px;
}

.invoice-form-body label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.invoice-form-body .form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
}

/* Services Container (Dynamic Checkboxes) */
.services-checkbox-container {
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 6px;
    background-color: #fbfbfb;
    max-height: 180px;
    overflow-y: auto;
}

.service-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    cursor: pointer;
}

.service-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2f3542;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    background-color: #212529;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 15px;
    transition: 0.3s;
}

.btn-generate:hover {
    background-color: #000;
    transform: translateY(-2px);
}
/* =========================================
  REPORT PAGE STYLING 
  =========================================
*/

/* Container-ka Guud */
.reports-container {
    padding: 25px;
    background-color: #f4f7f6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Qaybta Filter-ka (Taariikhda) */
.filter-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.filter-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.filter-box input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

/* Kaararka Sare (Summary Cards) */
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.report-card {
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.card-income {
    background: linear-gradient(135deg, #28a745, #218838);
    border-bottom: 5px solid #1e7e34;
}

.card-apps {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    border-bottom: 5px solid #d39e00;
}

.card-labs {
    background: linear-gradient(135deg, #17a2b8, #138496);
    border-bottom: 5px solid #117a8b;
}

.report-card h4 {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
    text-transform: uppercase;
}

.report-card p {
    margin: 15px 0 0;
    font-size: 2.2rem;
    font-weight: 800;
}

/* Jadwalka Warbixinta (Report Table) */
.report-table-wrapper {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table thead {
    background-color: #343a40;
    color: white;
}

.report-table th, .report-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.report-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Badhamada (Buttons) */
.btn-generate {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-generate:hover {
    background-color: #0056b3;
}

/* =========================================
  PRINT OPTIMIZATION 
  =========================================
*/
@media print {
    .sidebar, .nav-bar, .filter-box, .btn-generate, .btn-print {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .report-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        color: black !important;
        background: white !important;
    }

    .report-table {
        border: 1px solid #000 !important;
    }
}
/* Modal Container */
.status-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Marka hore waa qarsan yahay */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Modal Box */
.modal-content {
    background: white;
    width: 400px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-header {
    background: #00bcd4; /* Midabka cyan-ka ah ee sawirka */
    color: white;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #333;
}

.modal-body label {
    display: block;
    font-weight: bold;
    margin-top: 15px;
}

.modal-body select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Status Badge Styles */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}
.status-badge.confirmed { background: #e3f2fd; color: #0d6efd; }
.status-badge.completed { background: #e8f5e9; color: #2e7d32; }
.status-badge.pending { background: #fff3e0; color: #ef6c00; }
.status-badge.cancelled { background: #ffebee; color: #c62828; }
/* =========================================
   RESPONSIVE DESIGN (KUGU DAR)
   ========================================= */

/* Tablets & Laptops yaryar (ka yar 1024px) */
@media screen and (max-width: 1024px) {
    .stats-grid, .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        width: 200px;
    }
    
    .invoice-card {
        max-width: 95%;
    }
}

/* Moobilada (ka yar 768px) */
@media screen and (max-width: 768px) {
    body {
        overflow-y: auto; /* Moobilka inuu scroll noqdo */
    }

    .app-container {
        flex-direction: column;
    }

    /* Sidebar Fix for Mobile */
    .sidebar {
        width: 100%;
        height: auto;
        padding: 10px;
        display: block;
    }

    .sidebar .logo {
        margin-bottom: 10px;
        justify-content: center;
    }

    .sidebar-menu ul {
        display: flex;
        overflow-x: auto; /* Menu-ga moobilka inuu dhinac u socdo */
        padding-bottom: 5px;
        gap: 5px;
    }

    .sidebar-menu li {
        white-space: nowrap;
        padding: 8px 15px;
    }

    .menu-label {
        display: none; /* Qoraalka yar ee MAIN/PEOPLE qari */
    }

    .main-content {
        padding: 10px;
    }

    /* Grid layout-yada ka dhig hal column */
    .stats-grid, .actions-grid, .report-summary-grid {
        grid-template-columns: 1fr;
    }

    /* Invoice Form Fix */
    .invoice-card {
        flex-direction: column;
        height: auto;
    }

    .invoice-sidebar, .invoice-form-body {
        width: 100%;
        padding: 20px;
    }

    /* Table Responsiveness */
    .table-container, .report-table-wrapper, .table-wrapper {
        overflow-x: auto; /* Shaxda dhinac u riix moobilka */
    }

    table, .report-table, .invoice-table {
        min-width: 600px; /* Hubi inaanay shaxdu isku soo ururin */
    }

    /* Top Bar Fix */
    .top-bar {
        padding: 10px;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Form Design Fix */
    .form-card {
        width: 100%;
        max-width: 100%;
    }

    .report-card p {
        font-size: 1.5rem;
    }
}

/* Moobilada aadka u yaryar (ka yar 480px) */
@media screen and (max-width: 480px) {
    .header-action, .page-header, .billing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .add-service-btn, .btn-generate {
        width: 100%;
    }

    .user-profile {
        display: none; /* Qari profile-ka yar haddii boosku yaryahay */
    }
}