/* ============================================
   Studio - Design System
   Inspired by Linear / Vercel / Figma
   ============================================ */

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

:root {
    --bg-primary: #09090b;
    --bg-secondary: #111113;
    --bg-card: #131316;
    --bg-card-hover: #1a1a1e;
    --bg-input: #111113;
    --border-color: #1e1e22;
    --border-hover: #2e2e34;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text-secondary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--text-primary); }
img { max-width: 100%; height: auto; }

/* Alert */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid;
}
.alert-error { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.2); color: #86efac; }

/* ============================================
   Auth pages (login/register)
   ============================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.auth-container { width: 100%; max-width: 380px; padding: 20px; }

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
}

.auth-logo { text-align: center; margin-bottom: 36px; }
.auth-logo h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-logo p { color: var(--text-muted); font-size: 13px; }

.auth-card h2 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 28px;
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   Form elements
   ============================================ */
.form-group {
    margin-bottom: 24px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}
.form-group textarea { resize: vertical; min-height: 96px; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    letter-spacing: 0.01em;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}
.btn-full { width: 100%; padding: 12px; font-size: 14px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }

.btn-generate {
    margin-top: 4px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}
.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 52px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.nav-brand {
    display: flex;
    align-items: center;
}
.brand-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}
.brand-text:hover { color: var(--text-primary); }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-user { color: var(--text-muted); font-size: 13px; }
.nav-link { color: var(--text-muted); font-size: 13px; transition: var(--transition); }
.nav-link:hover { color: var(--text-primary); }
.nav-logout { color: var(--text-muted); }
.nav-logout:hover { color: var(--danger); }

/* ============================================
   Main content
   ============================================ */
.main-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.toolbar-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.toolbar-divider {
    width: 1px;
    height: 14px;
    background: var(--border-color);
}
.toolbar-stat {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   Generate section
   ============================================ */
.generate-section {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}

.generate-card, .result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
}

/* ============================================
   Upload area
   ============================================ */
.upload-area {
    position: relative;
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
    overflow: hidden;
    background: var(--bg-input);
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.03);
}

.upload-placeholder { text-align: center; padding: 40px 20px; }
.upload-svg-icon {
    color: var(--text-muted);
    margin-bottom: 14px;
    opacity: 0.6;
}
.upload-main-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; font-weight: 500; }
.upload-sub-text { font-size: 12px; color: var(--text-muted); }

.upload-preview {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.upload-preview img {
    max-height: 280px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}
.btn-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.btn-remove:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
    border-color: transparent;
}

/* ============================================
   Result section
   ============================================ */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.result-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}
.result-image-wrapper {
    text-align: center;
}
.result-image-wrapper img {
    max-width: 100%;
    max-height: 480px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

/* ============================================
   Progress modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 44px 48px;
    text-align: center;
    min-width: 300px;
}
.progress-wrapper h3 {
    margin: 20px 0 6px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}
.progress-wrapper p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.progress-spinner {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

.progress-bar-wrapper {
    width: 100%;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

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

/* ============================================
   Reference links section
   ============================================ */
.ref-section {
    position: relative;
}

.ref-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ref-input-row input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.ref-input-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.btn-parse {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 13px;
}

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

.ref-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.label-hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Parse results */
.ref-results {
    margin-top: 14px;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.ref-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ref-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ref-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid var(--border-color);
    transition: var(--transition);
    background: var(--bg-card);
}

.ref-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ref-thumb:hover {
    border-color: var(--text-muted);
}

.ref-thumb.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.ref-thumb-check {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.ref-thumb.selected .ref-thumb-check {
    display: flex;
}

.ref-tip {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: center;
}

/* ============================================
   Recent section & History
   ============================================ */
.recent-section {
    margin-top: 56px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.section-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.link-arrow {
    font-size: 12px;
    color: var(--text-muted);
    transition: var(--transition);
}
.link-arrow:hover { color: var(--text-primary); }

.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.page-header p { color: var(--text-muted); font-size: 13px; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { margin-bottom: 8px; font-size: 16px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; font-size: 13px; }

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.history-item:hover { border-color: var(--border-hover); }

.history-images { display: flex; gap: 6px; padding: 14px 14px 6px; }
.history-img-box { flex: 1; position: relative; }
.history-img-box img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.img-label {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0.04em;
}
.history-info { padding: 8px 14px 14px; }
.history-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-time {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* History list (for history.php) */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    gap: 16px;
    transition: var(--transition);
}
.history-card:hover { border-color: var(--border-hover); }
.history-card-images { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.history-card-images .history-img-box { width: 100px; flex: none; }
.history-card-images .history-img-box img { height: 100px; }
.history-arrow { color: var(--text-muted); font-size: 16px; }
.history-card-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.history-card-info .history-desc { font-size: 13px; margin-bottom: 10px; white-space: normal; color: var(--text-secondary); }
.history-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.error-hint { cursor: help; font-size: 12px; color: var(--text-muted); }

.img-placeholder {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
}
.img-fail { color: var(--danger); }

/* ============================================
   Status badges
   ============================================ */
.status-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.status-0 { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.status-1 { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.status-2 { background: rgba(239, 68, 68, 0.1); color: #f87171; }

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}
.page-link {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    transition: var(--transition);
}
.page-link:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.page-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.page-dots { color: var(--text-muted); font-size: 13px; }

/* ============================================
   Admin panel
   ============================================ */
.admin-body {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}
.sidebar-brand h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    transition: var(--transition);
}
.sidebar-nav .nav-item:hover { background: var(--bg-card); color: var(--text-secondary); }
.sidebar-nav .nav-item.active { background: var(--bg-card-hover); color: var(--text-primary); }
.sidebar-nav .nav-logout { color: var(--danger); margin-top: auto; }

.admin-main {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.admin-header h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.admin-user { color: var(--text-muted); font-size: 13px; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
}
.stat-blue::before { background: var(--accent); }
.stat-green::before { background: var(--success); }
.stat-purple::before { background: #8b5cf6; }
.stat-orange::before { background: var(--warning); }

.stat-icon { font-size: 24px; margin-bottom: 8px; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-footer {
    width: 100%;
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* Trend chart */
.trend-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
}
.trend-section h2 { margin-bottom: 20px; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 140px;
    padding-top: 16px;
}
.trend-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.trend-bar {
    width: 100%;
    max-width: 32px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 4px;
    transition: height 0.5s ease;
    opacity: 0.7;
}
.trend-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.trend-date { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* Search bar */
.search-bar { margin-bottom: 20px; }
.search-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-form input,
.search-form select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}
.search-form input { flex: 1; min-width: 180px; }
.search-form input:focus,
.search-form select:focus { border-color: var(--accent); }

/* Data table */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}
.data-table th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.data-table tr:hover td { background: var(--bg-card-hover); }
.table-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}
.desc-cell { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-muted { color: var(--text-muted); }

/* ============================================
   Spinner
   ============================================ */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* ============================================
   Toast
   ============================================ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .navbar { padding: 0 16px; }
    .nav-right { gap: 12px; }
    .main-content { padding: 0 16px 60px; }

    .admin-body { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 12px 0;
    }
    .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 0 10px; }
    .sidebar-nav .nav-item { white-space: nowrap; }
    .admin-main { padding: 16px; }

    .history-card { flex-direction: column; }
    .history-card-images { justify-content: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .generate-card, .result-card { padding: 20px; }
}
