:root {
    /* Surface colors */
    --surface: #e9ebe1;
    --surface-elevated: #f5f4ee;
    --surface-hover: #dfe3d7;

    /* Text colors */
    --text: #20231d;
    --text-secondary: #4f574b;
    --text-muted: #70786c;
    --text-inverse: #ffffff;

    /* Brand colors */
    --primary: #46513e;
    --primary-600: #30392b;
    --primary-50: #ecefe7;
    --primary-100: #d6ddcf;

    /* Semantic colors */
    --success: #60765a;
    --success-50: #edf2e9;
    --success-100: #d6e2d0;
    --warning: #a36f32;
    --warning-50: #f6efe3;
    --warning-100: #ead7b9;
    --danger: #9b5145;
    --danger-50: #f7ece8;
    --danger-100: #ead0c9;
    --info: #5b7770;
    --info-50: #eaf0ee;
    --info-100: #cee0db;

    /* Border & shadow */
    --border: #c8cec0;
    --border-subtle: rgba(86, 96, 79, 0.18);

    --shadow-sm: 0 1px 0 rgba(28, 34, 25, 0.05);
    --shadow-md: 0 14px 34px rgba(28, 34, 25, 0.06);
    --shadow-lg: 0 22px 56px rgba(28, 34, 25, 0.09);
    --shadow-xl: 0 34px 80px rgba(20, 25, 18, 0.14);
    --shadow-glow: 0 0 0 3px rgba(70, 81, 62, 0.14);

    /* Radius */
    --radius-sm: 2px;
    --radius-md: 3px;
    --radius-lg: 4px;
    --radius-xl: 6px;
    --radius-full: 9999px;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Motion */
    --duration-fast: 0.15s;
    --duration-normal: 0.25s;
    --duration-slow: 0.4s;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Typography */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "WenQuanYi Micro Hei", sans-serif;
}

/* Reset & base */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--surface);
    background-image:
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.03) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, button, textarea, select {
    font: inherit;
}

/* Utility classes */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-inverse { color: var(--text-inverse); }

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }

.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

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

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

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

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Main layout */
.main-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--space-6);
    animation: fadeIn var(--duration-slow) var(--ease-out);
    min-height: calc(100vh - 72px);
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 var(--space-6);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
}

.nav-brand a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-brand .logo-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    transition: color var(--duration-fast), background-color var(--duration-fast), transform var(--duration-fast);
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-50);
}

.nav-links a.active {
    color: var(--primary);
    background: var(--primary-100);
}

.nav-user {
    position: relative;
    margin-left: var(--space-4);
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.user-menu-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--border);
    color: var(--text);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--duration-fast), visibility var(--duration-fast), transform var(--duration-fast);
    z-index: 200;
}

.user-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: background var(--duration-fast), color var(--duration-fast);
}

.user-menu a:hover {
    background: var(--surface);
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    filter: brightness(1.05);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
    filter: brightness(1.05);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
    filter: brightness(1.05);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
    filter: brightness(1.05);
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--text-muted);
}

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

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

.btn:disabled,
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading .btn-text {
    opacity: 0.7;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-left-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: color var(--duration-fast);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-left: calc(var(--space-4) * 2 + 18px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: var(--surface-elevated);
    color: var(--text);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background-color var(--duration-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: var(--surface-elevated);
}

.form-control:focus + .input-icon,
.input-group:focus-within .input-icon {
    color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    animation: fadeInUp var(--duration-fast) var(--ease-out);
}

textarea.form-control {
    padding-left: var(--space-4);
    min-height: 100px;
    resize: vertical;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 420px;
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    padding: var(--space-4);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    animation: slideInRight var(--duration-normal) var(--ease-out);
    overflow: hidden;
    position: relative;
}

.toast.toast-exit {
    animation: slideOutRight var(--duration-normal) var(--ease-out) forwards;
}

.toast-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast), background var(--duration-fast);
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    width: 100%;
    transform-origin: left;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-danger { border-left: 4px solid var(--danger); }
.toast-danger .toast-icon { color: var(--danger); }

.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-info { border-left: 4px solid var(--info); }
.toast-info .toast-icon { color: var(--info); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-success { background: var(--success-100); color: #065f46; }
.badge-success .badge-dot { background: var(--success); }

.badge-pending { background: #f1f5f9; color: var(--text-muted); }
.badge-pending .badge-dot { background: #94a3b8; }

.badge-ai { background: var(--primary-100); color: #1e40af; }
.badge-ai .badge-dot { background: var(--primary); }

.badge-warning { background: var(--warning-100); color: #92400e; }
.badge-warning .badge-dot { background: var(--warning); }

.badge-danger { background: var(--danger-100); color: #991b1b; }
.badge-danger .badge-dot { background: var(--danger); }

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--space-3);
}

.skeleton-circle {
    border-radius: 50%;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
}

.progress-bar-fill.success {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.progress-bar-fill.warning {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

/* Auth pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    margin: calc(-1 * var(--space-6));
    min-height: calc(100vh - 64px - var(--space-6) * 2);
    background:
        radial-gradient(at 20% 30%, rgba(37, 99, 235, 0.06) 0px, transparent 40%),
        radial-gradient(at 80% 20%, rgba(16, 185, 129, 0.04) 0px, transparent 40%),
        radial-gradient(at 50% 90%, rgba(245, 158, 11, 0.04) 0px, transparent 40%),
        var(--surface);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.96);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeInUp var(--duration-slow) var(--ease-out);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-logo {
    width: 56px;
    height: 56px;
    color: var(--primary);
    margin-bottom: var(--space-4);
}

.auth-container h2 {
    margin: 0 0 var(--space-2) 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-form .form-group:last-child {
    margin-bottom: 0;
}

.auth-form .btn {
    width: 100%;
    padding: var(--space-3) var(--space-5);
    font-size: 1rem;
}

.auth-link {
    text-align: center;
    margin-top: var(--space-6);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Entry list */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.progress-widget {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-5);
    box-shadow: var(--shadow-sm);
    min-width: 280px;
}

.progress-widget-info {
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.progress-widget-info strong {
    color: var(--text);
    font-size: 1.1rem;
}

.progress-widget .progress-bar {
    width: 160px;
    flex-shrink: 0;
}

.filter-bar {
    display: inline-flex;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
    background: var(--surface-elevated);
    padding: var(--space-1);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.filter-bar a {
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
}

.filter-bar a:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.filter-bar a.active {
    color: white;
    background: var(--primary);
    box-shadow: var(--shadow-sm);
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-5);
}

.entry-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
    animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.entry-card:nth-child(1) { animation-delay: 0.04s; }
.entry-card:nth-child(2) { animation-delay: 0.08s; }
.entry-card:nth-child(3) { animation-delay: 0.12s; }
.entry-card:nth-child(4) { animation-delay: 0.16s; }
.entry-card:nth-child(5) { animation-delay: 0.20s; }
.entry-card:nth-child(6) { animation-delay: 0.24s; }
.entry-card:nth-child(7) { animation-delay: 0.28s; }
.entry-card:nth-child(8) { animation-delay: 0.32s; }

.entry-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-xl);
}

.entry-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.entry-thumb-wrap {
    position: relative;
    width: 100%;
    height: 170px;
    overflow: hidden;
    background: var(--surface-hover);
}

.entry-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
    opacity: 0;
}

.entry-thumb.loaded {
    opacity: 1;
    transition: opacity var(--duration-normal), transform var(--duration-slow) var(--ease-out);
}

.entry-card:hover .entry-thumb.loaded {
    transform: scale(1.06);
}

.entry-info {
    padding: var(--space-4);
}

.entry-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.entry-number {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
}

.entry-score-preview {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--success);
    background: var(--success-50);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
}

.entry-status-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 var(--space-2) 0;
    color: var(--text);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-8);
}

.pagination a, .pagination span {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--duration-fast);
}

.pagination a:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--text-muted);
}

.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Score page */
.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.score-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.score-nav {
    display: flex;
    gap: var(--space-3);
}

.score-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.resizable-row {
    display: flex;
    height: calc(100vh - 300px);
    min-height: 520px;
    max-height: 900px;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0;
}

.resizable-row .poster-panel {
    flex: 0 0 auto;
    width: 22%;
    min-width: 220px;
}

.resizable-row .report-panel {
    flex: 0 0 auto;
    width: 52%;
    min-width: 420px;
}

.resizable-row .ai-panel {
    flex: 1 1 auto;
    min-width: 300px;
}

.splitter {
    width: 12px;
    flex: 0 0 auto;
    cursor: col-resize;
    background: var(--border-subtle);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration-fast);
    user-select: none;
}

.splitter::after {
    content: "";
    width: 2px;
    height: 24px;
    background: var(--border);
    border-radius: 1px;
}

.splitter:hover,
.splitter.dragging {
    background: var(--primary-100);
}

.splitter:hover::after,
.splitter.dragging::after {
    background: var(--primary);
}

.panel {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow var(--duration-normal);
}

.panel:hover {
    box-shadow: var(--shadow-lg);
}

.panel-header {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: linear-gradient(to right, var(--surface-hover), transparent);
}

.panel-header-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.panel-body {
    flex: 1;
    overflow: auto;
    padding: var(--space-5);
}

.poster-panel .panel-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
    position: relative;
}

.poster-panel img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transition: transform var(--duration-normal);
}

.poster-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--duration-fast);
    pointer-events: none;
}

.poster-panel .panel-body:hover .poster-overlay {
    opacity: 1;
}

.poster-overlay-icon {
    width: 40px;
    height: 40px;
    color: white;
    transform: scale(0.8);
    transition: transform var(--duration-fast) var(--ease-spring);
}

.poster-panel .panel-body:hover .poster-overlay-icon {
    transform: scale(1);
}

.report-panel .panel-body {
    padding: 0;
    overflow: auto;
}

.report-content {
    min-width: 100%;
    min-height: 100%;
    padding: var(--space-6);
    opacity: 0;
    transition: opacity var(--duration-normal);
    box-sizing: border-box;
}

#report-container.report-loaded .report-content {
    opacity: 1;
}

.report-content h1, .report-content h2, .report-content h3 {
    color: var(--text);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
    font-weight: 700;
}

.report-content h1 { font-size: 1.5rem; }
.report-content h2 { font-size: 1.25rem; }
.report-content h3 { font-size: 1.1rem; }

.report-content p {
    margin: var(--space-3) 0;
    text-align: justify;
    color: var(--text-secondary);
}

.report-content table {
    border-collapse: collapse;
    width: 100%;
    margin: var(--space-4) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.report-content th, .report-content td {
    border: 1px solid var(--border);
    padding: var(--space-3);
    text-align: left;
}

.report-content th {
    background: var(--surface-hover);
    font-weight: 600;
    color: var(--text);
}

.report-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* AI panel */
.ai-total-card {
    background: linear-gradient(135deg, var(--primary-50), white);
    border: 1px solid var(--primary-100);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    margin-bottom: var(--space-5);
}

.ai-total-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.ai-total-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ai-total-max {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.ai-dimension {
    margin-bottom: var(--space-4);
}

.ai-dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.ai-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.ai-score {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.ai-bar-bg {
    height: 8px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.ai-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
}

.ai-actions {
    display: flex;
    gap: var(--space-2);
    margin: var(--space-5) 0;
}

.ai-actions .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: var(--space-2) var(--space-3);
}

.ai-reasoning, .ai-suggestions {
    font-size: 0.9rem;
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    white-space: pre-wrap;
    line-height: 1.7;
}

.ai-reasoning strong, .ai-suggestions strong {
    color: var(--text);
    display: block;
    margin-bottom: var(--space-2);
}

.ai-running {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-muted);
}

.ai-running .spinner {
    width: 32px;
    height: 32px;
    margin-bottom: var(--space-4);
}

/* Score form */
.score-form-panel {
    grid-column: 1 / -1;
    flex-direction: column;
}

.score-form-panel .panel-body {
    overflow: visible;
}

.dimensions-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.dimension-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}

.dimension-card:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.dimension-card.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    animation: shake 0.4s var(--ease-out);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.dimension-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dimension-max {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dimension-input-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.dimension-input-row input {
    flex: 1;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.dimension-input-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.stepper-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast);
    flex-shrink: 0;
}

.stepper-btn:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-100);
}

.stepper-btn:active {
    transform: scale(0.92);
}

.dimension-progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.dimension-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    border-radius: var(--radius-full);
    transition: width var(--duration-fast) var(--ease-out);
}

.total-display {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(135deg, var(--success-50), white);
    border: 1px solid var(--success-100);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.total-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.total-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--success);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: color var(--duration-fast);
}

.total-value.low { color: var(--danger); }
.total-value.medium { color: var(--warning); }
.total-value.high { color: var(--success); }

.total-max {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.suggestion-textarea {
    width: 100%;
    min-height: 100px;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    resize: vertical;
    background: var(--surface-elevated);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.suggestion-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.form-actions {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-6);
    align-items: center;
    flex-wrap: wrap;
}

#save-status {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--ease-out),
                visibility var(--duration-normal);
    backdrop-filter: blur(8px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-overlay img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    transform: scale(0.92);
    transition: transform var(--duration-normal) var(--ease-out);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

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

.modal-close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration-fast), transform var(--duration-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 22px;
    height: 22px;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(37, 99, 235, 0.15);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Admin */
.admin-section {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-md);
}

.admin-section h3 {
    margin: 0 0 var(--space-5) 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-50); color: var(--primary); }
.stat-icon.green { background: var(--success-50); color: var(--success); }
.stat-icon.orange { background: var(--warning-50); color: var(--warning); }
.stat-icon.red { background: var(--danger-50); color: var(--danger); }
.stat-icon.cyan { background: var(--info-50); color: var(--info); }

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: var(--space-1);
}

.stat-progress {
    margin-top: var(--space-3);
}

.admin-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.admin-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-table th {
    background: var(--surface-hover);
    padding: var(--space-4);
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    transition: background var(--duration-fast);
}

.admin-table tbody tr:hover td {
    background: var(--surface-hover);
}

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

.admin-table .user-name {
    font-weight: 600;
    color: var(--text);
}

.admin-actions {
    display: flex;
    gap: var(--space-2);
}

.admin-actions .btn {
    padding: var(--space-2) var(--space-3);
    font-size: 0.85rem;
}


/* AI panel split: suggestion top, chat bottom */
.ai-panel-body {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.ai-suggestion-wrap {
    flex: 1 1 auto;
    min-height: 120px;
    overflow: auto;
    padding: var(--space-5);
}

.ai-panel-resizer {
    flex: 0 0 auto;
    height: 10px;
    cursor: ns-resize;
    background: var(--border-subtle);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration-fast);
    user-select: none;
}

.ai-panel-resizer::after {
    content: "";
    width: 24px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
}

.ai-panel-resizer:hover,
.ai-panel-resizer.dragging {
    background: var(--primary-100);
}

.ai-panel-resizer:hover::after,
.ai-panel-resizer.dragging::after {
    background: var(--primary);
}

.ai-chat-wrap {
    flex: 0 0 auto;
    border-top: 1px solid var(--border);
    background: var(--surface-hover);
    display: flex;
    flex-direction: column;
    height: 220px;
    min-height: 160px;
    max-height: 500px;
}

.chat-header {
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
}

.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.chat-welcome {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-4) var(--space-2);
}

.chat-message {
    display: flex;
}

.chat-message-user {
    justify-content: flex-end;
}

.chat-message-assistant {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 85%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-message-user .chat-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.chat-message-assistant .chat-bubble {
    background: var(--surface-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: var(--radius-sm);
}

.chat-input-row {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-elevated);
}

.chat-input {
    flex: 1 1 auto;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.chat-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.chat-input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.chat-input-row .btn {
    flex: 0 0 auto;
    padding: var(--space-2) var(--space-3);
}

/* Review pool dimension diff badges */
.dimension-diff-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.dimension-diff-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    white-space: nowrap;
}

.diff-high {
    background: var(--danger-100);
    color: var(--danger);
}

.diff-mid {
    background: var(--warning-100);
    color: var(--warning);
}

.diff-low {
    background: var(--success-100);
    color: var(--success);
}

.filter-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-right: var(--space-2);
}


/* Admin dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.kpi-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    transition: transform var(--duration-normal), box-shadow var(--duration-normal);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-1);
}

.kpi-icon svg {
    width: 22px;
    height: 22px;
}

.kpi-icon-primary { background: var(--primary-50); color: var(--primary); }
.kpi-icon-success { background: var(--success-50); color: var(--success); }
.kpi-icon-warning { background: var(--warning-50); color: var(--warning); }
.kpi-icon-info { background: var(--info-50); color: var(--info); }
.kpi-icon-danger { background: var(--danger-50); color: var(--danger); }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-progress {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    margin-top: var(--space-2);
    overflow: hidden;
}

.kpi-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
}

/* Action cards */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-6);
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--text);
    transition: all var(--duration-normal);
    text-align: center;
    min-height: 170px;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-100);
}

.action-card form {
    display: contents;
}

.action-card button.action-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: center;
}

.action-card .action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-card .action-icon svg {
    width: 24px;
    height: 24px;
}

.action-card .action-title {
    font-weight: 700;
    font-size: 1rem;
}

.action-card .action-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Admin tables */
.table-panel {
    margin-bottom: var(--space-8);
}

.table-panel-body {
    padding: 0;
    overflow: hidden;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    background: var(--surface-hover);
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

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

.data-table .table-empty {
    text-align: center;
    padding: var(--space-10) var(--space-4);
    color: var(--text-muted);
}

.data-table .table-empty .empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-4);
    opacity: 0.5;
}

.data-table .table-empty h3 {
    margin: 0 0 var(--space-2);
    font-size: 1.1rem;
    color: var(--text);
}

.data-table .form-control {
    padding-left: var(--space-3);
}

.data-table textarea.form-control {
    padding-left: var(--space-3);
    min-height: 60px;
}

.data-table .table-actions {
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 1200px) {
    .score-layout {
        height: auto;
        overflow: visible;
    }

    .resizable-row {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .resizable-row .poster-panel,
    .resizable-row .report-panel,
    .resizable-row .ai-panel {
        width: 100% !important;
        min-width: 0;
        flex: 0 0 auto;
        height: auto;
        max-height: none;
    }

    .resizable-row .poster-panel .panel-body {
        height: 400px;
    }

    .resizable-row .report-panel .panel-body,
    .resizable-row .ai-panel .panel-body {
        max-height: 500px;
    }

    .splitter {
        display: none;
    }

    .dimensions-row {
        grid-template-columns: 1fr 1fr;
    }

    .score-form-panel {
        grid-column: 1;
    }
}

@media (max-width: 900px) {
    .main-container {
        padding: var(--space-3);
    }

    .navbar {
        padding: 0 var(--space-3);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .progress-widget {
        width: 100%;
    }

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

    /* Shrink KPI icons */
    .kpi-icon {
        width: 36px;
        height: 36px;
    }

    .kpi-icon svg {
        width: 18px;
        height: 18px;
    }

    .kpi-value {
        font-size: 1.4rem;
    }

    .kpi-label {
        font-size: 0.8rem;
    }

    .kpi-card {
        padding: var(--space-3);
    }

    /* Shrink action card icons */
    .action-card .action-icon {
        width: 40px;
        height: 40px;
    }

    .action-card .action-icon svg {
        width: 20px;
        height: 20px;
    }

    .action-card {
        padding: var(--space-4);
        min-height: 140px;
    }

    .action-cards {
        gap: var(--space-3);
    }

    .dashboard-grid {
        gap: var(--space-3);
    }
}

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

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

    .score-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .score-nav {
        width: 100%;
    }

    .score-nav .btn {
        flex: 1;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }

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

    .auth-container {
        padding: var(--space-6);
    }

    .nav-links {
        gap: var(--space-1);
    }

    .nav-links a {
        padding: var(--space-2) var(--space-3);
        font-size: 0.8rem;
    }

    .nav-user .user-name {
        display: none;
    }

    /* Dashboard KPI cards — stack */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .kpi-card {
        padding: var(--space-2) var(--space-3);
    }

    .kpi-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 0;
    }

    .kpi-icon svg {
        width: 14px;
        height: 14px;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    .kpi-label {
        font-size: 0.72rem;
    }

    .kpi-progress {
        margin-top: var(--space-1);
        height: 3px;
    }

    /* Action cards — 2 per row, compact */
    .action-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .action-card {
        padding: var(--space-3);
        min-height: 110px;
    }

    .action-card .action-icon {
        width: 32px;
        height: 32px;
        margin-bottom: var(--space-1);
    }

    .action-card .action-icon svg {
        width: 16px;
        height: 16px;
    }

    .action-card .action-title {
        font-size: 0.82rem;
    }

    .action-card .action-desc {
        font-size: 0.7rem;
        display: none;
    }

    /* Tables — compact */
    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: var(--space-2) var(--space-3);
        white-space: nowrap;
    }

    .data-table .table-actions {
        white-space: nowrap;
    }

    .data-table .btn-sm {
        padding: var(--space-1) var(--space-2);
        font-size: 0.75rem;
    }

    .data-table .form-control {
        font-size: 0.8rem;
        padding: var(--space-2);
    }

    /* Filter bar — wrap */
    .filter-bar {
        flex-wrap: wrap;
        gap: var(--space-1);
    }

    .filter-bar a {
        padding: var(--space-1) var(--space-3);
        font-size: 0.82rem;
    }

    .filter-label {
        width: 100%;
        margin-bottom: var(--space-1);
    }

    /* Panels */
    .panel-header {
        padding: var(--space-2) var(--space-3);
        font-size: 0.9rem;
    }

    .panel-body {
        padding: var(--space-3);
    }

    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .page-header h1 {
        font-size: 1.35rem;
    }

    /* Progress widget */
    .progress-widget {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .progress-widget .progress-bar {
        width: 100%;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
.resizable-row.no-ai .report-panel { flex: 1 1 auto; width: auto; }

/* DEM portal-aligned project review theme */
.review-shell {
    --review-dark: #1b1d19;
    --review-ink: #20231d;
    --review-olive: #46513e;
    --review-paper: #f0efe9;
    --review-field: #d9dccd;
    min-width: 320px;
    background: var(--review-field);
    background-image: linear-gradient(rgba(52, 61, 46, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(52, 61, 46, .035) 1px, transparent 1px);
    background-size: 72px 72px;
}

.review-shell a:focus-visible,
.review-shell button:focus-visible,
.review-shell input:focus-visible,
.review-shell textarea:focus-visible,
.review-shell select:focus-visible {
    outline: 2px solid #a87636;
    outline-offset: 3px;
}

.review-shell .navbar {
    height: 74px;
    padding: 0 max(28px, calc((100vw - 1600px) / 2));
    color: var(--review-ink);
    background: rgba(240, 239, 233, .92);
    border-bottom: 1px solid rgba(42, 48, 38, .18);
    box-shadow: none;
    backdrop-filter: blur(18px);
}

.review-shell .nav-brand a { gap: 13px; color: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.review-brand-mark { position: relative; display: block; width: 27px; height: 27px; border: 1px solid currentColor; border-radius: 50%; }
.review-brand-mark i { position: absolute; display: block; background: currentColor; }
.review-brand-mark i:first-child { top: 4px; bottom: 4px; left: 12px; width: 1px; }
.review-brand-mark i:last-child { top: 12px; right: 4px; left: 4px; height: 1px; }
.review-brand-copy { display: flex; gap: 10px; align-items: baseline; }
.review-brand-copy strong { font-size: 14px; font-weight: 650; letter-spacing: .04em; }
.review-brand-copy small { color: #61685c; font-size: 10px; font-weight: 500; letter-spacing: .08em; }

.review-shell .nav-links { gap: 0; }
.review-shell .nav-links > a {
    position: relative;
    padding: 27px 15px 25px;
    color: #565e51;
    border-radius: 0;
    font-size: 11px;
    font-weight: 550;
    letter-spacing: .04em;
}

.review-shell .nav-links > a::after {
    position: absolute;
    right: 15px;
    bottom: 17px;
    left: 15px;
    height: 1px;
    content: "";
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 260ms ease;
}

.review-shell .nav-links > a:hover,
.review-shell .nav-links > a.active { color: var(--review-ink); background: transparent; }
.review-shell .nav-links > a:hover::after,
.review-shell .nav-links > a.active::after { transform: scaleX(1); transform-origin: left; }
.review-shell .nav-user { margin-left: 12px; }
.review-shell .user-menu-toggle { gap: 9px; padding: 4px 4px 4px 12px; color: #4e574a; background: transparent; border-color: #bfc5b8; }
.review-shell .user-avatar { color: #edf0e8; background: var(--review-olive); }
.review-shell .user-menu { background: rgba(245, 244, 238, .98); border-color: #c3c8bc; border-radius: 2px; box-shadow: var(--shadow-lg); }

.review-shell .main-container {
    width: min(calc(100% - 72px), 1600px);
    max-width: none;
    min-height: calc(100vh - 74px);
    padding: 38px 0 80px;
}

.review-shell .page-header,
.review-shell .score-header {
    min-height: 156px;
    padding: 30px 0 34px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(42, 48, 38, .28);
}

.review-shell .page-header h1,
.review-shell .score-header h2 {
    color: var(--review-ink);
    font-size: clamp(34px, 4vw, 62px);
    font-weight: 520;
    line-height: 1.05;
    letter-spacing: -.055em;
}

.review-shell .page-header h1::before,
.review-shell .score-header h2::before {
    display: block;
    margin-bottom: 17px;
    color: #697164;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .18em;
    content: "HOMETOWN GEOGRAPHY / PROJECT REVIEW";
}

.review-shell .page-header > p { max-width: 620px; margin: 40px 0 0 auto; line-height: 1.8; }
.review-shell .btn { min-height: 41px; padding: 10px 17px; border: 1px solid transparent; border-radius: 1px; box-shadow: none; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.review-shell .btn-primary { color: #f4f4ee; background: var(--review-olive); border-color: var(--review-olive); }
.review-shell .btn-primary:hover { background: #30382b; border-color: #30382b; transform: translateY(-1px); }
.review-shell .btn-secondary { color: #3e463b; background: transparent; border-color: #aeb5a7; }
.review-shell .btn-secondary:hover { color: #f1f1eb; background: #30372c; border-color: #30372c; }
.review-shell .form-control,
.review-shell .suggestion-textarea,
.review-shell input,
.review-shell textarea,
.review-shell select { border-radius: 1px; }
.review-shell .form-control,
.review-shell .suggestion-textarea { color: var(--review-ink); background: rgba(249, 248, 243, .88); border-color: #bfc5b8; }
.review-shell .form-control:focus,
.review-shell .suggestion-textarea:focus { border-color: var(--review-olive); box-shadow: var(--shadow-glow); }

/* Authentication */
.review-shell--auth-login .main-container,
.review-shell--auth-register .main-container,
.review-shell--auth-change_password .main-container { width: 100%; padding: 0; }
.review-shell .auth-page {
    display: grid;
    grid-template-columns: minmax(360px, 1.15fr) minmax(440px, .85fr);
    align-items: stretch;
    min-height: calc(100vh - 74px);
    padding: 0;
    margin: 0;
    background: var(--review-paper);
}

.review-shell .auth-context {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: inherit;
    padding: clamp(54px, 8vw, 130px);
    overflow: hidden;
    color: #eef0e7;
    background: #444c3d;
}

.auth-context__eyebrow,
.auth-context__meta,
.auth-header__index { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; font-weight: 500; letter-spacing: .18em; }
.auth-context__eyebrow { position: relative; z-index: 2; margin-bottom: 34px; opacity: .68; }
.review-shell .auth-context h1 { position: relative; z-index: 2; margin: 0; font-size: clamp(62px, 7vw, 126px); font-weight: 500; line-height: .96; letter-spacing: -.075em; }
.review-shell .auth-context > p { position: relative; z-index: 2; max-width: 520px; margin: 42px 0 0; font-size: clamp(15px, 1.2vw, 20px); line-height: 1.8; opacity: .7; }
.auth-context__meta { position: absolute; right: clamp(30px, 5vw, 80px); bottom: 40px; left: clamp(30px, 5vw, 80px); z-index: 2; display: flex; justify-content: space-between; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .25); opacity: .6; }
.auth-topography { position: absolute; right: -8%; bottom: -4%; width: 92%; fill: none; stroke: rgba(237, 240, 231, .2); stroke-width: 1.2; }

.review-shell .auth-container {
    align-self: center;
    width: min(100% - 80px, 520px);
    max-width: none;
    padding: clamp(36px, 5vw, 68px);
    margin: 50px auto;
    background: transparent;
    border: 1px solid rgba(54, 61, 49, .22);
    border-radius: 1px;
    box-shadow: none;
    backdrop-filter: none;
}

.review-shell .auth-header { margin-bottom: 38px; text-align: left; }
.auth-header__index { display: block; margin-bottom: 21px; color: #737b6e; }
.review-shell .auth-container h2 { margin-bottom: 12px; color: var(--review-ink); font-size: clamp(30px, 3vw, 44px); font-weight: 520; letter-spacing: -.045em; }
.review-shell .auth-subtitle { margin: 0; color: #6b7367; line-height: 1.7; }
.review-shell .auth-form label { color: #51594d; font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.review-shell .auth-form .form-control { min-height: 49px; padding-block: 12px; background: rgba(249, 248, 243, .68); }
.review-shell .auth-form .btn { min-height: 50px; margin-top: 8px; }
.review-shell .auth-link { padding-top: 22px; margin-top: 26px; border-top: 1px solid rgba(54, 61, 49, .16); text-align: left; }
.review-shell .auth-link a { color: var(--review-olive); }

/* Submission list */
.review-shell .progress-widget { min-width: 320px; padding: 17px 0 17px 25px; background: transparent; border: 0; border-left: 1px solid #aeb5a7; border-radius: 0; box-shadow: none; }
.review-shell .progress-bar { height: 4px; background: rgba(70, 81, 62, .16); border-radius: 0; }
.review-shell .progress-bar-fill,
.review-shell .dimension-progress-fill,
.review-shell .kpi-progress-fill { background: var(--review-olive); border-radius: 0; }
.review-shell .filter-bar { gap: 0; padding: 0; margin-bottom: 28px; background: transparent; border: 0; border-bottom: 1px solid rgba(42, 48, 38, .24); border-radius: 0; box-shadow: none; }
.review-shell .filter-bar a { padding: 13px 25px; border-radius: 0; font-size: 10px; letter-spacing: .06em; }
.review-shell .filter-bar a:hover { background: rgba(70, 81, 62, .07); }
.review-shell .filter-bar a.active { color: #f2f2ec; background: var(--review-olive); box-shadow: none; }
.review-shell .entry-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1px; background: #bfc5b8; border: 1px solid #bfc5b8; }
.review-shell .entry-card { background: var(--review-paper); border: 0; border-radius: 0; box-shadow: none; }
.review-shell .entry-card:hover { z-index: 1; box-shadow: 0 26px 60px rgba(28, 34, 25, .17); transform: translateY(-4px); }
.review-shell .entry-thumb-wrap { height: 190px; background: #dfe2d8; }
.review-shell .entry-info { padding: 20px; }
.review-shell .entry-number { font-size: 16px; font-weight: 560; letter-spacing: -.02em; }
.review-shell .entry-author { display: block; margin-top: 7px; color: #747c70; font-size: 9px; font-weight: 400; }
.review-shell .badge,
.review-shell .dimension-diff-badge { border-radius: 1px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; letter-spacing: .07em; }
.review-shell .pagination a,
.review-shell .pagination span { border-radius: 1px; box-shadow: none; }
.review-shell .pagination .current { background: var(--review-olive); border-color: var(--review-olive); box-shadow: none; }

/* Immersive review and management */
.review-shell .score-layout { gap: 22px; }
.review-shell .panel,
.review-shell .score-form-panel,
.review-shell .admin-section,
.review-shell .kpi-card,
.review-shell .action-card { background: rgba(245, 244, 238, .94); border: 1px solid rgba(67, 76, 60, .24); border-radius: 1px; box-shadow: none; }
.review-shell .panel:hover,
.review-shell .kpi-card:hover,
.review-shell .action-card:hover { border-color: rgba(55, 64, 49, .48); box-shadow: 0 18px 42px rgba(29, 34, 25, .07); }
.review-shell .panel-header { min-height: 50px; padding: 14px 18px; color: #30362d; background: rgba(223, 226, 216, .55); border-bottom-color: rgba(67, 76, 60, .2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; letter-spacing: .1em; }
.review-shell .panel-header-icon { color: var(--review-olive); }
.review-shell .splitter { width: 9px; background: transparent; border-color: rgba(67, 76, 60, .15); }
.review-shell .splitter:hover,
.review-shell .splitter.dragging { background: #d2d7ca; }
.review-shell .splitter::after { background: #8b9485; }
.review-shell .poster-panel .panel-body { background: #dfe2d8; }
.review-shell .report-panel .panel-body { background: #f8f7f2; }
.review-shell .report-pdf { display: block; width: 100%; height: 100%; min-height: 620px; border: 0; }
.review-shell .ai-panel-body,
.review-shell .chat-messages { background: #eef0e8; }
.review-shell .chat-header { color: #ebeee6; background: var(--review-olive); }
.review-shell .chat-input-row { background: #f5f4ee; border-top-color: #c4cabd; }
.review-shell .score-form-panel { padding: clamp(22px, 3vw, 38px); }
.review-shell .dimension-item { background: transparent; border-bottom: 1px solid rgba(67, 76, 60, .15); border-radius: 0; }
.review-shell .dimension-progress { border-radius: 0; }
.review-shell .stepper-btn { border-radius: 1px; background: transparent; }
.review-shell .total-display { background: #e8ede3; border-color: #c4cebe; border-radius: 1px; }

.review-shell .dashboard-grid,
.review-shell .action-cards { gap: 1px; padding: 1px; background: #bdc3b6; }
.review-shell .kpi-card { min-height: 170px; padding: 24px; border: 0; }
.review-shell .kpi-icon,
.review-shell .stat-icon,
.review-shell .action-card .action-icon { color: #e9ece4; background: var(--review-olive); border-radius: 50%; }
.review-shell .kpi-value,
.review-shell .stat-value { font-size: clamp(28px, 3vw, 46px); font-weight: 520; letter-spacing: -.045em; }
.review-shell .kpi-label,
.review-shell .stat-label { font-size: 10px; letter-spacing: .06em; }
.review-shell .action-card { min-height: 185px; border: 0; }
.review-shell .action-card:hover { z-index: 1; transform: translateY(-3px); }
.review-shell .data-table,
.review-shell .admin-table { background: rgba(245, 244, 238, .8); }
.review-shell .data-table th,
.review-shell .admin-table th { color: #5b6357; background: #dde1d6; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; font-weight: 600; letter-spacing: .08em; }
.review-shell .data-table td,
.review-shell .admin-table td { border-bottom-color: rgba(67, 76, 60, .15); }
.review-shell .data-table tbody tr:hover td,
.review-shell .admin-table tbody tr:hover td { background: #e8ebe1; }
.review-shell .toast { background: #f5f4ee; border-radius: 1px; box-shadow: var(--shadow-lg); }

@media (max-width: 1100px) {
    .review-shell .auth-page { grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.15fr); }
    .review-shell .auth-context { padding: 54px; }
    .review-shell .auth-context h1 { font-size: clamp(54px, 7vw, 82px); }
    .review-brand-copy small { display: none; }
}

@media (max-width: 820px) {
    .review-shell .navbar { height: 66px; padding: 0 18px; }
    .review-shell .nav-links { max-width: 65vw; overflow-x: auto; }
    .review-shell .nav-links > a { flex: 0 0 auto; padding: 23px 10px 21px; }
    .review-shell .main-container { width: calc(100% - 36px); min-height: calc(100vh - 66px); padding-top: 24px; }
    .review-shell--auth-login .main-container,
    .review-shell--auth-register .main-container,
    .review-shell--auth-change_password .main-container { width: 100%; padding: 0; }
    .review-shell .auth-page { grid-template-columns: 1fr; }
    .review-shell .auth-context { min-height: 340px; padding: 50px 30px 80px; }
    .review-shell .auth-context h1 { font-size: clamp(52px, 13vw, 78px); }
    .review-shell .auth-context > p { max-width: 560px; margin-top: 25px; font-size: 14px; }
    .auth-context__meta { right: 30px; bottom: 24px; left: 30px; }
    .review-shell .auth-container { width: min(100% - 36px, 560px); margin: 38px auto; padding: 34px 24px; }
    .review-shell .page-header,
    .review-shell .score-header { min-height: 132px; }
}

@media (max-width: 640px) {
    .review-shell .nav-brand a { gap: 8px; }
    .review-brand-mark { width: 23px; height: 23px; }
    .review-brand-mark i:first-child { left: 10px; }
    .review-brand-mark i:last-child { top: 10px; }
    .review-shell .nav-links > a:not(.active) { display: none; }
    .review-shell .nav-user { margin-left: 4px; }
    .review-shell .page-header h1,
    .review-shell .score-header h2 { font-size: 38px; }
    .review-shell .progress-widget { min-width: 0; padding-left: 0; border-left: 0; }
    .review-shell .entry-grid { grid-template-columns: 1fr; }
    .review-shell .auth-context__meta span:last-child { display: none; }
}
