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

    body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', Cantarell, sans-serif;
        background: #f8fafc!important;
        color: #1a202c;
        line-height: 1.6;
    }

    /* Header */
    .main-header {
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        top: 0;
        z-index: 100;
    }

    .header-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 70px;
    }

    .header-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 24px;
        font-weight: 700;
        color: #1a202c;
        text-decoration: none;
    }

    .header-logo .logo-icon {
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, #ff6b6b, #ffa500);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 20px;
    }

    .actions {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    /* Main Layout */
    .main-wrapper {
        min-height: calc(100vh - 70px - 60px); /* minus header and footer */
        display: flex;
    }

    .content-wrapper {
        max-width: 1400px;
        margin: 0 auto;
        width: 100%;
        display: flex;
        gap: 20px;
        padding: 20px;
    }

    /* Sidebar */
    .sidebar {
        width: 280px;
        background: #ffffff;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        height: fit-content;
        position: sticky;
        top: 90px;
        overflow: hidden;
    }

    .sidebar-header {
        padding: 20px;
        border-bottom: 1px solid #e2e8f0;
        background: #f8fafc;
    }

    .sidebar-title {
        font-size: 16px;
        font-weight: 600;
        color: #374151;
        margin: 0;
    }

    .sidebar-nav {
        padding: 8px 0;
    }

    .nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        color: #6b7280;
        text-decoration: none;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        border-left: 3px solid transparent;
    }

    .nav-item:hover {
        background: #f8fafc;
        color: #374151;
    }

    .nav-item.active {
        background: #fef3f2;
        color: #dc2626;
        border-left-color: #dc2626;
    }

    .nav-item i {
        width: 20px;
        font-size: 16px;
        text-align: center;
    }

    /* Content Area */
    .content-area {
        flex: 1;
        background: #ffffff;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        min-height: 600px;
    }

    .content-header {
        padding: 24px;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f8fafc;
        border-radius: 12px 12px 0 0;
    }

    .content-title {
        font-size: 24px;
        font-weight: 700;
        color: #1a202c;
        margin: 0;
    }

    .content-body {
        padding: 24px;
    }

    .tab-content {
        display: none;
    }

    .tab-content.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

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

    /* Buttons */
    .btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        border: 1px solid transparent;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
        font-family: inherit;
        background: none;
    }

    .btn-primary {
        background: linear-gradient(135deg, #3b82f6, #1d4ed8);
        color: white;
        border-color: #3b82f6;
    }

    .btn-primary:hover {
        background: linear-gradient(135deg, #2563eb, #1e40af);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

    .btn-success {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
        border-color: #10b981;
    }

    .btn-success:hover {
        background: linear-gradient(135deg, #059669, #047857);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

    .btn-warning {
        background: linear-gradient(135deg, #f59e0b, #d97706);
        color: white;
        border-color: #f59e0b;
    }

    .btn-warning:hover {
        background: linear-gradient(135deg, #d97706, #b45309);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

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

    .btn-danger:hover {
        background: linear-gradient(135deg, #dc2626, #b91c1c);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }

    .btn-secondary {
        background: #f8fafc;
        color: #374151;
        border-color: #d1d5db;
    }

    .btn-secondary:hover {
        background: #f3f4f6;
        border-color: #9ca3af;
    }

    .btn-info {
        background: linear-gradient(135deg, #06b6d4, #0891b2);
        color: white;
        border-color: #06b6d4;
    }

    .btn-info:hover {
        background: linear-gradient(135deg, #0891b2, #0e7490);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
    }

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

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

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

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

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

    .form-input, .form-select, .form-textarea {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        font-size: 14px;
        transition: all 0.2s ease;
        font-family: inherit;
        background: #ffffff;
    }

    .form-input:focus, .form-select:focus, .form-textarea:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

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

    /* Tables */
    .data-table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #e5e7eb;
        margin-top: 16px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 16px;
        text-align: left;
        border-bottom: 1px solid #f3f4f6;
        font-size: 14px;
    }

    .data-table th {
        background: #f8fafc;
        color: #374151;
        font-weight: 600;
        border-bottom: 1px solid #e5e7eb;
    }

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

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

    /* Search Box */
    .search-box {
        width: 100%;
        max-width: 400px;
        padding: 10px 16px 10px 40px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        font-size: 14px;
        margin-bottom: 16px;
        transition: all 0.2s ease;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%236b7280"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /></svg>') no-repeat 12px center;
        background-size: 16px;
    }

    .search-box:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

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

    .stat-card {
        background: #ffffff;
        padding: 24px;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        transition: all 0.2s ease;
    }

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    }

    .stat-number {
        font-size: 28px;
        font-weight: 700;
        color: #1a202c;
        margin-bottom: 4px;
        line-height: 1;
    }

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

    .stat-card.primary .stat-number { color: #3b82f6; }
    .stat-card.success .stat-number { color: #10b981; }
    .stat-card.warning .stat-number { color: #f59e0b; }
    .stat-card.danger .stat-number { color: #ef4444; }

/* Modal - CSS với !important force override */
.modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 9999 !important;
    backdrop-filter: blur(4px) !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

.modal-content {
    background: #ffffff !important;
    border-radius: 12px !important;
    max-width: 600px !important;
    width: 100% !important;
    margin: 50px auto !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    border: 1px solid #e5e7eb !important;
    position: relative !important;
    max-height: calc(100vh - 100px) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;    padding: 0!important;
}

.modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: #f8fafc !important;
    border-radius: 12px 12px 0 0 !important;
    flex-shrink: 0 !important;
}

.modal-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #1a202c !important;
    margin: 0 !important;
}

.modal-body {
    padding: 24px !important;
    background: #ffffff !important;
    border-radius: 0 0 12px 12px !important;
    overflow-y: auto !important;
    flex: 1 !important;
}

.close-btn {
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    padding: 8px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.close-btn:hover {
    color: #374151 !important;
    background: #f3f4f6 !important;
}

/* Mobile modal */
@media (max-width: 768px) {
    .modal {
        padding: 10px !important;
    }
    
    .modal-content {
        margin: 20px auto !important;
        max-height: calc(100vh - 40px) !important;
        width: calc(100% - 20px) !important;
    }

    .modal-header,
    .modal-body {
        padding: 16px !important;
    }
    
    .modal-title {
        font-size: 16px !important;
    }
}

/* Đảm bảo modal hiển thị trên tất cả elements */
body.modal-open {
    overflow: hidden !important;
}

/* Modal visible state */
.modal[style*="display: block"] {
    display: block !important;
}

/* Dashboard responsive fixes */
@media (max-width: 768px) {
    /* Dashboard charts - stack panels vertically on mobile */
    #dashboardCharts > div:first-child {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        margin-top: 16px !important;
    }
    
    /* Notification panel mobile */
    #notificationsPanel > div {
        padding: 16px !important;
        margin-bottom: 16px !important;
    }
    
    #notificationsPanel h4 {
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }
    
    #notificationsPanel .btn-sm {
        padding: 4px 8px !important;
        font-size: 10px !important;
    }
    
    /* Appointments panel mobile */
    #appointmentsPanel > div {
        padding: 16px !important;
    }
    
    #appointmentsPanel h4 {
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }
    
    /* Notification items mobile */
    .notification-item,
    #notificationsPanel > div > div[style*="border-left"] {
        padding: 12px !important;
        margin-bottom: 8px !important;
        border-radius: 6px !important;
    }
    
    .notification-item strong,
    #notificationsPanel strong {
        font-size: 12px !important;
    }
    
    .notification-item div[style*="color: #6b7280"],
    #notificationsPanel div[style*="color: #6b7280"] {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }
    
    /* Appointment items mobile */
    #appointmentsPanel div[style*="border: 1px solid"] {
        padding: 12px !important;
        margin-bottom: 8px !important;
    }
    
    #appointmentsPanel div[style*="font-weight: 600"] {
        font-size: 12px !important;
        line-height: 1.3 !important;
    }
    
    #appointmentsPanel div[style*="font-size: 13px"] {
        font-size: 11px !important;
    }
    
    /* Button actions mobile */
    #appointmentsPanel .btn-sm,
    #notificationsPanel .btn-sm {
        padding: 3px 6px !important;
        font-size: 9px !important;
        margin: 2px !important;
    }
    
    /* Status badges mobile */
    .status-badge,
    span[style*="background:"] {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }
    
    /* Recent activities mobile */
    #recentActivitiesPanel > div {
        padding: 16px !important;
    }
    
    #recentActivitiesPanel h4 {
        font-size: 14px !important;
    }
    
    #recentActivitiesPanel h5 {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }
    
    #recentActivitiesPanel div[style*="max-height: 250px"] {
        max-height: 200px !important;
    }
    
    #recentActivitiesPanel div[style*="font-weight: 500"] {
        font-size: 11px !important;
    }
    
    #recentActivitiesPanel div[style*="font-size: 11px"] {
        font-size: 10px !important;
    }
    
    #recentActivitiesPanel div[style*="font-size: 10px"] {
        font-size: 9px !important;
    }
}

@media (max-width: 480px) {
    /* Extra small mobile adjustments */
    #dashboardCharts {
        margin-top: 12px !important;
    }
    
    .stats-grid {
        gap: 8px !important;
    }
    
    .stat-card {
        padding: 16px !important;
    }
    
    .stat-number {
        font-size: 20px !important;
    }
    
    .stat-label {
        font-size: 12px !important;
    }
}

    /* Notifications */
    .notification {
        position: fixed;
        top: 90px;
        right: 20px;
        z-index: 1100;
        max-width: 400px;
        padding: 16px 20px;
        border-radius: 8px;
        font-weight: 500;
        font-size: 14px;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        animation: slideInRight 0.3s ease;
        border-left: 4px solid;
    }

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

    .notification.success {
        background: #f0fdf4;
        color: #166534;
        border-left-color: #10b981;
    }

    .notification.error {
        background: #fef2f2;
        color: #991b1b;
        border-left-color: #ef4444;
    }

    .notification.warning {
        background: #fffbeb;
        color: #92400e;
        border-left-color: #f59e0b;
    }

    .notification.info {
        background: #eff6ff;
        color: #1e40af;
        border-left-color: #3b82f6;
    }

    /* Mini Clock */
    .mini-clock {
        background: #f8fafc;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 8px 12px;
        text-align: center;
        min-width: 85px;
    }

    .clock-time {
        font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
        font-size: 14px;
        font-weight: 600;
        color: #1a202c;
        line-height: 1;
    }

    .clock-date {
        font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
        font-size: 11px;
        color: #6b7280;
        line-height: 1;
        margin-top: 2px;
    }

    /* Footer */
    .main-footer {
        background: #ffffff;
        border-top: 1px solid #e2e8f0;
        padding: 20px 0;
        margin-top: auto;
    }

    .footer-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
        text-align: center;
        color: #6b7280;
        font-size: 14px;
    }

    .footer-container a {
        color: #3b82f6;
        text-decoration: none;
        font-weight: 500;
    }

    .footer-container a:hover {
        color: #1d4ed8;
    }

    /* Status badges */
    .status-badge {
        display: inline-flex;
        align-items: center;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .status-active { 
        background: #dcfce7; 
        color: #166534; 
    }
    
    .status-inactive { 
        background: #fef2f2; 
        color: #991b1b; 
    }
    
    .status-warning { 
        background: #fef3c7; 
        color: #92400e; 
    }
    
    .status-info { 
        background: #dbeafe; 
        color: #1e40af; 
    }

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

    .loading-spinner {
        width: 16px;
        height: 16px;
        border: 2px solid rgba(59, 130, 246, 0.2);
        border-top: 2px solid #3b82f6;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

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

    /* Responsive Design */
    @media (max-width: 1024px) {
        .content-wrapper {
            flex-direction: column;
        }

        .sidebar {
            width: 100%;
            position: static;
            order: 1;
        }

        .content-area {
            order: 2;
        }

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

    @media (max-width: 768px) {
        .header-container {
            padding: 8px 12px;
            height: auto;
            min-height: 50px;
            flex-direction: row;
            gap: 8px;
            align-items: center;
            justify-content: space-between;
        }

        .header-logo {
            font-size: 16px;
        }

        .header-logo span {
            display: none;
        }

        .header-logo .logo-icon {
            width: 32px;
            height: 32px;
            font-size: 16px;
        }

        .actions {
            gap: 6px;
            flex-wrap: nowrap;
        }

        /* Ẩn đồng hồ trên mobile */
        .mini-clock {
            display: none;
        }

        /* Ẩn nút xuất/nhập dữ liệu trên mobile */
        .actions .btn:nth-child(4),
        .actions .btn:nth-child(5) {
            display: none;
        }

        /* Kho ứng dụng chỉ có icon */
        .actions .btn-info span {
            display: none;
        }

        .content-wrapper {
            padding: 12px;
            gap: 12px;
        }

        .content-header {
            padding: 16px;
            flex-direction: column;
            gap: 12px;
            align-items: stretch;
        }

        .content-body {
            padding: 16px;
        }

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

        .modal-content {
            width: 95%;
            margin: 16px;
        }

        .modal-header,
        .modal-body {
            padding: 16px;
        }

        .nav-item {
            padding: 12px 16px;
            font-size: 14px;
        }

        .sidebar {
            margin-bottom: 16px;
        }

        .btn {
            padding: 6px 8px;
            font-size: 11px;
            white-space: nowrap;
        }

        .btn-sm {
            padding: 4px 6px;
            font-size: 10px;
        }

        .btn i {
            font-size: 12px;
        }

        /* Tối ưu user info trên mobile */
        #userInfo span:first-child {
            display: none;
        }
    }

    @media (max-width: 480px) {
        .stats-grid {
            grid-template-columns: 1fr;
        }

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

        .btn-sm {
            padding: 4px 8px;
            font-size: 11px;
        }
    }

    /* Print Styles */
    @media print {
        .main-header,
        .main-footer,
        .sidebar,
        .actions {
            display: none !important;
        }
        
        .content-wrapper {
            max-width: none;
            padding: 0;
        }
        
        .content-area {
            border: none;
            border-radius: 0;
        }

        body * {
            visibility: hidden;
        }
        .print-area, .print-area * {
            visibility: visible;
        }
        .print-area {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
        }

    }




