/* ============================================
   GestRDV - Gestion de Rendez-vous
   FullDevSolutions - Demo
   ============================================ */

/* Variables */
:root {
    --color-primary: #4F46E5;
    --color-primary-light: #6366F1;
    --color-primary-dark: #4338CA;
    --color-secondary: #10B981;
    --color-accent: #F59E0B;
    --color-danger: #EF4444;
    --color-bg: #F3F4F6;
    --color-bg-dark: #1F2937;
    --color-sidebar: #111827;
    --color-card: #FFFFFF;
    --color-text: #1F2937;
    --color-text-light: #6B7280;
    --color-text-muted: #9CA3AF;
    --color-border: #E5E7EB;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ============================================
   App Layout
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: 260px;
    background: var(--color-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.logo-text .accent {
    color: var(--color-primary-light);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
}

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

.nav-item.active {
    background: var(--color-primary);
    color: #fff;
}

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

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--color-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #fff;
    font-weight: 500;
}

.user-role {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

/* ============================================
   Top Bar
   ============================================ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    cursor: pointer;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: var(--transition);
}

.page-title h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 2px;
}

.page-title p {
    color: var(--color-text-light);
    font-size: 13px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    min-width: 280px;
}

.search-icon {
    font-size: 16px;
    color: var(--color-text-muted);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    color: var(--color-text);
}

.search-box input::placeholder {
    color: var(--color-text-muted);
}

.btn-notification {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    font-size: 18px;
    transition: var(--transition);
}

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

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--color-danger);
    border-radius: 50%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

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

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    background: var(--color-bg);
}

/* ============================================
   Dashboard Content
   ============================================ */
.dashboard-content {
    padding: 32px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 22px;
}

.stat-icon.blue {
    background: #EEF2FF;
    color: var(--color-primary);
}

.stat-icon.green {
    background: #ECFDF5;
    color: var(--color-secondary);
}

.stat-icon.purple {
    background: #F5F3FF;
    color: #8B5CF6;
}

.stat-icon.orange {
    background: #FFF7ED;
    color: var(--color-accent);
}

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2px;
}

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

.stat-trend {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.stat-trend.up {
    background: #ECFDF5;
    color: var(--color-secondary);
}

.stat-trend.down {
    background: #FEF2F2;
    color: var(--color-danger);
}

/* Cards */
.card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-content {
    padding: 20px 24px;
}

.date-badge, .period-badge {
    padding: 6px 12px;
    background: var(--color-bg);
    color: var(--color-text-light);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
}

.view-all {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 13px;
}

.view-all:hover {
    text-decoration: underline;
}

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* Schedule / Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.timeline-item:hover {
    background: var(--color-bg);
}

.timeline-item.current {
    background: #EEF2FF;
    border-left: 3px solid var(--color-primary);
}

.timeline-item.completed {
    opacity: 0.6;
}

.timeline-time {
    width: 50px;
    font-weight: 600;
    color: var(--color-text-light);
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.timeline-header .client-name {
    font-weight: 600;
}

.status-badge {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
}

.status-badge.completed {
    background: #ECFDF5;
    color: var(--color-secondary);
}

.status-badge.current {
    background: #EEF2FF;
    color: var(--color-primary);
}

.status-badge.upcoming {
    background: var(--color-bg);
    color: var(--color-text-light);
}

.timeline-content .service-name {
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 4px;
}

.timeline-content .duration {
    font-size: 13px;
    color: var(--color-text-light);
}

/* Mini Calendar */
.calendar-nav {
    display: flex;
    gap: 8px;
}

.cal-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    color: var(--color-text-light);
    transition: var(--transition);
}

.cal-nav-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.mini-calendar {
    margin-bottom: 24px;
}

.cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 12px;
}

.cal-header span {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-light);
    padding: 8px 0;
}

.cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 4px;
}

.cal-body span {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    margin: 0 auto;
}

.cal-body span:hover {
    background: var(--color-bg);
}

.cal-body span.other-month {
    color: var(--color-text-muted);
}

.cal-body span.today {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.cal-body span.has-events::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
}

.cal-body span.has-events {
    position: relative;
}

.cal-body span.today.has-events::after {
    background: #fff;
}

.cal-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.cal-stat {
    text-align: center;
}

.cal-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.cal-stat-label {
    font-size: 12px;
    color: var(--color-text-light);
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Clients List */
.clients-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.client-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.client-item:hover {
    background: var(--color-bg);
}

.client-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.client-info {
    flex: 1;
    min-width: 0;
}

.client-info .client-name {
    display: block;
    font-weight: 500;
    margin-bottom: 2px;
}

.client-email {
    font-size: 12px;
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-meta .last-visit {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Services Stats */
.services-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.service-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-stat .service-info {
    display: flex;
    justify-content: space-between;
}

.service-stat .service-name {
    font-weight: 500;
}

.service-stat .service-count {
    font-size: 13px;
    color: var(--color-text-light);
}

.service-bar {
    height: 6px;
    background: var(--color-bg);
    border-radius: 3px;
    overflow: hidden;
}

.service-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Reminders */
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminder-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

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

.reminder-info {
    flex: 1;
}

.reminder-client {
    display: block;
    font-weight: 500;
    margin-bottom: 2px;
}

.reminder-time {
    font-size: 12px;
    color: var(--color-text-light);
}

.btn-send {
    padding: 8px 16px;
    background: var(--color-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

/* Dashboard Footer */
.dashboard-footer {
    text-align: center;
    padding: 32px;
    color: var(--color-text-muted);
    font-size: 13px;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 200;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 500px;
    max-width: 95%;
    max-height: 90vh;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 201;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

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

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

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

    .menu-toggle {
        display: flex;
    }

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

    .search-box {
        display: none;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 16px 20px;
    }

    .topbar-right .btn span:last-child {
        display: none;
    }

    .dashboard-content {
        padding: 20px;
    }

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

    .stat-card {
        padding: 20px;
    }

    .card-header,
    .card-content {
        padding: 16px 20px;
    }

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

@media (max-width: 480px) {
    .page-title h1 {
        font-size: 18px;
    }

    .stat-value {
        font-size: 20px;
    }

    .timeline-item {
        flex-direction: column;
        gap: 8px;
    }

    .timeline-time {
        width: auto;
    }
}

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

.stat-card,
.card {
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }

.main-grid .card:nth-child(1) { animation-delay: 0.3s; }
.main-grid .card:nth-child(2) { animation-delay: 0.35s; }

.bottom-grid .card:nth-child(1) { animation-delay: 0.4s; }
.bottom-grid .card:nth-child(2) { animation-delay: 0.45s; }
.bottom-grid .card:nth-child(3) { animation-delay: 0.5s; }

/* ============================================
   Calendar Selected State
   ============================================ */
.cal-body span.selected {
    background: var(--color-primary-light) !important;
    color: #fff !important;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-light);
}

.empty-state .empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 20px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--color-sidebar);
    color: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 300;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.toast-success .toast-icon {
    background: var(--color-secondary);
}

.toast-error .toast-icon {
    background: var(--color-danger);
}

.toast-warning .toast-icon {
    background: var(--color-accent);
}

.toast-info .toast-icon {
    background: var(--color-primary);
}

.toast-message {
    font-size: 14px;
}

/* ============================================
   Detail Modal
   ============================================ */
.detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 250;
}

.detail-modal.active {
    opacity: 1;
    visibility: visible;
}

.detail-modal-content {
    width: 420px;
    max-width: 95%;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: var(--transition);
}

.detail-modal.active .detail-modal-content {
    transform: scale(1);
}

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

.detail-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.detail-modal-body {
    padding: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

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

.detail-label {
    color: var(--color-text-light);
}

.detail-value {
    font-weight: 500;
}

.detail-value.status-terminé { color: var(--color-secondary); }
.detail-value.status-en-cours { color: var(--color-primary); }
.detail-value.status-à-venir { color: var(--color-text-light); }

.detail-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

/* Client Profile in Modal */
.client-profile {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.client-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    margin: 0 auto 12px;
}

.client-profile h4 {
    font-size: 18px;
}

/* ============================================
   Notifications Panel
   ============================================ */
.notifications-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: 8px;
    overflow: hidden;
    z-index: 100;
    animation: slideDown 0.2s ease;
}

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

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

.notif-header h4 {
    font-size: 16px;
    font-weight: 600;
}

.notif-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.notif-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}

.notif-item:hover {
    background: var(--color-bg);
}

.notif-item.unread {
    background: #EEF2FF;
}

.notif-item.unread:hover {
    background: #E0E7FF;
}

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

.notif-content p {
    font-weight: 500;
    margin-bottom: 4px;
}

.notif-time {
    font-size: 12px;
    color: var(--color-text-muted);
}

.notif-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.notif-footer a {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 13px;
}

.notif-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Search Dropdown
   ============================================ */
.search-box {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 8px;
    overflow: hidden;
    z-index: 100;
    animation: slideDown 0.2s ease;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.search-result:hover {
    background: var(--color-bg);
}

.search-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.search-info {
    display: flex;
    flex-direction: column;
}

.search-name {
    font-weight: 500;
}

.search-email {
    font-size: 12px;
    color: var(--color-text-light);
}

/* ============================================
   Footer with Logo
   ============================================ */
.dashboard-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 32px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.dashboard-footer img {
    height: 20px;
    width: auto;
    opacity: 0.6;
}

.dashboard-footer a {
    color: var(--color-primary);
    transition: var(--transition);
}

.dashboard-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Page Views - Navigation Pages
   ============================================ */
.page-view {
    animation: fadeIn 0.3s ease;
}

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

.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-actions h3 {
    margin: 0;
    font-size: 18px;
}

.filters {
    display: flex;
    gap: 12px;
}

.filters select {
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: white;
    font-size: 14px;
    cursor: pointer;
}

.search-large {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0 16px;
    min-width: 300px;
}

.search-large input {
    border: none;
    padding: 12px;
    flex: 1;
    font-size: 14px;
}

.search-large input:focus {
    outline: none;
}

/* Calendar View */
.calendar-view {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
}

.calendar-full {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

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

.calendar-header-full h2 {
    margin: 0;
    font-size: 20px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.calendar-weekdays span {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-light);
    padding: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-day {
    padding: 12px 8px;
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    min-height: 70px;
}

.cal-day:hover:not(.other-month) {
    background: var(--color-bg);
}

.cal-day.other-month {
    color: var(--color-text-muted);
    cursor: default;
}

.cal-day.today {
    background: var(--color-primary);
    color: white;
}

.cal-day.selected {
    background: var(--color-primary-light);
    border: 2px solid var(--color-primary);
}

.cal-day.has-events::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
    margin: 4px auto 0;
}

.cal-day.today.has-events::after {
    background: white;
}

.day-num {
    font-weight: 500;
}

.event-count {
    display: block;
    font-size: 11px;
    color: var(--color-text-light);
    margin-top: 4px;
}

.calendar-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.calendar-sidebar h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
}

.day-appointments {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-apt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.day-apt-item.completed { opacity: 0.6; }
.day-apt-item.current { background: var(--color-primary-light); }

.apt-time {
    font-weight: 600;
    font-size: 14px;
    min-width: 50px;
}

.apt-info {
    flex: 1;
}

.apt-client {
    display: block;
    font-weight: 500;
}

.apt-service {
    font-size: 12px;
    color: var(--color-text-light);
}

.apt-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--color-bg);
}

.empty-message {
    text-align: center;
    color: var(--color-text-muted);
    padding: 40px 20px;
}

/* Appointments View */
.appointments-view {
    padding: 0;
}

.appointments-list {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.apt-list-item {
    display: grid;
    grid-template-columns: 80px 70px 1fr 1fr 120px 80px;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: var(--transition);
}

.apt-list-item:hover {
    background: var(--color-bg);
}

.apt-list-item.completed {
    opacity: 0.6;
}

.apt-date {
    font-weight: 600;
    color: var(--color-primary);
}

.apt-time-col {
    font-weight: 500;
}

.apt-client-col {
    font-weight: 500;
}

.apt-service-col {
    color: var(--color-text-light);
}

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

.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--color-bg);
}

/* Clients View */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.client-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.client-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.client-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    margin: 0 auto 16px;
}

.client-card h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.client-card-email, .client-card-phone {
    font-size: 13px;
    color: var(--color-text-light);
    margin: 4px 0;
}

.client-card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Services View */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.service-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.service-card-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-card-header h4 {
    margin: 0;
    font-size: 16px;
}

.service-price {
    font-weight: 700;
    font-size: 18px;
    color: var(--color-primary);
}

.service-card-body {
    padding: 0 20px 16px;
}

.service-card-body p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--color-text-light);
}

.service-card-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 12px;
}

.btn-small {
    padding: 8px 16px !important;
    font-size: 13px !important;
}

/* Stats View */
.stats-period {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.period-btn {
    padding: 10px 20px;
    border: 1px solid var(--color-border);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.period-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.stats-cards-large {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card-large {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon-large {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon-large.blue { background: #EFF6FF; }
.stat-icon-large.green { background: #ECFDF5; }
.stat-icon-large.purple { background: #F5F3FF; }
.stat-icon-large.orange { background: #FFF7ED; }

.stat-info-large {
    flex: 1;
}

.stat-value-large {
    display: block;
    font-size: 28px;
    font-weight: 700;
}

.stat-label-large {
    font-size: 13px;
    color: var(--color-text-light);
}

.stat-trend-large {
    font-size: 14px;
    font-weight: 600;
}

.stat-trend-large.up { color: var(--color-success); }

.stats-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.chart-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    height: 200px;
    padding-top: 20px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 10px;
    transition: height 0.5s ease;
}

.chart-bar span {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--color-text-light);
}

.services-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.breakdown-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.breakdown-item strong {
    margin-left: auto;
}

/* Settings View */
.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.settings-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 400px;
}

.settings-form .form-group {
    margin: 0;
}

.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-border);
    border-radius: 26px;
    transition: var(--transition);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: var(--color-primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.schedule-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin-bottom: 20px;
}

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

.schedule-row span:first-child {
    min-width: 80px;
    font-weight: 500;
}

.schedule-row input[type="time"] {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.schedule-row.closed {
    color: var(--color-text-muted);
}

.closed-label {
    color: var(--color-danger);
}

/* Responsive */
@media (max-width: 1024px) {
    .calendar-view {
        grid-template-columns: 1fr;
    }

    .apt-list-item {
        grid-template-columns: 1fr 1fr;
    }

    .apt-date, .apt-time-col {
        grid-column: 1;
    }

    .apt-client-col, .apt-service-col {
        grid-column: 2;
    }

    .apt-status-col, .apt-actions {
        grid-column: span 2;
    }

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

@media (max-width: 768px) {
    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-large {
        min-width: auto;
    }

    .filters {
        flex-direction: column;
    }

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

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