/* ============================================
   SHELADIYA CLINIC — Design System
   Minimalist Modern with Electric Blue Accent
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Calistoga&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Colors */
    --background: #FAFAFA;
    --foreground: #0F172A;
    --muted: #F1F5F9;
    --muted-foreground: #64748B;
    --accent: #0052FF;
    --accent-secondary: #4D7CFF;
    --accent-foreground: #FFFFFF;
    --border: #E2E8F0;
    --card: #FFFFFF;
    --ring: #0052FF;

    /* Semantic */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --info: #3B82F6;
    --info-bg: #EFF6FF;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
    --shadow-accent: 0 4px 14px rgba(0,82,255,0.25);
    --shadow-accent-lg: 0 8px 24px rgba(0,82,255,0.35);

    /* Spacing */
    --sidebar-width: 270px;
    --sidebar-collapsed: 0px;
    --header-height: 70px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--accent-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
    font-family: 'Calistoga', Georgia, serif;
    font-weight: normal;
    line-height: 1.2;
    color: var(--foreground);
}

h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}
h4 { font-size: 1.125rem; }

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

/* ---------- Layout: Sidebar + Main ---------- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--foreground);
    color: #CBD5E1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
}

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

.sidebar-brand h1 {
    font-size: 1.35rem;
    color: #FFFFFF;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.sidebar-brand .brand-subtitle {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-secondary);
    opacity: 0.8;
}

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

.nav-section-label {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.3);
    padding: 16px 12px 8px;
    margin-top: 8px;
}

.nav-section-label:first-child {
    margin-top: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-lg);
    color: #94A3B8;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-base);
    margin-bottom: 2px;
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #E2E8F0;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(0,82,255,0.15), rgba(77,124,255,0.08));
    color: #FFFFFF;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, var(--accent), var(--accent-secondary));
    border-radius: 0 4px 4px 0;
}

.nav-link svg,
.nav-link .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition-base);
}

.nav-link.active svg,
.nav-link.active .nav-icon {
    opacity: 1;
    color: var(--accent-secondary);
}

.nav-badge {
    margin-left: auto;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
}

.sidebar-footer .clinic-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-footer .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s infinite;
}

/* ---------- Main Content Area ---------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Top Header Bar ---------- */
.top-header {
    height: var(--header-height);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.85);
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-header-left h2 {
    font-family: 'Calistoga', Georgia, serif;
    font-size: 1.25rem;
    color: var(--foreground);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.breadcrumb a {
    color: var(--muted-foreground);
    transition: color var(--transition-base);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb .separator {
    color: var(--border);
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-date {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    font-family: 'JetBrains Mono', monospace;
    background: var(--muted);
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    color: var(--foreground);
    transition: all var(--transition-base);
}

.mobile-menu-btn:hover {
    background: var(--muted);
}

/* ---------- Page Content ---------- */
.page-content {
    flex: 1;
    padding: 32px;
}

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-left h1 {
    font-size: 1.75rem;
    margin-bottom: 4px;
}

.page-header-left p {
    color: var(--muted-foreground);
    font-size: 0.9rem;
}

/* ---------- Section Badge ---------- */
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0,82,255,0.25);
    background: rgba(0,82,255,0.05);
    padding: 6px 16px;
    margin-bottom: 12px;
}

.section-badge .badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 2s infinite;
}

.section-badge span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    font-weight: 500;
}

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

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,82,255,0.03), transparent);
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0,82,255,0.15);
}

.stat-card:hover::after {
    opacity: 1;
}

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

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-accent);
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 3px;
}

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

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

.stat-value {
    font-family: 'Calistoga', Georgia, serif;
    font-size: 2rem;
    line-height: 1;
    color: var(--foreground);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-slow);
}

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

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

.card-header h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.card-body.no-padding {
    padding: 0;
}

/* ---------- Content Grid ---------- */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.content-grid .card.full-width {
    grid-column: 1 / -1;
}

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

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

table th {
    text-align: left;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-foreground);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    white-space: nowrap;
    background: var(--muted);
}

table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--foreground);
    vertical-align: middle;
}

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

table tbody tr {
    transition: background var(--transition-base);
}

table tbody tr:hover {
    background: rgba(0,82,255,0.02);
}

.patient-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.patient-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.patient-name-cell .name {
    font-weight: 600;
    color: var(--foreground);
}

.patient-name-cell .case-id {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-family: 'JetBrains Mono', monospace;
}

/* ---------- Status Badges ---------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.active {
    background: var(--success-bg);
    color: var(--success);
}
.status-badge.active::before {
    background: var(--success);
}

.status-badge.completed {
    background: var(--info-bg);
    color: var(--info);
}
.status-badge.completed::before {
    background: var(--info);
}

.status-badge.cancelled {
    background: var(--danger-bg);
    color: var(--danger);
}
.status-badge.cancelled::before {
    background: var(--danger);
}

.status-badge.pending {
    background: var(--warning-bg);
    color: var(--warning);
}
.status-badge.pending::before {
    background: var(--warning);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.98);
}

.btn svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-base);
}

/* Primary gradient button */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: var(--accent-foreground);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent-lg);
    filter: brightness(1.08);
    color: var(--accent-foreground);
}

.btn-primary:hover svg {
    transform: translateX(2px);
}

/* Secondary button */
.btn-secondary {
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--muted);
    border-color: rgba(0,82,255,0.3);
    box-shadow: var(--shadow-sm);
}

/* Ghost button */
.btn-ghost {
    background: transparent;
    color: var(--muted-foreground);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--muted);
    color: var(--foreground);
}

/* Danger button */
.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}

/* Success button */
.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Small button */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
}

.btn-sm svg {
    width: 15px;
    height: 15px;
}

/* Icon button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Action buttons group */
.action-btns {
    display: flex;
    gap: 6px;
}

/* ---------- Forms ---------- */
.form-grid {
    display: grid;
    gap: 20px;
}

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

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

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--foreground);
    background: var(--card);
    transition: all var(--transition-base);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,82,255,0.1);
}

.form-control::placeholder {
    color: rgba(100,116,139,0.5);
}

textarea.form-control {
    height: auto;
    min-height: 100px;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.6;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.form-section-title .icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.form-section-title .icon svg {
    width: 18px;
    height: 18px;
}

.form-section-title h4 {
    font-size: 0.95rem;
    color: var(--foreground);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

/* ---------- Search Bar ---------- */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    background: var(--card);
    color: var(--foreground);
    transition: all var(--transition-base);
    outline: none;
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,82,255,0.1);
}

.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted-foreground);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-state .empty-icon svg {
    width: 36px;
    height: 36px;
    color: var(--muted-foreground);
}

.empty-state h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-decoration: none;
    transition: all var(--transition-base);
}

.pagination a:hover {
    background: var(--muted);
    color: var(--foreground);
}

.pagination .active {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: white;
    box-shadow: var(--shadow-accent);
}

/* ---------- Detail View ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    padding: 14px 0;
}

.detail-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.detail-label {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-foreground);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--foreground);
    font-weight: 500;
}

.detail-value.large {
    font-family: 'Calistoga', Georgia, serif;
    font-size: 1.5rem;
    font-weight: normal;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-text {
    font-size: 0.9rem;
    color: var(--foreground);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ---------- Patient Profile Header ---------- */
.patient-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(0,82,255,0.04), rgba(77,124,255,0.02));
    border-bottom: 1px solid var(--border);
}

.patient-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Calistoga', Georgia, serif;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-accent);
}

.patient-profile-info h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.patient-profile-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.patient-profile-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Appointment Cards ---------- */
.appointment-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--card);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    transition: all var(--transition-base);
}

.appointment-card:hover {
    border-color: rgba(0,82,255,0.2);
    box-shadow: var(--shadow-sm);
}

.appointment-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: white;
    flex-shrink: 0;
}

.appointment-date-badge .day {
    font-family: 'Calistoga', Georgia, serif;
    font-size: 1.25rem;
    line-height: 1;
}

.appointment-date-badge .month {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
}

.appointment-info {
    flex: 1;
}

.appointment-info .patient-name {
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 2px;
}

.appointment-info .appointment-detail {
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    min-width: 320px;
    animation: slideInRight 0.4s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 4px;
    font-size: 1.1rem;
    line-height: 1;
}

/* ---------- Modal / Confirm Dialog ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
}

.modal h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal p {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ---------- Welcome Banner ---------- */
.welcome-banner {
    background: linear-gradient(135deg, var(--foreground) 0%, #1E293B 100%);
    border-radius: var(--radius-xl);
    padding: 32px 36px;
    margin-bottom: 28px;
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0,82,255,0.15), transparent 70%);
    border-radius: 50%;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.welcome-banner h1 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* ---------- Quick Actions ---------- */
.quick-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

/* ---------- Animations ---------- */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.w-full { width: 100%; }

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

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

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

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

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

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

    .mobile-menu-btn {
        display: flex;
    }

    .top-header {
        padding: 0 16px;
    }

    .page-content {
        padding: 20px 16px;
    }

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

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .welcome-banner {
        padding: 24px 20px;
    }

    .welcome-banner h1 {
        font-size: 1.35rem;
    }

    .quick-actions {
        flex-wrap: wrap;
    }

    .form-actions {
        flex-wrap: wrap;
    }

    .form-actions .btn {
        flex: 1;
    }

    .modal {
        margin: 16px;
    }

    .header-date {
        display: none;
    }

    .patient-profile-header {
        flex-direction: column;
        text-align: center;
    }

    .patient-profile-meta {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-btns {
        flex-wrap: wrap;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    .sidebar,
    .top-header,
    .btn,
    .action-btns,
    .pagination,
    .search-bar,
    .mobile-menu-btn {
        display: none !important;
    }

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

    .page-content {
        padding: 0;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* ---------- Sidebar Overlay (Mobile) ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}
