/* CaseHub — teal healthcare theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    background-color: #f8fafc;
    color: #1e293b;
    margin: 0;
    padding: 0;
}

/* ── Bootstrap primary override ── */
:root {
    --bs-primary: #0d9488;
    --bs-primary-rgb: 13, 148, 136;
    --bs-link-color: #0d9488;
    --bs-link-hover-color: #0f766e;
}

a { color: #0d9488; }
a:hover { color: #0f766e; }

/* ── Buttons ── */
.btn-primary {
    background-color: #0d9488;
    border-color: #0d9488;
    border-radius: 6px;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #0f766e;
    border-color: #0f766e;
}
.btn-outline-primary {
    color: #0d9488;
    border-color: #0d9488;
    border-radius: 6px;
}
.btn-outline-primary:hover {
    background-color: #0d9488;
    border-color: #0d9488;
    color: #fff;
}
.btn { border-radius: 6px; font-weight: 500; }

/* ── Cards ── */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card-header {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
    padding: .75rem 1.25rem;
    border-bottom: none;
}
.card-header h5, .card-header h4, .card-header h3 { color: #fff; margin: 0; }
.card-header a { color: rgba(255,255,255,.85); }
.card-header a:hover { color: #fff; }

/* ── Tables ── */
.table-dark thead { background-color: #1e293b !important; }
.table thead th { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* ── Nav section labels ── */
.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 1rem 1rem .25rem 1rem;
    user-select: none;
}

/* ── KPI cards ── */
.kpi-card {
    border-left: 4px solid #0d9488;
    border-radius: 10px;
    background: #fff;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.kpi-card .kpi-value { font-size: 2rem; font-weight: 700; color: #0d9488; line-height: 1; }
.kpi-card .kpi-label { font-size: .75rem; color: #64748b; margin-top: .25rem; }

/* ── Quick action buttons ── */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: .75rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0d9488;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 500;
    transition: all .15s;
    min-width: 90px;
}
.quick-action-btn:hover {
    background: #0d9488;
    color: #fff;
    border-color: #0d9488;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,148,136,.3);
}
.quick-action-btn svg, .quick-action-btn .icon { font-size: 1.4rem; }

/* ── Welcome banner ── */
.welcome-banner {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}
.welcome-banner h2 { color: #fff; font-weight: 700; margin: 0 0 .25rem 0; }
.welcome-banner p { color: rgba(255,255,255,.85); margin: 0; }

/* ── Status badges ── */
.badge { border-radius: 20px; font-weight: 500; font-size: .72em; }

/* ── Form controls ── */
.form-control:focus, .form-select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 .2rem rgba(13,148,136,.25);
}

/* ── Validation ── */
h1:focus { outline: none; }
.valid.modified:not([type=checkbox]) { outline: 1px solid #0d9488; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

/* ── Blazor error boundary ── */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4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jY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

/* ── Calendar grid ── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.calendar-day-header {
    background: #1e293b;
    color: #fff;
    text-align: center;
    padding: .4rem .25rem;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
}
.calendar-day {
    background: #fff;
    min-height: 80px;
    padding: .35rem .4rem;
    cursor: default;
}
.calendar-day.other-month { background: #f8fafc; color: #94a3b8; }
.calendar-day.today { background: #f0fdfa; }
.calendar-day-num {
    font-size: .8rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.6;
}
.calendar-day.today .calendar-day-num {
    background: #0d9488;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
}
.cal-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #0d9488;
    margin: 1px;
}
.cal-appt-label {
    font-size: .65rem;
    color: #0f766e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    background: #f0fdfa;
    border-left: 2px solid #0d9488;
    padding: 1px 3px;
    margin-top: 2px;
    border-radius: 2px;
}

/* ── Note type section ── */
.note-type-section {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.tracking-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}
.status-badge-top {
    display: inline-block;
    padding: .3em .8em;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
}

/* ── Week Calendar View ── */
.week-calendar {
    overflow-x: auto;
}
.week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    min-width: 700px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.week-header-cell {
    background: #1e293b;
    color: #fff;
    text-align: center;
    padding: 8px 4px;
    font-size: .8rem;
    font-weight: 600;
    border-right: 1px solid #334155;
}
.week-header-cell.today-col {
    background: #0d9488;
}
.week-time-label {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    font-size: .7rem;
    color: #64748b;
    padding: 2px 4px;
    text-align: right;
    vertical-align: top;
    height: 48px;
    line-height: 48px;
}
.week-cell {
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    height: 48px;
    position: relative;
    padding: 2px;
}
.week-cell.today-col {
    background: #f0fdfa;
}
.week-appt-block {
    display: block;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: .65rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-decoration: none;
    width: 100%;
    margin-bottom: 1px;
}
.week-appt-scheduled { background: #dbeafe; color: #1e40af; border-left: 3px solid #2563eb; }
.week-appt-completed { background: #dcfce7; color: #166534; border-left: 3px solid #16a34a; }
.week-appt-cancelled { background: #fee2e2; color: #991b1b; border-left: 3px solid #dc2626; }
.week-appt-noshow    { background: #f3f4f6; color: #374151; border-left: 3px solid #9ca3af; }
.week-appt-default   { background: #e0f2fe; color: #0c4a6e; border-left: 3px solid #0284c7; }

/* ── Client Avatar Circle ── */
.client-avatar-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Notification bell ── */
.notification-bell-wrapper {
    position: relative;
    display: inline-block;
}
.notification-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Improved table row hover ── */
.table-hover tbody tr:hover {
    background-color: #f0fdfa !important;
}

/* ── Status badge colors ── */
.status-active { background-color: #10b981 !important; color: white !important; }
.status-inactive { background-color: #6b7280 !important; color: white !important; }
.status-discharged { background-color: #ef4444 !important; color: white !important; }
.status-draft { background-color: #6b7280 !important; color: white !important; }
.status-signed { background-color: #10b981 !important; color: white !important; }
.status-amended { background-color: #f59e0b !important; color: white !important; }
.status-open { background-color: #3b82f6 !important; color: white !important; }
.status-closed { background-color: #6b7280 !important; color: white !important; }
.status-scheduled { background-color: #0d9488 !important; color: white !important; }
.status-completed { background-color: #10b981 !important; color: white !important; }
.status-cancelled { background-color: #ef4444 !important; color: white !important; }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}
.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-state h5 { color: #374151; margin-bottom: .5rem; }
.empty-state p { color: #9ca3af; margin-bottom: 1.5rem; }

/* ── Loading skeleton ── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Required field indicator ── */
.required-label::after {
    content: " *";
    color: #ef4444;
}

/* ── Breadcrumb improvements ── */
.breadcrumb-nav {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}
.breadcrumb-nav a {
    color: #0d9488;
    text-decoration: none;
}
.breadcrumb-nav a:hover { text-decoration: underline; }
.breadcrumb-nav .separator { margin: 0 0.4rem; color: #9ca3af; }

/* ── Card stat improvements ── */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.stat-card .stat-value { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .75rem; color: #6b7280; margin-top: .25rem; font-weight: 500; }
.stat-card .stat-trend { font-size: .75rem; margin-top: .5rem; }
.stat-trend-up { color: #10b981; }
.stat-trend-down { color: #ef4444; }

/* ── Print improvements ── */
@media print {
    .sidebar, .top-bar, .no-print { display: none !important; }
    .main-content, .container-fluid { padding: 0 !important; margin: 0 !important; }
    body { font-size: 11px; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
    .badge { border: 1px solid #999; }
}

/* ── Table improvements ── */
.table th { white-space: nowrap; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background-color: #f0fdfa; }

/* ── Form section headers ── */
.form-section-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: .5rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid #e2e8f0;
}

/* ── Clickable rows ── */
.table tr.clickable-row { cursor: pointer; }
.table tr.clickable-row:hover td { background-color: #e6fffa; }

/* ── Status badges ── */
.badge.bg-teal { background-color: #0d9488 !important; }
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.status-dot-active { background: #10b981; }
.status-dot-inactive { background: #f59e0b; }
.status-dot-discharged { background: #ef4444; }

/* ── Page header improvements ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.page-header h3 { margin: 0; font-weight: 700; }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .5; }
.empty-state h5 { font-weight: 600; color: #374151; }
