/* Invoice Modal/Form Customizations */
.invoice-item input,
.invoice-item button {
    margin-bottom: 0 !important;
}

#invoiceModal .modal-content {
    max-width: 100vw;
    width: 100%;
    padding: 0;
}

#invoiceModal form {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    #invoiceModal .modal-content {
        max-width: 98vw;
        min-width: 0;
        border-radius: 0.5rem;
    }
    .invoice-item {
        grid-template-columns: 1fr !important;
    }
    #invoiceModal form > .grid,
    #invoiceModal form > .mb-4 {
        margin-bottom: 1rem !important;
    }
}
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.hospital-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-block {
    width: 100%;
}

.login-footer {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
}

.login-footer p {
    margin-bottom: 8px;
    color: var(--text-dark);
}

.login-footer p strong {
    color: var(--text-dark);
}

.login-footer code {
    background-color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    color: var(--primary-color);
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 15px;
    display: none;
}

.alert-hidden {
    display: none !important;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    display: block;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: block;
}

/* Dashboard Page */
.dashboard-page {
    display: flex;
    height: 100vh;
}

.dashboard-container {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--text-dark);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.logo i {
    font-size: 28px;
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background-color: rgba(37, 99, 235, 0.2);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.logout-btn:hover {
    color: var(--danger-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background-color: white;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 28px;
    color: var(--text-dark);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info span {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.user-info small {
    color: var(--text-light);
    font-size: 12px;
}

.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Statistics Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-icon.patients {
    background-color: #dbeafe;
    color: var(--primary-color);
}

.stat-icon.doctors {
    background-color: #dcfce7;
    color: var(--success-color);
}

.stat-icon.appointments {
    background-color: #fef3c7;
    color: var(--warning-color);
}

.stat-icon.pending {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.stat-content h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Recent Section */
.recent-section {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 20px;
    color: var(--text-dark);
}

.view-all-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s;
}

.view-all-btn:hover {
    color: #1d4ed8;
}

/* Table */
.appointments-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: var(--light-bg);
}

th {
    text-align: left;
    padding: 12px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

tbody tr:hover {
    background-color: var(--light-bg);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-completed {
    background-color: #dcfce7;
    color: #15803d;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.text-center {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0;
    }

    .nav-item {
        flex-shrink: 0;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 12px 16px;
    }

    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }

    .sidebar-footer {
        display: none;
    }

    .stats-section {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        margin: 0 auto;
    }

    .header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .appointments-table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }

    .stat-card {
        padding: 16px;
    }

    .dashboard-content {
        padding: 12px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
