/* ============================================================
   Celestial — shadcn/ui dark, full-width layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #09090b;
    --bg-deep: #050506;
    --surface: #0c0c0e;
    --surface-2: #18181b;
    --surface-3: #27272a;
    --border: #27272a;
    --border-strong: #3f3f46;
    --input: #18181b;
    --ring: rgba(212, 212, 216, 0.08);
    --text: #fafafa;
    --text-2: #a1a1aa;
    --text-3: #71717a;
    --accent: #e11d48;
    --accent-fg: #fff;
    --accent-hover: #be123c;
    --accent-dim: rgba(225, 29, 72, 0.10);
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.12);
    --warning: #eab308;
    --warning-dim: rgba(234, 179, 8, 0.12);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.12);
    --r: 8px;
    --r-sm: 6px;
    --r-lg: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
input, textarea, button, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.hidden { display: none !important; }
html { color-scheme: dark; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== ANIMATIONS ===== */

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

/* ===== TOPBAR ===== */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-brand {
    color: var(--text);
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
    transition: color 0.15s;
}
.topbar-brand:hover { color: var(--text-2); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right .btn { height: 38px; padding: 0 16px; font-size: 14px; }
.topbar-user {
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    padding: 0 6px;
}

/* ===== CONTAINER ===== */

.container {
    padding: 32px 32px 80px;
}

/* ===== BUTTONS ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary {
    background: var(--accent);
    color: var(--accent-fg);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}
.btn-success {
    background: var(--success);
    color: #09090b;
}
.btn-success:hover:not(:disabled) { opacity: 0.9; }
.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.18);
}
.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--surface-2);
    color: var(--text);
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon {
    width: 36px; height: 36px; padding: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-3);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; transition: all 0.15s;
}
.btn-icon:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border-strong);
}

/* ===== LOGIN ===== */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px;
    background: var(--bg-deep);
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: fadeUp 0.4s ease-out;
}

.login-halo {
    width: 48px; height: 48px;
    margin: 0 auto 20px;
    opacity: 0.7;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    letter-spacing: -0.3px;
}
.login-card .login-sub {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 8px;
    font-weight: 500;
}

.login-hint {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.6;
}
.login-hint code {
    background: var(--surface-2);
    padding: 2px 7px;
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    border: 1px solid var(--border);
}

.login-card form { display: flex; flex-direction: column; gap: 14px; }

.login-card input[type="text"] {
    text-align: center;
    font-size: 28px;
    letter-spacing: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 16px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.login-card input[type="text"]::placeholder { color: var(--text-3); letter-spacing: 10px; }
.login-card input[type="text"]:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px var(--ring);
}

.login-card button[type="submit"] {
    height: 44px;
    background: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: var(--r);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.15s;
}
.login-card button[type="submit"]:hover { background: var(--accent-hover); }

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 10px;
}

/* ===== BUILDS GRID ===== */

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 28px;
    letter-spacing: -0.5px;
}

/* Builds page — 2-column grid cards with image on top */
.builds-grid2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.build-card2 {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    animation: fadeUp 0.35s ease-out backwards;
}
.build-card2:hover {
    border-color: var(--border-strong);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.build-card2:nth-child(1) { animation-delay: 0.03s; }
.build-card2:nth-child(2) { animation-delay: 0.06s; }
.build-card2:nth-child(3) { animation-delay: 0.09s; }
.build-card2:nth-child(4) { animation-delay: 0.12s; }
.build-card2:nth-child(5) { animation-delay: 0.15s; }
.build-card2:nth-child(6) { animation-delay: 0.18s; }

.build-closed { opacity: 0.5; }
.build-closed:hover { opacity: 0.7; }

.build-card2-img-wrap {
    padding: 14px 14px 0;
}
.build-card2-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--r);
    display: block;
}

.build-card2-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.build-card2 h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}
.build-card2-descr {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.build-card2-footer { margin-top: auto; }
.build-card2-pct {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 8px;
    font-family: var(--font-mono);
}

/* Admin page grid cards */
.builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.builds-grid .build-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.builds-grid .build-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.builds-grid .build-card-img {
    width: auto;
    height: 140px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
}
.builds-grid .build-card-body { padding: 16px 18px; }
.builds-grid .build-card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}
.builds-grid .build-card-meta {
    font-size: 12px;
    color: var(--text-3);
    font-family: var(--font-mono);
    margin-bottom: 10px;
}
.builds-grid .build-card-pct {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 8px;
    font-family: var(--font-mono);
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    vertical-align: middle;
}
.badge-closed { background: var(--danger-dim); color: var(--danger); }
.badge-open { background: var(--success-dim); color: var(--success); }

.empty-state { color: var(--text-3); text-align: center; padding: 80px 0; font-size: 15px; }

/* ===== PROGRESS BAR ===== */

.progress-bar-wrap {
    position: relative;
    height: 6px;
    background: var(--surface-3);
    border-radius: 9999px;
    overflow: hidden;
}
.progress-bar-done {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--success);
    border-radius: 9999px;
    z-index: 2;
    transition: width 0.4s ease;
}
.progress-bar-taken {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--accent);
    border-radius: 9999px;
    z-index: 1;
    transition: width 0.4s ease;
}

/* ===== BUILD PAGE ===== */

.back-link {
    color: var(--text-3);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
}
.back-link:hover { color: var(--text-2); }

/* Build hero */
.build-hero {
    display: flex;
    gap: 28px;
    margin-bottom: 32px;
    animation: fadeUp 0.35s ease-out;
}
.build-hero-img {
    flex-shrink: 0;
    width: 320px;
    height: 200px;
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.build-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.build-hero-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.build-hero-info h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}
#buildStatus .badge { display: inline-block; margin-bottom: 8px; }
.build-hero-descr {
    color: var(--text-2);
    font-size: 15px;
    margin-bottom: 12px;
    line-height: 1.5;
}
.build-hero-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.build-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-3);
    font-size: 13px;
    font-family: var(--font-mono);
}
.build-meta-item svg { color: var(--text-3); flex-shrink: 0; }

/* Claim button */
.btn-claim {
    height: 36px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Done label */
.done-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--success);
}
.text-done { color: var(--text-3); }

.build-header {
    margin-bottom: 28px;
    animation: fadeUp 0.35s ease-out;
}
.build-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 12px 0 8px;
}
.build-descr { color: var(--text-2); font-size: 15px; margin-bottom: 6px; }
.build-meta { color: var(--text-3); font-size: 13px; font-family: var(--font-mono); }

/* ===== TOOLBAR ===== */

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    animation: fadeUp 0.35s ease-out 0.08s backwards;
}

/* Search */
.search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
}
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}
.search-input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 40px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px var(--ring);
}
.search-input::placeholder { color: var(--text-3); }

/* Custom select */
.custom-select {
    position: relative;
    min-width: 160px;
    user-select: none;
}
.custom-select-trigger {
    height: 40px;
    padding: 0 36px 0 14px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
}
.custom-select-trigger::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-3);
    transition: transform 0.15s;
}
.custom-select.open .custom-select-trigger {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px var(--ring);
}
.custom-select.open .custom-select-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 4px;
    z-index: 60;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.12s, transform 0.12s;
}
.custom-select.open .custom-select-options {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.custom-select-option {
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text-2);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}
.custom-select-option:hover {
    background: var(--surface-3);
    color: var(--text);
}
.custom-select-option.selected {
    color: var(--text);
    font-weight: 600;
}

.toolbar-admin { margin-left: auto; }

/* ===== MY TASKS ===== */

.my-tasks-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px 24px;
    margin-bottom: 24px;
    animation: fadeUp 0.35s ease-out 0.12s backwards;
}
.my-tasks-section h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.my-task-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.my-task-row:last-child { border-bottom: none; }
.my-task-name { flex: 1; font-weight: 500; }
.my-task-amount {
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
}
.my-task-done { opacity: 0.35; }
.my-task-done:hover { opacity: 0.55; }

/* ===== RESOURCE TABLE ===== */

.res-table {
    width: 100%;
    border-collapse: collapse;
}
.res-table th {
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-3);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.res-table td {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    transition: background 0.1s;
}
.res-table tbody tr { transition: background 0.1s; }
.res-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

.res-table .col-icon { width: 60px; text-align: center; padding: 6px 10px; }
.res-table .col-name { min-width: 180px; font-weight: 500; }
.res-table .col-num {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-align: right;
    min-width: 90px;
}
.res-table .col-status { min-width: 140px; }
.res-table .col-act { width: 120px; text-align: center; }

/* ===== ITEM SLOT (inventory style) ===== */

.item-slot {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    position: relative;
    transition: border-color 0.15s;
    flex-shrink: 0;
}
.item-slot:hover {
    border-color: var(--border-strong);
}

.item-icon {
    width: 32px;
    height: 32px;
    display: block;
    border-radius: 2px;
}
.item-icon-cube {
    image-rendering: auto;
    filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.4));
}

/* ===== ROW STATE ===== */

.row-taken td { opacity: 0.3; }
.row-taken:hover td { opacity: 0.5; }
.row-taken .item-slot { opacity: 0.5; }

.claim-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-2);
}
.claim-empty { color: var(--text-3); }

/* Status icons */
.status-icon { flex-shrink: 0; vertical-align: middle; }
.status-icon.status-done { color: var(--success); }
.status-icon.status-pending { color: var(--warning); }

.claim-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* ===== AMOUNT POPUP ===== */

.amount-wrap {
    position: relative;
    display: inline-block;
}
.amount-num {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 1px dashed var(--text-3);
    transition: color 0.15s;
}
.amount-num:hover { color: var(--text); }
.amount-popup {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 16px;
    white-space: nowrap;
    z-index: 50;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.12s, transform 0.12s;
}
.amount-popup.open {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}
.amount-row {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    padding: 3px 0;
}
.amount-row-alt {
    color: var(--text-2);
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 6px;
}

/* ===== MODAL ===== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}
.modal-overlay.active { display: flex; }

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px;
    min-width: 360px;
    max-width: 90vw;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: fadeUp 0.2s ease-out;
}
.modal-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}
.modal-card p {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 18px;
    font-family: var(--font-mono);
}
.modal-card input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-size: 16px;
    font-family: var(--font-mono);
    font-weight: 500;
    outline: none;
    margin-bottom: 20px;
    transition: border-color 0.15s, box-shadow 0.15s;
    -moz-appearance: textfield;
}
.modal-card input::-webkit-outer-spin-button,
.modal-card input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.modal-card input::placeholder { color: var(--text-3); }
.modal-card input:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px var(--ring);
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-card-sm { min-width: 320px; }
.confirm-text {
    color: var(--text-2);
    font-size: 14px;
    font-family: var(--font);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ===== ADMIN ===== */

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 24px 28px;
}
.admin-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}
.form-row { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}
.form-required { color: var(--danger); }
.form-input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px var(--ring);
}
.form-input::placeholder { color: var(--text-3); }
textarea.form-input {
    height: auto;
    padding: 10px 14px;
    resize: vertical;
    min-height: 56px;
    line-height: 1.5;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--r);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--input);
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}
.dropzone.has-file {
    border-color: var(--success);
    border-style: solid;
    background: var(--success-dim);
}
.dropzone-icon {
    color: var(--text-3);
    margin-bottom: 10px;
    transition: color 0.15s;
}
.dropzone:hover .dropzone-icon, .dropzone.dragover .dropzone-icon { color: var(--text-2); }
.dropzone.has-file .dropzone-icon { color: var(--success); }
.dropzone-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
}
.dropzone-hint {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 6px;
}
.dropzone.has-file .dropzone-text,
.dropzone.has-file .dropzone-hint { display: none; }
.dropzone-file {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--success);
}
.dropzone-file:empty { display: none; }

/* File input styled */
.file-input {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text-3);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 14px;
    font-family: var(--font);
}
.file-input:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
    color: var(--text-2);
}
.file-input.has-file {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-dim);
}
.file-input-icon { flex-shrink: 0; }
.file-input-text { white-space: nowrap; }
.file-input.has-file .file-input-text { display: none; }
.file-input-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-input-name:empty { display: none; }

/* Image upload area (admin build page) */
.image-upload-area {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.image-preview {
    width: 200px;
    height: 130px;
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
    flex-shrink: 0;
}
.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.image-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-status {
    font-size: 13px;
    color: var(--text-2);
    margin-left: 14px;
}
.form-error { color: var(--danger); }
.form-success { color: var(--success); }

/* ===== SCROLLBAR ===== */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
    .container { padding: 24px 20px 64px; }
    .topbar { padding: 0 20px; }
    .build-header h1 { font-size: 24px; }
}

/* Mobile */
@media (max-width: 640px) {
    .container { padding: 16px 12px 48px; }
    .topbar { padding: 0 12px; height: 48px; }
    .topbar-brand { font-size: 14px; gap: 8px; }
    .topbar-right { gap: 6px; }
    .topbar-user { display: none; }

    .page-title { font-size: 20px; margin-bottom: 20px; }
    .section-title { font-size: 16px; }

    .builds-grid { grid-template-columns: 1fr; gap: 12px; }
    .builds-grid2 { grid-template-columns: 1fr; gap: 14px; }
    .build-card2-img { height: 140px; }
    .build-card2-img-wrap { padding: 10px 10px 0; }
    .build-card2-body { padding: 12px 14px 14px; }
    .build-card2 h2 { font-size: 15px; }

    .build-header h1 { font-size: 22px; margin: 8px 0 6px; }
    .build-descr { font-size: 14px; }

    .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .search-wrap { min-width: 0; }
    .custom-select { min-width: 0; }
    .toolbar-admin { margin-left: 0; }

    .my-tasks-section { padding: 16px; }
    .my-tasks-section h2 { font-size: 14px; }
    .my-task-row { gap: 10px; padding: 8px 0; font-size: 13px; }

    /* Table: horizontal scroll on narrow screens */
    #resourceTable { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .res-table { min-width: 600px; }
    .res-table th { padding: 10px 12px; font-size: 12px; }
    .res-table td { padding: 8px 12px; font-size: 13px; }
    .res-table .col-icon { width: 48px; }
    .res-table .col-num { min-width: 70px; font-size: 12px; }
    .res-table .col-act { width: 90px; }
    .item-slot { width: 36px; height: 36px; }
    .item-icon { width: 28px; height: 28px; }

    .admin-card { padding: 16px; }
    .admin-card-title { font-size: 15px; margin-bottom: 16px; }
    .form-label { font-size: 13px; }
    .dropzone { padding: 28px 16px; }

    .modal-overlay { padding: 12px; }
    .modal-card { min-width: 0; width: 100%; padding: 24px 20px; border-radius: var(--r); }
    .modal-card h3 { font-size: 16px; }

    .login-card { padding: 36px 24px; margin: 0; }
    .login-card h1 { font-size: 22px; }
    .login-card input[type="text"] { font-size: 24px; letter-spacing: 8px; padding: 14px; }

    .build-hero { flex-direction: column; gap: 16px; }
    .build-hero-img { width: 100%; height: 180px; }
    .build-hero-info h1 { font-size: 22px; }
    .build-hero-descr { font-size: 14px; }

    .btn { height: 40px; font-size: 14px; }
    .btn-sm { height: 36px; font-size: 13px; }
    .btn-claim { height: 40px; padding: 0 16px; }
}
