:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-hover: #1a1a1a;
    --border: #2a2a2a;
    --text: #e5e5e5;
    --text-dim: #888;
    --accent: #6366f1;
    --accent-dim: #4338ca;
    --green: #22c55e;
    --green-dim: #16a34a;
    --red: #ef4444;
    --yellow: #eab308;
    --code-bg: #1a1a2e;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'SF Mono', 'Fira Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-card .subtitle {
    color: var(--text-dim);
    margin-bottom: 32px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
}

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

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

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

.btn-secondary:hover { border-color: var(--text-dim); }

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--red);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.error-msg.visible { display: block; }

/* Dashboard layout */
.app-header {
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.app-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-left h1 {
    font-size: 16px;
    font-weight: 700;
}

.header-left .badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-dim);
    color: white;
    font-weight: 500;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.header-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.header-nav a:hover { color: var(--text); background: var(--surface); }
.header-nav a.active { color: var(--text); background: var(--surface); }

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right .user {
    font-size: 13px;
    color: var(--text-dim);
}

.logout-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.logout-btn:hover { color: var(--text); border-color: var(--text-dim); }

main.container {
    padding-top: 32px;
    padding-bottom: 48px;
}

/* Page title */
.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* Stat cards grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.stat-card .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.stat-card .sub {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}

.stat-card .value.green { color: var(--green); }
.stat-card .value.accent { color: var(--accent); }

/* Sparkline */
.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 32px;
    margin-top: 8px;
}

.sparkline .bar {
    flex: 1;
    background: var(--accent);
    border-radius: 2px;
    min-height: 2px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sparkline .bar:hover { opacity: 1; }

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
}

/* Filter pills */
.filter-pills {
    display: flex;
    gap: 6px;
}

.filter-pills button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.filter-pills button:hover { border-color: var(--text-dim); color: var(--text); }
.filter-pills button.active { background: var(--accent-dim); border-color: var(--accent-dim); color: white; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

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

.data-table .mono {
    font-family: var(--mono);
    font-size: 12px;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status.approved { background: rgba(34, 197, 94, 0.12); color: var(--green); }
.status.rejected { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.status.pending  { background: rgba(234, 179, 8, 0.12); color: var(--yellow); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.pagination .info {
    font-size: 12px;
    color: var(--text-dim);
}

.pagination .controls {
    display: flex;
    gap: 6px;
}

.pagination button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) { border-color: var(--text-dim); color: var(--text); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* Card wrapper */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

/* Settings page */
.settings-card {
    max-width: 480px;
}

.settings-card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.profile-info {
    margin-bottom: 20px;
}

.profile-info .form-group {
    margin-bottom: 12px;
}

.profile-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    padding: 8px 0 0;
}

.password-section {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 8px;
}

.password-section summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--text-dim);
    user-select: none;
}

.password-section summary:hover {
    color: var(--text);
}

.success-msg {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--green);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.success-msg.visible { display: block; }

/* Loading state */
.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-dim);
}

.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-dim);
    font-size: 13px;
}

/* Agent avatar */
.agent-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.agent-avatar.large {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

/* Suspended status */
.status.suspended { background: rgba(234, 179, 8, 0.12); color: #f59e0b; }

/* Agent header */
.agent-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.agent-header-info {
    flex: 1;
}

.agent-header-info h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.agent-header-info .developer {
    color: var(--text-dim);
    font-size: 13px;
}

.agent-header-actions {
    display: flex;
    gap: 8px;
}

/* Action buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
}

.action-btn:hover { border-color: var(--text-dim); }

.action-btn.approve { border-color: var(--green-dim); color: var(--green); }
.action-btn.approve:hover { background: rgba(34, 197, 94, 0.1); }

.action-btn.suspend { border-color: #d97706; color: #f59e0b; }
.action-btn.suspend:hover { background: rgba(245, 158, 11, 0.1); }

.action-btn.danger { border-color: var(--red); color: var(--red); }
.action-btn.danger:hover { background: rgba(239, 68, 68, 0.1); }

/* API key display */
.key-section {
    margin-top: 24px;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
}

.key-display code {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-dim);
    flex: 1;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.back-link:hover { color: var(--text); }

/* Leaderboard */
.leaderboard {
    list-style: none;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.leaderboard-item:last-child { border-bottom: none; }

.leaderboard-rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dim);
    min-width: 24px;
    text-align: center;
}

.leaderboard-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.leaderboard-name a {
    color: var(--text);
    text-decoration: none;
}

.leaderboard-name a:hover { color: var(--accent); }

.leaderboard-stat {
    font-size: 13px;
    color: var(--text-dim);
    font-family: var(--mono);
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    max-width: 480px;
    width: 90%;
}

.modal h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.modal p {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal .key-value {
    font-family: var(--mono);
    font-size: 12px;
    word-break: break-all;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
    user-select: all;
    cursor: text;
}

/* Agent name cell */
.agent-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agent-name-cell a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.agent-name-cell a:hover { color: var(--accent); }

/* Click-through rows */
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--surface-hover); }

/* Generation config */
.generation-config-card {
    max-width: 720px;
}

.config-subtitle {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 20px;
}

.config-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-family: var(--mono);
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.config-textarea:focus { border-color: var(--accent); }

.config-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.config-select:focus { border-color: var(--accent); }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
    line-height: 1.5;
}

.form-hint code {
    font-family: var(--mono);
    font-size: 10px;
    background: var(--bg);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.voice-fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.voice-fieldset legend {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    padding: 0 8px;
}

.config-history {
    margin-top: 24px;
}

.config-history summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--text-dim);
    padding: 8px 0;
}

.config-history summary:hover { color: var(--text); }

.config-history-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.config-history-item .version-id { font-family: var(--mono); }
.config-history-item .version-meta { display: flex; gap: 12px; }

.config-restore-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.config-restore-btn:hover { color: var(--text); border-color: var(--text-dim); }

/* Toggle switch */
.toggle-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-slider {
    width: 44px; height: 24px;
    background: var(--border); border-radius: 12px;
    position: relative; transition: background 0.2s;
}
.toggle-slider::after {
    content: ""; position: absolute;
    top: 3px; left: 3px; width: 18px; height: 18px;
    background: var(--text-dim); border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--green-dim); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(20px); background: var(--green); }
.toggle-label { font-size: 13px; font-weight: 600; color: var(--text-dim); }

.reject-btn { background: none; border: 1px solid var(--red); color: var(--red); padding: 3px 10px; border-radius: 4px; font-size: 11px; cursor: pointer; }
.reject-btn:hover { background: var(--red); color: white; }

/* Copyable cells */
.copyable { cursor: pointer; user-select: all; }
.copyable:hover { color: var(--text); }

/* Superseded status badge */
.status.superseded { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

/* Audio player button */
.play-btn {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}
.play-btn:hover { background: var(--accent); color: white; }
.play-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.play-btn.playing { background: var(--accent); color: white; }

/* Inline audio player */
.audio-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 50;
    font-size: 13px;
}

.audio-player-bar .player-label {
    color: var(--text-dim);
    font-size: 12px;
    white-space: nowrap;
}

.audio-player-bar .player-progress {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.audio-player-bar .player-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.audio-player-bar .player-time {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
    min-width: 40px;
}

.audio-player-bar .player-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
}

/* Filter controls (pills + toggle) */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle-switch.compact .toggle-slider { width: 36px; height: 20px; }
.toggle-switch.compact .toggle-slider::after { width: 14px; height: 14px; }
.toggle-switch.compact input:checked + .toggle-slider::after { transform: translateX(16px); }

/* Version badge */
.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text-dim);
}

.version-badge .ver-num {
    font-weight: 600;
    color: var(--text);
}

.version-badge .ver-total {
    color: var(--text-dim);
}

.version-badge .ver-expand {
    background: none;
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    font-family: var(--font);
    margin-left: 2px;
    transition: all 0.2s;
}

.version-badge .ver-expand:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* Version history sub-rows */
.data-table tr.version-row td {
    background: var(--bg);
    padding: 8px 14px;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}

.data-table tr.version-row td:first-child {
    padding-left: 28px;
}

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

/* Script modal */
.script-modal {
    max-width: 640px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.script-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.script-modal-header h3 { margin: 0; }

.script-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    flex: 1;
    margin-bottom: 16px;
    max-height: 50vh;
    user-select: text;
}

/* POI page */
.bulk-actions-bar {
    border: 1px solid var(--accent-dim);
    background: rgba(99, 102, 241, 0.05);
}

.bulk-actions-bar .action-btn,
.bulk-actions-bar .reject-btn {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
    line-height: 1.4;
}

.bulk-actions-bar .action-btn.suspend {
    background: var(--yellow);
    color: #000;
}

.bulk-actions-bar .action-btn.suspend:hover {
    background: #ca9b08;
}

.bulk-actions-bar .reject-btn {
    background: var(--red);
    color: white;
}

.bulk-actions-bar .reject-btn:hover {
    background: #dc2626;
}

.bulk-actions-bar .action-btn:last-of-type {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.bulk-actions-bar .action-btn:last-of-type:hover {
    border-color: #444;
    color: var(--text);
}

.gen-source-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    margin-top: 3px;
}

.gen-source-badge.batch { color: var(--cyan); background: rgba(34,211,238,0.12); border: 1px solid rgba(34,211,238,0.25); }
.gen-source-badge.on-demand { color: var(--green); background: rgba(34,211,153,0.12); border: 1px solid rgba(34,211,153,0.25); }
.gen-source-badge.prefetch { color: var(--yellow); background: rgba(234,179,8,0.12); border: 1px solid rgba(234,179,8,0.25); }

.photo-reported-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--yellow);
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.25);
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
}

/* Custom checkbox */
.check-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.check-wrap input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    z-index: 1;
}

.check-box {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-wrap input:checked + .check-box {
    background: var(--accent);
    border-color: var(--accent);
}

.check-wrap input:checked + .check-box::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.check-wrap:hover .check-box {
    border-color: var(--accent);
}

/* Custom select */
.custom-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 8px 32px 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s;
}

.custom-select:hover { border-color: #444; }
.custom-select:focus { border-color: var(--accent); outline: none; }

.custom-select option {
    background: var(--surface);
    color: var(--text);
}

input.custom-select {
    background-image: none;
    padding-right: 12px;
}

input.custom-select::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 440px;
    animation: modalIn 0.2s ease;
}

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

.modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-body {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal-input-wrap {
    margin-bottom: 16px;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font);
    resize: vertical;
    min-height: 40px;
    transition: border-color 0.15s;
}

.modal-input:focus {
    border-color: var(--accent);
    outline: none;
}

.modal-input::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

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

.modal-btn.secondary:hover {
    border-color: #444;
    color: var(--text);
}

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

.modal-btn.primary:hover {
    background: var(--accent-dim);
}

.modal-btn.danger {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

.modal-btn.danger:hover {
    background: #dc2626;
}

.poi-filters { margin: 0; }

.poi-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.poi-filter-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 4px;
    font-weight: 600;
}

.poi-count {
    font-size: 13px;
    color: var(--text-dim);
    font-family: var(--mono);
}

.poi-status-icon {
    font-size: 12px;
    font-family: var(--mono);
}

.poi-status-icon.has { color: var(--green); }
.poi-status-icon.missing { color: var(--text-dim); opacity: 0.4; }

.photo-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 11px;
}
.photo-link:hover { color: var(--accent); }

.poi-name-with-photo { cursor: pointer; border-bottom: 1px dotted var(--text-dim); }

.photo-tooltip {
    position: fixed;
    z-index: 200;
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    pointer-events: none;
}

.photo-tooltip img {
    display: block;
    max-width: 300px;
    max-height: 200px;
    border-radius: 6px;
    object-fit: cover;
}

/* Tier badges */
.tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--mono);
}
.tier-1 { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.tier-2 { background: rgba(99, 102, 241, 0.2); color: var(--accent); }
.tier-3 { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.tier-4 { background: rgba(136, 136, 136, 0.15); color: var(--text-dim); }

/* Photo review */
.photo-preview {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}
.photo-preview:hover { transform: scale(1.05); }

/* Responsive */
@media (max-width: 640px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .header-nav { display: none; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 10px; }
    .login-card { padding: 28px; }
    .filter-pills { flex-wrap: wrap; }
}
