/* Vanco Reno PM — mobile-first stylesheet */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #68768a;
  --brand: #1f6feb;
  --brand-dark: #1757bd;
  --green: #1a7f37;
  --red: #b42318;
  --line: #dfe5ec;
  --radius: 12px;
  --tap: 48px; /* minimum touch target */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

/* ---- header / nav ---- */
.topbar {
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.userbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.userbox .who em { font-style: normal; opacity: 0.7; }

.nav {
  display: flex;
  gap: 0.25rem;
  background: #2a3444;
  padding: 0.25rem 0.5rem;
  overflow-x: auto;
}
.nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 0.9rem;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  white-space: nowrap;
}
.nav a:active { background: rgba(255,255,255,0.15); }
.nav-dropdown { position: relative; display: inline-flex; }
.nav-dropdown .nav-dropbtn { cursor: pointer; }
.nav-dropdown-content {
  display: none;
  position: fixed;
  background: #2a3444;
  min-width: 180px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
  padding: 0.25rem;
}
.nav-dropdown-content a {
  display: flex;
  width: 100%;
  box-sizing: border-box;
}
.nav-dropdown.open .nav-dropdown-content {
  display: block;
}
.cascade-highlight {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
  background: #fef3c7 !important;
}
.search-bar {
  width: 100%;
  max-width: 400px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { background: rgba(0,0,0,0.05); }

.wrap { padding: 1rem; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 1.5rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.75rem 0 0.75rem; }
.task-main {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #2563eb;
  color: #fff;
  border-left: 5px solid #1e40af;
  border-radius: 6px;
}
.task-main .task-name { font-weight: 700; }
.task-main .task-meta { color: #dbeafe; font-size: 0.85rem; }
.task-main .task-meta a { color: #fff; }
.task-main.done { background: #16a34a; border-left-color: #14532d; }
.task-main.done .task-meta { color: #dcfce7; }
.task-milestone {
  background: #9333ea;
  color: #fff;
  border-left: 5px solid #6b21a8;
}
.task-milestone .task-name { font-weight: 700; }
.task-milestone .task-meta { color: #e9d5ff; font-size: 0.85rem; }
.task-milestone .task-meta a { color: #fff; }
.task-milestone.done { background: #16a34a; border-left-color: #14532d; }
.task-milestone.done .task-meta { color: #dcfce7; }
.task-subtask {
  background: #dbeafe;
  color: #1e40af;
  border-left: 5px solid #3b82f6;
}
.task-subtask .task-meta { color: #1d4ed8; }
.task-subtask.done { background: #86efac; }
/* Dropped tasks: visibly dimmed so they read as history, not live work. */
.task-card.dropped, .card.dropped { opacity: 0.55; }
.task-card.dropped .task-name, .card.dropped .task-name {
  text-decoration: line-through;
}
/* Subtasks sit indented under their Main Task in list-style views
   (list + dashboard; board cards are untouched). */
.task-card.task-subtask { margin-left: 1.75rem; }
details.task-edit-wrap { padding: 0.4rem 0.75rem; }
details.task-edit-wrap summary {
  cursor: pointer;
  color: var(--muted, #666);
  font-size: 0.85rem;
}

/* ---- cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 2px rgba(16,24,40,0.06);
  position: relative;
}

/* Milestone/Main Task cards: the type colors must beat .card's white
   background (higher specificity wins). Without this, white text sits
   on a white card and the name is invisible. */
.card.task-milestone {
  background: #9333ea;
  color: #fff;
  border-left: 5px solid #6b21a8;
}
.card.task-milestone .task-name { font-weight: 700; }
.card.task-milestone .task-meta { color: #e9d5ff; font-size: 0.85rem; }
.card.task-milestone .task-meta a { color: #fff; }
.card.task-milestone.done { background: #16a34a; border-left-color: #14532d; }
.card.task-milestone.done .task-meta { color: #dcfce7; }
.card.task-main {
  background: #2563eb;
  color: #fff;
  border-left: 5px solid #1e40af;
}
.card.task-main .task-name { font-weight: 700; }
.card.task-main .task-meta { color: #dbeafe; font-size: 0.85rem; }
.card.task-main .task-meta a { color: #fff; }
.card.task-main.done { background: #16a34a; border-left-color: #14532d; }
.card.task-main.done .task-meta { color: #dcfce7; }
.card.task-subtask {
  background: #dbeafe;
  color: #1e40af;
  border-left: 5px solid #3b82f6;
}
.card.task-subtask .task-name { font-weight: 600; }
.card.task-subtask .task-meta { color: #1d4ed8; font-size: 0.85rem; }
.card.task-subtask.done { background: #86efac; border-left-color: #14532d; }
.cards { display: grid; gap: 0.75rem; }
/* List view: one row per task — the task card on the left, its Edit box
   on the right, on every screen size. */
.task-item { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; min-width: 0; align-items: stretch; }
.task-item > * { min-width: 0; }
.tasks-list .card { margin-bottom: 0; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.tasks-list .task-main[onclick], .tasks-list .task-card[onclick] { cursor: pointer; }
/* Main-task cards used to be section headers with big vertical margins;
   inside the task list they are grid rows, so drop the margins to keep
   the Edit box exactly flush with the card. */
.tasks-list .task-main { margin: 0; }
details.task-edit-wrap { align-self: start; }
.tasks-list .task-card.task-subtask { margin-left: 0; }
a.card { text-decoration: none; color: inherit; display: block; }

.task-name { font-weight: 600; font-size: 1.05rem; }
.task-meta { color: var(--muted); font-size: 0.95rem; margin-top: 0.25rem; }
.task-card.done { border-left: 5px solid var(--green); }

.unit-name { font-weight: 700; font-size: 1.15rem; }
.unit-prop { color: var(--muted); font-size: 0.95rem; }
.unit-pct { margin-top: 0.4rem; font-weight: 600; }
.progress {
  margin-top: 0.5rem;
  height: 12px;
  background: #e6ebf1;
  border-radius: 999px;
  overflow: hidden;
}
.progress .bar { height: 100%; background: var(--brand); border-radius: 999px; }

.totals { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* ---- tables ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.98rem;
}
.table th, .table td { padding: 0.75rem 0.6rem; text-align: left; border-bottom: 1px solid var(--line); }
.table thead th { background: #eef2f6; font-size: 0.9rem; }
.table tr.paid td { color: var(--green); }
.table tr.total-row td { background: #eef2f6; }
.nowrap { white-space: nowrap; }

/* ---- forms ---- */
.form label { display: block; margin-bottom: 0.9rem; font-weight: 600; }
.form input, .form select, .form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.8rem;
  min-height: var(--tap);
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-weight: 400;
}
.form textarea { min-height: 0; }
.form .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.inline { display: inline; }
.status-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; align-items: stretch; }
.status-form select {
  flex: 1;
  padding: 0.7rem;
  min-height: var(--tap);
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.task-edit { margin-top: 0.75rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; width: 100%; }
.btn-primary:active { background: var(--brand-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-small { min-height: 44px; padding: 0.5rem 0.9rem; font-size: 0.95rem; }

.error {
  background: #fdecea;
  color: var(--red);
  border: 1px solid #f5c6c2;
  border-radius: 10px;
  padding: 0.75rem;
}
.notice {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
  padding: 0.75rem;
}
.reset-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0.5rem 0;
}
.perm-table th, .perm-table td {
  border: 1px solid #e0e0e0;
  padding: 0.5rem;
  text-align: center;
}
.perm-table th:first-child, .perm-table td:first-child {
  text-align: left;
}
.perm-table thead th {
  background: #f5f5f5;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll .perm-table {
  min-width: 34rem;
}
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- desktop tweaks ---- */
@media (min-width: 700px) {
  .cards:not(.tasks-list) { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .btn-primary { width: auto; }
}

/* ---- view tabs ---- */
.view-tabs { display: flex; gap: 0.5rem; margin: 1rem 0; }
.view-tab {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  font-size: 0.95rem;
}
.view-tab.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }

/* ---- board ---- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; align-items: start; }
.board-col { background: var(--card, #f8fafc); border-radius: 8px; padding: 0.6rem; }
.board-col h3 { margin: 0.2rem 0 0.6rem; font-size: 1rem; }
.board-card { margin-bottom: 0.5rem; }
.board-card.task-main { margin: 0 0 0.5rem; font-size: 1rem; padding: 0.75rem; }
.board-card .status-form { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.board-card .status-form select { flex: 1; }
@media (max-width: 720px) { .board { grid-template-columns: 1fr; } }

/* ---- gantt ---- */
.gantt { border: 1px solid var(--border, #ddd); border-radius: 8px; overflow: hidden; }
.gantt-row { display: flex; border-bottom: 1px solid var(--border, #eee); }
.gantt-row:last-child { border-bottom: none; }
.gantt-label {
  width: 34%; min-width: 0; padding: 0.4rem 0.6rem; font-size: 0.85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-right: 1px solid var(--border, #eee);
}
.gantt-track { position: relative; flex: 1; min-height: 2rem; }
.gantt-bar {
  position: absolute; top: 0.55rem; height: 0.9rem;
  background: #3b82f6; border-radius: 4px;
}
.gantt-bar.g-done { background: #16a34a; }
.gantt-bar.g-progress { background: #f59e0b; }
.gantt-diamond {
  position: absolute; top: 0.65rem; width: 0.7rem; height: 0.7rem;
  background: #a855f7; transform: rotate(45deg); border-radius: 2px;
}
.unscheduled { font-size: 0.9rem; }
.unscheduled li { margin-bottom: 0.25rem; }
.badge { display: inline-block; padding: 0.3rem 0.6rem; border-radius: 999px; font-size: 0.85rem; font-weight: 700; margin: 0.4rem 0; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-declined { background: #fee2e2; color: #991b1b; }
.badge-accepted { background: #dcfce7; color: #166534; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.thumb { border: 1px solid var(--line); border-radius: 10px; padding: 0.4rem; background: #fff; }
.thumb img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: block; }
.thumb-meta { font-size: 0.8rem; color: var(--muted); margin: 0.3rem 0; word-break: break-word; }
.comment-head { margin-bottom: 0.3rem; }
.comment-body { white-space: pre-wrap; margin-bottom: 0.5rem; }
.radio-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.radio-row label { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; margin-bottom: 0; }
.template-step { margin-top: 0.75rem; padding: 0.75rem; background: #f1f5f9; border-radius: 8px; }
.radio-col { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0; }
.radio-col label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin-bottom: 0; }
details.visit { margin-bottom: 1rem; }
details.visit summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; padding: 0.5rem 0; }
details.more { margin-bottom: 0.9rem; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 0.5rem 0; }
details.edit-full { margin-top: 1rem; }
details.edit-full summary { cursor: pointer; font-weight: 700; color: var(--brand); padding: 0.5rem 0; }

/* ---- labeled fact rows (task detail) ---- */
.facts { margin: 0.75rem 0; }
.facts div { display: flex; gap: 0.75rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: none; }
.facts dt { color: var(--muted); width: 6.5rem; flex-shrink: 0; }
.facts dd { margin: 0; font-weight: 600; }

/* ---- inline contact form (users page) ---- */
.contact-form input {
  display: block;
  width: 100%;
  min-width: 11rem;
  margin-bottom: 0.4rem;
  padding: 0.6rem;
  min-height: 44px;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

/* Overdue tasks: very light red wash. The type's left-border color stays,
   so the task type is still readable under the wash. */
.card.overdue, .task-main.overdue { background: #fee2e2; }
.card, .task-main { position: relative; }
.overdue-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #dc2626;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  line-height: 1.2;
}
/* Board cards are narrow: show the badge inline after the name so it
   never covers the text. */
.overdue-badge-inline {
  position: static;
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.task-main.overdue, .task-milestone.overdue { color: #7f1d1d; }
.task-main.overdue .task-meta, .task-milestone.overdue .task-meta { color: #b91c1c; }
.task-main.overdue .task-meta a, .task-milestone.overdue .task-meta a { color: #7f1d1d; }

/* Plan tab: sheet-style grid */
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.plan-table { border-collapse: collapse; width: 100%; min-width: 40rem; font-size: 0.85rem; }
.plan-table th, .plan-table td { border: 1px solid var(--line); padding: 0.35rem 0.4rem; text-align: left; vertical-align: top; }
.plan-table thead th { background: #f1f5f9; }
.plan-table input[type="date"] { font-size: 0.8rem; max-width: 8.5rem; }
.plan-table input[type="time"] { font-size: 0.8rem; max-width: 7rem; }
.plan-table select { font-size: 0.8rem; max-width: 9rem; }
.plan-main td { background: #e7f2ff; }
.plan-mile td { background: #f8f0ff; }
/* Unallow jump: flash the task row red so it gets fixed on the spot. */
#tpl-tasks tr.row-flash td { background: #fecaca !important; }
.small { font-size: 0.8rem; }
/* Dependency picker modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 10px; padding: 1rem; width: 26rem; max-width: 100%; max-height: 85vh; overflow: auto; }
.dep-list { margin: 0.5rem 0; max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem; }
.dep-list label { display: block; padding: 0.3rem 0.2rem; border-bottom: 1px solid #f1f5f9; }
.dep-list input[type="checkbox"] { margin-right: 0.5rem; }
.dep-dates { color: var(--muted); font-size: 0.8em; }
input.full { width: 100%; box-sizing: border-box; }
textarea.full { width: 100%; box-sizing: border-box; }

/* Scheduling conflict banner */
.conflict-banner { background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px; padding: 0.75rem 1rem; margin: 0.75rem 0; }
.conflict-banner strong { color: #991b1b; }
.conflict-banner ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.conflict-banner li { margin: 0.25rem 0; font-size: 0.9rem; }

/* Project list: 100% status shown green */
.status-complete { color: #1a7f37; font-weight: bold; }

/* Project list: inline schedule editor */
.sched-form { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.sched-form input[type="date"] { width: 8.2em; padding: 2px 4px; font-size: 0.85em; }
.proj-status { padding: 2px 4px; font-size: 0.85em; border-radius: 4px; font-weight: bold; }
.status-not-started { color: #6b7280; }
.status-in-progress { color: #1d4ed8; }
.status-on-hold { color: #b45309; background: #fef3c7; }
.status-completed { color: #1a7f37; background: #dcfce7; }

/* Project edit page */
.danger-zone { color: #991b1b; margin-top: 2em; }

/* Customers */
.badge-archived { background: #e5e7eb; color: #4b5563; }
.dimmed { opacity: 0.55; }
.filter-row { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; margin: 0.75rem 0; }
.filter-row label { display: flex; flex-direction: column; font-weight: 600; font-size: 0.9rem; }
.filter-row select { padding: 0.5rem; border: 1px solid #ccc; border-radius: 6px; min-width: 12rem; }
.req { color: #b91c1c; font-weight: 700; }
.hint { font-size: 0.9rem; color: #6b7280; margin: 0.25rem 0 0.75rem; }

/* ---- template task table: stack rows as cards on phones ---- */
@media (max-width: 720px) {
  .tpl-stack { min-width: 0; }
  .tpl-stack thead { display: none; }
  .tpl-stack, .tpl-stack tbody { display: block; }
  .tpl-stack tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.6rem;
    border: 1px solid var(--line); border-radius: 10px;
    padding: 0.6rem; margin-bottom: 0.75rem; background: #fff;
  }
  .tpl-stack tr.plan-main { background: #e7f2ff; }
  .tpl-stack tr.plan-mile { background: #f8f0ff; }
  .tpl-stack td { display: block; border: none; padding: 0; min-width: 0; }
  .tpl-stack td.span2 { grid-column: span 2; }
  .tpl-stack td::before {
    content: attr(data-label); display: block;
    font-size: 0.72rem; font-weight: 600; color: #64748b; margin-bottom: 0.15rem;
  }
  .tpl-stack td[data-label=""]::before { display: none; }
  .tpl-stack td input, .tpl-stack td select, .tpl-stack td textarea {
    width: 100% !important; min-width: 0 !important; max-width: none !important;
  }
  .tpl-stack td[data-label="Blocks site"] input { width: auto !important; }
  .tpl-stack td[data-label="Blocks site"]::before { display: inline; margin: 0 0.4rem 0 0; }
}

/* ---- template drag-and-drop reorder ---- */
.drag-handle {
  cursor: grab; color: #94a3b8; font-size: 1.05rem; letter-spacing: -2px;
  padding: 0 0.4rem 0 0.1rem; user-select: none; -webkit-user-select: none;
}
.drag-handle:active { cursor: grabbing; }
#tpl-tasks tr.dragging { opacity: 0.45; }
#tpl-tasks tr.drop-before td { border-top: 2px solid #1d4ed8; }
#tpl-tasks tr.drop-after td { border-bottom: 2px solid #1d4ed8; }

/* Users page: editable user cards */
.user-card { margin-bottom: 0.75rem; }
.user-card summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.user-card summary::-webkit-details-marker { display: none; }
.user-summary-id { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.user-summary-id .muted { font-size: 0.85rem; }
.user-edit-btn {
  flex-shrink: 0;
  background: #eef2ff; color: var(--brand);
  border: 1px solid #c7d2fe; border-radius: 999px;
  padding: 0.35rem 0.9rem; font-size: 0.9rem; font-weight: 600;
}
.user-details-body { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #eee; }
.user-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.75rem; }
.user-grid label { display: block; font-size: 0.85rem; font-weight: 600; }
.user-grid input, .user-grid select { width: 100%; margin-top: 0.2rem; font-weight: 400; }
.user-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
@media (max-width: 560px) {
  .user-grid { grid-template-columns: 1fr; }
}

/* ---- allowed warnings review toggle (template page) ---- */
.allowed-banner {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: 0.6rem 0.9rem; margin: 0.5rem 0;
}
.allowed-banner summary { cursor: pointer; font-weight: 600; }
.allowed-banner ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.allowed-banner li { margin: 0.25rem 0; }

/* ---- template task instructions + documents sub-rows ---- */
.tpl-sub td { background: #f8fafc; padding: 0.5rem 0.75rem; }
.tpl-sub-inner { display: flex; flex-direction: column; gap: 0.5rem; }
.tpl-instr { display: block; font-size: 0.85rem; font-weight: 600; color: #475569; }
.tpl-instr textarea {
  display: block; margin-top: 0.25rem; font-weight: 400;
  resize: vertical; min-height: 2.5rem; font-size: 0.95rem;
}
.tpl-docs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.tpl-docs-title { font-weight: 600; color: #475569; }
.clip-btn {
  background: none; border: none; cursor: pointer; font-size: 1.35rem;
  padding: 0.15rem 0.35rem; border-radius: 6px; line-height: 1; position: relative;
}
.clip-btn:hover { background: #e2e8f0; }
.clip-count {
  font-size: 0.68rem; font-weight: 700; background: #6366f1; color: #fff;
  border-radius: 999px; padding: 0.05rem 0.35rem; vertical-align: super; margin-left: 0.1rem;
}
.docs-list { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.docs-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.35rem 0; border-bottom: 1px solid #f1f5f9;
}
.docs-list li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-file {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 0.2rem 0.35rem;
}
.tpl-file a { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-upload { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ---- task instructions box (project task page) ---- */
.instr-box {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 0.7rem 0.9rem; margin: 0.75rem 0;
}
.instr-title { font-weight: 700; margin-bottom: 0.3rem; }
.instr-body { white-space: pre-wrap; }

/* Dashboard project cards (shared by dashboard + /projects/cards) */
.dash-proj { display:block; text-decoration:none; color:inherit; }
.dash-proj-main { display:block; text-decoration:none; color:inherit; }
.dash-assign { margin-top:.6rem; border-top:1px solid #eef2f6; padding-top:.55rem; }
.dash-assign-label { font-size:.72rem; font-weight:700; color:#5b6b7a; text-transform:uppercase; letter-spacing:.05em; margin-bottom:.4rem; }
.dash-assign-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(70px,1fr)); gap:.4rem; }
.dash-assign-box { display:block; text-align:center; border-radius:8px; padding:.45rem .2rem; text-decoration:none; }
.dash-assign-box .n { display:block; font-size:1.25rem; font-weight:800; line-height:1.15; }
.dash-assign-box .l { display:block; font-size:.7rem; font-weight:600; margin-top:.1rem; }
.box-pending { background:#fef3c7; color:#92400e; }
.box-confirmed { background:#dcfce7; color:#166534; }
.box-declined { background:#fee2e2; color:#991b1b; }
.box-unconfirmed { background:#f3f4f6; color:#374151; }
.dash-proj .progress { margin:.4rem 0; }
.progress { background:#e8edf2; border-radius:6px; height:10px; overflow:hidden; }
.progress .bar { height:100%; background:#2b7cd3; border-radius:6px; }
.dash-proj-head { display:flex; justify-content:space-between; align-items:baseline; gap:.5rem; }
.dash-proj-name { font-weight:700; font-size:1.05rem; }
.dash-pct { font-weight:800; color:#1a3a5c; white-space:nowrap; }
.dash-meta { font-size:.85rem; color:#5b6b7a; }
.st { font-weight:700; font-size:.8rem; white-space:nowrap; }
.st-not-started { color:#9aa4ad; } .st-in-progress { color:#2b7cd3; }
.st-on-hold { color:#e8912d; } .st-completed { color:#2e9e52; }
.attn-item { display:flex; justify-content:space-between; gap:.5rem; align-items:center; padding:.5rem 0; border-bottom:1px solid #f1f5f9; }
.attn-item:last-child { border-bottom:none; }
.attn-item a { font-weight:600; }
.attn-due { font-size:.82rem; color:#d32f2f; white-space:nowrap; }
.badge-attention { background:#fef2f2; color:#b91c1c; border:1px solid #fecaca; }
.badge-attention-ok { background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }
.status-badge { position:absolute; top:.5rem; right:.5rem; display:inline-block; font-size:.75rem; font-weight:700; padding:.25rem .65rem; border-radius:999px; white-space:nowrap; line-height:1.2; }
.status-badge-completed { background:#dcfce7; color:#166534; }
.status-badge-inprogress { background:#dbeafe; color:#1d4ed8; }
.status-badge-notstarted { background:#f3f4f6; color:#6b7280; }
.status-badge-dropped { background:#f3f4f6; color:#9ca3af; text-decoration:line-through; }
.task-dates { font-weight:700; font-size:1rem; }
