/* ========================================
   base.css — 全站設計系統 (SaaS Premium)
   ======================================== */

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

/* ── CSS Variables — Professional SaaS ── */
:root {
    /* Surface */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f4f4f5;
    --bg-elevated: #ffffff;
    --bg-canvas: #f0f0f1;
    --bg-hover: #f4f4f5;
    --bg-subtle: #fafafa;

    /* Accent — single brand color */
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-primary-light: #eef2ff;
    --accent-primary-muted: rgba(99, 102, 241, 0.08);
    --accent-secondary: #71717a;
    --accent-success: #22c55e;
    --accent-success-bg: #f0fdf4;
    --accent-warning: #eab308;
    --accent-warning-bg: #fefce8;
    --accent-danger: #ef4444;
    --accent-danger-bg: #fef2f2;
    --accent-interactive: #6366f1;

    /* Text */
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --text-inverse: #ffffff;
    --text-link: #6366f1;

    /* Borders — solid colors */
    --border-color: #e4e4e7;
    --border-light: #f4f4f5;
    --border-input: #d4d4d8;

    /* Core */
    --color-dark: #18181b;
    --color-dark-soft: #27272a;

    /* No gradients — solid colors only */
    --gradient-primary: #6366f1;
    --gradient-accent: #6366f1;
    --gradient-dark: #18181b;
    --gradient-surface: #ffffff;
    --gradient-glow: transparent;
    --gradient-holo: #6366f1;

    /* Shadows — neutral, no colored glows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-ring: 0 0 0 2px #eef2ff, 0 0 0 4px rgba(99, 102, 241, 0.25);
    --shadow-card: none;
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-holo: none;
    --shadow-glow: none;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Radius — controlled */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Motion */
    --transition-fast: 0.1s ease;
    --transition-normal: 0.15s ease;
    --transition-slow: 0.25s ease;
    --transition-spring: 0.3s cubic-bezier(0.22, 1, 0.36, 1);

    /* Type */
    --font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Menlo', 'Monaco', monospace;

    /* Sidebar — pure dark */
    --sidebar-w: 240px;
    --sidebar-bg: #18181b;
    --sidebar-text: #a1a1aa;
    --sidebar-text-hover: #fafafa;
    --sidebar-active-bg: rgba(99, 102, 241, 0.1);
    --sidebar-active-text: #ffffff;
    --sidebar-accent: #6366f1;
    --sidebar-divider: #27272a;
    --sidebar-group-text: #52525b;

    /* Admin */
    --header-h: 56px;
    --content-bg: #fafafa;
}

/* ── Typography ── */
html {
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: inherit;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Material Symbols 全域設定 */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    padding: 12px 24px;
    background: var(--color-dark);
    color: #fff;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    transition: all var(--transition-normal);
    pointer-events: none;
    box-shadow: var(--shadow-xl);
    letter-spacing: -0.01em;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Modal Overlay ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ── Modal ── */
.modal,
.modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    max-width: 92vw;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: modalSlideUp 0.2s ease-out;
    overflow: hidden;
}

.modal-box {
    width: 90%;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 0.95rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    font-size: 1.2rem;
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--bg-elevated);
}

/* ── Form Fields ── */
.form-field {
    margin-bottom: 18px;
}

.form-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
    box-sizing: border-box;
    background: #fff;
    color: var(--text-primary);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-ring);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--text-muted);
}

.form-error {
    color: var(--accent-danger);
    font-size: 0.82rem;
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--accent-danger-bg);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.12);
}

/* ── Form Group ── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    letter-spacing: -0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-ring);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

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

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.empty-state .material-symbols-outlined,
.empty-state .material-symbols-rounded {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.2;
}

/* ── Confirm Dialog ── */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.confirm-overlay.active {
    display: flex;
}

.confirm-box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
    text-align: center;
}

.confirm-box p {
    font-size: 0.88rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    line-height: 1.5;
}

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

/* ── Utility ── */
.hidden {
    display: none !important;
}

.icon-xs {
    font-size: 14px !important;
}

.icon-sm {
    font-size: 16px !important;
}

.icon-md {
    font-size: 18px !important;
}

.icon-lg {
    font-size: 20px !important;
}

.icon-inherit {
    font-size: inherit !important;
}

.text-danger {
    color: var(--accent-danger);
}

.text-muted-sm {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.optional-hint {
    color: var(--text-muted);
    font-weight: 400;
}

.required-mark {
    color: var(--accent-danger);
}

/* ── Table States ── */
.td-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 48px;
}

.td-error {
    text-align: center;
    color: var(--accent-danger);
    padding: 24px;
}

/* ── Skeleton Loading ── */
@keyframes skeletonPulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.7;
    }
}

.skeleton {
    animation: skeletonPulse 1.5s ease-in-out infinite;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.wide {
    width: 80%;
}

.skeleton-text.medium {
    width: 50%;
}

.skeleton-text.narrow {
    width: 30%;
}

.skeleton-card {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 14px;
}

.skeleton-card .skeleton-avatar {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
}

.skeleton-card .skeleton-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-card .skeleton-meta {
    display: flex;
    gap: 12px;
}

.skeleton-stat {
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.skeleton-stat .skeleton-number {
    width: 48px;
    height: 28px;
    border-radius: 6px;
}

.skeleton-stat .skeleton-label {
    width: 60px;
    height: 12px;
    border-radius: 4px;
}

/* ── Button System ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    line-height: 1.4;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    position: relative;
    background: #fff;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-input);
    color: var(--text-primary);
}

.btn:active {
    background: var(--bg-tertiary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.btn .material-symbols-outlined {
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
}

.btn-primary:active {
    background: #4338ca;
}

.btn-secondary {
    background: #fff;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-input);
}

.btn-danger {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
    border-color: transparent;
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-dark {
    background: var(--color-dark);
    color: #fff;
    border-color: var(--color-dark);
}

.btn-dark:hover {
    background: var(--color-dark-soft);
    border-color: var(--color-dark-soft);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: var(--radius-xs);
    gap: 4px;
}

.btn-sm .material-symbols-outlined {
    font-size: 0.85rem;
}

/* ── Form Inputs ── */
.form-input,
.form-select,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: #fff;
    color: var(--text-primary);
}

.form-input:focus,
.form-select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-ring);
}

.form-input::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

/* ── Data Table ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

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

/* ── Filter Select ── */
.filter-select {
    padding: 8px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: inherit;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-ring);
}

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

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

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

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

/* ── Smooth page transitions ── */
@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-main>.container,
.admin-main>div {
    animation: contentFadeIn 0.3s ease;
}

/* ========================================
   統一設計元件系統
   ======================================== */

/* ── Stat Card ── */
.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-card);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(99, 102, 241, 0.12);
}

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

.stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 20px;
}

.stat-card-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.stat-card-icon.success {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.stat-card-icon.warning {
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
}

.stat-card-icon.danger {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 750;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: -0.01em;
}

.stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

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

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

/* Stat card grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

/* ── Badge System ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    line-height: 1.5;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.badge-success {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.badge-warning {
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
}

.badge-danger {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.badge-neutral {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ── Section Title ── */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.section-title h2,
.section-title h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-title .material-symbols-outlined,
.section-title .material-symbols-rounded {
    font-size: 20px;
    color: var(--accent-primary);
}

.section-title-bar {
    width: 3px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.section-title-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: auto;
}

/* ── Enhanced Data Table ── */
.data-table tbody tr:nth-child(even) {
    background: var(--bg-subtle);
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
    box-shadow: inset 3px 0 0 var(--accent-primary);
}

.data-table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

/* ── Card Container ── */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-elevated);
}

/* ── Page Container ── */
.page-container {
    padding: 32px 36px;
    max-width: 1400px;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 750;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.page-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: 24px 0;
}

/* ── Number animation ── */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: countUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.animate-in:nth-child(1) {
    animation-delay: 0.05s;
}

.animate-in:nth-child(2) {
    animation-delay: 0.1s;
}

.animate-in:nth-child(3) {
    animation-delay: 0.15s;
}

.animate-in:nth-child(4) {
    animation-delay: 0.2s;
}

.animate-in:nth-child(5) {
    animation-delay: 0.25s;
}

.animate-in:nth-child(6) {
    animation-delay: 0.3s;
}

/* ── Subtle glow for interactive elements ── */
.glow-hover {
    transition: box-shadow var(--transition-normal);
}

.glow-hover:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.08), var(--shadow-md);
}

/* ── Tab Navigation ── */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-nav-item {
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    letter-spacing: -0.01em;
}

.tab-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-nav-item.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    font-weight: 600;
}

/* ── Search Input ── */
.search-input {
    position: relative;
}

.search-input input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-input input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-ring);
}

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

.search-input .material-symbols-outlined,
.search-input .material-symbols-rounded {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* ── Progress Bar ── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-fill.success {
    background: var(--accent-success);
}

.progress-bar-fill.warning {
    background: var(--accent-warning);
}

.progress-bar-fill.danger {
    background: var(--accent-danger);
}

/* ── Avatar ── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 650;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.avatar.sm {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
    border-radius: var(--radius-xs);
}

.avatar.lg {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

/* ── Responsive helpers ── */
@media (max-width: 768px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

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

    .stat-card {
        padding: 16px 18px;
    }

    .stat-card-value {
        font-size: 1.35rem;
    }
}

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