/* ============================================================
   CliniCare Portal — Professional Medical Admin Design System
   Brand colors: Green #69ca98, Blue #00b2e2
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */

:root {
    --cc-green: #69ca98;
    --cc-green-dark: #4fb882;
    --cc-green-light: rgba(105, 202, 152, 0.12);
    --cc-blue: #00b2e2;
    --cc-blue-dark: #0098c4;
    --cc-blue-light: rgba(0, 178, 226, 0.12);
    --cc-dark: #0F172A;
    --cc-text: #1d1d1f;
    --cc-muted: #64748B;
    --cc-border: rgba(0, 0, 0, 0.06);
    --cc-radius: 12px;
}

/* ── Reset & Base ───────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    min-height: 100vh;
    color: var(--cc-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* ── Portal Layout ──────────────────────────────────────────── */

.portal-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */

.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 28px 24px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--cc-border);
    margin-bottom: 8px;
}

.brand-logo {
    width: 85%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
}

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

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #86868b;
    padding: 8px 16px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--cc-green-light);
}

.nav-item.active {
    background: var(--cc-green-light);
    color: var(--cc-green-dark);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    flex-shrink: 0;
}

.nav-item.active .nav-icon {
    opacity: 1;
    color: var(--cc-green);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cc-green), var(--cc-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

.user-role {
    font-size: 11px;
    color: #86868b;
}

/* ── Mobile Sidebar Toggle ──────────────────────────────────── */

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
}

/* ── Main Content ───────────────────────────────────────────── */

.main-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    min-width: 0;
}

/* ── Page Header ────────────────────────────────────────────── */

.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: #86868b;
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Glass Card ─────────────────────────────────────────────── */

.glass-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

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

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
}

.card-subtitle {
    font-size: 13px;
    color: #86868b;
}

/* ── KPI Grid ───────────────────────────────────────────────── */

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

.kpi-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 24px;
    cursor: default;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    margin-bottom: 16px;
    font-size: 22px;
}

.kpi-icon.blue {
    background: var(--cc-blue-light);
    color: var(--cc-blue);
}

.kpi-icon.green {
    background: rgba(52, 199, 89, 0.12);
    color: #34C759;
}

.kpi-icon.orange {
    background: rgba(255, 149, 0, 0.12);
    color: #FF9500;
}

.kpi-icon.red {
    background: rgba(255, 59, 48, 0.12);
    color: #FF3B30;
}

.kpi-icon.purple {
    background: rgba(175, 82, 222, 0.12);
    color: #AF52DE;
}

.kpi-icon.neutral {
    background: rgba(142, 142, 147, 0.1);
    color: #8e8e93;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.kpi-label {
    font-size: 13px;
    color: #86868b;
    font-weight: 500;
}

.kpi-change {
    font-size: 12px;
    margin-top: 8px;
    font-weight: 600;
}

.kpi-change.up {
    color: #34C759;
}

.kpi-change.down {
    color: #FF3B30;
}

/* ── Data Table ─────────────────────────────────────────────── */

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #86868b;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: transparent;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: #1d1d1f;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(105, 202, 152, 0.06);
}

.table-empty {
    text-align: center;
    padding: 48px;
    color: #86868b;
}

/* ── Badges ─────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge-success {
    background: rgba(52, 199, 89, 0.08);
    color: #2D8A4E;
}

.badge-warning {
    background: rgba(200, 150, 50, 0.10);
    color: #8A6D2B;
}

.badge-danger {
    background: rgba(200, 80, 70, 0.10);
    color: #A63D2F;
}

.badge-info {
    background: rgba(80, 130, 190, 0.10);
    color: #3D6B99;
}

.badge-neutral {
    background: rgba(0, 0, 0, 0.05);
    color: #8E8E93;
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.badge-success.badge-dot::before {
    background: #2D8A4E;
}

.badge-warning.badge-dot::before {
    background: #8A6D2B;
}

.badge-danger.badge-dot::before {
    background: #A63D2F;
}

.badge-info.badge-dot::before {
    background: #3D6B99;
}

.badge-neutral.badge-dot::before {
    background: #8E8E93;
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.1px;
    text-decoration: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.4;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--cc-green);
    color: white;
    box-shadow: 0 2px 8px rgba(105, 202, 152, 0.35);
}

.btn-primary:hover {
    background: var(--cc-green-dark);
    box-shadow: 0 4px 12px rgba(105, 202, 152, 0.45);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: #1d1d1f;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: #FF3B30;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.btn-danger:hover {
    background: #D70015;
}

.btn-ghost {
    background: transparent;
    color: var(--cc-green-dark);
}

.btn-ghost:hover {
    background: var(--cc-green-light);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
}

/* ── Search Input ───────────────────────────────────────────── */

.search-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 0 16px;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus-within {
    border-color: rgba(105, 202, 152, 0.4);
    background: white;
    box-shadow: 0 0 0 4px rgba(105, 202, 152, 0.15);
}

.search-input input {
    border: none;
    background: transparent;
    padding: 12px 0;
    flex: 1;
    font-size: 14px;
    outline: none;
    color: #1d1d1f;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-width: 0;
}

.search-input input::placeholder {
    color: #86868b;
}

.search-icon {
    color: #86868b;
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Filter Pills ───────────────────────────────────────────── */

.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.pill {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
    color: #1d1d1f;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.pill:hover {
    border-color: rgba(105, 202, 152, 0.4);
    background: rgba(105, 202, 152, 0.06);
}

.pill.active {
    background: var(--cc-green);
    color: white;
    border-color: var(--cc-green);
}

/* ── Clinic Grid ────────────────────────────────────────────── */

.clinic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.clinic-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clinic-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.clinic-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1d1d1f;
}

.clinic-address {
    font-size: 13px;
    color: #86868b;
    line-height: 1.5;
}

.clinic-meta {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    font-size: 12px;
    color: #86868b;
}

/* ── Modal ──────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 20px;
    width: 520px;
    max-width: calc(100vw - 40px);
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #1d1d1f;
    border: none;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    max-height: calc(85vh - 160px);
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Confirm Dialog ────────────────────────────────────────── */

.confirm-dialog {
    width: 420px;
    max-width: 90vw;
    padding: 32px;
    text-align: center;
    animation: modalSlideIn 0.25s ease;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 12px 0;
}

.confirm-msg {
    font-size: 14px;
    color: #6e6e73;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.confirm-actions .btn {
    min-width: 120px;
    padding: 10px 24px;
}

/* ── Form Elements ──────────────────────────────────────────── */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    color: #1d1d1f;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(0, 122, 255, 0.4);
    background: white;
    box-shadow: 0 0 0 4px rgba(105, 202, 152, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #86868b;
}

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

.form-row {
    display: flex;
    gap: 16px;
}

.form-row > * {
    flex: 1;
}

.form-hint {
    font-size: 12px;
    color: #86868b;
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: #FF3B30;
    margin-top: 4px;
}

/* ── Toast Notifications ────────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.toast-success {
    background: rgba(52, 199, 89, 0.95);
    color: white;
}

.toast-error {
    background: rgba(255, 59, 48, 0.95);
    color: white;
}

.toast-info {
    background: rgba(0, 122, 255, 0.95);
    color: white;
}

/* ── Pagination ─────────────────────────────────────────────── */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
}

.page-info {
    font-size: 13px;
    color: #86868b;
}

.page-links {
    display: flex;
    gap: 4px;
}

.page-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    color: #1d1d1f;
    background: transparent;
    text-decoration: none;
}

.page-link:hover {
    background: var(--cc-green-light);
}

.page-link.active {
    background: var(--cc-green);
    color: white;
}

.page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Chart Container ────────────────────────────────────────── */

.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 16px 0;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--cc-green) 0%, rgba(105, 202, 152, 0.5) 100%);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chart-bar:hover {
    background: linear-gradient(180deg, var(--cc-blue) 0%, rgba(0, 178, 226, 0.6) 100%);
}

/* ── Loading / Spinner ──────────────────────────────────────── */

.loading {
    text-align: center;
    padding: 48px;
    color: #86868b;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--cc-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

/* ── Login Page ─────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    width: 400px;
    max-width: 100%;
    padding: 48px;
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cc-green), var(--cc-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.login-brand-logo {
    display: block;
    width: 320px;
    height: auto;
    margin: 0 auto 32px;
    object-fit: contain;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1d1d1f;
    letter-spacing: -0.3px;
}

.login-subtitle {
    font-size: 14px;
    color: #86868b;
    margin-bottom: 32px;
}

.login-error {
    background: rgba(255, 59, 48, 0.1);
    color: #D70015;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-card .form-group {
    text-align: left;
}

.login-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
    margin-top: 8px;
}

/* ── Empty State ────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state-icon {
    font-size: 56px;
    color: #C7C7CC;
    margin-bottom: 16px;
    line-height: 1;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: #86868b;
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Config Grid ────────────────────────────────────────────── */

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.config-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    text-align: center;
    padding: 40px 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.config-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.config-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border-radius: 20px;
}

.config-icon.blue {
    background: rgba(0, 122, 255, 0.12);
    color: var(--cc-blue);
}

.config-icon.green {
    background: rgba(52, 199, 89, 0.12);
    color: #34C759;
}

.config-icon.orange {
    background: rgba(255, 149, 0, 0.12);
    color: #FF9500;
}

.config-icon.purple {
    background: rgba(175, 82, 222, 0.12);
    color: #AF52DE;
}

.config-icon.red {
    background: rgba(255, 59, 48, 0.12);
    color: #FF3B30;
}

.config-label {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
}

.config-desc {
    font-size: 13px;
    color: #86868b;
    margin-top: 6px;
}

/* ── Utility Classes ────────────────────────────────────────── */

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

.text-right {
    text-align: right;
}

.text-muted {
    color: #86868b;
}

.text-primary {
    color: var(--cc-green);
}

.text-success {
    color: #34C759;
}

.text-danger {
    color: #FF3B30;
}

.text-warning {
    color: #FF9500;
}

.font-mono {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* ── Animations ─────────────────────────────────────────────── */

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

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.06) 25%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.06) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

/* ── Custom Scrollbar ───────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .clinic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 220px;
    }

    .main-content {
        padding: 24px;
    }

    .page-header h1 {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 150;
        width: 260px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.1);
    }

    .sidebar-toggle {
        display: flex;
    }

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

    .main-content {
        padding: 20px;
        padding-top: 68px;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
    }

    .page-actions {
        width: 100%;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

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

    .config-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal {
        width: calc(100vw - 32px);
        border-radius: 20px;
    }

    .modal-header {
        padding: 20px 24px;
    }

    .modal-body {
        padding: 24px;
    }

    .modal-footer {
        padding: 16px 24px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        min-width: auto;
    }

    .filter-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px;
        padding-top: 64px;
    }

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

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

    .kpi-card {
        padding: 20px;
    }

    .kpi-value {
        font-size: 28px;
    }

    .glass-card {
        padding: 20px;
        border-radius: 14px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .pagination {
        flex-direction: column;
        gap: 12px;
    }
}

/* ── Additional Template Classes ──────────────────────────── */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    color: #1d1d1f;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.form-input:focus {
    border-color: rgba(0, 122, 255, 0.4);
    background: white;
    box-shadow: 0 0 0 4px rgba(105, 202, 152, 0.15);
}

.form-input::placeholder {
    color: #86868b;
}

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

select.form-input {
    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='%2386868b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

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

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

.clinic-card-body {
    margin-bottom: 16px;
}

.clinic-detail {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #86868b;
    margin-bottom: 8px;
    line-height: 1.5;
}

.clinic-detail svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.clinic-card-footer {
    display: flex;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 16px;
    margin-top: auto;
}

.detail-field {
    margin-bottom: 12px;
}

.detail-field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #86868b;
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-field span {
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 500;
}

.filter-pill {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
    color: #1d1d1f;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
}

.filter-pill:hover {
    border-color: rgba(105, 202, 152, 0.4);
    background: rgba(105, 202, 152, 0.06);
    color: var(--cc-blue);
}

.filter-pill.active {
    background: var(--cc-green);
    color: white;
    border-color: var(--cc-green);
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: rgba(0, 122, 255, 0.06) !important;
}

.sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sort-link:hover {
    color: var(--cc-green);
}

.sort-arrow {
    font-size: 10px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    color: #1d1d1f;
    background: transparent;
    text-decoration: none;
}

.pagination-btn:hover {
    background: var(--cc-green-light);
    color: var(--cc-blue);
}

.pagination-btn.active {
    background: var(--cc-green);
    color: white;
    pointer-events: none;
}

.pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #86868b;
    font-size: 14px;
}

.btn-danger-text {
    color: #FF3B30 !important;
}

.btn-danger-text:hover {
    background: rgba(255, 59, 48, 0.08) !important;
    color: #D70015 !important;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 20px;
    width: 600px;
    max-width: calc(100vw - 40px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.clinic-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
}

@media (max-width: 640px) {
    .modal-content {
        width: calc(100vw - 32px);
    }
}

.empty-icon {
    color: #C7C7CC;
    margin-bottom: 16px;
}

/* ── Print Styles ───────────────────────────────────────────── */

@media print {
    .sidebar,
    .sidebar-toggle,
    .toast-container,
    .modal-overlay,
    .page-actions,
    .btn {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .glass-card {
        box-shadow: none;
        border: 1px solid #e0e0e0;
        backdrop-filter: none;
        background: white;
        break-inside: avoid;
    }

    body {
        background: white;
    }
}

/* ── UX Utility Classes ──────────────────────────────────── */

.action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-card:hover {
    transform: translateY(-2px);
}

.info-box {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.glass-card.accent-success {
    border-left: 3px solid #34C759;
}

.glass-card.accent-danger {
    border-left: 3px solid #ff3b30;
}

.glass-card.accent-warning {
    border-left: 3px solid #FF9500;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.back-link {
    color: #86868b;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #69ca98;
}

@media (max-width: 480px) {
    .action-card {
        padding: 16px;
    }
}
