/* The Drawing Board — Barndo & Co. Plan & Design HQ */
/* Official Barndo & Co. palette (Canva brand kit):
   #333333 charcoal · #a07c52 camel · #4a301d dark brown · #654321 brown
   #caa377 tan · #ffebd5 cream · #fcad5b apricot · #300904 espresso */
:root {
  --bg: #333333;
  --bg-2: #2a2724;
  --card: #4a301d;
  --card-2: #654321;
  --line: rgba(160, 124, 82, .38);
  --gold: #caa377;
  --gold-dim: #a07c52;
  --text: #ffebd5;
  --muted: rgba(255, 235, 213, .58);
  --red: #fcad5b;
  --green: #8fb996;
  --espresso: #300904;
  --shadow: 0 8px 24px rgba(20, 8, 2, .5);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, "Helvetica Neue", Segoe UI, sans-serif;
}
.hidden { display: none !important; }
h1 { font-family: "Palatino", "Georgia", serif; font-weight: 500; font-size: 26px; color: var(--gold); letter-spacing: .3px; }
h2, h3 { font-family: "Palatino", "Georgia", serif; font-weight: 500; color: var(--gold); }
.sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------- wordmark / logo ---------- */
.logo { display: block; width: 240px; max-width: 80%; margin: 0 auto; }
.logo.small { width: 150px; }
.wordmark { font-family: "Snell Roundhand", "Palatino", cursive; font-size: 34px; color: var(--gold); text-align: center; }
.wordmark.small { font-size: 24px; }
.wordmark-sub { text-align: center; font-size: 10px; letter-spacing: 2.5px; color: var(--muted); margin-top: 2px; }
.wordmark-sub.small { font-size: 8.5px; letter-spacing: 2px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: var(--gold-dim); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #333333; font-weight: 600; }
.btn.gold:hover { background: #d9b489; }
.btn.ghost { background: transparent; }
.btn.slim { padding: 6px 12px; font-size: 13px; }
.btn.danger { color: var(--red); }
.pill { background: var(--gold); color: #333333; border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 700; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at top, #3d332a, var(--bg)); }
.login-card { width: 420px; max-width: 92vw; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 40px 36px; box-shadow: var(--shadow); }
.login-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 22px 0 14px; }
.login-users { display: grid; gap: 10px; }
.login-user { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); font-size: 15px; }
.login-user:hover { border-color: var(--gold-dim); }
.login-user .lu-title { display: block; font-size: 11.5px; color: var(--muted); }
.pin-form { display: grid; gap: 10px; margin-top: 8px; }
.pin-for { text-align: center; color: var(--muted); font-size: 13px; }
.pin-form input { background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 12px; font-size: 20px; text-align: center; letter-spacing: 8px; }
.form-error { color: var(--red); font-size: 13px; text-align: center; min-height: 18px; }

/* ---------- avatars ---------- */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #333333; flex: 0 0 auto; box-shadow: 0 0 0 1.5px rgba(255,235,213,.25); }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

/* ---------- shell ---------- */
.app { display: flex; height: 100vh; }
.sidebar { width: 220px; flex: 0 0 220px; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 26px 14px 16px; }
.nav { display: grid; gap: 4px; margin-top: 30px; }
.nav-btn { display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: 14px; cursor: pointer; text-align: left; }
.nav-btn:hover { color: var(--text); }
.nav-btn.active { background: var(--card); color: var(--gold); border-color: var(--line); }
.nav-btn .ico { width: 18px; text-align: center; }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; }
.me-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 10px; background: var(--card); border-radius: 8px; border: 1px solid var(--line); }
.me-chip .mc-role { display: block; font-size: 11px; color: var(--muted); }
.main { flex: 1; overflow: auto; padding: 26px 28px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }

/* ---------- board ---------- */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 20px; }
.col { width: 268px; flex: 0 0 268px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.col-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.col-head .col-name { font-family: "Palatino", "Georgia", serif; color: var(--gold); font-size: 15px; }
.col-head .col-step { font-size: 10px; letter-spacing: 1.5px; color: var(--muted); }
.col-head .col-count { float: right; color: var(--muted); font-size: 12px; margin-top: 2px; }
.col-list { padding: 10px; display: grid; gap: 10px; min-height: 60px; }
.col-list.drag-over { outline: 2px dashed var(--gold-dim); outline-offset: -6px; border-radius: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 10px; cursor: pointer; position: relative; }
.tile:hover { border-color: var(--gold-dim); }
.tile.draggable { cursor: grab; }
.tile.dragging { opacity: .45; }
.tile.ready { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.tile .t-prio { position: absolute; top: 10px; right: 10px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.tile .t-name { font-weight: 600; font-size: 14px; padding-right: 34px; }
.tile .t-client { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tile .t-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.tile .t-pkg { font-size: 11px; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 6px; padding: 1px 7px; }
.tile .t-due { font-size: 11.5px; color: var(--muted); }
.tile .t-due.overdue { color: var(--red); font-weight: 600; }
.tile .t-due.soon { color: var(--gold); }
.tile .t-ready { font-size: 10.5px; color: var(--green); margin-top: 8px; letter-spacing: .5px; }
.tile .avatar { width: 22px; height: 22px; font-size: 9.5px; }

/* ---------- calendar ---------- */
.cal-wrap { display: flex; gap: 20px; align-items: flex-start; }
.cal-left { flex: 1; min-width: 0; }
.cal-title { font-size: 20px; margin-bottom: 12px; }
.cal-nav { display: flex; gap: 6px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day { min-width: 0; }
.cal-dow { text-align: center; font-size: 11px; letter-spacing: 1px; color: var(--muted); padding: 4px 0; }
.cal-day { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; min-height: 96px; padding: 6px; cursor: pointer; }
.cal-day:hover { border-color: var(--gold-dim); }
.cal-day.dim { opacity: .38; }
.cal-day.today { border-color: var(--gold); }
.cal-day .d-num { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cal-day.today .d-num { color: var(--gold); font-weight: 700; }
.cal-task { display: flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 5px; border-radius: 5px; background: var(--card-2); margin-bottom: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-task .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(255,235,213,.3); }
.cal-task.done { text-decoration: line-through; opacity: .5; }
.cal-more { font-size: 10.5px; color: var(--muted); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.cal-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.cal-upcoming { width: 300px; flex: 0 0 300px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.cal-upcoming h3 { margin-bottom: 10px; }
.up-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.up-item:last-child { border-bottom: 0; }
.up-item .u-when { color: var(--muted); font-size: 11.5px; }

/* ---------- tasks ---------- */
.mytasks { max-width: 720px; display: grid; gap: 22px; }
.task-group h3 { font-size: 15px; margin-bottom: 8px; }
.task-group h3.late { color: var(--red); }
.task-row { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; margin-bottom: 8px; }
.task-row.done .tk-title { text-decoration: line-through; color: var(--muted); }
.task-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer; }
.tk-title { flex: 1; }
.tk-meta { color: var(--muted); font-size: 12px; }
.tk-del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; }
.tk-del:hover { color: var(--red); }
.empty { color: var(--muted); font-size: 14px; padding: 20px 0; }

/* ---------- team ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; max-width: 1000px; }
.member { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; gap: 14px; }
.member .m-name { font-weight: 600; font-size: 15px; }
.member .m-title { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.member .m-load { color: var(--gold); font-size: 12px; margin-top: 8px; }
.member .m-edit { margin-top: 10px; }

/* ---------- drawer & modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10,8,4,.6); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 94vw; background: var(--bg-2); border-left: 1px solid var(--line); z-index: 50; overflow-y: auto; padding: 26px; box-shadow: var(--shadow); }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 460px; max-width: 92vw; max-height: 88vh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; z-index: 50; padding: 26px; box-shadow: var(--shadow); }
.d-close { position: absolute; top: 16px; right: 18px; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
.d-close:hover { color: var(--text); }
.d-stage { font-size: 11px; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 6px; }
.d-title { font-size: 21px; padding-right: 30px; }
.field { display: grid; gap: 5px; margin-top: 14px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.field input, .field select, .field textarea {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 9px 11px; font-size: 14px; font-family: inherit; width: 100%;
}
.field textarea { min-height: 70px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.d-section { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.d-section h3 { font-size: 14px; margin-bottom: 10px; }
.stage-track { display: grid; gap: 6px; }
.st-step { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent; }
.st-step.current { background: var(--card); border-color: var(--gold-dim); }
.st-step.past { color: var(--muted); }
.st-step .st-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); flex: 0 0 auto; }
.st-step.past .st-dot { background: var(--green); border-color: var(--green); }
.st-step.current .st-dot { border-color: var(--gold); background: var(--gold); }
.st-step .st-who { margin-left: auto; }
.act-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.act-item:last-child { border-bottom: 0; }
.act-item .a-meta { color: var(--muted); font-size: 11.5px; }
.act-item.event .a-text { color: var(--muted); font-style: italic; }
.note-form { display: flex; gap: 8px; margin-top: 10px; }
.note-form input { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 9px 11px; font-size: 14px; }
.d-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.modal h2 { font-size: 19px; margin-bottom: 4px; }
.modal .m-sub { color: var(--muted); font-size: 13px; }
.m-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ---------- project files ---------- */
.fslot { margin-bottom: 16px; }
.fslot:last-child { margin-bottom: 0; }
.fs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.fs-label { font-size: 12.5px; color: var(--muted); letter-spacing: .5px; }
.fcard { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--gold-dim); border-radius: 10px; padding: 11px 13px; text-decoration: none; color: var(--text); }
.fcard:hover { border-color: var(--gold); }
.fcard .fc-icon { font-size: 20px; }
.fcard .fc-main { flex: 1; min-width: 0; display: grid; }
.fcard .fc-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.fc-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.fc-latest { color: #333333; background: var(--gold); border-radius: 4px; padding: 0 5px; font-weight: 700; font-size: 10px; margin-right: 4px; }
.fcard .fc-open { color: var(--gold); font-size: 12.5px; flex: 0 0 auto; }
.fprev { margin-top: 6px; }
.fprev summary { cursor: pointer; color: var(--muted); font-size: 12px; padding: 3px 2px; }
.fprev summary:hover { color: var(--text); }
.fprev-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px 6px 14px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.fprev-row:last-child { border-bottom: 0; }
.fprev-row .fprev-name { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--card-2); border: 1px solid var(--gold-dim); color: var(--text); border-radius: 10px; padding: 12px 20px; z-index: 60; box-shadow: var(--shadow); font-size: 14px; }
.toast.err { border-color: var(--red); color: var(--red); }

/* ---------- dashboard ---------- */
.dash-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; min-width: 130px; cursor: pointer; }
.stat:hover { border-color: var(--gold-dim); }
.stat .st-num { font-family: "Palatino", "Georgia", serif; font-size: 28px; color: var(--gold); line-height: 1.1; }
.stat .st-num.alert { color: var(--red); }
.stat .st-num.ok { color: var(--green); }
.stat .st-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-section { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.dash-section h3 { font-size: 15px; margin-bottom: 12px; }
.ds-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ds-hint { font-size: 12px; color: var(--muted); }
.dash-board { padding-bottom: 6px; }
.dash-board .col { width: 216px; flex: 0 0 216px; background: var(--bg); }
.dash-board .col-list { min-height: 40px; }
.dash-board .tile { padding: 9px 10px 8px; }
.dash-board .tile .t-name { font-size: 12.5px; padding-right: 26px; }
.dash-board .tile .t-stage { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.dash-board .tile .t-prio { top: 8px; right: 8px; font-size: 10px; }
.dash-board .col-head { padding: 9px 12px 8px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.dg-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer; border-radius: 6px; }
.dg-row:hover { background: var(--card); }
.dg-row:last-child { border-bottom: 0; }
.dg-row .dg-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-row .dg-meta { color: var(--muted); font-size: 12px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-row .dg-meta.late { color: var(--red); font-weight: 600; }
.dg-row .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.dg-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }
.btn.tiny { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.dg-day { font-size: 11px; letter-spacing: 1px; color: var(--gold); margin: 10px 6px 2px; text-transform: uppercase; }
.dg-day:first-child { margin-top: 0; }
.stage-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; cursor: pointer; border-radius: 6px; }
.stage-row:hover { background: var(--card); }
.stage-row .sr-name { flex: 0 0 200px; font-size: 13px; }
.stage-row .sr-bar { flex: 1; height: 8px; background: var(--card); border-radius: 4px; overflow: hidden; }
.stage-row .sr-fill { height: 100%; background: var(--gold-dim); border-radius: 4px; }
.stage-row .sr-count { flex: 0 0 24px; text-align: right; color: var(--gold); font-size: 13px; font-weight: 600; }
.tile .t-desk { font-size: 10px; color: var(--muted); border: 1px dashed var(--line); border-radius: 5px; padding: 1px 5px; margin-right: 6px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- staff board ---------- */
.staff-col .col-head .col-step { text-transform: uppercase; letter-spacing: 1px; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-col .t-pkg { border-color: var(--line); color: var(--muted); }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 10px; gap: 10px; }
  .nav { display: flex; margin: 0; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .logo.small, .wordmark.small, .wordmark-sub.small { display: none; }
  .cal-wrap { flex-direction: column; }
  .cal-upcoming { width: 100%; }
}
