/* ===== CUSTOMER DASHBOARD PRO - POLISHED & PROFESSIONAL ===== */

:root {
    --primary-dark: #1a1a1a;
    --primary-light: #ffffff;
    --accent: #2a2a2a;
    --accent-hover: #1a1a1a;
    --text-dark: #1a1a1a;
    --text-muted: #666666;
    --text-light: #999999;
    --border-light: #e0e0e0;
    --bg-light: #f9f9f9;
    --bg-white: #ffffff;
    --bg-gray: #f5f5f5;
    --success: #333333;
    --warning: #666666;
    --danger: #666666;
    --info: #444444;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* ===== PAGE WRAPPER ===== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ===== SIDEBAR ===== */
.dashboard-sidebar {
    width: 260px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-light);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 32px 24px 28px;
    border-bottom: 1px solid var(--border-light);
}

.brand-logo {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.brand-tagline {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.sidebar-nav {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.sidebar-nav-item {
    margin-bottom: 8px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    gap: 12px;
}

.sidebar-nav-link:hover {
    background-color: var(--bg-gray);
    color: var(--accent);
}

.sidebar-nav-link.active {
    background-color: #f0f0f0;
    color: var(--accent);
}

.sidebar-nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
}

.sidebar-tagline {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.6;
}

/* ===== MAIN CONTENT ===== */
.dashboard-main {
    margin-left: 260px;
    flex: 1;
    background-color: var(--bg-light);
}

/* ===== HEADER BAR ===== */
.dashboard-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 500;
}

.header-title-area h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.header-title-area p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

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

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--bg-gray);
    color: var(--text-dark);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.header-icon-btn:hover {
    background-color: var(--border-light);
}

/* ===== CONTENT AREA ===== */
.dashboard-content {
    padding: 24px 28px;
    max-width: 1400px;
}

/* ===== SECTION HEADER ===== */
.section-header {
    margin-bottom: 28px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

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

/* ===== WELCOME SECTION ===== */
.welcome-section {
    margin-bottom: 32px;
}

.welcome-text h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.15;
}

.welcome-text p {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    position: relative;
    background: var(--bg-white);
    padding: 28px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2a2a2a, transparent);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.stat-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0;
}

.stat-card-icon {
    font-size: 24px;
    color: var(--accent);
}

.stat-card-content {
    margin-bottom: 20px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.stat-value-detail {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.stat-progress {
    margin-top: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.progress-label-text {
    color: var(--text-muted);
    font-weight: 500;
}

.progress-label-value {
    color: var(--text-dark);
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: var(--bg-gray);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2a2a2a, #555555);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.stat-card-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
}

.stat-action-link {
    color: #2a2a2a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.stat-action-link:hover {
    gap: 10px;
}

/* ===== CHARTS SECTION ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-white);
    padding: 28px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: var(--shadow-md);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.chart-card-actions {
    display: flex;
    gap: 8px;
}

.chart-filter-btn {
    padding: 6px 12px;
    background: var(--bg-gray);
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-filter-btn:hover {
    background-color: var(--border-light);
    color: var(--text-dark);
}

.chart-canvas-container {
    position: relative;
    height: 300px;
    margin-bottom: 16px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.chart-legend-indicator {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* ===== RECENT ORDERS SECTION ===== */
.recent-orders-section {
    margin-bottom: 32px;
}

.section-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.view-all-link {
    color: #2a2a2a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.view-all-link:hover {
    gap: 10px;
}

.orders-table {
    width: 100%;
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.orders-table-header {
    background-color: var(--bg-gray);
    border-bottom: 1px solid var(--border-light);
}

.orders-table-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px 120px;
    align-items: center;
    padding: 0;
    border-bottom: 1px solid var(--border-light);
}

.orders-table-row:last-child {
    border-bottom: none;
}

.orders-table-header .orders-table-row {
    background-color: var(--bg-gray);
}

.orders-table-cell {
    padding: 16px 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.orders-table-header .orders-table-cell {
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.3px;
}

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

.order-product-image {
    width: 64px;
    height: 64px;
    background-color: var(--bg-gray);
    border-radius: 8px;
    overflow: hidden;
}

.order-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-product-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.order-product-info p {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

.order-date {
    color: var(--text-muted);
}

.order-amount {
    font-weight: 600;
    color: var(--text-dark);
}

.order-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.status-delivered {
    background-color: #e8e8e8;
    color: #333333;
}

.status-pending {
    background-color: #f5f5f5;
    color: #555555;
}

.status-cancelled {
    background-color: #f0f0f0;
    color: #666666;
}

.orders-table-row:hover {
    background-color: var(--bg-light);
}

.table-more {
    padding: 20px;
    text-align: center;
}

.table-more-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

/* ===== PRODUCT CATALOG SECTION ===== */
.product-catalog-section {
    margin-bottom: 32px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: var(--bg-gray);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f7f6f4;
}

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
    min-height: 28px;
}

.product-price {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.product-credits {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #333333;
    font-weight: 600;
    background-color: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 12px;
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.product-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-btn-primary {
    background-color: var(--accent);
    color: var(--bg-white);
}

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

.product-btn-secondary {
    background-color: var(--bg-gray);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

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

/* ===== DOCTOR SECTION ===== */
.doctors-section {
    margin-bottom: 32px;
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.doctor-card {
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.doctor-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.doctor-avatar {
    width: 100px;
    height: 100px;
    background-color: var(--bg-gray);
    border-radius: 50%;
    margin: 0 auto 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
}

.doctor-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.doctor-specialty {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.doctor-rating {
    font-size: 12px;
    color: #666666;
    margin-bottom: 16px;
}

.doctor-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--accent);
    color: var(--bg-white);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.doctor-btn:hover {
    background-color: var(--accent-hover);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .dashboard-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        flex-direction: row;
    }

    .sidebar-header {
        padding: 16px 24px;
        border-bottom: none;
        border-right: 1px solid var(--border-light);
    }

    .sidebar-nav {
        padding: 0;
        display: flex;
        gap: 4px;
        flex: 1;
        overflow-x: auto;
    }

    .sidebar-nav-item {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .sidebar-footer {
        display: none;
    }

    .dashboard-main {
        margin-left: 0;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .dashboard-content {
        padding: 20px;
    }

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

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

    .orders-table-row {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .doctors-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.stat-card,
.chart-card,
.orders-table,
.product-card,
.doctor-card {
    animation: slideInUp 0.4s ease-out;
}

/* ===== CUSTOMER VIEW REFINEMENTS ===== */
.customer-page {
    min-width: 0;
}

.customer-page :is(.card, .stat-card, .chart-card, .orders-table, .product-card, .doctor-card, .summary-card) {
    min-width: 0;
}

.customer-page :is(p, li, td, th, label, input, select, textarea, button):not(.cp *) {
    font-size: 0.95rem;
}

.customer-page :is(.btn, .button, .action-btn, .submit-btn, .apply-btn, .activation-btn):not(.cp *) {
    font-size: 0.92rem;
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 18px 16px;
    }

    .section-header {
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .welcome-text h2 {
        font-size: 22px;
    }

    .stat-card {
        padding: 20px;
    }

    .stats-grid {
        gap: 16px;
    }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
