/* Brand: Coral #FE5E41 (headers), Charcoal #231F20 (text), Peach tints #FFF0EE / #FFC3BB, font Poppins. */
:root {
  --coral: #FE5E41;
  --coral-dark: #E04A2F;
  --charcoal: #231F20;
  --muted: #6B5F60;
  --peach-light: #FFF0EE;
  --peach-mid: #FFC3BB;
  --line: #F3DDD8;
  --card: #FFFFFF;
  --danger: #C0262D;
  --danger-bg: #FDE8E8;
  --ok: #1B7A3E;
  --ok-bg: #E4F4EA;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--charcoal);
  background: var(--peach-light);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Header */
.topbar {
  background: var(--coral);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 36px; height: 36px; border-radius: 10px; background: #fff; position: relative; }
.mark::after {
  content: ''; position: absolute; left: 12px; top: 10px;
  border-left: 12px solid var(--coral); border-top: 8px solid transparent; border-bottom: 8px solid transparent;
}
.brand-title { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; opacity: .92; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#search {
  border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.18); color: #fff;
  border-radius: 999px; padding: 8px 16px; min-width: 220px; outline: none;
}
#search::placeholder { color: rgba(255,255,255,.85); }
#search:focus { background: rgba(255,255,255,.3); }

/* Tabs */
.tabs {
  display: flex; gap: 6px; padding: 12px 24px 0; overflow-x: auto; background: #fff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.tab {
  background: none; border: 0; padding: 12px 14px; cursor: pointer; color: var(--muted);
  font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; display: flex; gap: 8px; align-items: center;
}
.tab[aria-selected="true"] { color: var(--coral-dark); border-bottom-color: var(--coral); font-weight: 600; }
.count {
  background: var(--peach-mid); color: var(--charcoal); border-radius: 999px; font-size: 12px;
  padding: 1px 9px; font-weight: 600; min-width: 22px; text-align: center;
}
.count.zero { background: var(--line); color: var(--muted); }
.count.alert { background: var(--coral); color: #fff; }

/* Content */
.content { padding: 20px 24px 60px; max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 16px; font-weight: 700; margin: 22px 0 10px; color: var(--charcoal); }
.hint { color: var(--muted); font-size: 13px; margin: -4px 0 12px; }
.muted { color: var(--muted); }
.empty {
  background: #fff; border: 1px dashed var(--peach-mid); border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--muted);
}
.list { display: grid; gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  display: grid; gap: 8px; box-shadow: 0 1px 2px rgba(35,31,32,.04);
}
.card.overdue { border-left: 5px solid var(--danger); }
.card.critical { border-left: 5px solid var(--coral); }
.card-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.doer { font-weight: 700; }
.task-text { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; }
.meta b { color: var(--charcoal); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--peach-light);
  color: var(--charcoal); border: 1px solid var(--peach-mid);
}
.chip.critical { background: var(--coral); color: #fff; border-color: var(--coral); }
.chip.high { background: var(--peach-mid); }
.chip.overdue { background: var(--danger-bg); color: var(--danger); border-color: #F5B8B8; }
.chip.hold { background: #FFF4D6; border-color: #F2DC9B; }
.chip.done { background: var(--ok-bg); color: var(--ok); border-color: #B8E0C5; }
.chip.fail { background: var(--danger-bg); color: var(--danger); border-color: #F5B8B8; }
.note { background: var(--peach-light); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--charcoal); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Buttons */
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font-weight: 500; font-size: 13px;
}
.btn:hover { border-color: var(--coral); color: var(--coral-dark); }
.btn.primary { background: #fff; color: var(--coral-dark); border: 0; font-weight: 600; padding: 9px 18px; }
.btn.primary:hover { background: var(--peach-light); }
.btn.solid { background: var(--coral); color: #fff; border-color: var(--coral); font-weight: 600; }
.btn.solid:hover { background: var(--coral-dark); color: #fff; }
.btn.danger { color: var(--danger); border-color: #F5B8B8; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Tables */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--peach-light); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: 0; }

/* Dialog */
.dlg {
  border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(35,31,32,.25); color: var(--charcoal);
}
.dlg::backdrop { background: rgba(35,31,32,.45); }
.dlg-form { padding: 24px; display: grid; gap: 14px; }
.dlg-form h3 { margin: 0; font-size: 18px; color: var(--coral-dark); }
.field { display: grid; gap: 6px; }
.field label, .field .lbl { font-size: 13px; font-weight: 600; }
.field .help { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px var(--peach-mid); }
.field textarea { min-height: 84px; resize: vertical; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios label {
  display: flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-weight: 500; cursor: pointer; font-size: 13px;
}
.radios input { accent-color: var(--coral); }
.err { color: var(--danger); background: var(--danger-bg); border-radius: 10px; padding: 8px 12px; margin: 0; font-size: 13px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--charcoal); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 20;
}
.toast.error { background: var(--danger); }

@media (max-width: 640px) {
  .topbar, .content { padding-left: 14px; padding-right: 14px; }
  .tabs { padding-left: 10px; padding-right: 10px; }
  #search { min-width: 0; width: 100%; }
  .top-actions { width: 100%; }
}
