:root {
    --sidebar-width: 250px;
    --sidebar-collapsed: 60px;
    --primary-color: #0d6efd;
    --medical-blue: #1a73e8;
    --medical-green: #34a853;
    --medical-red: #ea4335;
    --medical-orange: #fbbc04;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
    position: fixed;
    z-index: 1000;
}

#sidebar.collapsed {
    min-width: var(--sidebar-collapsed);
    max-width: var(--sidebar-collapsed);
}

#sidebar.collapsed .sidebar-text {
    display: none;
}

#sidebar.collapsed .sidebar-header a {
    justify-content: center;
}

#sidebar .nav-link {
    border-radius: 8px;
    margin: 2px 0;
    padding: 10px 12px;
    transition: all 0.2s;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

#page-content-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

#page-content-wrapper.expanded {
    margin-left: var(--sidebar-collapsed);
}

/* Dashboard Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

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

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

/* Status Badges */
.badge-status {
    padding: 0.4em 0.8em;
    font-weight: 500;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--medical-blue);
    box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.15);
}

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

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    padding-left: 38px;
    border-radius: 8px;
}

/* Patient Avatar */
.patient-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--medical-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.patient-avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 1.8rem;
}

/* Appointment Status Colors */
.status-confirmed { color: #34a853; }
.status-waiting { color: #fbbc04; }
.status-cancelled { color: #ea4335; }
.status-finished { color: #6c757d; }
.status-absent { color: #9e9e9e; }

/* Print Styles */
@media print {
    #sidebar, .navbar, .no-print { display: none !important; }
    #page-content-wrapper { margin-left: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar.show {
        margin-left: 0;
    }
    #page-content-wrapper {
        margin-left: 0;
    }
}

/* Auth Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--medical-blue);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--medical-blue);
}

/* Calendar */
.calendar-day {
    min-height: 100px;
    border: 1px solid #e9ecef;
    padding: 4px;
}

.calendar-day.today {
    background-color: rgba(13, 110, 253, 0.05);
}

.calendar-event {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: pointer;
}

/* Waiting Room */
.waiting-card {
    border-left: 4px solid;
    transition: all 0.2s;
}

.waiting-card:hover {
    transform: translateX(4px);
}

/* Modals */
.modal-content {
    border-radius: 12px;
    border: none;
}

/* Loading */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

/* Prescription Print */
.prescription-header {
    border-bottom: 2px solid #333;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.prescription-footer {
    border-top: 1px solid #ccc;
    padding-top: 1rem;
    margin-top: 2rem;
}
