/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #9083D5;
    --secondary-color: #807593;
    --success-color: #0FB800;
    --warning-color: #FFA800;
    --danger-color: #FF3B3B;
    --info-color: #3B72FF;
    --bg-light: #F4F5F7;
    --bg-white: #ffffff;
    --text-dark: #181C25;
    --text-light: #636E72;
    --text-muted: #8992A9;
    --border-color: #E3EBFF;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(88deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    color: white;
}

.logo-image {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    padding: 2px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
}

.nav-icon {
    font-size: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    width: calc(100% - 260px);
}

/* Header */
.header {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-notification {
    background: var(--bg-light);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-notification:hover {
    background: var(--primary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: var(--bg-light);
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.user-name {
    font-weight: 600;
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.stat-card-blue .stat-icon {
    background: rgba(59, 114, 255, 0.1);
}

.stat-card-green .stat-icon {
    background: rgba(15, 184, 0, 0.1);
}

.stat-card-orange .stat-icon {
    background: rgba(255, 168, 0, 0.1);
}

.stat-card-red .stat-icon {
    background: rgba(255, 59, 59, 0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Card */
.card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.chart-card canvas {
    max-height: 300px;
}

/* Appointments List */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.appointment-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.appointment-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.appointment-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(8deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(144, 131, 213, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 59, 59, 0.3);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 13px;
    border-radius: 8px;
}

.btn-edit {
    background: rgba(59, 114, 255, 0.1);
    color: var(--info-color);
}

.btn-delete {
    background: rgba(255, 59, 59, 0.1);
    color: var(--danger-color);
}

/* Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-light);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.status-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: rgba(255, 168, 0, 0.1);
    color: var(--warning-color);
}

.status-confirmed {
    background: rgba(59, 114, 255, 0.1);
    color: var(--info-color);
}

.status-completed {
    background: rgba(15, 184, 0, 0.1);
    color: var(--success-color);
}

.status-cancelled {
    background: rgba(255, 59, 59, 0.1);
    color: var(--danger-color);
}

/* Doctors Grid */
.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.doctor-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
}

.doctor-card:hover {
    transform: translateY(-5px);
}

.doctor-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.doctor-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.doctor-card .specialization {
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 1rem;
}

.doctor-card .info-item {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.doctor-card .actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Profile Page */
.profile-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.profile-card {
    grid-column: 1 / -1;
    text-align: center;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(144, 131, 213, 0.3);
}

.profile-info {
    padding: 1rem 0;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.profile-role {
    color: var(--text-light);
    font-size: 16px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.activity-item:last-child {
    margin-bottom: 0;
}

.activity-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
}

.activity-info {
    flex: 1;
}

.activity-text {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.activity-subtext {
    color: var(--text-light);
    font-size: 14px;
}

/* Reports Page */
.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.report-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.report-select {
    width: 200px;
    padding: 0.75rem;
}

/* Billing Styles */
.billing-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.billing-tab {
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.billing-tab:hover {
    color: var(--primary-color);
}

.billing-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.billing-tab-content {
    display: none;
}

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

.report-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    min-height: 500px;
}

.report-preview {
    width: 100%;
}

.report-placeholder {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.placeholder-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 1rem;
}

.report-placeholder h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.report-section {
    margin-bottom: 2rem;
}

.report-section:last-child {
    margin-bottom: 0;
}

.report-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.report-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 1.5rem 0 1rem;
    padding-left: 10px;
    border-left: 4px solid var(--primary-color);
}

.report-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 1rem;
}

.report-meta-item {
    display: flex;
    flex-direction: column;
}

.report-meta-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.report-meta-value {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 600;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.report-table th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.report-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

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

.report-table tr:hover {
    background: var(--bg-light);
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.report-summary-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.report-summary-card h4 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.report-summary-card p {
    font-size: 14px;
    opacity: 0.9;
}

/* Print Styles */
.print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.print-logo h1 {
    color: var(--primary-color);
    font-size: 24px;
}

.print-info {
    text-align: right;
}

.print-info p {
    margin: 0.25rem 0;
    font-size: 14px;
}

.print-footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
}

.print-footer p {
    margin: 0.25rem 0;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    #print-template,
    #print-template * {
        visibility: visible;
    }
    
    #print-template {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
        padding: 20px;
    }
    
    .report-table th {
        background: #9083D5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .report-summary-card {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(144, 131, 213, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-cancel {
    background: transparent;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-container {
        grid-template-columns: 1fr;
    }
    
    .reports-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .report-actions {
        width: 100%;
    }
    
    .report-select {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        padding: 1rem 0.5rem;
    }
    
    .logo-text {
        display: none;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
    }
    
    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
        padding: 1rem;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .report-actions {
        flex-direction: column;
    }
    
    .report-actions button {
        width: 100%;
    }
    
    .report-table {
        font-size: 12px;
    }
    
    .report-table th,
    .report-table td {
        padding: 8px;
    }
    
    .report-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
