/* =============================================
   STATIK v3 — Clean Interface
   Based on statik_ui_concept.html
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ─── TOKENS ─────────────────────────────────── */
:root {
  --bg:      #0c0d13;
  --panel:   #13151e;
  --s2:      #1b1e2a;
  --lift:    #22263a;
  --border:  rgba(255,255,255,0.055);
  --border2: rgba(255,255,255,0.10);
  --border3: rgba(255,255,255,0.18);
  --text:    #e6e9f4;
  --sub:     #8890a6;
  --muted:   #454c62;

  /* Primary (--red kept for JS compat) */
  --red:      #e8192c;
  --red-dim:  rgba(232,25,44,0.12);
  --red-mid:  rgba(232,25,44,0.28);

  /* Semantic colours */
  --green:   #22c55e;
  --amber:   #f59e0b;
  --blue:    #3b82f6;
  --purple:  #a855f7;
  --teal:    #14b8a6;

  /* Task type colours (used in JS) */
  --work:     #3b82f6;
  --material: #14b8a6;
  --extra:    #a855f7;
  --waiting:  #f59e0b;
  --approve:  #e8192c;

  /* Aliases for backward compat */
  --card: #13151e;
  --bg2:  #0f1018;

  /* Layout */
  --sidebar-w: 210px;
  --r:    7px;
  --r-md: 9px;
  --r-lg: 12px;
  --r-xl: 16px;

  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --font-cond: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow:    0 2px 14px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.7);
}

[data-theme="light"] {
  --bg:      #eef0f5;
  --panel:   #ffffff;
  --s2:      #f3f4f8;
  --lift:    #e6e8ee;
  --border:  rgba(0,0,0,0.07);
  --border2: rgba(0,0,0,0.13);
  --border3: rgba(0,0,0,0.22);
  --text:    #0f1117;
  --sub:     #565e72;
  --muted:   #9aa0ae;
  --card:    #ffffff;
  --bg2:     #e8eaf0;
  --red-dim: rgba(232,25,44,0.08);
  --red-mid: rgba(232,25,44,0.20);
  --shadow:    0 2px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
}

/* ─── RESET ──────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--font); cursor: pointer; }
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ─── SIDEBAR ────────────────────────────────── */
.rail {
  display: none;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}
@media(min-width:768px) { .rail { display: flex; } }

.rail-header {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-decoration: none;
}
.rail-logo {
  width: 26px; height: 26px;
  background: var(--red); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #fff;
  flex-shrink: 0;
}
.rail-brand {
  font-size: 15px; font-weight: 800; color: var(--text);
}
.rail-brand span { color: var(--red); }

.rail-nav {
  flex: 1;
  padding: 8px 7px;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 1px;
}
.rail-section {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted);
  padding: 10px 8px 3px;
}

.r-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 9px;
  border-radius: var(--r);
  font-size: 13px; font-weight: 500;
  color: var(--sub);
  transition: all 0.1s;
  text-decoration: none;
  border: none; background: transparent;
  cursor: pointer; text-align: left;
  white-space: nowrap;
}
.r-btn:hover { background: var(--s2); color: var(--text); }
.r-btn.on, .r-btn.active {
  background: var(--red-dim);
  color: var(--red);
  font-weight: 600;
}
.r-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none; flex-shrink: 0;
}
.r-btn-badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 99px;
}

.rail-sep {
  height: 1px; background: var(--border);
  margin: 4px 9px; flex-shrink: 0;
}
.rail-bot {
  padding: 8px 7px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.rail-avatar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px;
}
.rail-avatar-circle {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  background: var(--blue); flex-shrink: 0;
}
.rail-user-name { font-size: 13px; font-weight: 600; }
.rail-user-role { font-size: 10px; color: var(--muted); }

/* ─── LAYOUT ─────────────────────────────────── */
.container {
  max-width: 820px;
  padding: 18px 14px 88px;
}
@media(min-width:768px) {
  .container {
    margin-left: var(--sidebar-w);
    padding: 22px 26px 40px;
    max-width: calc(var(--sidebar-w) + 1000px);
  }
}

/* ─── DESKTOP TOPBAR ─────────────────────────── */
.dTopbar {
  display: none;
  position: sticky; top: 0; z-index: 50;
  height: 52px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 26px;
  align-items: center; gap: 10px;
  margin-left: var(--sidebar-w);
}
@media(min-width:768px) { .dTopbar { display: flex; } }
.dTopbar h1 { font-size: 14px; font-weight: 700; }
.dTopSearchBox {
  display: flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 6px 11px; width: 200px;
  margin-left: auto;
}
.dTopSearchBox svg {
  width: 13px; height: 13px; stroke: var(--muted); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.dTopSearchBox input {
  border: none; background: transparent; color: var(--text);
  font-family: var(--font); font-size: 13px; outline: none; width: 100%;
}
.dTopSearchBox input::placeholder { color: var(--muted); }

/* ─── MOBILE HEADER ──────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
@media(min-width:768px) { .header { display: none; } }

.headerInner {
  padding: 0 14px;
  height: 50px;
  display: flex; align-items: center; gap: 10px;
}

/* Logo mark (used in both mobile header and sidebar) */
.lm {
  width: 25px; height: 25px;
  background: var(--red); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #fff; flex-shrink: 0;
}
.brandName { font-size: 15px; font-weight: 800; }
.brandName span { color: var(--red); }
.logoLink { display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--text); }
.brand { display: flex; align-items: center; }

/* Icon button */
.ib {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r); border: none; background: transparent;
  color: var(--sub); cursor: pointer; transition: background 0.1s;
  flex-shrink: 0;
}
.ib:hover { background: var(--s2); color: var(--text); }
.ib svg {
  width: 17px; height: 17px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Legacy nav (hidden, kept for event wiring) */
.nav { display: none !important; }
#navToggle { display: none !important; }
.navRight { display: flex; align-items: center; gap: 6px; }
.navBadge {
  display: inline-block; background: var(--red); color: #fff;
  font-size: 9px; font-weight: 800; border-radius: 99px;
  min-width: 15px; height: 15px; line-height: 15px;
  text-align: center; padding: 0 3px; margin-left: 4px;
  vertical-align: middle;
}
.navSearch { position: relative; }
.navSearch input {
  width: 160px; padding: 6px 12px;
  border-radius: var(--r); border: 1px solid var(--border2);
  background: var(--panel); color: var(--text);
  font-size: 13px; outline: none;
}
.navSearch input::placeholder { color: var(--muted); }

/* ─── BOTTOM NAV ─────────────────────────────── */
.bottomNav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 5px 0 env(safe-area-inset-bottom, 5px);
}
@media(max-width:767px) { .bottomNav { display: flex; } }
.bottomNav a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 4px 2px;
  color: var(--muted); font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  transition: color 0.1s; min-width: 0;
  border: none; background: transparent; cursor: pointer;
}
.bottomNav a.active, .bottomNav a:hover { color: var(--red); }
.bnSvg {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── FAB ────────────────────────────────────── */
.fab {
  display: none;
  position: fixed; bottom: 68px; right: 16px;
  width: 48px; height: 48px;
  background: var(--red); border-radius: 50%; border: none;
  color: #fff; cursor: pointer; z-index: 99;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(232,25,44,0.4);
}
@media(max-width:767px) { .fab { display: flex; } }
.fab svg {
  width: 20px; height: 20px; stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── TYPOGRAPHY ─────────────────────────────── */
.h1 {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px; margin: 0 0 16px; flex-wrap: wrap;
}
.h1 h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.sub { font-size: 13px; color: var(--sub); line-height: 1.5; }
.pageTitle { font-size: clamp(18px,4vw,24px); font-weight: 900; letter-spacing: -0.5px; }

/* Section head */
.sh {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sh h2 {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--sub);
}

/* ─── STATS STRIP ────────────────────────────── */
.stats {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 18px;
}
.stats-item {
  flex: 1; padding: 11px 6px; text-align: center;
  border-right: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.stats-item:last-child { border-right: none; }
.stats-item:hover { background: var(--s2); }
.stats-num { font-size: 22px; font-weight: 800; line-height: 1; }
.stats-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--sub); margin-top: 3px;
}

/* KPI grid (alternative to stats strip) */
.kpiGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px,1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  margin-bottom: 18px;
}
.kpiTile { background: var(--panel); padding: 12px 14px; }
.kpiTile .kpiVal { font-size: 22px; font-weight: 800; line-height: 1; }
.kpiTile .kpiLabel {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--sub); margin-top: 3px;
}

/* ─── TASK GROUPS ────────────────────────────── */
.pg, .taskGroup { margin-bottom: 20px; }

.pgh, .taskGroupHead {
  display: flex; align-items: center;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
}
.pn, .taskGroupName { font-size: 13px; font-weight: 700; flex: 1; }
.pc, .taskGroupCount { font-size: 11px; font-weight: 700; color: var(--muted); }

/* ─── TASK ROWS (inline expand) ──────────────── */
.tw { border-bottom: 1px solid var(--border); }
.tw:last-child { border-bottom: none; }

.tr {
  display: flex; align-items: center;
  padding: 9px 0; gap: 10px;
  cursor: pointer;
  border-radius: var(--r);
  transition: background 0.1s;
}
.tr:hover, .tr.open {
  background: var(--s2);
  margin: 0 -8px; padding: 9px 8px;
}
.tl {
  width: 3px; height: 24px;
  border-radius: 2px; flex-shrink: 0;
}
.tt {
  flex: 1; font-size: 14px; font-weight: 500;
  min-width: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.tbadges { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

/* Expand panel */
.te { max-height: 0; overflow: hidden; transition: max-height 0.28s ease; }
.te.open { max-height: 600px; }
.ei { padding: 10px 0 14px 11px; }

/* Expand actions */
.eactions { display: flex; align-items: center; gap: 6px; padding-top: 6px; }
.xb {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: var(--r);
  border: 1px solid var(--border2); background: var(--panel);
  color: var(--sub); cursor: pointer; font-family: var(--font);
  transition: all 0.1s;
}
.xb:hover { background: var(--lift); color: var(--text); }
.xb.done { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.2); color: var(--green); }
.xb svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xopen {
  margin-left: auto; font-size: 11px; font-weight: 700;
  color: var(--muted); padding: 5px 0; border: none; background: transparent;
  cursor: pointer; font-family: var(--font); transition: color 0.1s;
}
.xopen:hover { color: var(--text); }

/* Inline comment box */
.ecomments { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 10px; }
.echead { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 8px; }
.ecomment { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.ecava {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
  flex-shrink: 0; margin-top: 1px; background: var(--blue);
}
.ecbody { flex: 1; min-width: 0; }
.ecwho { font-size: 12px; font-weight: 700; margin-right: 5px; }
.ectext { font-size: 12px; color: var(--sub); }
.ectime { font-size: 10px; color: var(--muted); margin-left: 4px; }
.ecinput { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.ecinput input {
  flex: 1; background: transparent; border: none;
  border-bottom: 1px solid var(--border2);
  padding: 6px 0; color: var(--text); font-family: var(--font);
  font-size: 13px; outline: none; transition: border-color 0.1s;
}
.ecinput input:focus { border-bottom-color: var(--red); }
.ecinput input::placeholder { color: var(--muted); }
.ecsend {
  width: 28px; height: 28px;
  background: var(--red); border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.ecsend svg { width: 13px; height: 13px; stroke: #fff; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Status row in expand */
.statusRow { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.statusRow > span { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--muted); margin-right: 2px; }
.stPill {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px; padding: 3px 9px; border-radius: 99px;
  border: none; cursor: pointer; font-family: var(--font);
  transition: all 0.1s; background: var(--s2); color: var(--sub);
}
.stPill:hover { background: var(--lift); }
.stPill.sel-work { background: rgba(59,130,246,0.15); color: #3b82f6; }
.stPill.sel-prog { background: rgba(34,197,94,0.15); color: #22c55e; }
.stPill.sel-wait { background: rgba(245,158,11,0.15); color: #f59e0b; }
.stPill.sel-done { background: rgba(34,197,94,0.15); color: #22c55e; }

.edesc { font-size: 13px; color: var(--sub); line-height: 1.55; margin-bottom: 10px; }
.ephotos { display: flex; gap: 4px; margin-bottom: 10px; }
.ephoto {
  width: 64px; height: 64px; background: var(--lift);
  border-radius: var(--r); display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 20px;
  flex-shrink: 0; overflow: hidden;
}

/* ─── TASK CARDS (legacy grid view) ─────────── */
.taskCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--r);
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.taskCard:hover { background: var(--s2); }
.taskCard[data-type="work"]     { border-left-color: var(--work); }
.taskCard[data-type="material"] { border-left-color: var(--material); }
.taskCard[data-type="extra"]    { border-left-color: var(--extra); }
.taskCard[data-type="waiting"]  { border-left-color: var(--waiting); }

/* ─── PROJECT CARDS ──────────────────────────── */
.grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 10px;
}
.projectCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--r);
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.1s;
  display: block;
}
.projectCard:hover { background: var(--s2); }

/* ─── GRID ───────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
  gap: 10px;
}

/* ─── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 7px 14px;
  border-radius: var(--r);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--s2); color: var(--text);
  transition: all 0.1s; white-space: nowrap;
}
.btn:hover { background: var(--lift); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--s2); }
.btn.danger { background: rgba(232,25,44,0.12); border-color: rgba(232,25,44,0.25); color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.xs { padding: 3px 8px; font-size: 11px; }
.btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── BADGES & PILLS ─────────────────────────── */
.badge, .p {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
  padding: 2px 7px; border-radius: 99px;
  white-space: nowrap;
}
.badge.work,     .p.w   { background: rgba(59,130,246,0.12); color: #3b82f6; }
.badge.material, .p.m   { background: rgba(20,184,166,0.12); color: #14b8a6; }
.badge.extra,    .p.tf  { background: rgba(168,85,247,0.12); color: #a855f7; }
.badge.waiting,  .p.wt  { background: rgba(245,158,11,0.13); color: #f59e0b; }
.badge.high,     .p.ap  { background: rgba(232,25,44,0.12);  color: #e8192c; }
.badge.done,     .p.dn  { background: rgba(34,197,94,0.12);  color: #22c55e; }
.badge.inprog,   .p.pg  { background: rgba(34,197,94,0.12);  color: #22c55e; }
.badge.open,     .p.pn  { background: rgba(245,158,11,0.13); color: #f59e0b; }
.badge.nd2,      .p.nd2 { background: rgba(245,158,11,0.13); color: #f59e0b; }
.badge.hd,       .p.hd  { background: rgba(139,146,163,0.1); color: #8b92a3; }

/* Due date chips */
.due { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 99px; }
.due.today   { background: rgba(245,158,11,0.15);   color: var(--amber); }
.due.overdue { background: rgba(232,25,44,0.12);    color: var(--red); }
.due.soon    { background: rgba(139,146,163,0.10);  color: var(--sub); }

/* New notification dot */
.nd { width: 6px; height: 6px; background: var(--red); border-radius: 50%; flex-shrink: 0; }

/* Status dot */
.statusDot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.statusDot.open   { background: var(--amber); }
.statusDot.inprog { background: var(--blue); }
.statusDot.done   { background: var(--green); }

/* ─── FORMS ──────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--sub);
}
.field input, .field select, .field textarea {
  background: var(--s2);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 8px 10px;
  color: var(--text);
  font-family: var(--font); font-size: 14px;
  outline: none; width: 100%;
  transition: border-color 0.1s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--red);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.field select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238890a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; padding-right: 26px;
}
.field input[type=file] { padding: 6px 10px; color: var(--sub); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media(max-width:500px) { .split { grid-template-columns: 1fr; } }
.checkRow { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.checkRow input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--red); flex-shrink: 0; }

/* Location chips */
.locChips { display: flex; gap: 6px; flex-wrap: wrap; }
.locChip {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: var(--r);
  border: 1px solid var(--border2); background: var(--s2);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.1s;
}
.locChip input[type=radio] { display: none; }
.locChip:has(input:checked) {
  background: var(--red-dim); border-color: var(--red); color: var(--red);
}

/* ─── MODAL ──────────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  align-items: flex-end; justify-content: center;
}
@media(min-width:600px) { .modal { align-items: center; } }
.modal.open { display: flex; }

.panel {
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  width: 100%; max-height: 92dvh;
  overflow-y: auto;
  padding: 0 20px env(safe-area-inset-bottom, 18px);
}
@media(min-width:600px) {
  .panel { border-radius: var(--r-lg); max-width: 500px; max-height: 88dvh; }
}
.panelBody { padding: 14px 0; }
.content { padding: 14px 0; }

.panel header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 700;
  position: sticky; top: 0; background: var(--panel); z-index: 1;
}
.panel footer {
  display: flex; gap: 8px;
  padding: 12px 0 6px;
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--panel); z-index: 1;
}
.panel footer .btn { flex: 1; }

/* Mobile drag handle */
.panel::before {
  content: '';
  display: block;
  width: 32px; height: 3px;
  background: var(--border2); border-radius: 2px;
  margin: 10px auto 0;
}
@media(min-width:600px) { .panel::before { display: none; } }

/* Type selector in modal */
.typerow {
  display: flex; gap: 0;
  background: var(--s2); border-radius: var(--r);
  padding: 3px; margin: 14px 0 16px;
}
.tp {
  flex: 1; padding: 7px 3px; border-radius: 5px;
  font-size: 11px; font-weight: 700; text-align: center;
  cursor: pointer; border: none; font-family: var(--font);
  color: var(--sub); background: transparent; transition: all 0.15s;
}
.tp.sw  { background: rgba(59,130,246,0.2);  color: #3b82f6; }
.tp.sm  { background: rgba(20,184,166,0.2);  color: #14b8a6; }
.tp.se  { background: rgba(168,85,247,0.2);  color: #a855f7; }
.tp.swt { background: rgba(245,158,11,0.2);  color: #f59e0b; }

/* ─── CARDS / PANELS ─────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.card.pad { padding: 14px 16px; }
.card.section { margin-top: 14px; }

/* ─── STAFF CARDS ────────────────────────────── */
.staffCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
}
.staffAvatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--blue); flex-shrink: 0;
}

/* ─── TOOL CARDS ─────────────────────────────── */
.toolCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  cursor: pointer; transition: background 0.1s;
}
.toolCard:hover { background: var(--s2); }

/* ─── MEMO / NOTE / RECEIPT CARDS ───────────── */
.memoCard, .noteCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  cursor: pointer; transition: background 0.1s;
}
.memoCard:hover, .noteCard:hover { background: var(--s2); }

/* ─── ACTIVITY FEED ──────────────────────────── */
.actFeed { display: flex; flex-direction: column; }
.actItem {
  display: flex; gap: 11px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.actItem:last-child { border-bottom: none; }
.actAvatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0; margin-top: 1px;
}

/* Activity card (legacy) */
.activityCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex; gap: 12px; align-items: flex-start;
}

/* ─── TIME ENTRIES ───────────────────────────── */
.timeRow {
  display: flex; align-items: center;
  padding: 10px 14px; gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.timeRow:first-child { border-radius: var(--r) var(--r) 0 0; }
.timeRow:last-child { border-bottom: none; border-radius: 0 0 var(--r) var(--r); }

/* ─── SEARCH ─────────────────────────────────── */
.searchResults {
  position: absolute; top: calc(100% + 4px); right: 0;
  width: 260px; background: var(--panel);
  border: 1px solid var(--border2); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-lg); z-index: 200;
}
.searchResults.hidden { display: none; }
.searchResult {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.searchResult:last-child { border-bottom: none; }
.searchResult:hover { background: var(--s2); }
.searchType {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--red); min-width: 44px;
}
.searchLabel { font-size: 13px; }

/* ─── FILTER CHIPS ───────────────────────────── */
.frow {
  display: flex; gap: 5px; overflow-x: auto;
  scrollbar-width: none; margin-bottom: 16px; padding-bottom: 2px;
}
.frow::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px; padding: 5px 11px; border-radius: 99px;
  cursor: pointer; border: none; font-family: var(--font);
  white-space: nowrap; transition: all 0.1s;
  background: var(--s2); color: var(--sub);
}
.chip:hover { background: var(--lift); color: var(--text); }
.chip.active { background: var(--red-dim); color: var(--red); }

/* ─── LOGIN ──────────────────────────────────── */
.loginWrap {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 16px; background: var(--bg);
}
.loginCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 28px; width: 100%; max-width: 380px;
}
.loginSub { font-size: 13px; color: var(--sub); }
.statikLogo { margin: 0 auto 4px; }

/* ─── CALENDAR ───────────────────────────────── */
.calWrap { display: flex; gap: 0; height: calc(100vh - 50px); overflow: hidden; }
@media(min-width:768px) { .calWrap { height: calc(100vh - 52px); margin-left: var(--sidebar-w); } }
.calSidebar {
  width: 240px; flex-shrink: 0;
  background: var(--panel); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 14px;
}
@media(max-width:767px) { .calSidebar { display: none; } }
.calMain { flex: 1; overflow-y: auto; }

/* ─── MANAGEMENT ─────────────────────────────── */
.mgmtShell { display: flex; gap: 0; overflow: hidden; }

/* ─── INSPECTION FORM PICKER ─────────────────── */
#taskInspFormPicker label {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 7px; border-radius: 5px; cursor: pointer;
  font-size: 12px; font-weight: 500;
  transition: background 0.1s;
}
#taskInspFormPicker label:hover { background: var(--s2); }
#taskInspFormPicker input[type=checkbox] { accent-color: var(--red); width: 13px; height: 13px; }

/* ─── RUNTIME ERROR BANNER ───────────────────── */
#runtimeErrorBanner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9999;
  display: none; padding: 12px 14px; border-radius: 14px;
  background: rgba(180,40,40,.92); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  font-size: 12px; line-height: 1.4;
}
@media(min-width:768px) { #runtimeErrorBanner { left: calc(var(--sidebar-w) + 12px); } }

/* ─── MISC ───────────────────────────────────── */
section { margin-bottom: 20px; }

/* Mobile activity link */
.mobileActivityBtn {
  display: flex; align-items: center;
  padding: 5px; color: var(--sub);
  border: none; background: none; position: relative;
}

/* Scrollable X on mobile tables */
.tableWrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--s2) 25%, var(--lift) 50%, var(--s2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r);
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
