/* ===== Angrale Therapist — Global Design System ===== */

/* Design Tokens */
:root {
    --ag-sage: #8daa91;
    --ag-sage-dark: #6e8e73;
    --ag-sage-hover: #7a9b7f;
    --ag-sage-light: #eef3ef;
    --ag-bg: #f5f5f0;
    --ag-surface: #ffffff;
    --ag-border: #e8e8e3;
    --ag-border-hover: #d5d5d0;
    --ag-text: #2d3436;
    --ag-text-muted: #636e72;
    --ag-bg-hover: #f0f0ec;
    --ag-bg-subtle: #fafaf7;
    --ag-font: 'Manrope', 'Inter', 'Helvetica', 'Arial', sans-serif;
    --ag-radius: 8px;
    --ag-radius-lg: 12px;
    --ag-radius-xl: 14px;
    --ag-shadow-sm: 0 1px 8px rgba(0, 0, 0, 0.04);
    --ag-shadow-md: 0 2px 16px rgba(0, 0, 0, 0.06);
}

html,
body {
    font-family: var(--ag-font);
    margin: 0;
    padding: 0;
}

/* ===== SHARED LAYOUT (sidebar + main) ===== */
.ag-layout {
    display: flex;
    min-height: 100vh;
    font-family: var(--ag-font);
    background: var(--ag-bg);
}

/* ===== SIDEBAR ===== */
.ag-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--ag-surface);
    border-right: 1px solid var(--ag-border);
    padding: 24px 16px 20px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

/* Brand header */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 16px;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ag-sage), var(--ag-sage-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.sidebar-brand .brand-title {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    font-size: 15px;
    color: var(--ag-text);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

/* Profile card */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--ag-sage), var(--ag-sage-dark));
    border-radius: var(--ag-radius-lg);
    padding: 14px 16px;
    margin: 0 0 16px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.profile-info {
    flex: 1;
    overflow: hidden;
}

.profile-name {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

/* Nav links */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--ag-radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--ag-text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: var(--ag-bg-hover);
    color: var(--ag-text);
}

.nav-link.active {
    background: var(--ag-sage-light);
    color: #5a7d5e;
    font-weight: 600;
}

.nav-link .material-symbols-outlined {
    font-size: 20px;
}

/* Button-styled nav link (for logout form) */
.nav-link-btn {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--ag-radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--ag-text-muted);
    transition: all 0.15s ease;
}

.nav-link-btn:hover {
    background: var(--ag-bg-hover);
    color: var(--ag-text);
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-nav-bottom {
    border-top: 1px solid var(--ag-border);
    padding-top: 8px;
    margin-top: 8px;
}

/* Legacy user card (hidden now, kept for PatientLayout etc.) */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    border-top: 1px solid var(--ag-border);
    margin-top: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ag-sage), #b8d4bc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--ag-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--ag-text-muted);
}

/* ===== CONTENT WRAPPER (top bar + main) ===== */
.ag-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== TOP BAR ===== */
.ag-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    background: var(--ag-surface);
    border-bottom: 1px solid var(--ag-border);
    gap: 24px;
}

.topbar-search {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.topbar-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--ag-text-muted);
    pointer-events: none;
}

.topbar-search .search-input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-lg);
    font-family: var(--ag-font);
    font-size: 14px;
    color: var(--ag-text);
    background: var(--ag-bg);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.topbar-search .search-input::placeholder {
    color: var(--ag-text-muted);
}

.topbar-search .search-input:focus {
    border-color: var(--ag-sage);
    box-shadow: 0 0 0 3px rgba(141, 170, 145, 0.12);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-bell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ag-radius);
    border: 1px solid var(--ag-border);
    background: var(--ag-surface);
    color: var(--ag-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.topbar-bell:hover {
    background: var(--ag-bg-hover);
    color: var(--ag-text);
    border-color: var(--ag-border-hover);
}

.topbar-bell .material-symbols-outlined {
    font-size: 20px;
}

.topbar-date {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.topbar-date .date-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--ag-text-muted);
}

.topbar-date .date-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--ag-text);
    text-transform: capitalize;
}

/* ===== MAIN CONTENT AREA ===== */
.ag-main {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    max-width: 960px;
}

/* ===== LOADING ===== */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ag-border);
    border-top-color: var(--ag-sage);
    border-radius: 50%;
    animation: ag-spin 0.8s linear infinite;
}

@keyframes ag-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== SHARED BUTTON STYLES ===== */
.ag-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--ag-sage), var(--ag-sage-hover));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.ag-btn-primary:hover {
    background: linear-gradient(135deg, var(--ag-sage-hover), var(--ag-sage-dark));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(141, 170, 145, 0.4);
}

.ag-btn-primary .material-symbols-outlined {
    font-size: 20px;
}

/* ===== RESPONSIVE SIDEBAR ===== */
@media (max-width: 768px) {
    .ag-layout {
        flex-direction: column;
    }

    .ag-sidebar {
        width: 100%;
        min-width: auto;
        height: auto;
        position: relative;
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid var(--ag-border);
    }

    .sidebar-brand,
    .sidebar-profile {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 4px;
    }

    .sidebar-spacer,
    .sidebar-user,
    .sidebar-nav-bottom {
        display: none;
    }

    .ag-topbar {
        padding: 12px 16px;
    }

    .ag-main {
        padding: 20px 16px;
    }
}

/* ===== LEGACY — will be removed once all pages migrate ===== */
a,
.btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44Nzc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Zz4=) 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;
}
/* ===== ADMIN PANEL — Shared Component Styles ===== */
/* Global (not scoped) — used across all admin child pages */

.admin-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 28px; }
.admin-stat-card { background: #fff; border-radius: 12px; padding: 20px 24px; border: 1px solid #e2e8f0; display: flex; align-items: center; gap: 16px; }
.admin-stat-icon { width: 48px; height: 48px; min-width: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.admin-stat-icon.teal { background: rgba(14, 165, 233, 0.1); color: #0ea5e9; }
.admin-stat-icon.green { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.admin-stat-icon.amber { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.admin-stat-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.admin-stat-info { flex: 1; }
.admin-stat-value { font-size: 24px; font-weight: 700; color: #0f172a; line-height: 1; }
.admin-stat-label { font-size: 13px; color: #64748b; margin-top: 4px; }
.admin-stat-trend { font-size: 12px; font-weight: 600; margin-top: 4px; }
.admin-stat-trend.up { color: #22c55e; }
.admin-stat-trend.down { color: #ef4444; }

.admin-card { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 20px; overflow: hidden; }
.admin-card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid #f1f5f9; }
.admin-card-title { font-size: 16px; font-weight: 600; color: #0f172a; display: flex; align-items: center; gap: 8px; }
.admin-card-title .material-symbols-outlined { font-size: 20px; color: #64748b; }
.admin-card-body { padding: 24px; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 10px 16px; font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #e2e8f0; }
.admin-table td { padding: 14px 16px; font-size: 14px; color: #1e293b; border-bottom: 1px solid #f1f5f9; }
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-status { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.admin-status.active { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.admin-status.pending { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.admin-status.rejected, .admin-status.inactive { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

.admin-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; font-family: inherit; transition: all 0.15s ease; text-decoration: none; }
.admin-btn-primary { background: linear-gradient(135deg, #0ea5e9, #06b6d4); color: #fff; }
.admin-btn-primary:hover { background: linear-gradient(135deg, #0284c7, #0891b2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3); color: #fff; }
.admin-btn-success { background: #22c55e; color: #fff; }
.admin-btn-success:hover { background: #16a34a; }
.admin-btn-danger { background: transparent; color: #ef4444; border: 1px solid #ef4444; }
.admin-btn-danger:hover { background: #ef4444; color: #fff; }
.admin-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.admin-btn-secondary:hover { background: #e2e8f0; }
.admin-btn .material-symbols-outlined { font-size: 18px; }

.admin-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #f59e0b; color: #0f172a; font-size: 11px; font-weight: 700; margin-left: auto; }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-grid-60-40 { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; }

.admin-empty { text-align: center; padding: 48px 24px; color: #94a3b8; }
.admin-empty .material-symbols-outlined { font-size: 48px; margin-bottom: 12px; }
.admin-empty p { font-size: 15px; margin: 0; }

.admin-pagination { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-top: 1px solid #e2e8f0; font-size: 13px; color: #64748b; }

.admin-search { position: relative; flex: 1; max-width: 400px; }
.admin-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 20px; color: #94a3b8; pointer-events: none; }
.admin-search input { width: 100%; padding: 10px 16px 10px 42px; border: 1px solid #e2e8f0; border-radius: 8px; font-family: inherit; font-size: 14px; color: #1e293b; background: #f8fafc; outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.admin-search input::placeholder { color: #94a3b8; }
.admin-search input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12); background: #fff; }

.admin-filter-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-filter-row select { padding: 9px 36px 9px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-family: inherit; font-size: 14px; color: #1e293b; background: #f8fafc; appearance: none; cursor: pointer; outline: none; }
.admin-filter-row select:focus { border-color: #0ea5e9; }

.admin-loading { display: flex; align-items: center; justify-content: center; min-height: 40vh; }
.admin-spinner { width: 40px; height: 40px; border: 3px solid #e2e8f0; border-top-color: #0ea5e9; border-radius: 50%; animation: admin-spin 0.8s linear infinite; }
@keyframes admin-spin { to { transform: rotate(360deg); } }

.admin-therapist-inline { display: flex; align-items: center; gap: 10px; }
.admin-therapist-avatar { width: 36px; height: 36px; min-width: 36px; border-radius: 50%; background: linear-gradient(135deg, #0ea5e9, #06b6d4); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; }
.admin-therapist-name { font-weight: 600; color: #0f172a; }
.admin-therapist-email { font-size: 12px; color: #94a3b8; }

.admin-form-group { margin-bottom: 16px; }
.admin-form-group label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.admin-form-group input, .admin-form-group textarea, .admin-form-group select { width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px; font-family: inherit; font-size: 14px; color: #1e293b; outline: none; transition: border-color 0.2s; box-sizing: border-box; }
.admin-form-group input:focus, .admin-form-group textarea:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); }
.admin-form-group textarea { resize: vertical; min-height: 80px; }

.admin-banner { padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.admin-banner.success { background: rgba(34, 197, 94, 0.1); color: #16a34a; border: 1px solid rgba(34, 197, 94, 0.2); }
.admin-banner.error { background: rgba(239, 68, 68, 0.1); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.2); }
.admin-banner .material-symbols-outlined { font-size: 20px; }

@media (max-width: 768px) { .admin-grid-2, .admin-grid-60-40 { grid-template-columns: 1fr; } }
