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

:root {
    --bg-deep: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --accent: #22d3a7;
    --accent-dim: rgba(34, 211, 167, 0.12);
    --accent-glow: rgba(34, 211, 167, 0.25);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(148, 163, 184, 0.08);
    --gradient-start: #22d3a7;
    --gradient-end: #3b82f6;

    /* Stage colors */
    --stage-lead: #f59e0b;
    --stage-consult: #3b82f6;
    --stage-active: #22d3a7;
    --stage-maint: #8b5cf6;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
}

.ambient-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
}
.ambient-bg::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(34, 211, 167, 0.06) 0%, transparent 70%);
}
.ambient-bg::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(ellipse, rgba(59, 130, 246, 0.04) 0%, transparent 70%);
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Nav */
nav {
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}
.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    text-decoration: none;
}
.logo span { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 100px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Nav Tabs */
.nav-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.25);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border);
}
.nav-tab {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 8px 20px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-tab:hover {
    color: var(--text-secondary);
}
.nav-tab.active {
    background: var(--accent-dim);
    color: var(--accent);
}

/* Top Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 20px;
    transition: all 0.2s;
}
.metric-card:hover {
    border-color: rgba(148, 163, 184, 0.15);
    transform: translateY(-1px);
}
.metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.metric-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
}
.metric-value.accent { color: var(--accent); }

/* Section blocks */
.section-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 28px;
}
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-title h2 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 16px;
}

/* Conversion Funnel */
.funnel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.funnel-stage {
    display: flex;
    align-items: center;
}
.funnel-bar {
    height: 52px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transition: all 0.5s ease;
    min-width: 200px;
}
.funnel-bar.consultation {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}
.funnel-bar.active {
    background: linear-gradient(135deg, rgba(34, 211, 167, 0.25), rgba(34, 211, 167, 0.1));
    border-color: rgba(34, 211, 167, 0.3);
}
.funnel-bar.maintenance {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(139, 92, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
}
.funnel-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
}
.funnel-count {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
}
.funnel-arrow {
    display: flex;
    align-items: center;
    padding: 2px 0 2px 16px;
}
.conversion-rate {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 3px 12px;
    border-radius: 100px;
}

/* Two column layout */
.two-col {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
}
.flex-2 { flex: 2; min-width: 0; }
.flex-1 { flex: 1; min-width: 280px; }

/* Pipeline Board */
.pipeline-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    min-height: 350px;
}
.pipeline-col {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}
.col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 4px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.col-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.lead-dot { background: var(--stage-lead); }
.consult-dot { background: var(--stage-consult); }
.active-dot { background: var(--stage-active); }
.maint-dot { background: var(--stage-maint); }
.col-count {
    margin-left: auto;
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.72rem;
}
.col-cards {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
}
.col-cards::-webkit-scrollbar { width: 4px; }
.col-cards::-webkit-scrollbar-track { background: transparent; }
.col-cards::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

/* Patient Card */
.patient-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.patient-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(148, 163, 184, 0.15);
    transform: translateY(-1px);
}
.patient-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 4px;
}
.patient-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.patient-revenue {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 6px;
}
.patient-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.stage-btn {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.stage-btn:hover {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(34, 211, 167, 0.25);
}
.stage-btn.current {
    opacity: 0.3;
    pointer-events: none;
}

/* Insights */
.insight-block {
    margin-bottom: 24px;
}
.insight-block h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-secondary);
}
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bar-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    min-width: 90px;
    text-align: right;
}
.bar-track {
    flex: 1;
    height: 24px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    padding-left: 8px;
}
.bar-fill.source-fill {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.6), rgba(59, 130, 246, 0.3));
}
.bar-fill.med-fill {
    background: linear-gradient(135deg, rgba(34, 211, 167, 0.6), rgba(34, 211, 167, 0.3));
}
.bar-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}
.search-input {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 16px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    outline: none;
    width: 200px;
    transition: border-color 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: rgba(34, 211, 167, 0.3); }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary.btn-sm { padding: 7px 16px; font-size: 0.8rem; }
.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 9px 20px;
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.04); }
.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 8px 18px;
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 32px;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal.modal-lg { max-width: 680px; }
.modal.modal-xl { max-width: 780px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.form-group {
    margin-bottom: 4px;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(34, 211, 167, 0.3);
}
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}
.form-group textarea {
    resize: vertical;
    min-height: 50px;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* Detail view */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.detail-item {
    padding: 12px 0;
}
.detail-item .dlabel {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.detail-item .dvalue {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
}
.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
}
.stage-badge.lead { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.stage-badge.consultation { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stage-badge.active { background: rgba(34, 211, 167, 0.15); color: #22d3a7; }
.stage-badge.maintenance { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.history-list {
    margin-top: 16px;
}
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}
.history-item:last-child { border-bottom: none; }
.history-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.history-text { color: var(--text-secondary); }
.history-date { margin-left: auto; color: var(--text-muted); font-size: 0.75rem; }

.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Detail Tabs */
.detail-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.detail-tab {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.detail-tab:hover {
    color: var(--text-secondary);
}
.detail-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Notes */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    max-height: 320px;
    overflow-y: auto;
}
.note-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.note-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.note-type-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
}
.note-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.note-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.5;
    transition: all 0.15s;
}
.note-delete:hover {
    opacity: 1;
    color: #ef4444;
}
.note-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}
.add-note-form {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.note-type-select {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    outline: none;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.note-type-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}
.empty-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 20px 0;
    text-align: center;
}

/* Timeline */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 480px;
    overflow-y: auto;
}
.timeline-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.stage-change-icon {
    background: rgba(34, 211, 167, 0.15);
    color: var(--accent);
}
.note-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}
.appt-icon {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}
.timeline-body {
    flex: 1;
    min-width: 0;
}
.timeline-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
}
.timeline-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 4px 0;
    white-space: pre-wrap;
}
.timeline-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Appointment Status Badges */
.appt-status-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.status-scheduled {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}
.status-completed {
    background: rgba(34, 211, 167, 0.15);
    color: #22d3a7;
}
.status-cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Appointments View */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.appt-date-group {
    margin-bottom: 8px;
}
.appt-date-header {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 12px 0 8px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.today-badge {
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.appt-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 8px;
}
.appt-row:hover {
    background: rgba(255,255,255,0.02);
}
.appt-row:last-child { border-bottom: none; }
.appt-row-time {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 52px;
}
.appt-row-info {
    flex: 1;
    min-width: 0;
}
.appt-row-patient {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
}
.appt-row-type {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.appt-row-actions {
    display: flex;
    gap: 4px;
}

/* Patient Appointments Tab */
.patient-appts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}
.appt-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.appt-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}
.appt-card-type {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
}
.appt-card-datetime {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.appt-card-notes {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}
.appt-actions {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}
.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.88rem;
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}
.footer-text { font-size: 0.8rem; color: var(--text-muted); }
.footer-powered { font-size: 0.75rem; color: var(--text-muted); }
.footer-powered a { color: var(--text-secondary); text-decoration: none; }

/* Loading state */
.loading-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    height: 20px;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Scrollbars for notes & timeline */
.notes-list::-webkit-scrollbar,
.timeline-list::-webkit-scrollbar,
.patient-appts-list::-webkit-scrollbar { width: 4px; }
.notes-list::-webkit-scrollbar-track,
.timeline-list::-webkit-scrollbar-track,
.patient-appts-list::-webkit-scrollbar-track { background: transparent; }
.notes-list::-webkit-scrollbar-thumb,
.timeline-list::-webkit-scrollbar-thumb,
.patient-appts-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

/* Nav Badge */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    border-radius: 100px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Card Reminder Badge */
.card-reminder-badge {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    white-space: nowrap;
}
.card-reminder-badge.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.card-reminder-badge.due-today {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Reminder statuses */
.status-overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.status-due-today {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}
.status-reminder-pending {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}
.status-comm {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

/* Timeline icons for new types */
.reminder-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}
.comm-icon {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

/* Reminder cards */
.reminder-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.reminder-card.overdue-card {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}
.reminder-card.due-today-card {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

/* Reminders list view */
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 500px;
    overflow-y: auto;
}
.reminders-list::-webkit-scrollbar { width: 4px; }
.reminders-list::-webkit-scrollbar-track { background: transparent; }
.reminders-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.reminder-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.15s;
}
.reminder-row:hover {
    background: rgba(255,255,255,0.02);
    border-color: rgba(148, 163, 184, 0.15);
}
.reminder-row.overdue-row {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}
.reminder-row.due-today-row {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}
.reminder-row-info {
    flex: 1;
    min-width: 0;
}
.reminder-row-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reminder-row-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.reminder-row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Reminder presets */
.reminder-presets {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 12px 0 4px;
}
.preset-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.preset-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.preset-btn:hover {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(34, 211, 167, 0.25);
}

/* Communication cards */
.comm-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.comm-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.comm-channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.comm-card-info {
    flex: 1;
    min-width: 0;
}
.comm-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
}
.comm-card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.comm-card-content {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 1024px) {
    .two-col { flex-direction: column; }
    .pipeline-board { grid-template-columns: repeat(2, 1fr); }
    .flex-1 { min-width: auto; }
}
@media (max-width: 768px) {
    .metrics-row { grid-template-columns: repeat(2, 1fr); }
    .pipeline-board { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-input { width: 100%; }
    footer { flex-direction: column; gap: 8px; text-align: center; }
    .section-title { flex-direction: column; align-items: flex-start; }
    .detail-grid { grid-template-columns: 1fr; }
    .nav-tabs { width: 100%; justify-content: center; }
    .detail-tabs { flex-wrap: wrap; }
    .appt-row { flex-wrap: wrap; }
    .appt-row-actions { width: 100%; margin-top: 8px; }
}
