/* === MODERN POLISHED UI === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #e8e8ea;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-2: #3f3f46;
  --muted: #71717a;
  --muted-2: #a1a1aa;
  --navy: #0a0a0a;
  --navy-d: #000000;
  --navy-l: #27272a;
  --accent: #e63946;
  --accent-d: #c1121f;
  --ok: #16a34a;
  --ok-l: #dcfce7;
  --ok-d: #15803d;
  --warn: #f59e0b;
  --warn-l: #fef3c7;
  --warn-d: #b45309;
  --err: #ef4444;
  --err-l: #fee2e2;
  --err-d: #b91c1c;
  --info: #e63946;
  --info-l: #fee2e2;
  --purple: #8b5cf6;
  --purple-l: #ede9fe;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.05), 0 10px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.1), 0 4px 8px rgba(15, 23, 42, 0.04);
  --t: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-d); }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin-bottom: 6px; }
h3 { font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 16px 0 8px; letter-spacing: -0.005em; }
h4 { font-size: 0.9rem; font-weight: 600; color: var(--text-2); margin: 8px 0 4px; }
.w { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); } .small { font-size: 0.8rem; }
.inline { display: inline; } .full { width: 100%; }
.center { text-align: center; } .pad { padding: 16px; }
.r { float: right; }

/* HEADER */
#hd {
  background: var(--navy-d);
  background-image: linear-gradient(180deg, var(--navy-d) 0%, var(--navy) 100%);
  color: #e2e8f0; position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}
.hw { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; min-height: 52px; gap: 12px; }
.logo {
  color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em;
  white-space: nowrap; padding-right: 14px; margin-right: 4px;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.logo span { font-weight: 400; opacity: 0.6; margin-left: 2px; }
.ham { display: block; background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); transition: all var(--t); }
.ham:hover { background: rgba(255,255,255,0.08); }
.hdr-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.n-link { position: relative; padding: 6px 8px; font-size: 1rem; color: rgba(255,255,255,0.85); border-radius: var(--radius-sm); }
.n-link:hover { background: rgba(255,255,255,0.08); text-decoration: none; }
.n-dot {
  position: absolute; top: -2px; right: -2px; background: var(--err); color: #fff;
  font-size: 0.6rem; padding: 1px 5px; border-radius: 10px; font-weight: 700;
  border: 2px solid var(--navy-d);
}
.u-name {
  font-size: 0.78rem; opacity: 0.7; max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0 6px; border-left: 1px solid rgba(255,255,255,0.1); margin-left: 4px;
}
.hdr-r a, .hdr-r .theme-toggle { color: rgba(255,255,255,0.85); padding: 6px 8px; border-radius: var(--radius-sm); }
.hdr-r a:hover, .hdr-r .theme-toggle:hover { background: rgba(255,255,255,0.08); text-decoration: none; color: #fff; }
.hdr-r .logout { font-size: 0.78rem; }

/* === LEFT SIDEBAR === */
.app-shell { display: flex; max-width: 1400px; margin: 0 auto; align-items: flex-start; }
.sb {
  width: 220px; flex-shrink: 0; position: sticky; top: 52px;
  align-self: flex-start;
  max-height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 18px 12px 24px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 50;
}
html[data-theme="dark"] .sb { background: rgba(255,255,255,0.02); }
.sb-section { margin-bottom: 14px; }
.sb-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 10px; margin-bottom: 4px;
}
.sb a {
  display: block; padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500; color: var(--text-2);
  white-space: nowrap; transition: all var(--t);
  margin-bottom: 1px;
}
.sb a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sb a.on { background: var(--accent); color: #fff; }
.sb a.on:hover { background: var(--accent-d); color: #fff; }
.sb-cta {
  display: block !important; background: var(--accent) !important; color: #fff !important;
  font-weight: 600 !important; text-align: center;
  padding: 9px 12px !important;
}
.sb-cta:hover { background: var(--accent-d) !important; }
.sb-backdrop { display: none; }
main { flex: 1; min-width: 0; }

/* Collapsed (desktop): hide the sidebar entirely, main takes full width */
body.sb-collapsed .sb { display: none; }
@media (min-width: 881px) {
  /* On desktop, when collapsed we slide it out cleanly */
  body.sb-collapsed .sb { display: none; }
}
.logout { opacity: 0.5; font-size: 0.78rem; }

/* MAIN + FOOTER */
main { min-height: calc(100vh - 110px); padding: 24px 0; }
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 14px 0; font-size: 0.75rem; color: var(--muted); text-align: center;
}
footer a { color: var(--muted); }

/* FLASH */
.flash {
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: 0.88rem; border-left: 3px solid;
}
.fl-ok { background: var(--ok-l); color: var(--ok-d); border-color: var(--ok); }
.fl-err { background: var(--err-l); color: var(--err-d); border-color: var(--err); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 0.83rem; font-weight: 500; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; text-decoration: none; white-space: nowrap;
  transition: all var(--t); line-height: 1.4;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted-2); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-d); border-color: var(--navy-d); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn.danger { color: var(--err-d); border-color: var(--err-l); }
.btn.danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn.sm { padding: 4px 10px; font-size: 0.78rem; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
  line-height: 1.4;
}
.badge-open { background: var(--ok-l); color: var(--ok-d); }
.badge-in_progress, .badge-in-progress { background: #dbeafe; color: #1e40af; }
.badge-pending { background: var(--warn-l); color: var(--warn-d); }
.badge-done { background: var(--ok-l); color: var(--ok-d); }
.badge-closed { background: var(--surface-3); color: var(--text-2); }
.badge-blocked, .badge-on_hold { background: var(--err-l); color: var(--err-d); }
.badge-review { background: var(--purple-l); color: #5b21b6; }
.badge-cancelled { background: var(--surface-3); color: var(--muted); }
.badge-admin { background: var(--navy); color: #fff; }
.badge-manager { background: #1e40af; color: #fff; }
.badge-editor { background: var(--muted); color: #fff; }
.badge.accent { background: var(--warn-l); color: var(--warn-d); }
.pri-low { color: var(--muted); font-size: 0.75rem; }
.pri-normal { color: var(--text-2); font-size: 0.75rem; font-weight: 500; }
.pri-high { color: var(--warn-d); font-size: 0.75rem; font-weight: 600; }
.pri-urgent { color: var(--err-d); font-size: 0.75rem; font-weight: 700; }
.text-warn { color: var(--err-d) !important; font-weight: 600; }
.tag { display: inline-block; background: var(--surface-3); padding: 1px 7px; border-radius: 3px; font-size: 0.7rem; margin: 1px; color: var(--text-2); }

/* PAGE HEAD */
.pg-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.pg-head h2 { margin: 0; }
.pg-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* TABLES */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.85rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.tbl th {
  background: var(--surface-2); text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border); font-weight: 600;
  font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }
.row-off td { opacity: 0.45; }
.card-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-scroll .tbl { border: 0; }

/* FORMS */
.form-box { max-width: 680px; background: var(--surface); padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.form-box label, .modal-box label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--text-2); margin: 12px 0 4px;
}
.form-box input, .form-box select, .form-box textarea,
.modal-box input, .modal-box select, .modal-box textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 0.88rem; font-family: inherit;
  background: var(--surface); color: var(--text); transition: all var(--t);
}
/* Number inputs don't need to be full-width - they hold short values */
.form-box input[type="number"],
.modal-box input[type="number"] { max-width: 180px; }
/* Date inputs are also short */
.form-box input[type="date"],
.modal-box input[type="date"] { max-width: 200px; }
/* Cap textarea growth so they don't dominate the form visually */
.form-box textarea, .modal-box textarea {
  resize: vertical; min-height: 60px; max-height: 200px;
}
.form-box input:focus, .modal-box input:focus, .form-box select:focus, .form-box textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.row2 { display: flex; gap: 12px; } .row2 > div { flex: 1; }
.form-act { margin-top: 16px; display: flex; gap: 8px; align-items: center; }
.cb { font-size: 0.85rem; font-weight: normal; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cb input { margin: 0; width: auto !important; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.inp-sm { width: 130px !important; padding: 5px 8px !important; font-size: 0.82rem !important; }
.inp-xs { width: 70px !important; padding: 5px 8px !important; font-size: 0.82rem !important; }

/* CARDS */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--t);
}
.card > .card-hd:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card:hover { box-shadow: var(--shadow); }
.card.warn { border-color: #fca5a5; }
.card-hd {
  padding: 12px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border); font-weight: 600;
  font-size: 0.92rem; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; letter-spacing: -0.005em;
}

/* STATS */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 18px;
  box-shadow: var(--shadow-sm); transition: all var(--t);
  position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: var(--muted-2); transition: background var(--t);
}
.stat-card.s-active::before { background: var(--accent); }
.stat-card.s-done::before { background: var(--ok); }
.stat-card.s-hold::before { background: var(--warn); }
.stat-card.s-mine::before { background: var(--info); }
.stat-card.accent::before { background: var(--info); }
.stat-num { font-size: 2.1rem; font-weight: 700; line-height: 1; color: var(--text); letter-spacing: -0.02em; }
.stat-lbl { font-size: 0.78rem; color: var(--muted); margin-top: 6px; font-weight: 500; letter-spacing: 0.2px; }
.stat-ico { position: absolute; top: 14px; right: 14px; font-size: 1.2rem; opacity: 0.18; }

/* PROGRESS BARS */
.prog-bar {
  height: 8px; background: var(--surface-3); border-radius: 100px;
  overflow: hidden; position: relative;
}
.prog-bar.sm { height: 5px; }
.prog-bar.lg { height: 22px; }
.prog-fill {
  height: 100%; background: var(--ok);
  background-image: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
  border-radius: 100px; color: #fff; font-size: 0.68rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; min-width: 18px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.prog-bar.lg .prog-fill { font-size: 0.78rem; }

/* DASHBOARD */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.job-prog { padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background var(--t); }
.job-prog:last-child { border-bottom: none; }
.job-prog:hover { background: var(--surface-2); }
.jp-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.jp-title { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.jp-stage { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; flex-wrap: wrap; }
.stage-pill {
  padding: 2px 8px; font-size: 0.72rem; border-radius: 4px;
  background: var(--surface-3); color: var(--text-2); font-weight: 500;
}
.jp-detail { font-size: 0.7rem; color: var(--muted); margin-top: 5px; display: flex; gap: 12px; }
.team-row { padding: 10px 16px; border-bottom: 1px solid var(--border); transition: background var(--t); }
.team-row:last-child { border-bottom: none; }
.team-row:hover { background: var(--surface-2); }
.tm-name { font-weight: 500; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.tm-nums { font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; display: flex; gap: 10px; }
.tm-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #e63946, #c1121f);
  color: #fff; font-size: 0.72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.overall-prog { margin-bottom: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.op-label { font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--text); display: flex; justify-content: space-between; }

/* ACTIVITY */
.activity { max-height: 380px; overflow-y: auto; padding: 0; }
.act-item {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.83rem; position: relative;
}
.act-item:last-child { border-bottom: none; }
.act-item strong { color: var(--text); font-weight: 600; }
.act-action { color: var(--text-2); }
.act-item time { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 3px; }

/* STAGE DISTRIBUTION (NEW) */
.stage-dist { padding: 16px; }
.stage-dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.stage-dist-row:last-child { margin-bottom: 0; }
.stage-dist-lbl { width: 110px; font-size: 0.82rem; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stage-dist-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stage-dist-bar { flex: 1; height: 22px; background: var(--surface-3); border-radius: 4px; overflow: hidden; position: relative; }
.stage-dist-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding: 0 8px; color: #fff; font-size: 0.74rem; font-weight: 600; transition: width 0.5s; }
.stage-dist-num { width: 30px; text-align: right; font-size: 0.82rem; font-weight: 600; color: var(--text); }

/* KANBAN */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; -webkit-overflow-scrolling: touch; min-height: 320px; }
.k-col { min-width: 220px; max-width: 280px; flex: 1; background: var(--surface-2); border-radius: var(--radius); display: flex; flex-direction: column; border: 1px solid var(--border); }
.k-hd { padding: 10px 12px; font-size: 0.82rem; font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; letter-spacing: 0.4px; }
.k-cnt { background: var(--surface); border: 1px solid var(--border); padding: 1px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 700; color: var(--text); }
.k-body { flex: 1; padding: 6px 8px 10px; min-height: 60px; }
.k-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px;
  cursor: grab; transition: all var(--t); touch-action: none;
  box-shadow: var(--shadow-sm);
}
.k-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--muted-2); }
.k-card.dragging { opacity: 0.4; }
.k-title { font-size: 0.86rem; font-weight: 600; color: var(--text); display: block; }
.k-title:hover { text-decoration: none; color: var(--accent-d); }
.k-sub { font-size: 0.76rem; color: var(--muted); margin-top: 3px; }
.k-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #e63946, #c1121f);
  color: #fff; font-size: 0.62rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.k-prog { flex: 1; height: 4px; background: var(--surface-3); border-radius: 2px; min-width: 30px; overflow: hidden; }
.k-prog-bar { height: 100%; background: var(--ok); border-radius: 2px; }
.drag-over { background: #ecfdf5 !important; outline: 2px dashed var(--ok); outline-offset: -2px; }

/* PIPELINE */
.pipeline { display: flex; align-items: center; margin: 14px 0; gap: 4px; flex-wrap: wrap; }
.pipe-s { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 0.8rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.pipe-s.cur { background: #fee2e2; border-color: #fca5a5; font-weight: 600; color: #991b1b; }
.pipe-s.past { opacity: 0.5; background: var(--surface-2); }
.pipe-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pipe-s small { font-size: 0.6rem; color: var(--accent-d); margin-left: 2px; font-weight: 700; text-transform: uppercase; }
.pipe-line { width: 16px; height: 2px; background: var(--border-strong); flex-shrink: 0; }
.pipe-line.past { background: var(--ok); }
.move-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 10px 0; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* JOB LAYOUT */
.job-layout { display: flex; gap: 20px; margin-top: 14px; }
.job-main { flex: 1; min-width: 0; }
.job-side { width: 220px; flex-shrink: 0; }
.side-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.side-box h4 { margin: 0 0 8px; color: var(--text); }
.w-list { list-style: none; font-size: 0.85rem; }
.w-list li { padding: 4px 0; color: var(--text-2); }
.side-info { font-size: 0.82rem; }
.side-info > div { padding: 4px 0; }
.d-label { font-size: 0.7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; display: block; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 18px; padding: 14px 16px; }
.d-item { padding: 4px 0; }
.d-item > span:last-child { color: var(--text); font-weight: 500; }

/* STAGE CARDS */
.stage-card { margin-bottom: 10px; }
.stage-cur { background: #fef2f2; border-color: #fca5a5; }
.sub-row { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-bottom: 1px solid var(--border); font-size: 0.85rem; flex-wrap: wrap; }
.sub-row:last-child { border-bottom: none; }
.sub-name { font-weight: 500; min-width: 140px; color: var(--text); }
.asgn-form { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.asgn-form select, .asgn-form input { padding: 4px 8px; font-size: 0.8rem; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface); }
.quick-st { padding: 3px 6px; font-size: 0.76rem; border: 1px solid var(--border-strong); border-radius: 4px; cursor: pointer; margin-left: auto; background: var(--surface); }

/* CHECKLISTS */
.cl-list { padding: 6px 14px 10px; border-top: 1px solid var(--border); background: var(--surface-2); }
.cl-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; cursor: pointer; font-size: 0.85rem; border-radius: 4px; transition: background var(--t); }
.cl-item:hover { background: var(--surface-3); }
.cl-item.done { color: var(--ok-d); }
.cl-item.done .ck { background: var(--ok); color: #fff; border-color: var(--ok); }
.ck { width: 16px; height: 16px; border: 1.5px solid var(--border-strong); border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; flex-shrink: 0; background: var(--surface); transition: all var(--t); }

/* WORKFLOW BUILDER */
.builder { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.hint { font-size: 0.83rem; color: var(--muted); margin-bottom: 12px; }
.bld-stage { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; padding: 10px 12px; background: var(--surface-2); transition: all var(--t); }
.bld-stage:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.bs-hd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bs-grip { cursor: grab; color: var(--muted-2); font-size: 1rem; }
.bs-num { font-weight: 700; color: var(--text); font-size: 0.85rem; min-width: 22px; }
.bs-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.bs-edit { display: flex; gap: 4px; align-items: center; flex: 1; }
.bs-name { padding: 5px 8px !important; font-size: 0.9rem !important; font-weight: 600; border: 1px solid transparent !important; background: transparent !important; flex: 1; min-width: 100px; }
.bs-name:focus { border-color: var(--border-strong) !important; background: var(--surface) !important; }
.bs-clr { width: 30px !important; height: 26px; padding: 0 !important; border: 1px solid var(--border-strong) !important; cursor: pointer; border-radius: 4px; }
.bs-subs { margin: 8px 0 4px 26px; }
.bs-sub { display: flex; align-items: center; gap: 8px; padding: 3px 6px; font-size: 0.82rem; border-bottom: 1px solid var(--border); }
.bs-checks { margin: 6px 0 0 26px; }
.bs-checks-t { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; letter-spacing: 0.5px; }
.bs-chk { display: flex; justify-content: space-between; padding: 2px 6px; font-size: 0.82rem; color: var(--text-2); }
.add-row { display: flex; gap: 4px; align-items: center; margin: 6px 0 0 26px; }
.add-stage { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.add-stage input[type=text] { padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 0.88rem; flex: 1; background: var(--surface); }
.add-stage input[type=color] { width: 32px; height: 32px; padding: 0; border: 1px solid var(--border-strong); cursor: pointer; border-radius: 4px; }
.add-field { margin-top: 10px; }

/* OPTIONS */
.opt-card { margin-bottom: 12px; }
.opt-items { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; }
.opt-item { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.83rem; color: var(--text-2); transition: all var(--t); }
.opt-item:hover { background: var(--surface-3); }
.add-opt { display: flex; gap: 6px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* NOTIFICATIONS */
.notif { padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); transition: background var(--t); }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: #fffbeb; border-left: 3px solid var(--warn); }
.notif-t { font-weight: 500; font-size: 0.9rem; color: var(--text); }

/* MODAL */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.5); z-index: 200; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); padding: 22px; width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.modal-hd h3 { margin: 0; color: var(--text); }
.modal-hd button { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 4px; transition: all var(--t); }
.modal-hd button:hover { background: var(--surface-2); color: var(--text); }

/* LOGIN */
.pg-login { background: var(--bg); background-image: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-hd { text-align: center; font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: -0.01em; }
.login-sub { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 24px; }
.login-card label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-2); margin: 12px 0 4px; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 0.92rem; background: var(--surface); transition: all var(--t); }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.login-card .btn { margin-top: 18px; padding: 11px; font-size: 0.92rem; }

/* EMPTY */
.empty-box { text-align: center; padding: 48px 24px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }

/* ATTENDANCE */
.att-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.78rem; background: var(--surface); }
.att-tbl th, .att-tbl td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 3px; }
.att-tbl thead th { background: var(--surface-2); font-weight: 600; color: var(--text-2); text-align: center; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.3px; padding: 8px 4px; }
.att-tbl .att-name { position: sticky; left: 0; background: var(--surface); z-index: 2; text-align: left; padding: 10px 12px; min-width: 110px; max-width: 140px; }
.att-tbl thead .att-name { background: var(--surface-2); }
.att-role { font-size: 0.65rem; color: var(--muted); font-weight: normal; text-transform: capitalize; }
.att-day { width: 30px; min-width: 30px; text-align: center; }
.att-day.we { background: #fef3c7; color: var(--warn-d); }
.att-tot { text-align: center; background: var(--surface-2); font-weight: 700; min-width: 60px; color: var(--text); }
.att-cell { width: 30px; height: 30px; text-align: center; font-size: 0.72rem; vertical-align: middle; cursor: default; }
.att-cell.editable { cursor: pointer; }
.att-cell.editable:hover { background: #dbeafe !important; outline: 2px solid var(--accent); outline-offset: -2px; }
.att-cell.we { background: #fffbeb; }
.att-cell.pr { background: var(--ok-l); color: var(--ok-d); font-weight: 700; }
.att-cell.ab { background: var(--err-l); color: var(--err-d); font-weight: 700; }
.att-cell.ph { background: #dbeafe; color: #1e40af; font-weight: 700; }
.att-cell.hd { background: var(--warn-l); color: var(--warn-d); font-weight: 700; }
.att-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 16px 0; font-size: 0.82rem; align-items: center; color: var(--text-2); }
.inline-cell { display: inline-block; width: 26px; height: 22px; line-height: 20px; border-radius: 3px; border: 1px solid var(--border); text-align: center; font-size: 0.7rem; font-weight: 700; }
.modal-sm { max-width: 360px; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .job-layout { flex-direction: column; }
  .job-side { width: 100%; }
}
@media (max-width: 880px) {
  /* Sidebar becomes off-canvas drawer */
  .sb {
    position: fixed; top: 52px; left: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.3);
    z-index: 200;
  }
  body.sb-open .sb { transform: translateX(0); }
  .sb-backdrop {
    display: none;
    position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 150;
  }
  body.sb-open .sb-backdrop { display: block; }
  /* Hide username on small to save space */
  .u-name { display: none; }
}
@media (max-width: 768px) {
  .logo { border-right: 0; padding-right: 12px; }
  .row2 { flex-direction: column; gap: 0; }
  .pipeline { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .kanban { flex-direction: column; }
  .k-col { max-width: none; min-width: 0; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .sub-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .perm-grid { grid-template-columns: 1fr 1fr; }
  .move-bar { overflow-x: auto; flex-wrap: nowrap; }
}
@media (max-width: 480px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* === DARK MODE === */
html[data-theme="dark"] {
  --bg: #050505;
  --surface: #0f0f10;
  --surface-2: #18181b;
  --surface-3: #27272a;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --text: #fafafa;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --navy: #0a0a0a;
  --navy-d: #000000;
  --navy-l: #3f3f46;
  --accent: #ef4444;
  --accent-d: #e63946;
  --ok: #34d399;
  --ok-l: rgba(16, 185, 129, 0.15);
  --ok-d: #34d399;
  --warn: #fbbf24;
  --warn-l: rgba(245, 158, 11, 0.15);
  --warn-d: #fbbf24;
  --err: #f87171;
  --err-l: rgba(239, 68, 68, 0.15);
  --err-d: #f87171;
  --info-l: rgba(99, 102, 241, 0.2);
  --purple-l: rgba(139, 92, 246, 0.2);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4), 0 10px 20px rgba(0,0,0,0.25);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.3);
}
html[data-theme="dark"] #hd {
  background: var(--navy-d);
  background-image: linear-gradient(180deg, #000000 0%, #0a0a0a 100%);
}
html[data-theme="dark"] .badge-pending { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
html[data-theme="dark"] .badge-done, html[data-theme="dark"] .badge-open { background: rgba(16, 185, 129, 0.18); color: #34d399; }
html[data-theme="dark"] .badge-in_progress, html[data-theme="dark"] .badge-in-progress { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
html[data-theme="dark"] .badge-blocked, html[data-theme="dark"] .badge-on_hold { background: rgba(239, 68, 68, 0.18); color: #f87171; }
html[data-theme="dark"] .badge-closed, html[data-theme="dark"] .badge-cancelled { background: var(--surface-3); color: var(--muted); }
html[data-theme="dark"] .badge-review { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
html[data-theme="dark"] .pipe-s.cur { background: rgba(59, 130, 246, 0.15); border-color: #3b82f6; color: #93c5fd; }
html[data-theme="dark"] .stage-cur { background: rgba(59, 130, 246, 0.08); border-color: #3b82f6; }
html[data-theme="dark"] .cl-list { background: var(--surface-2); }
html[data-theme="dark"] .att-cell.we { background: rgba(245, 158, 11, 0.06); }
html[data-theme="dark"] .att-day.we { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
html[data-theme="dark"] .att-cell.pr { background: rgba(16, 185, 129, 0.2); color: #34d399; }
html[data-theme="dark"] .att-cell.ab { background: rgba(239, 68, 68, 0.2); color: #f87171; }
html[data-theme="dark"] .att-cell.ph { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
html[data-theme="dark"] .att-cell.hd { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
html[data-theme="dark"] .att-cell.editable:hover { background: rgba(59, 130, 246, 0.25) !important; }
html[data-theme="dark"] .notif.unread { background: rgba(245, 158, 11, 0.08); }
html[data-theme="dark"] .drag-over { background: rgba(16, 185, 129, 0.12) !important; outline-color: var(--ok); }
html[data-theme="dark"] .pg-login {
  background: var(--bg);
  background-image: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
}
html[data-theme="dark"] .modal { background: rgba(0,0,0,0.7); }
html[data-theme="dark"] .stage-pill { background: var(--surface-3); color: var(--text-2); }
html[data-theme="dark"] .text-warn { color: #fca5a5 !important; }
html[data-theme="dark"] .fl-ok { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
html[data-theme="dark"] .fl-err { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

/* THEME TOGGLE BUTTON */
.theme-toggle {
  background: transparent !important;
  color: rgba(255,255,255,0.7) !important;
  border: none !important;
  padding: 6px 9px !important;
  font-size: 1rem !important;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { background: rgba(255,255,255,0.1) !important; color: #fff !important; }
html[data-theme="dark"] .theme-toggle .ico-light { display: inline; }
html[data-theme="dark"] .theme-toggle .ico-dark { display: none; }
.theme-toggle .ico-light { display: none; }
.theme-toggle .ico-dark { display: inline; }

/* Smooth theme transition */
body, .card, .btn, .stat-card, .tbl, .form-box, input, select, textarea, .modal-box, .side-box, .k-card, .k-col {
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

/* === DARK FLOW BRAND TWEAKS === */
/* Logo image in header */
.logo { padding: 6px 18px 6px 0; margin-right: 8px; border-right: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; }
.logo-img { height: 32px; width: auto; display: block; }

/* Login page logo */
.login-logo { display: flex; justify-content: center; margin-bottom: 6px; }
.login-logo img { height: 64px; width: auto; }
.login-card { background: #ffffff; border: 1px solid var(--border); }
html[data-theme="dark"] .login-card { background: #0f0f10; border-color: rgba(255,255,255,0.08); }

/* Header gets pure black with subtle red accent line */
#hd {
  background: #000000;
  background-image: linear-gradient(180deg, #000000 0%, #0a0a0a 100%);
  border-bottom: 1px solid #1a1a1a;
  box-shadow: 0 1px 0 rgba(230, 57, 70, 0.15), 0 2px 8px rgba(0,0,0,0.4);
}

/* + New button — red */
.n-btn {
  background: #e63946 !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 7px 14px !important;
  box-shadow: 0 1px 3px rgba(230, 57, 70, 0.4);
}
.n-btn:hover { background: #c1121f !important; box-shadow: 0 2px 6px rgba(230, 57, 70, 0.5); }

/* Stat cards — accent the "active" one with red */
.stat-card.s-active::before { background: #e63946; }
.stat-card.s-done::before { background: #16a34a; }
.stat-card.s-mine::before { background: #e63946; }
.stat-card.accent { border-color: rgba(230, 57, 70, 0.3); background: #fef2f2; }
html[data-theme="dark"] .stat-card.accent { background: rgba(230, 57, 70, 0.06); border-color: rgba(230, 57, 70, 0.25); }

/* Theme toggle: red glow on hover in dark mode */
html[data-theme="dark"] .theme-toggle:hover { background: rgba(230, 57, 70, 0.15) !important; color: #ef4444 !important; }

/* Buttons: primary uses black like the logo */
.btn.primary { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
.btn.primary:hover { background: #1a1a1a; border-color: #1a1a1a; }
html[data-theme="dark"] .btn.primary { background: #e63946; border-color: #e63946; }
html[data-theme="dark"] .btn.primary:hover { background: #c1121f; border-color: #c1121f; }

/* Accent button is red */
.btn.accent { background: #e63946; color: #fff; border-color: #e63946; }
.btn.accent:hover { background: #c1121f; border-color: #c1121f; }

/* Total fee / highlight bars */
html[data-theme="dark"] .badge-admin { background: #e63946; color: #fff; }

/* Focus rings — red */
.form-box input:focus, .modal-box input:focus, .form-box select:focus, .form-box textarea:focus,
.login-card input:focus {
  border-color: #e63946; box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

/* Login card subtitle */
.login-sub { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 24px; margin-top: 4px; }

/* === INFO TOOLTIP ICON === */
.info-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface-3); color: var(--muted);
  font-size: 0.7rem; font-weight: 700; font-family: inherit;
  cursor: help; margin-left: 4px; vertical-align: middle;
  border: 1px solid var(--border);
  transition: all 150ms;
}
.info-i:hover { background: #e63946; color: #fff; border-color: #e63946; }
html[data-theme="dark"] .info-i { background: var(--surface-3); color: var(--muted); }

/* === HELP PAGE === */
.help-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.help-nav {
  position: sticky; top: 70px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-sm);
}
.help-nav a {
  display: block; padding: 7px 12px; font-size: 0.85rem;
  color: var(--text-2); border-radius: var(--radius-sm); text-decoration: none;
  transition: all 150ms;
}
.help-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.help-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow-sm); }
.help-body section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); scroll-margin-top: 70px; }
.help-body section:last-child { border-bottom: none; margin-bottom: 0; }
.help-body h3 { font-size: 1.2rem; color: var(--text); margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid #e63946; display: inline-block; }
.help-body p { margin: 8px 0; color: var(--text-2); line-height: 1.7; font-size: 0.92rem; }
.help-body ul, .help-body ol { margin: 8px 0 12px 20px; color: var(--text-2); line-height: 1.7; font-size: 0.92rem; }
.help-body li { margin: 4px 0; }
.help-body strong { color: var(--text); font-weight: 600; }
.help-body a { color: #e63946; }
.help-body a:hover { color: #c1121f; }

@media (max-width: 800px) {
  .help-wrap { grid-template-columns: 1fr; }
  .help-nav { position: static; }
}

/* === UX POLISH === */
/* Required field marker */
.req { color: #e63946; margin-left: 2px; }

/* Field hint text below inputs */
.field-hint {
  font-size: 0.78rem; color: var(--muted); margin-top: 4px; margin-bottom: 4px;
  line-height: 1.4;
}
.field-hint strong { color: var(--text-2); }

/* Permission grid - richer layout */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.perm-item {
  display: flex !important; align-items: flex-start !important; gap: 8px !important;
  padding: 10px 12px !important; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 150ms;
}
.perm-item:hover { border-color: var(--accent); background: var(--surface-3); }
.perm-item input { margin-top: 2px !important; flex-shrink: 0; }
.perm-item span { line-height: 1.4; }
.perm-item small { font-size: 0.74rem; display: block; margin-top: 2px; }

/* Empty drop zone hint in board columns */
.k-empty {
  padding: 12px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Clickable cards are click-handled now */
.k-card { user-select: none; }
.k-card .k-title { pointer-events: auto; }

/* Code style for category names */
code {
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.85em;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  color: var(--text);
}

/* Pad inside hint cards */
.pad.small { padding: 12px 16px !important; font-size: 0.85rem; color: var(--text-2); }
html[data-theme="dark"] .card[style*="background:#eff6ff"] {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
}

/* === HEADER SEARCH === */
.hdr-search {
  position: relative;
  margin-left: 12px;
  flex: 0 1 300px;
  min-width: 0;
}
.hdr-search-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.85rem;
  opacity: 0.5;
  color: #fff;
}
#hdr-q {
  width: 100%;
  padding: 7px 10px 7px 30px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 150ms;
}
#hdr-q::placeholder { color: rgba(255,255,255,0.4); }
#hdr-q:focus { outline: none; background: rgba(255,255,255,0.12); border-color: #e63946; }
#hdr-q:focus + .hdr-suggest { display: block; }

.hdr-suggest {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 200;
}
.hdr-sug-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background 100ms;
}
.hdr-sug-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.hdr-sug-title { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.hdr-sug-meta { font-size: 0.78rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.hdr-sug-stage { padding: 1px 6px; background: var(--surface-3); color: var(--text-2); font-size: 0.7rem; border-radius: 3px; }
.hdr-sug-client { color: var(--muted); }
.hdr-sug-empty { padding: 14px; color: var(--muted); font-size: 0.85rem; text-align: center; }
.hdr-sug-all { display: block; padding: 8px 14px; background: var(--surface-2); color: #e63946; font-size: 0.82rem; font-weight: 600; text-decoration: none; text-align: center; }
.hdr-sug-all:hover { background: var(--surface-3); }
.hdr-sug-section {
  padding: 6px 14px 4px; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); border-top: 1px solid var(--border);
}
.hdr-sug-section:first-child { border-top: 0; }

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.filter-bar select, .filter-bar input {
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--surface);
  font-family: inherit;
  color: var(--text);
}
.filter-search { flex: 1; min-width: 180px; padding-left: 32px !important; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>"); background-repeat: no-repeat; background-position: 8px center; background-size: 16px; }
.filter-count { margin-left: auto; }

/* === INSTANT CSS TOOLTIPS === */
/* These replace the slow browser default tooltips. Triggered by data-tip attribute. */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 5px;
  white-space: nowrap;
  max-width: 280px;
  white-space: normal;
  width: max-content;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  animation: tipIn 120ms ease-out;
}
[data-tip]:hover::before, [data-tip]:focus::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
  z-index: 1000;
  pointer-events: none;
}
@keyframes tipIn { from { opacity: 0; transform: translateX(-50%) translateY(2px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
[data-tip-pos="right"]:hover::after, [data-tip-pos="right"]:focus::after {
  bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);
}
[data-tip-pos="right"]:hover::before, [data-tip-pos="right"]:focus::before {
  bottom: 50%; left: calc(100% + 2px); transform: translateY(50%); border-top-color: transparent; border-right-color: #1a1a1a;
}

/* Info icon more visible */
.info-i {
  background: #fff;
  color: #e63946;
  border: 1px solid #e63946;
  font-weight: 700;
  width: 17px;
  height: 17px;
  font-size: 0.72rem;
}
.info-i:hover { background: #e63946; color: #fff; }
html[data-theme="dark"] .info-i { background: rgba(230, 57, 70, 0.12); color: #ef4444; border-color: rgba(230, 57, 70, 0.4); }
html[data-theme="dark"] .info-i:hover { background: #e63946; color: #fff; }

/* Mobile: hide header search */
@media (max-width: 768px) {
  .hdr-search { display: none; }
}

/* === HEADER LAYOUT TWEAKS === */
.hw { flex-wrap: nowrap !important; gap: 8px; }
.logo { padding-right: 12px; }
.logo-img { height: 28px; }
.hdr-search { flex: 1 1 320px; min-width: 0; margin-right: auto; max-width: 480px; }
.hdr-r { margin-left: 8px; flex-shrink: 0; gap: 4px; }
.hdr-r a, .hdr-r .theme-toggle { padding: 5px 7px !important; }
.u-name { padding: 0 6px; font-size: 0.74rem; max-width: 90px; }
.logout { font-size: 0.74rem; padding: 0 4px !important; }

/* On medium screens, hide less critical items */
@media (max-width: 1300px) {
  .u-name { display: none; }
}
@media (max-width: 1024px) {
  .hdr-search { display: none; }
}

/* Tooltip pop-out — high z-index, never clipped */
[data-tip]:hover::after, [data-tip]:focus::after {
  z-index: 9999 !important;
}
[data-tip]:hover::before, [data-tip]:focus::before {
  z-index: 9999 !important;
}
/* Card-hd needs to allow tooltip overflow when info-i is inside */
.card-hd { overflow: visible; }
/* Activity feed scrollbox keeps its own overflow */
.activity { overflow-y: auto; }

/* Security log */
.row-warn td { background: rgba(239, 68, 68, 0.05); }
html[data-theme="dark"] .row-warn td { background: rgba(239, 68, 68, 0.08); }
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 18px 0; }

/* === BETA MARKERS === */
.beta-strip {
  background: linear-gradient(90deg, rgba(230,57,70,.14), rgba(230,57,70,.06));
  border-bottom: 1px solid rgba(230,57,70,.3);
  color: #e63946;
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
  letter-spacing: .2px;
}
.beta-tag {
  display: inline-block;
  background: #e63946;
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin: 0 2px;
}

/* Announcement banner shown until user dismisses */
.ann-banner {
  background: linear-gradient(90deg, rgba(230,57,70,.10), rgba(230,57,70,.04));
  border-bottom: 1px solid rgba(230,57,70,.25);
  padding: 10px 0;
}
.ann-banner-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 18px;
  display: flex; align-items: center; gap: 14px;
  font-size: .88rem;
}
.ann-banner-icon { font-size: 1.1rem; flex-shrink: 0; }
.ann-banner-content { flex: 1; min-width: 0; line-height: 1.4; }
.ann-banner-content strong { color: var(--text); font-weight: 600; }
.ann-banner-body {
  font-size: .8rem; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ann-banner-link {
  flex-shrink: 0; color: #e63946; font-weight: 600; font-size: .82rem;
  text-decoration: none; padding: 4px 10px; border-radius: 4px;
}
.ann-banner-link:hover { background: rgba(230,57,70,.08); }
.ann-banner-close {
  flex-shrink: 0; background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 1.4rem; line-height: 1; padding: 2px 8px;
  border-radius: 4px;
}
.ann-banner-close:hover { color: var(--text); background: rgba(255,255,255,.05); }
@media (max-width: 640px) {
  .ann-banner-body { display: none; }
  .ann-banner-link { font-size: .75rem; padding: 4px 6px; }
}

/* Function-template-based checklists (new) */
.fn-sub {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 14px 0 4px;
  margin-top: 8px;
}
.fn-sub-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.fn-sub-tag {
  display: inline-block; font-size: .68rem; font-weight: 700;
  background: #e63946; color: #fff;
  padding: 2px 8px; border-radius: 4px; margin-right: 10px; letter-spacing: .5px;
}
.fn-sub-name { font-size: .95rem; font-weight: 600; color: var(--text); }
.fn-sub-pct { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.fn-sub-bar { background: rgba(255,255,255,.06); height: 6px; border-radius: 3px; margin-bottom: 14px; overflow: hidden; }
.fn-sub-bar > div { height: 100%; background: #16a34a; transition: width .3s; }
.fn-sub-bar > div.partial { background: #f59e0b; }
.fn-sub-bar > div.empty { background: #e63946; }
.fn-sub-bar > div.full { background: #16a34a; }

.fn-day-grp { margin-bottom: 12px; }
.fn-day-grp:last-child { margin-bottom: 0; }
.fn-day-name {
  font-size: .68rem; font-weight: 700; letter-spacing: .8px;
  color: var(--muted); text-transform: uppercase; margin-bottom: 4px; padding-left: 4px;
}
.fn-row {
  display: grid; grid-template-columns: 1fr 110px 60px;
  gap: 10px; align-items: center;
  padding: 6px 10px; border-radius: 5px;
  font-size: .87rem;
}
.fn-row + .fn-row { margin-top: 2px; }
.fn-row:hover { background: rgba(255,255,255,.025); }
.fn-row.is-ok { background: rgba(22,163,74,.06); }
.fn-row.is-ko { background: rgba(230,57,70,.06); }
.fn-row.is-na { opacity: .45; }
.fn-name { color: var(--text); }
.fn-status {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 4px 8px; font-size: .82rem;
  font-family: inherit; cursor: pointer; font-weight: 500;
  min-width: 80px;
}
.fn-status option { background: var(--surface-2); color: var(--text); }
html[data-theme="dark"] .fn-status { color-scheme: dark; }
.fn-row.is-ok .fn-status { border-color: #16a34a; color: #16a34a; }
.fn-row.is-ko .fn-status { border-color: #e63946; color: #e63946; }
.fn-row.is-na .fn-status { border-color: rgba(255,255,255,.15); }
.fn-weight { text-align: right; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Job comments thread */
.comment-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.comment-row:last-child { border-bottom: none; }
.comment-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; margin-bottom: 6px;
}
.comment-body {
  white-space: pre-wrap; line-height: 1.5;
  font-size: .92rem; color: var(--text);
}
.comment-edit-form { margin-top: 6px; }

/* Comment category badges - subtle colors per category */
.badge-general  { background: rgba(255,255,255,.08); color: var(--muted); }
.badge-qc       { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge-manager  { background: rgba(99,102,241,.15); color: #818cf8; }
.badge-internal { background: rgba(230,57,70,.12); color: #e63946; }
.badge-delivery { background: rgba(22,163,74,.15); color: #16a34a; }

/* Attachments */
.attach-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.attach-row:last-child { border-bottom: none; }
.attach-icon { font-size: 1.4rem; flex-shrink: 0; }
.attach-info { flex: 1; min-width: 0; }
.attach-info a { color: var(--text); }
.attach-info a:hover { color: #e63946; }

/* Additional category badges for attachments */
.badge-reference { background: rgba(99,102,241,.15); color: #818cf8; }
.badge-contract  { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge-moodboard { background: rgba(168,85,247,.15); color: #c084fc; }
.badge-music     { background: rgba(236,72,153,.15); color: #f472b6; }
.badge-footage   { background: rgba(34,197,94,.15); color: #4ade80; }

/* Disk locations per job */
.loc-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.loc-row:last-child { border-bottom: none; }
.loc-info { flex: 1; min-width: 0; }
.loc-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font-size: .95rem; }
.loc-detail { display: flex; gap: 12px; flex-wrap: wrap; font-size: .85rem; align-items: center; }
.loc-disk { color: var(--muted); }
.loc-path { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; padding: 2px 6px; background: rgba(255,255,255,.04); border-radius: 4px; color: var(--text); word-break: break-all; }
a.loc-path { color: #e63946; text-decoration: none; }
a.loc-path:hover { background: rgba(230,57,70,.08); }
.loc-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Location kind badges */
.badge-source      { background: rgba(99,102,241,.15); color: #818cf8; }
.badge-destination { background: rgba(34,197,94,.15); color: #4ade80; }
.badge-backup      { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge-mixed       { background: rgba(168,85,247,.15); color: #c084fc; }

/* Editable checklist items - real form inputs, no JS needed for toggle */
.cl-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: background var(--t);
}
.cl-item:hover { background: var(--surface-3); }
.cl-item.done { color: var(--ok-d); }
.cl-form { display: inline; margin: 0; padding: 0; }
.cl-tick {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}
.cl-tick:hover { background: rgba(255,255,255,.04); }
.cl-cb {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--ok);
  flex-shrink: 0;
  margin: 0;
}
.cl-text { flex: 1; min-width: 0; user-select: none; }
.cl-btn {
  background: none; border: 1px solid transparent;
  color: var(--muted); cursor: pointer;
  padding: 1px 6px; border-radius: 3px;
  font-size: 0.8rem; line-height: 1;
  opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.cl-item:hover .cl-btn { opacity: 1; }
.cl-btn:hover { background: rgba(255,255,255,.08); color: var(--text); border-color: var(--border); }
.cl-btn.danger:hover { color: #e63946; border-color: rgba(230,57,70,.3); }
.cl-rename-input {
  width: 100%; padding: 2px 4px; font-size: 0.85rem;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 3px; color: var(--text); font-family: inherit;
}
.cl-add-row {
  display: flex; gap: 6px; align-items: center;
  margin-top: 6px; padding: 4px 6px;
}
.cl-add-row input {
  flex: 1; padding: 4px 8px; font-size: 0.83rem;
  background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: 4px; color: var(--text); font-family: inherit;
}
.cl-add-row input:focus { border-style: solid; border-color: #e63946; outline: none; }

/* Collapsible stage cards */
.stage-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--t);
}
.stage-toggle:hover { background: rgba(255,255,255,.03); }
.stage-chev {
  font-size: 0.75rem;
  color: var(--muted);
  width: 12px;
  display: inline-block;
  transition: color var(--t);
}
.stage-toggle:hover .stage-chev { color: var(--text); }
.stage-title { flex: 1; }
.stage-cl-count {
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.05);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
}
.stage-body { animation: stage-expand 0.15s ease-out; }
.stage-body.is-closed { display: none !important; }
.stage-body.is-open { display: block; }
@keyframes stage-expand {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sub-stage collapsible (L1/L2/L2+/L3) */
.fn-sub-toggle {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  padding: 6px 4px;
  border-radius: 4px;
  transition: background var(--t);
}
.fn-sub-toggle:hover { background: rgba(255,255,255,.03); }
.fn-sub-chev {
  font-size: 0.75rem;
  color: var(--muted);
  width: 12px;
  display: inline-block;
}
.fn-sub-toggle:hover .fn-sub-chev { color: var(--text); }
.fn-sub-body { animation: stage-expand 0.15s ease-out; }
.fn-sub-body.is-closed { display: none !important; }
.fn-sub-body.is-open { display: block; }

/* Global dark-mode native form element fix - tells the browser to use dark UI */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] select option { background: var(--surface-2); color: var(--text); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  color: var(--text);
}

/* Event Checklist & Completion - master 4-column view matching his Excel master sheet */
.evt-matrix { padding: 8px; }
.evt-day-block {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.evt-day-name {
  background: var(--surface-2);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.evt-day-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}
.evt-col {
  background: var(--surface);
  padding: 6px;
  min-width: 0;
}
.evt-col-hd {
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  padding: 4px 0 6px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.evt-col-empty {
  color: var(--muted-2);
  text-align: center;
  font-size: 0.75rem;
  padding: 8px;
}
.evt-fn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 4px;
  margin-bottom: 4px;
  border-radius: 3px;
  background: var(--surface-2);
  font-size: 0.78rem;
}
.evt-fn-name { color: var(--text); line-height: 1.2; word-break: break-word; }
.evt-fn-status { width: 100%; min-width: unset; padding: 2px 4px; font-size: 0.72rem; }
.evt-fn.is-ok { border-left: 2px solid var(--ok); }
.evt-fn.is-ko { border-left: 2px solid #e63946; }
.evt-fn.is-na { border-left: 2px solid var(--muted); opacity: 0.6; }
.evt-fn.is-pending { border-left: 2px solid transparent; }
/* Stack columns on mobile */
@media (max-width: 700px) {
  .evt-day-cols { grid-template-columns: 1fr 1fr; }
}

/* Event-day picker on the new job form - pill chips */
.day-picker-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.form-box label.day-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; margin: 0; border: 1px solid var(--border-strong);
  border-radius: 999px; cursor: pointer; user-select: none;
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  transition: all var(--t);
}
.form-box label.day-chip input[type="checkbox"] { width: auto; margin: 0; accent-color: #e63946; }
.form-box label.day-chip.on { border-color: #e63946; background: rgba(230,57,70,.08); }
.form-box label.day-chip:hover { border-color: #e63946; }

/* Day -> chain -> function cards (All-types view) */
.dc-block { padding: 8px 14px 4px; }
.dc-block-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 4px 0 6px; flex-wrap: wrap;
}
.dc-block-label {
  font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  font-size: .88rem; color: var(--text);
  padding: 6px 12px; border-left: 4px solid #e63946;
  background: rgba(230,57,70,.08); border-radius: 4px;
}
.dc-assign { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dc-assign select { width: auto; min-width: 120px; padding: 3px 6px; font-size: .78rem; }
.dc-assign input[type="date"] { width: auto; padding: 3px 6px; font-size: .78rem; }
.dc-fn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 5px 8px; border-radius: 6px; margin: 2px 0;
  background: var(--surface-2, rgba(127,127,127,.05));
}

.dc-fn-name { font-size: .86rem; }
.dc-fn select.fn-status { width: auto; min-width: 96px; }
.dc-fn.is-ok { border-left: 3px solid var(--ok, #16a34a); }
.dc-fn.is-in_progress { border-left: 3px solid #f59e0b; }
.dc-fn.is-ko { border-left: 3px solid #e63946; }
.dc-fn.is-na { opacity: .55; }
.day-assign-row { display: flex; gap: 6px; align-items: center; padding: 8px 14px 0; flex-wrap: wrap; }
.day-assign-row select, .day-assign-row input { width: auto; }

/* Per-chain disk handoff strip */
.dc-storage { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:4px 4px 6px; margin-left:2px; }
.dc-storage-info { display:flex; align-items:center; gap:6px; flex-wrap:wrap; flex:1; min-width:200px; }
.dc-storage-ico { opacity:.7; }
.dc-path { font-size:.78rem; padding:1px 6px; border-radius:4px; background:var(--surface-2,rgba(127,127,127,.12)); color:var(--text); }
.dc-storage-toggle { text-decoration:none; white-space:nowrap; }
.dc-storage-form { display:flex; gap:6px; align-items:center; flex-wrap:wrap; width:100%; margin-top:2px; }
.dc-storage-form select, .dc-storage-form input[type="text"] { width:auto; }
.dc-storage-form input[type="text"] { min-width:240px; flex:1; }

/* Destination modal rows + multi-dest display */
.dc-dest { display:inline-flex; align-items:center; gap:4px; }
.dest-row select, .dest-row input { font-size:.85rem; }

/* Combined-type picker */
.type-chip .prim-tag { font-size:.6rem; font-weight:800; color:#fff; background:#e63946; text-transform:uppercase; margin-left:6px; padding:1px 6px; border-radius:8px; letter-spacing:.4px; }
.type-chip .set-main { font-size:.62rem; font-weight:600; color:#2563eb; margin-left:6px; cursor:pointer; text-decoration:underline; }
.type-chip .set-main:hover { color:#1d4ed8; }

/* On-hold freeze banner */
.hold-banner { background:rgba(139,92,246,.12); border:1px solid rgba(139,92,246,.35); color:#6d28d9; padding:10px 14px; border-radius:8px; margin-bottom:14px; font-size:.9rem; }
html[data-theme="dark"] .hold-banner { color:#c4b5fd; }

/* Day names always shown uppercase to match the rest (e.g. "Engagement" -> "ENGAGEMENT") */
.stage-title { text-transform: uppercase; }
.day-chip { text-transform: uppercase; }
.eds-day-hd strong, .eds-day strong { text-transform: uppercase; }

/* Per-day comment icon + collapsible panel */
.day-cmt-btn { background:none; border:none; cursor:pointer; font-size:.95rem; margin-left:10px; padding:2px 7px; border-radius:6px; color:var(--muted,#9ca3af); opacity:.55; }
.day-cmt-btn:hover { background:rgba(37,99,235,.10); opacity:1; }
.day-cmt-btn.has { opacity:1; color:#2563eb; }
.day-cmt-count { font-size:.68rem; font-weight:700; color:#fff; background:#e63946; border-radius:9px; padding:1px 6px; margin-left:1px; vertical-align:middle; }
.day-cmt-panel { background:rgba(37,99,235,.05); border:1px solid rgba(37,99,235,.18); border-radius:8px; padding:10px 12px; margin:0 0 12px; }
.day-cmt-head { font-size:.72rem; text-transform:uppercase; letter-spacing:.4px; color:#2563eb; font-weight:700; margin-bottom:6px; }
.day-cmt-item { padding:5px 0; border-bottom:1px solid var(--border); }
.day-cmt-item:last-of-type { border-bottom:0; }
.day-cmt-meta { font-size:.78rem; margin-bottom:1px; }
.day-cmt-body { font-size:.9rem; white-space:pre-wrap; }
.day-cmt-form { display:flex; gap:8px; margin-top:8px; align-items:flex-end; }
.day-cmt-form textarea[name="body"] {
  flex:1; min-height:38px; max-height:220px; resize:vertical;
  padding:8px 11px; border:1px solid var(--border-strong); border-radius:var(--radius);
  background:var(--surface); color:var(--text); font-family:inherit; font-size:.9rem;
  line-height:1.4; overflow-y:auto;
}
.day-cmt-form button { flex:0 0 auto; }

/* Monochrome line icons in the top bar (replace emoji glyphs) */
.ic { stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; vertical-align:middle; display:inline-block; }
.hdr-search-ico .ic { width:16px; height:16px; }
.n-link .ic, .theme-toggle .ic, .hdr-r a .ic { opacity:.85; }
.hdr-r a:hover .ic, .theme-toggle:hover .ic { opacity:1; }

/* ---- Visual polish pass (v137) — cosmetic only ---- */
/* Board cards: subtle lift on hover */
.k-card { transition: box-shadow var(--t), transform var(--t), border-color var(--t); }
.k-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--border-strong); }
/* Progress bars: rounded, softer track, smooth fill */
.k-prog, .prog-bar, .rp-proj-bar { border-radius: 999px; overflow: hidden; }
.k-prog-bar, .prog-fill, .rp-proj-bar-fill { border-radius: 999px; transition: width var(--t); }
/* Status badges: consistent weight + tighter pill */
.badge { font-weight: 600; letter-spacing: .2px; }
.badge-in_progress, .badge-in-progress, .badge-editing { background:#dbeafe; color:#1e40af; }
.badge-pending { background: var(--warn-l); color: var(--warn-d); }
.badge-completed, .badge-done, .badge-open { background: var(--ok-l); color: var(--ok-d); }
/* Cards: consistent 12px radius + hairline */
.card { border-radius: var(--radius-lg); }
/* Filter bars: unify inputs height/feel */
.board-filters input, .board-filters select,
.user-filters input, .user-filters select,
.rp-proj-filters input, .rp-proj-filters select,
.notif-filters input, .notif-filters select { border-radius: var(--radius); }
/* Table rows: gentle hover */
.tbl tbody tr { transition: background var(--t); }
.tbl tbody tr:hover { background: var(--surface-2); }
/* Sidebar active item: clearer */
aside a.on { font-weight: 600; }

/* ---- Board filter toolbar (refined) ---- */
.board-filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.bf-search-wrap { position: relative; flex: 1; min-width: 200px; display: flex; align-items: center; }
.bf-search-ico { position: absolute; left: 11px; color: var(--muted-2); display: inline-flex; pointer-events: none; }
.bf-search-wrap input { width: 100%; padding-left: 34px; height: 36px; border-radius: var(--radius); }
.board-filters select {
  height: 36px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); color: var(--text-2); padding: 0 10px; cursor: pointer;
  transition: border-color var(--t);
}
.board-filters select:hover { border-color: var(--border-strong); }
.board-filters .bf-clear { height: 36px; border-radius: var(--radius); opacity: .55; transition: opacity var(--t), background var(--t); }
.board-filters .bf-clear.on { opacity: 1; border-color: var(--accent); color: var(--accent); }
.bf-count { margin-left: auto; padding-right: 4px; white-space: nowrap; }
@media (max-width: 640px){ .bf-search-wrap{ min-width: 100%; } .bf-count{ margin-left: 0; } }
