/* ============================================================
   Tasker — stylesheet
   ============================================================ */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --border: #e6e8ec;
    --border-strong: #d3d7de;
    --text: #1b2130;
    --muted: #6b7280;
    --muted-2: #9aa1ad;
    --primary: #6366f1;
    --primary-600: #4f46e5;
    --primary-050: #eef0ff;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --amber: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
    --shadow-md: 0 4px 12px rgba(16,24,40,.08);
    --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 58px;
    display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; }
.brand-mark {
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
    background: var(--primary); color: #fff; font-size: .95rem;
}
.topnav { display: flex; gap: 6px; }
.topnav a {
    padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: .92rem;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { background: var(--primary-050); color: var(--primary-600); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-name { font-weight: 550; font-size: .9rem; }
@media (max-width: 640px) { .topbar-name { display: none; } .topbar-inner { gap: 16px; padding: 0 14px; } }

/* ---------- Layout ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 64px; }
@media (max-width: 640px) { .page { padding: 20px 14px 48px; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head p { margin: 4px 0 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px; justify-content: center;
    padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text); font-weight: 550; font-size: .9rem;
    cursor: pointer; transition: .12s ease; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-block { width: 100%; }
.btn-link {
    background: none; border: none; color: var(--primary-600); cursor: pointer; font-weight: 550;
    padding: 6px 4px; font-size: .9rem;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.inline { display: inline; }

/* ---------- Alerts ---------- */
.alert { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .9rem; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: #047857; border-color: #a7f3d0; }
.alert-error { background: var(--danger-bg); color: #b91c1c; border-color: #fecaca; }

/* ---------- Avatars ---------- */
.avatar {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    color: #fff; font-size: .74rem; font-weight: 650; flex: none; box-shadow: 0 0 0 2px var(--surface);
}
.avatar-sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar-empty { background: #e2e5ea !important; color: var(--muted-2); }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-value { font-size: 2rem; font-weight: 720; letter-spacing: -.03em; }
.stat-label { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.stat-card.accent-amber .stat-value { color: var(--amber); }
.stat-card.accent-red .stat-value { color: var(--danger); }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.count-pill { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 20px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.empty { color: var(--muted); padding: 16px 4px; }

/* ---------- Task list (dashboard) ---------- */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 8px; border-bottom: 1px solid var(--border); }
.task-row:hover { background: var(--surface-2); }
.task-list li:last-child .task-row { border-bottom: none; }
.task-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.task-title { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.prio-low { background: #94a3b8; } .prio-medium { background: #3b82f6; }
.prio-high { background: #f59e0b; } .prio-urgent { background: #ef4444; }
.status-chip, .due-chip { font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.status-chip { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.status-backlog { color: #64748b; } .status-todo { color: #475569; }
.status-in_progress { color: #2563eb; background: #eff6ff; border-color: #dbeafe; }
.status-review { color: #9333ea; background: #faf5ff; border-color: #f3e8ff; }
.status-done { color: #059669; background: var(--success-bg); border-color: #a7f3d0; }
.due-chip { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.due-chip.due-soon { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.due-chip.overdue { color: #b91c1c; background: var(--danger-bg); border-color: #fecaca; }

/* ---------- Activity ---------- */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { display: flex; gap: 11px; padding: 9px 0; }
.activity-list p { margin: 0; font-size: .9rem; }

/* ---------- Project cards ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: .14s ease; display: block; }
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.project-card h3 { font-size: 1.02rem; margin-bottom: 12px; }
.project-badge { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 8px; border-radius: 6px; color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
.project-badge.lg { min-width: 48px; height: 40px; font-size: .95rem; border-radius: 9px; }
.role-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.progress { height: 6px; background: #eceef1; border-radius: 20px; overflow: hidden; margin: 4px 0 6px; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 20px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-emoji { font-size: 3rem; margin-bottom: 8px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.field > span { font-weight: 550; font-size: .85rem; color: #374151; }
.field input, .field select, .field textarea {
    padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); width: 100%; transition: .12s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050);
}
.field textarea { resize: vertical; }
.hint { color: var(--muted-2); font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-form .span-2 { grid-column: 1 / -1; }
.form-panel { max-width: 640px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
@media (max-width: 560px) { .grid-form { grid-template-columns: 1fr; } }

/* ---------- Guest / auth ---------- */
body.guest { background: linear-gradient(160deg, #eef0ff 0%, #f5f6f8 40%, #f5f6f8 100%); }
.guest-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.guest-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 34px 32px; width: 100%; max-width: 400px; }
.guest-brand { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 1.3rem; justify-content: center; margin-bottom: 22px; }
.guest-title { font-size: 1.4rem; text-align: center; }
.guest-sub { text-align: center; color: var(--muted); margin: 6px 0 22px; }
.guest-alt { text-align: center; margin: 20px 0 0; color: var(--muted); font-size: .9rem; }
.guest-alt a { color: var(--primary-600); font-weight: 600; }
.guest-foot { color: var(--muted-2); font-size: .82rem; margin-top: 22px; }

/* ---------- Board ---------- */
.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.board-title { display: flex; gap: 14px; align-items: center; }
.board-title p { margin: 3px 0 0; }
.board-actions { display: flex; align-items: center; gap: 10px; }
.member-stack { display: flex; }
.member-stack .avatar { margin-left: -8px; }
.member-stack .avatar:first-child { margin-left: 0; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar select, .filter-search { padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.filter-search { flex: 1; min-width: 180px; }
.filter-bar select:focus, .filter-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 120px; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px 8px; }
.column-head h3 { font-size: .88rem; font-weight: 650; }
.col-dot { width: 9px; height: 9px; border-radius: 50%; }
.col-backlog { background: #94a3b8; } .col-todo { background: #64748b; }
.col-in_progress { background: #3b82f6; } .col-review { background: #a855f7; } .col-done { background: #10b981; }
.column-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 12px 14px; min-height: 40px; }
.column-body.drop-hint { background: var(--primary-050); border-radius: 8px; outline: 2px dashed var(--primary); outline-offset: -4px; }

.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); cursor: grab; transition: box-shadow .12s, transform .12s; display: block; }
.tcard:hover { box-shadow: var(--shadow-md); }
.tcard.dragging { opacity: .5; }
.tcard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.tcard-title { margin: 0 0 12px; font-size: .92rem; font-weight: 550; line-height: 1.35; }
.tcard-foot { display: flex; align-items: center; justify-content: space-between; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; padding: 24px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-close { background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }
.member-list { list-style: none; margin: 0 0 16px; padding: 0; }
.member-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.member-list li > div { flex: 1; }
.add-member-form { display: flex; gap: 8px; }
.add-member-form input { flex: 1; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.add-member-form select { padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }

/* ---------- Task detail ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--muted); font-size: .9rem; }
.breadcrumb a:hover { color: var(--primary-600); }
.task-detail { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; margin-bottom: 22px; }
@media (max-width: 860px) { .task-detail { grid-template-columns: 1fr; } }
.task-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.title-input { width: 100%; border: 1px solid transparent; background: transparent; font-size: 1.35rem; font-weight: 650; letter-spacing: -.01em; padding: 6px 8px; border-radius: 8px; margin-bottom: 16px; }
.title-input:hover { background: var(--surface-2); }
.title-input:focus { outline: none; background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }
.task-side { display: flex; flex-direction: column; gap: 16px; }
.side-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.side-meta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px; font-size: .85rem; }
.side-meta > div { display: flex; justify-content: space-between; gap: 10px; }
.task-danger { margin: -6px 0 22px; text-align: right; }

/* ---------- Comments ---------- */
.comment-list { list-style: none; margin: 0 0 18px; padding: 0; }
.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-body { flex: 1; }
.comment-meta { margin-bottom: 3px; }
.comment-body p { margin: 0; }
.comment-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.comment-form textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); resize: vertical; }
.comment-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }

/* ============================================================
   Dark theme
   ============================================================ */
:root[data-theme="dark"] {
    --bg: #0f1420;
    --surface: #171d2b;
    --surface-2: #1e2637;
    --border: #2a3245;
    --border-strong: #3b455c;
    --text: #e6e9f0;
    --muted: #9aa4b8;
    --muted-2: #6b7688;
    --primary: #7c83ff;
    --primary-600: #6366f1;
    --primary-050: #232a44;
    --danger: #f87171;
    --danger-bg: #2a1a1e;
    --success: #34d399;
    --success-bg: #10281f;
    --amber: #fbbf24;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 6px 16px rgba(0,0,0,.5);
    --shadow-lg: 0 14px 36px rgba(0,0,0,.6);
}
[data-theme="dark"] .topbar { background: rgba(23,29,43,.82); }
[data-theme="dark"] body.guest { background: linear-gradient(160deg, #171d2b 0%, #0f1420 45%, #0f1420 100%); }
[data-theme="dark"] .avatar { box-shadow: 0 0 0 2px var(--surface); }
[data-theme="dark"] .status-in_progress { background:#1e2b46; border-color:#274069; }
[data-theme="dark"] .status-review { background:#2a2140; border-color:#3f2d63; }
[data-theme="dark"] .status-done { background:#123027; border-color:#1c5340; }
[data-theme="dark"] .due-chip.due-soon { background:#2e2410; border-color:#5a4715; color:#fcd34d; }
[data-theme="dark"] .due-chip.overdue { background:#2a1a1e; border-color:#5f2a2f; color:#fca5a5; }
[data-theme="dark"] .field input[type="color"] { background: var(--surface); }
[data-theme="dark"] img.photo-thumb, [data-theme="dark"] .photo-thumb img { filter: brightness(.95); }

/* ============================================================
   Theme toggle + role tags
   ============================================================ */
.theme-toggle {
    width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border-strong);
    background: var(--surface); cursor: pointer; font-size: 1rem; line-height: 1;
    display: inline-grid; place-items: center; transition: .12s;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle.floating { position: fixed; top: 18px; right: 18px; z-index: 10; box-shadow: var(--shadow); }

.role-tag.role-customer { color: var(--primary-600); background: var(--primary-050); border-color: transparent; }
.role-tag.role-executor { color: #0d9488; background: #ccfbf1; border-color: transparent; }
[data-theme="dark"] .role-tag.role-executor { color: #5eead4; background: #0f2f2a; }
.topbar-name .role-tag { margin-left: 4px; }

/* ============================================================
   Invite banner + copy
   ============================================================ */
.invite-banner {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 22px;
}
.invite-name { font-weight: 650; font-size: 1.05rem; }
.invite-code-box { display: flex; flex-direction: column; }
.invite-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .12em;
    font-size: 1.1rem; color: var(--primary-600); cursor: pointer; user-select: all;
    display: inline-flex; align-items: center; gap: 8px;
}
.invite-code.big { font-size: 1.6rem; }
.invite-code .copy-hint { font-size: .8rem; opacity: .5; }
.invite-code.copied::after { content: "Скопировано"; font-family: var(--font); font-size: .7rem; letter-spacing: 0; color: var(--success); font-weight: 600; }
.invite-banner .btn { margin-left: auto; }

/* ============================================================
   Segmented control (registration) + row-2
   ============================================================ */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .row-2 { grid-template-columns: 1fr; } }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg {
    position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 11px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; transition: .12s;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg strong { font-size: .92rem; }
.seg small { color: var(--muted); font-size: .78rem; }
.seg.on { border-color: var(--primary); background: var(--primary-050); box-shadow: 0 0 0 2px var(--primary-050); }
.seg.disabled { opacity: .45; cursor: not-allowed; }

/* ============================================================
   Buttons (success/danger)
   ============================================================ */
.btn-success { background: var(--success); border-color: var(--success); color: #06281d; }
.btn-success:hover { filter: brightness(.95); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }

/* ============================================================
   Reports / photo review
   ============================================================ */
.notice { background: var(--primary-050); color: var(--primary-600); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; font-size: .9rem; font-weight: 500; }
.report-form { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.report-form input[type="file"] { padding: 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); width: 100%; }
.report-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.report { border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-2); }
.report-pending { border-left-color: var(--amber); }
.report-accepted { border-left-color: var(--success); }
.report-rejected { border-left-color: var(--danger); }
.report-head { display: flex; align-items: center; gap: 10px; }
.report-meta { display: flex; flex-direction: column; }
.report-status { margin-left: auto; font-size: .74rem; font-weight: 700; padding: 2px 10px; border-radius: 20px; }
.rs-pending { color: #b45309; background: #fffbeb; }
.rs-accepted { color: #047857; background: var(--success-bg); }
.rs-rejected { color: #b91c1c; background: var(--danger-bg); }
[data-theme="dark"] .rs-pending { color: #fcd34d; background: #2e2410; }
.report-note { margin: 10px 0 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.photo-thumb { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.decision { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .9rem; }
.decision-rejected { background: var(--danger-bg); color: var(--danger); }
.decision-accepted { background: var(--success-bg); color: #047857; }
[data-theme="dark"] .decision-accepted { color: #34d399; }
.report-decide { display: flex; gap: 10px; margin-top: 14px; }
.reject-form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.reject-form textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); resize: vertical; }
.reject-form textarea:focus { outline: none; border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }

/* card report chip */
.tcard-badges { display: flex; gap: 6px; align-items: center; }
.report-chip { font-size: .72rem; font-weight: 600; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 20px; padding: 1px 7px; }
[data-theme="dark"] .report-chip { color: #fcd34d; background: #2e2410; border-color: #5a4715; }

/* read-only task view (executor) */
.task-h1 { font-size: 1.4rem; margin-bottom: 14px; }
.task-desc { white-space: pre-wrap; line-height: 1.6; }
.side-block.ro { gap: 14px; }
.side-block.ro > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .9rem; }
.side-block.ro .muted { font-size: .85rem; }
.prio-inline { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   Theme-aware form controls (fixes inputs/textareas outside .field
   that otherwise render white / dark-text in dark mode)
   ============================================================ */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
input, textarea, select { color: var(--text); background-color: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
.title-input { color: var(--text); background: transparent; }
.title-input:hover { background: var(--surface-2); }
.filter-search, .reject-form textarea, .comment-form textarea { background-color: var(--surface); color: var(--text); }
.report-form input[type="file"] { background-color: var(--surface-2); }
input[type="color"] { padding: 4px; }

/* ============================================================
   Admin panel
   ============================================================ */
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.admin-table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.row-unassigned { background: rgba(245, 158, 11, .07); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.assign-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.assign-form select { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.cur-state { white-space: nowrap; }
.role-tag.role-admin { color: #b91c1c; background: #fef2f2; border-color: transparent; }
[data-theme="dark"] .role-tag.role-admin { color: #fca5a5; background: #2a1a1e; }
.role-tag.role-pending { color: var(--amber); background: var(--surface-2); border-color: transparent; }

/* compact create-group form */
.inline-create { display: flex; gap: 8px; max-width: 460px; margin-bottom: 18px; }
.inline-create input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background-color: var(--surface); color: var(--text); }
.inline-create input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }

/* groups list */
.group-list { list-style: none; margin: 0; padding: 0; }
.group-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.group-list li:last-child { border-bottom: none; }
.group-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.admin-table .cur-state div { font-weight: 550; margin-bottom: 3px; }
