:root {
  color-scheme: dark;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.14);
  --primary-border: #1e40af;
  --on-primary: #ffffff;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --input-border: #475569;
  --surface: #1e293b;
  --surface-strong: #172033;
  --field: #0f172a;
  --background: #0f172a;
  --disabled: #334155;
  --disabled-text: #64748b;
  --success: #4ade80;
  --success-bg: rgba(34, 197, 94, 0.12);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.28);
  --focus-ring: rgba(59, 130, 246, 0.35);
}

html[data-theme="light"] {
  color-scheme: light;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --on-primary: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --input-border: #cbd5e1;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --field: #ffffff;
  --background: #f1f5f9;
  --disabled: #cbd5e1;
  --disabled-text: #94a3b8;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.05);
  --focus-ring: rgba(37, 99, 235, 0.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  transition: background 0.2s, color 0.2s;
}

h1 { font-size: 20px; font-weight: 700; margin: 0 8px 0 0; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 16px; }
h3 { font-size: 16px; font-weight: 600; margin: 24px 0 12px; }
p { margin: 8px 0; }

.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.content { min-width: 0; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 14px; border-bottom: 1px solid var(--border); }
.brand strong { display: block; font-size: 18px; letter-spacing: 0.04em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-border, var(--primary-hover))); color: var(--on-primary); font-weight: 800; letter-spacing: 0.04em; box-shadow: var(--shadow); }
.sidebar-section { display: flex; flex-direction: column; gap: 12px; }
.sidebar-section select, .sidebar-section button { width: 100%; }
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.menu-item {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
}
.sidebar button.menu-item:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }

.tabs { display: flex; gap: 6px; margin-top: 14px; overflow-x: auto; }
.sidebar .tabs { flex-direction: column; gap: 4px; margin: 0; overflow: visible; }
.sidebar .tab {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 6px;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}
.sidebar .tab.active { background: var(--primary-soft); color: var(--primary); border-left-color: var(--primary); }
.sidebar .tab:disabled { opacity: 0.5; }
.agent-status { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.agent-status::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.agent-token { font-family: monospace; font-size: 12px; padding: 6px 12px; word-break: break-all; color: var(--muted); }
.agent-status[data-state="online"] { color: var(--primary); }
.agent-status[data-state="online"]::before { background: #22c55e; }
.tab {
  padding: 10px 16px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  border-radius: 0;
  white-space: nowrap;
}
.tab:hover:not(:disabled) { color: var(--text); background: transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:disabled { color: var(--disabled-text); cursor: not-allowed; }

main { padding: 24px; max-width: 1120px; margin: 0 auto; }
.stage {
  background: var(--surface);
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px 20px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--field);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
input[type="file"] { padding: 6px; font-size: 14px; }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }

button, .file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
button:hover:not(:disabled):not(.tab), .file-button:hover { background: var(--primary-hover); }
button:focus-visible, .file-button:focus-within { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
button.secondary, .file-button.secondary {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--primary-border);
}
button.secondary:hover:not(:disabled), .file-button.secondary:hover { background: var(--primary-soft); }
button:disabled { background: var(--disabled); color: var(--disabled-text); border-color: transparent; cursor: not-allowed; }
button.secondary:disabled { background: var(--surface-strong); color: var(--disabled-text); border-color: var(--border); }

.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 20px 0; }

.busy { cursor: progress; opacity: 0.8; }
.busy::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: busy-spin 0.8s linear infinite;
}
@keyframes busy-spin { to { transform: rotate(360deg); } }

.photo-groups { display: grid; gap: 24px; margin-top: 8px; }
.photo-group h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.photo-group h3 span { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-strong); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }
.photo-groups p, .analogs > p { color: var(--muted); }
textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px 14px;
  font: inherit;
  line-height: 1.5;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--primary, var(--primary)); box-shadow: 0 0 0 3px var(--focus-ring); }

.analog-form { margin-bottom: 20px; }
.analog-form button { align-self: end; justify-self: start; }
#analogs-count { font-weight: 600; color: var(--muted); margin: 0 0 12px; }

.analogs { display: flex; flex-direction: column; gap: 12px; }
.analog {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.analog.selected { border-color: var(--primary); background: var(--primary-soft); }
.analog-body { flex: 1; min-width: 0; }
.analog-body > div:first-child { font-weight: 600; font-size: 16px; }
.analog a { display: inline-block; margin: 4px 0; font-size: 13px; color: var(--primary); word-break: break-all; }
.analog img { display: block; max-width: 360px; margin: 10px 0; border-radius: 8px; border: 1px solid var(--border); }
.analog input[type="file"] { margin-top: 6px; }
.analog-select {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.analog.selected .analog-select { border-color: var(--primary); }

.summary { font-size: 16px; line-height: 1.8; background: var(--primary-soft); border-radius: 8px; padding: 16px 20px; }
.summary p { margin: 0; }

.message { min-height: 0; margin: 0 0 16px; padding: 0; color: var(--success); font-weight: 500; }
.message:not(:empty) { padding: 10px 14px; border-radius: 8px; background: var(--success-bg); }
.message.error { color: var(--danger); background: var(--danger-bg); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 32px;
  max-width: 1120px;
  margin: 0 auto;
}

.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; position: relative; }
.login-screen .theme-toggle { position: absolute; top: 20px; right: 20px; }
.login-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0; }
.login-card button[type="submit"] { width: 100%; }

.admin-panel { max-width: 1120px; margin: 0 auto; padding: 24px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.admin-head h2 { margin: 0; }
.admin-head .actions { margin: 0; }
.admin-panel .tabs { margin: 16px 0 20px; border-bottom: 1px solid var(--border); }
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.admin-card h3:first-child { margin-top: 0; }
.table-wrap { overflow-x: auto; margin-top: 16px; }

#activity-wrap { max-height: 60vh; overflow-y: auto; }

.activity-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; color: var(--muted); }

#search-wrap { max-height: 60vh; overflow: auto; }

.task-list { display: grid; gap: 10px; margin-top: 12px; }
.task-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.task-card.overdue { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger); }
.task-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.task-status { color: var(--muted); font-size: 13px; white-space: nowrap; }
.task-comment { color: #f59e0b; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo-item {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}
.photo-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.photo-item a { display: block; aspect-ratio: 4 / 3; background: var(--surface-strong); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item button { margin: 10px; padding: 7px 12px; font-size: 13px; }
.photo-empty { margin: 0; padding: 18px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); text-align: center; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; background: var(--surface-strong); }
tbody tr:hover { background: var(--surface-strong); }
.filters { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.filters label { min-width: 200px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions button { padding: 6px 10px; font-size: 13px; }

.hint { color: var(--muted); }
.calc-result { margin: 0; font-weight: 600; flex: 1; }
table.calc { width: auto; min-width: 100%; font-size: 13px; }
table.calc th, table.calc td { padding: 6px 8px; white-space: nowrap; }
table.calc .calc-label { position: sticky; left: 0; background: var(--surface); min-width: 240px; white-space: normal; font-weight: 500; }
table.calc input { min-width: 96px; padding: 6px 8px; font-size: 13px; }
table.calc td:nth-child(2) input, table.calc th:nth-child(2) { min-width: 170px; }
table.calc td.overridden input { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
table.calc .calc-value { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
table.calc .calc-error { display: block; margin-top: 3px; font-size: 12px; color: var(--danger); }
code { font-family: Consolas, monospace; font-size: 13px; }
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.calc-memo {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px;
  font-size: 13px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.calc-memo h4 { margin: 14px 0 6px; font-size: 14px; }
.calc-memo h4:first-child { margin-top: 0; }
.calc-memo ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.calc-label { cursor: help; }
@media (max-width: 1100px) {
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
  .calc-memo { position: static; max-height: none; }
}
input[readonly] { cursor: not-allowed; color: var(--muted); background: var(--surface-strong); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; overflow: visible; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar .tabs { flex-direction: row; overflow-x: auto; }
  .sidebar .tab { width: auto; border-left: 1px solid transparent; border-bottom: 3px solid transparent; }
  .sidebar .tab.active { border-left-color: transparent; border-bottom-color: var(--primary); }
  .sidebar-bottom { flex-direction: row; flex-wrap: wrap; margin-top: 0; }
  .menu-item { width: auto; }
}

@media (max-width: 720px) {
  main { padding: 16px; }
  .stage { padding: 18px; }
  .analog { flex-direction: column; }
}
.calc-missing { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-weight: 600; }
table.calc td.required input { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-bg); }
main.wide, footer.wide { max-width: none; }
.stage:has(.calc-layout) { padding: 20px 22px; }
.calc-layout { display: block; }
.calc-memo { margin-bottom: 14px; padding: 10px 14px; font-size: 13px; background: var(--surface-strong); border: 1px solid var(--border); border-radius: var(--radius); }
.calc-memo summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.calc-memo #calc-memo-body { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 20px; }
.calc-memo h4 { margin: 0 0 6px; font-size: 13px; }
.calc-memo ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
#calc-table.table-wrap { max-height: 72vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 0; }
table.calc { font-size: 12px; width: max-content; min-width: 100%; }
table.calc th, table.calc td { padding: 4px 6px; white-space: nowrap; vertical-align: middle; }
table.calc thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-strong); }
table.calc .calc-label { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 210px; max-width: 230px; white-space: normal; font-size: 12px; line-height: 1.3; }
table.calc thead th:first-child { position: sticky; left: 0; z-index: 3; }
table.calc td { position: relative; }
table.calc td input { min-width: 104px; width: 104px; padding: 4px 6px; font-size: 12px; }
table.calc td:nth-child(2) input, table.calc th:nth-child(2) { min-width: 150px; width: 150px; }
table.calc .cell-ref { display: block; font-size: 10px; line-height: 1; color: var(--subtle, var(--muted)); margin: 0 0 2px 2px; font-weight: 600; letter-spacing: 0.03em; }
table.calc .calc-value, table.calc .calc-error { font-size: 11px; }
.doc-preview { background: #fff; color: #111; border-radius: 8px; padding: 32px 40px; max-height: 80vh; overflow: auto; font-family: "Times New Roman", serif; font-size: 14px; line-height: 1.45; }
.doc-preview p { margin: 0 0 6px; text-align: justify; text-indent: 0; white-space: pre-wrap; }
.doc-preview img { max-width: 100%; height: auto; display: block; margin: 6px auto; }
.doc-preview table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.doc-preview .message.error { color: #b00020; }
.doc-preview p[contenteditable="true"] { cursor: text; border-radius: 3px; min-height: 1.2em; }
.doc-preview p[contenteditable="true"]:hover { outline: 1px dashed #9db4d6; outline-offset: 2px; }
.doc-preview p[contenteditable="true"]:focus { outline: 2px solid #3b82f6; outline-offset: 2px; background: #fffbe6; }
.doc-preview th, .doc-preview td { background: #fff; color: #111; font-size: inherit; font-weight: normal; border: 1px solid #999; padding: 4px 6px; vertical-align: top; }
.doc-preview th { text-align: left; }
.doc-preview p, .doc-preview table { color: #111; }
.priority-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-left: 6px; }
.priority-badge.priority-critical { background: var(--danger-bg); color: var(--danger, var(--danger)); }
.priority-badge.priority-high { background: #fff1d6; color: #9a5b00; }
.task-card.priority-critical { border-left: 4px solid var(--danger, var(--danger)); }
.task-card.priority-high { border-left: 4px solid #d98a00; }
.label-chip { display: inline-block; margin: 0 4px 4px 0; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); font-size: 12px; }
.board-wrap { overflow-x: auto; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; align-items: start; }
.board-column { background: var(--surface-strong); border-radius: 8px; padding: 10px; min-height: 120px; }
.board-column h4 { margin: 0 0 8px; font-size: 14px; }
.board-column .task-card { margin-bottom: 8px; }
.assignee-group { margin-bottom: 16px; }
.assignee-group h3 span { color: var(--muted); font-weight: normal; }
#search-results { min-width: 1180px; }
#admin-reports { min-width: 860px; }
#admin-reports th, #search-results th, #admin-activity th, #stats-totals th, #stats-employees th, #stats-ai th { white-space: nowrap; }
#search-results td:last-child, #admin-reports td:last-child { white-space: nowrap; }
#admin-reports td, #search-results td, #admin-activity td { font-size: 13px; }
.admin-card .message { margin: 8px 0 0; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 1000; max-width: 380px; padding: 14px 18px; border-radius: 10px; background: var(--success); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.toast.error { background: var(--danger); }
.report-banner { margin: 0 0 16px; padding: 12px 16px; border-radius: 8px; background: var(--primary-soft); font-weight: 600; }
.report-locked #app-main input, .report-locked #app-main textarea, .report-locked #app-main select, .report-locked #app-main label.file-button,
.report-locked #app-footer #next-stage, .report-locked .doc-preview p { pointer-events: none; opacity: 0.6; }
.report-locked #save-general, .report-locked #save-region, .report-locked #description-save, .report-locked #description-ai,
.report-locked #fetch-analogs, .report-locked #calc-reset, .report-locked #preview-reset, .report-locked #analog-form button,
.report-locked [data-photo-delete], .report-locked [data-analog-id], .report-locked [data-screenshot-id] { pointer-events: none; opacity: 0.5; }
.app-dialog { width: min(460px, 92vw); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; padding: 20px 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.app-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.app-dialog h3 { margin: 0 0 8px; }
.app-dialog label { display: flex; flex-direction: column; gap: 6px; }
.app-dialog textarea { width: 100%; box-sizing: border-box; margin-top: 10px; }
.app-dialog .actions { justify-content: flex-end; margin-top: 16px; }
#tasks-panel .filters { align-items: flex-end; }
#tasks-panel .filters label { min-width: 150px; }
.task-notes { display: grid; gap: 6px; margin-top: 8px; }
.task-note { margin: 0; padding: 6px 8px; border-radius: 6px; background: var(--surface-strong); font-size: 13px; }
.task-notes textarea { width: 100%; box-sizing: border-box; }
.task-notes button { justify-self: start; }

.board { grid-auto-columns: minmax(240px, 1fr); }
.board-column { min-width: 0; }
.board-column .task-card { font-size: 13px; padding: 10px 12px; }
.board-column .task-card .actions { gap: 6px; }
.board-column .task-card .actions button { padding: 4px 8px; font-size: 12px; }
.board-column .task-head strong { font-size: 13px; }
.board-column h4 span { color: var(--muted); font-weight: normal; }

.task-card.new-task { border-color: var(--primary, var(--primary)); background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary, var(--primary)); }
.task-card.new-task .task-status { color: var(--primary, var(--primary)); font-weight: 700; }

.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.inline-field select { width: auto; }
.task-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.task-meta-row p { margin: 0; }
.priority-line { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.priority-line select { width: auto; min-width: 150px; }
.task-notes { display: grid; gap: 6px; margin-top: 10px; }
.task-composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.task-composer textarea { flex: 1; min-height: 0; }
.task-composer button { white-space: nowrap; }
.task-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.task-actions-main { display: flex; gap: 8px; flex-wrap: wrap; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
button.ghost:hover { color: var(--primary); }

.memo { margin: 0 0 16px; padding: 10px 14px; border-left: 3px solid var(--primary, var(--primary)); border-radius: 6px; background: var(--primary-soft); color: var(--muted); font-size: 13px; line-height: 1.5; }
.memo strong { color: var(--text, inherit); }

/* R2D2 — визуальная доводка */
.login-screen { background: radial-gradient(1200px 600px at 20% -10%, var(--primary-soft), transparent), var(--background); min-height: 100vh; display: grid; place-items: center; }
.login-card { box-shadow: var(--shadow); border-radius: 16px; padding: 28px; gap: 14px; }
.stage { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow); }
.stage h2 { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 2px solid var(--primary-soft); }
.stage h2::before { content: ""; display: inline-block; width: 6px; height: 18px; margin-right: 10px; vertical-align: -3px; border-radius: 3px; background: var(--primary); }
.memo { border-radius: 10px; }
.sidebar-section { background: var(--surface-strong); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.admin-card { border-radius: 14px; box-shadow: var(--shadow); }
.task-card { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.task-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.file-button { cursor: pointer; }
