/* ═══════════════════════════════════════════════════════════════════════════
   Ideogram Control Center — Premium Dark Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
    --bg-main: #0a0e17;
    --bg-card: #111827;
    --bg-hover: #1a2236;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-solid: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #8896ab;
    --primary: #4f8bff;
    --primary-hover: #3b7aed;
    --primary-glow: rgba(79, 139, 255, 0.15);
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --accent: #a78bfa;
    --terminal-bg: #060a12;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45), 0 4px 8px rgba(0, 0, 0, 0.25);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-btn: 8px;
    --transition: all 0.15s ease;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 24px;
    min-height: 100vh;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ── Focus-visible ─────────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Layout Container ──────────────────────────────────────────────────── */
.app-container {
    max-width: 1350px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── App Header ────────────────────────────────────────────────────────── */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 22px;
    background: var(--primary-glow);
    border: 1px solid rgba(79, 139, 255, 0.2);
    border-radius: var(--radius);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header h1 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Status Pill ───────────────────────────────────────────────────────── */
.status-pill {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.status-pill.idle {
    background: rgba(136, 150, 171, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(136, 150, 171, 0.2);
}

.status-pill.running {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.status-pill.stopping {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

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

/* ── Navigation Tabs ───────────────────────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.nav-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    margin-bottom: -1px;
}

.nav-btn:hover {
    color: var(--text-main);
}

.nav-btn.active {
    color: var(--text-main);
    border-bottom-color: var(--primary);
}

/* ── Tab Panes ─────────────────────────────────────────────────────────── */
.tab-pane {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.tab-pane.active {
    display: flex;
}

/* ── Stats Grid ────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--text-muted);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card.clickable {
    cursor: pointer;
    user-select: none;
}

.stat-card.clickable:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.stat-card.clickable:active {
    transform: translateY(0);
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger  { border-left-color: var(--danger); }
.stat-card.accent  { border-left-color: var(--accent); }

.stat-title {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.danger .stat-value  { color: var(--danger); }
.stat-card.accent .stat-value  { color: var(--accent); }

/* ── Control Panel ─────────────────────────────────────────────────────── */
.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    background-image: linear-gradient(135deg, rgba(79, 139, 255, 0.03), transparent 60%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 16px;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius-btn);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-family: inherit;
    line-height: 1.2;
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, #4f8bff, #3b7aed);
    color: white;
    border-color: rgba(79, 139, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5e96ff, #4f8bff);
    box-shadow: 0 0 16px rgba(79, 139, 255, 0.25);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    font-weight: 600;
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
    color: #0f172a;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Ghost buttons — for table actions */
.btn-ghost {
    background: transparent;
    border: 1px solid rgba(79, 139, 255, 0.25);
    color: var(--primary);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(79, 139, 255, 0.1);
    border-color: var(--primary);
}

.btn-ghost-danger {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.btn-ghost-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
}

.btn-outline-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.8);
    color: #fff;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.2;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    white-space: nowrap;
}

/* ── Refresh / WS Indicator ────────────────────────────────────────────── */
.refresh-indicator {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.dot.offline {
    background: var(--danger);
}

/* ── Terminal ──────────────────────────────────────────────────────────── */
.terminal-container {
    background: var(--terminal-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 480px;
    box-shadow: var(--shadow-md);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

.terminal-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.terminal-dot.red    { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green  { background: #27c93f; }

.terminal-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auto-scroll-toggle {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.terminal-body {
    padding: 18px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: #c8d1dc;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.65;
}

.log-line {
    white-space: pre-wrap;
    word-break: break-word;
}

.log-line.system {
    color: #60a5fa;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.15);
}

.log-line.error {
    color: #f87171;
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.12);
}

.log-line.success {
    color: #4ade80;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.12);
}

.log-timestamp {
    color: #64748b;
    font-size: 0.85em;
    user-select: none;
    margin-right: 6px;
    font-weight: 500;
    opacity: 0.85;
}

/* ── VNC ───────────────────────────────────────────────────────────────── */
.vnc-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.vnc-container {
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    height: 650px;
    display: flex;
    flex-direction: column;
    position: relative;
}

#vnc-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.vnc-fallback {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(10, 14, 23, 0.92);
    backdrop-filter: blur(8px);
    padding: 12px 18px;
    border-radius: var(--radius-btn);
    border: 1px solid var(--border-color);
    font-size: 13px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.vnc-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.vnc-link:hover {
    text-decoration: underline;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card h3 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

/* ── Prompt Form ───────────────────────────────────────────────────────── */
.prompt-form {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.prompt-form input,
.prompt-form textarea {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-btn);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.prompt-form input:focus,
.prompt-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 139, 255, 0.12);
}

/* ── Table ─────────────────────────────────────────────────────────────── */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-filters {
    display: flex;
    gap: 6px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

.prompts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.prompts-table th,
.prompts-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.prompts-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.prompts-table tbody tr {
    transition: background 0.1s ease;
}

.prompts-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.01);
}

.prompts-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Prompt text truncation & inline edit */
.prompt-text-cell {
    max-width: 280px;
    color: var(--text-main);
    font-weight: 400;
    position: relative;
    cursor: pointer;
}

.prompt-cell-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.prompt-text-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.btn-edit-prompt-icon {
    background: transparent;
    border: none;
    font-size: 13px;
    cursor: pointer;
    opacity: 0.3;
    padding: 2px 4px;
    border-radius: 4px;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1;
}

.prompts-table tbody tr:hover .btn-edit-prompt-icon,
.prompt-text-cell:hover .btn-edit-prompt-icon {
    opacity: 1;
}

.btn-edit-prompt-icon:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Filename truncation */
.filename-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Action cell — buttons side by side */
.action-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 160px;
}

.nowrap {
    white-space: nowrap;
}

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-block;
}

.badge.done {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.badge.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.clickable {
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.badge.clickable:hover {
    transform: scale(1.04);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.btn-view-reason {
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    cursor: pointer;
    transition: all 0.15s ease;
    vertical-align: middle;
}

.btn-view-reason:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
    border-color: #ef4444;
}

.badge.pending {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
}

.badge.running {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
    font-weight: 400;
}

/* ── Gallery ───────────────────────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.gallery-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.gallery-card.selected {
    border-color: #f59e0b;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

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

.gallery-img-wrapper {
    aspect-ratio: 9 / 16;
    width: 100%;
    background: #090d16;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.gallery-select-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.gallery-select-badge input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #f59e0b;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #090d16;
    transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-img {
    transform: scale(1.04);
}

.score-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(10, 14, 23, 0.88);
    backdrop-filter: blur(6px);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 12px;
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
    letter-spacing: 0.02em;
    z-index: 4;
}

.gallery-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.gallery-prompt {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.gallery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
    gap: 8px;
}

/* ── Settings Form ─────────────────────────────────────────────────────── */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 650px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    background: var(--bg-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-btn);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 139, 255, 0.12);
}

.input-with-button {
    display: flex;
    gap: 10px;
}

.input-with-button input {
    flex: 1;
}

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

.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toast-msg {
    font-size: 13px;
    font-weight: 500;
    color: var(--success);
}

/* ── Links ─────────────────────────────────────────────────────────────── */
a {
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .app-container {
        gap: 14px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
    }

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

    .stat-value {
        font-size: 26px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 14px;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .control-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        width: 100%;
    }

    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .prompts-table {
        table-layout: auto;
    }

    .prompt-text-cell {
        max-width: 200px;
    }
}
