:root {
    --bg: #111827;
    --surface: #1f2937;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --primary: #3b82f6;
    --accent: #22c55e;
    --danger: #ef4444;
    --border: #374151;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

h1, h2, h3 { margin: 0 0 10px; }

input, select, textarea, button {
    width: 100%;
    padding: 9px;
    margin: 6px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 88%, black 12%);
    color: var(--text);
}

button, .btn-inline {
    cursor: pointer;
    background: var(--primary);
    border: none;
    color: #fff;
    font-weight: 600;
}

button.secondary, .btn-inline.secondary { background: var(--accent); }
button.danger, .btn-inline.danger { background: var(--danger); }

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.actions form { margin: 0; }

.small { color: var(--muted); font-size: 0.9rem; }
.tiny { color: var(--muted); font-size: 0.82rem; }

.nav {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    border-bottom: 1px solid var(--border);
    padding: 8px;
    text-align: left;
}

.hidden-section {
    opacity: 0.65;
    border-style: dashed;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.section-header h3 {
    margin: 0;
}

.section-collapsed .section-body {
    display: none;
}

.section-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.section-loading .section-spinner {
    display: inline-block;
}

.project-hero {
    min-height: 180px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    margin-bottom: 14px;
    overflow: hidden;
}

.project-hero-inner {
    background: color-mix(in srgb, var(--surface) 68%, transparent 32%);
    padding: 14px;
}

.project-banner {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 0;
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.dashboard-project-banner {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 0;
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.dashboard-project-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.dashboard-project-link:hover {
    text-decoration: none;
}

.dashboard-project-card {
    margin-bottom: 0;
}

.dashboard-project-card h3 {
    margin: 0 0 6px;
}

.dashboard-project-description {
    margin: 0 0 4px;
}

.dashboard-project-card .tiny {
    margin: 0;
}

.checklist-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.checklist-check {
    width: auto;
    margin: 0;
}

.checklist-sep {
    color: var(--muted);
}

.checklist-inline-image {
    max-width: 72px;
    max-height: 54px;
    width: auto;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
    object-fit: contain;
    cursor: pointer;
}

.image-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-thumb {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
}

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

.modal {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--bg) 40%, black 60%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.open { display: flex; }

.modal-card {
    width: min(760px, 92vw);
    max-height: 88vh;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.image-modal-card {
    width: min(1200px, 95vw);
}

.image-modal-actions {
    margin-bottom: 10px;
}

.image-modal-frame {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #000;
    overflow: auto;
    max-height: 78vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modalImage {
    display: block;
}

#modalImage.fit-browser {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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