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

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background: #f8fafc;
        color: #334155;
        line-height: 1.6;
        overflow-x: hidden;
    }

    /* Header */
    .clinic-header {
        background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
        color: white;
        padding: 16px 0;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .clinic-header-content {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
.card {padding:0!important}
#patients-list-container, #examinations-list-container,#invoices-list-container, #rooms-list, #doctors-list,#advances-list-container,#drugs-list-container{padding:10px}
    .clinic-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 20px;
        font-weight: 700;
    }

    .clinic-tools {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .clinic-tool-btn {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: white;
        padding: 8px 16px;
        border-radius: 8px;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .clinic-tool-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
    }

    /* Main Container */
    .clinic-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 20px;
        display: flex;
        gap: 20px;
        min-height: calc(100vh - 120px);
    }

    /* Sidebar Menu */
    .clinic-sidebar {
        width: 280px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        height: fit-content;
        position: sticky;
        top: 100px;
    }

    .sidebar-header {
        padding: 20px;
        background: linear-gradient(135deg, #059669 0%, #10b981 100%);
        color: white;
        border-radius: 12px 12px 0 0;
        text-align: center;
        font-weight: 600;
    }

    .sidebar-menu {
        padding: 0;
        list-style: none;
    }

    .menu-item {
        border-bottom: 1px solid #f1f5f9;
    }

    .menu-item:last-child {
        border-bottom: none;
    }

    .menu-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
        color: #64748b;
        text-decoration: none;
        transition: all 0.3s ease;
        cursor: pointer;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        font-size: 14px;max-height: 60px;height: 100%;
    }

    .menu-link:hover {
        background: #f8fafc;
        color: #334155;
    }

    .menu-link.active {
        background: linear-gradient(135deg, #059669 0%, #10b981 100%);
        color: white;
        border-radius: 0;
    }

    .menu-link.active:hover {
        background: linear-gradient(135deg, #047857 0%, #059669 100%);
    }

    .menu-icon {
        width: 20px;
        text-align: center;
        font-size: 16px;
    }

    /* Content Area */
    .clinic-content {
        flex: 1;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        min-height: 600px;
    }

    .content-header {
        padding: 20px 30px;
        border-bottom: 1px solid #e2e8f0;
        background: #f8fafc;
        border-radius: 12px 12px 0 0;
    }

    .content-title {
        font-size: 24px;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .content-subtitle {
        color: #64748b;
        font-size: 14px;
    }

    .content-body {
        padding: 30px;
    }

    .tab-content {
        display: none;
    }

    .tab-content.active {
        display: block;
    }

    /* Forms */
    .form-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-bottom: 24px;
    }

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

    .form-label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #374151;
        font-size: 14px;
    }

    .form-input, .form-select, .form-textarea {
        width: 100%;
        padding: 12px;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
        font-family: inherit;
        transition: border-color 0.3s ease;
    }

    .form-input:focus, .form-select:focus, .form-textarea:focus {
        outline: none;
        border-color: #059669;
        box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
    }

    .form-textarea {
        min-height: 100px;
        resize: vertical;
    }

    /* Buttons */
    .btn {
        padding: 12px 24px;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
    }

    .btn-primary {
        background: linear-gradient(135deg, #059669 0%, #10b981 100%);
        color: white;
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    }

    .btn-secondary {
        background: #f1f5f9;
        color: #475569;
        border: 1px solid #e2e8f0;
    }

    .btn-secondary:hover {
        background: #e2e8f0;
    }

    .btn-danger {
        background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
        color: white;
    }

    .btn-danger:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    }

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

    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none !important;
        box-shadow: none !important;
    }

    /* Cards & Lists */
    .card {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 20px;
        margin-bottom: 16px;
    }

    .card-header {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid #e2e8f0;
        color: #1e293b;
    }

    .list-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-bottom: 8px;
        background: #fafafa;
    }

    .list-item:hover {
        background: #f1f5f9;
    }

    /* Stats Cards */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        margin-bottom: 30px;
    }

    .stat-card {
        background: white;
        border-radius: 12px;
        padding: 20px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-left: 4px solid #059669;
    }

    .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #059669;
    margin-bottom: 8px;
    display: block;
    word-break: break-word;
    }

    .stat-label {
        color: #64748b;
        font-size: 14px;
        font-weight: 500;
    }

    /* Badges */
    .badge {
        display: inline-flex;
        align-items: center;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        gap: 4px;
    }

    .badge-success {
        background: #dcfce7;
        color: #166534;
    }

    .badge-warning {
        background: #fef3c7;
        color: #92400e;
    }

    .badge-danger {
        background: #fee2e2;
        color: #991b1b;
    }

    .badge-info {
        background: #dbeafe;
        color: #1e40af;
    }

    /* Notifications */
    .notification {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1001;
        max-width: 400px;
        padding: 16px 20px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        animation: slideInRight 0.3s ease;
        cursor: pointer;
    }

    @keyframes slideInRight {
        from { transform: translateX(100%); }
        to { transform: translateX(0); }
    }

    .notification.success {
        background: #ecfdf5;
        color: #065f46;
        border: 1px solid #a7f3d0;
    }

    .notification.error {
        background: #fef2f2;
        color: #991b1b;
        border: 1px solid #fca5a5;
    }

    .notification.warning {
        background: #fffbeb;
        color: #92400e;
        border: 1px solid #fed7aa;
    }

    /* Loading */
    .loading {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .loading-spinner {
        width: 16px;
        height: 16px;
        border: 2px solid #e2e8f0;
        border-top: 2px solid #059669;
        border-radius: 50%;
        animation: spin 1s linear infinite;margin-right:10px;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    .content-loading {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 60px;
        color: #64748b;
    }

    /* Tables */
    .data-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 16px;
        background: white;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .data-table th {
        background: #f8fafc;
        padding: 12px;
        text-align: left;
        font-weight: 600;
        color: #374151;
        border-bottom: 2px solid #e2e8f0;
    }

    .data-table td {
        padding: 12px;
        border-bottom: 1px solid #f1f5f9;
    }

    .data-table tr:hover {
        background: #f8fafc;
    }

    /* Search */
    .search-box {
        position: relative;
        margin-bottom: 20px;
        max-width: 400px;
    }

    .search-input {
        width: 100%;
        padding: 12px 16px 12px 40px;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
    }

    .search-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
    }

    /* Footer */
    .clinic-footer {
        background: #1e293b;
        color: #cbd5e1;
        text-align: center;
        padding: 20px;
        margin-top: 40px;
    }

    /* Responsive */
    @media (max-width: 1024px) {
        .clinic-container {
            flex-direction: column;
            padding: 10px;
        }
        
        .clinic-sidebar {
            width: 100%;
            position: static;
        }
        
        .sidebar-menu {
            display: flex;
            overflow-x: auto;
            padding: 0;
        }
        
        .menu-item {
            border-bottom: none;
            border-right: 1px solid #f1f5f9;
            min-width: 150px;
        }
        
        .menu-item:last-child {
            border-right: none;
        }
        
        .form-grid {
            grid-template-columns: 1fr;
        }
        
        .stats-grid {
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        }
    }

    @media (max-width: 768px) {
        .clinic-header-content {
            padding: 0 15px;
            flex-direction: column;
            gap: 12px;
        }
        
        .clinic-tools {
            width: 100%;
            justify-content: center;
        }
        
        .container {
            padding: 10px;
        }
        
        .content-body {
            padding: 10px;
        }
        
        .notification {
            right: 10px;
            left: 10px;
            max-width: none;
        }
    }

    /* Hide scrollbar for sidebar menu on mobile */
    .sidebar-menu::-webkit-scrollbar {
        height: 4px;
    }

    .sidebar-menu::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

    .sidebar-menu::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }
.modal-content{padding:0!important}
/* Thêm vào cuối hàm addStyles() */

/* Drug Search Styling */
.drug-search-container {
    position: relative;
}

.drug-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.drug-search-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s ease;
}

.drug-search-item:hover {
    background: #f8fafc;
}

.drug-search-item:last-child {
    border-bottom: none;
}

.drug-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.drug-details {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 12px;
}

/* Dosage Schedule Styling */
.dosage-schedule-container {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 8px;
}

.dosage-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dosage-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dosage-option:has(input[type="checkbox"]:checked) {
    background: #ecfdf5;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    margin: 0;
    min-width: 80px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #059669;
    cursor: pointer;
}

.dose-quantity {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    background: white;
    transition: all 0.2s ease;
}

.dose-quantity:enabled {
    border-color: #059669;
    background: white;
}

.dose-quantity:disabled {
    background: #f3f4f6;
    color: #9ca3af;
}

.dose-unit {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.dosage-option:has(input[type="checkbox"]:checked) .dose-unit {
    color: #059669;
    font-weight: 600;
}

/* As-needed special styling */
.dosage-option:nth-child(5) {
    grid-column: 1 / -1;
    background: #fffbeb;
    border-color: #fbbf24;
}

.dosage-option:nth-child(5):has(input[type="checkbox"]:checked) {
    background: #fef3c7;
    border-color: #f59e0b;
}

.dosage-option:nth-child(5) .checkbox-label {
    color: #92400e;
}

.dosage-option:nth-child(5) .dose-unit {
    color: #92400e;
}

/* Preset Schedules */
.preset-schedules {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.preset-schedules .btn {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    transition: all 0.2s ease;
}

.preset-schedules .btn:hover {
    background: #059669;
    color: white;
    border-color: #059669;
    transform: translateY(-1px);
}

/* Stats Summary */
.stats-summary {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-summary i {
    font-size: 16px;
}

.total-count strong {
    font-size: 16px;
    color: #1e40af;
    font-weight: 700;
}

/* Form Grid Responsive */
@media (max-width: 768px) {
    .dosage-options {
        grid-template-columns: 1fr;
    }
    
    .dosage-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .checkbox-label {
        min-width: auto;
    }
    
    .preset-schedules {
        justify-content: center;
    }
}

/* Form Input Enhancements */
.form-input:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

#treatment-days {
    width: 100px;
    text-align: center;
    font-weight: 600;
}

#drug-usage-notes {
    font-style: italic;
}

/* Max daily doses input for as-needed */
#max-daily-doses {
    width: 80px !important;
    margin-left: 8px !important;
    padding: 6px 8px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    text-align: center !important;
    font-size: 14px !important;
    background: white !important;
}

#max-daily-doses:enabled {
    border-color: #f59e0b !important;
}

#max-daily-doses:disabled {
    background: #f3f4f6 !important;
    color: #9ca3af !important;
}
