/* app.css — drawer layout, compact-by-default, responsive filters, 1-column preview, urgency colors */
/* ---------- THEME TOKENS ---------- */
:root{
  --bg:#1a1e2e;
  --panel:rgba(255,255,255,0.18); --panel-strong:rgba(255,255,255,0.25);
  --line:rgba(255,255,255,0.25); --text:#1a1e2e; --muted:#3a4055;
  --btn:rgba(255,255,255,0.5); --btnb:rgba(255,255,255,0.35); --btnh:rgba(255,255,255,0.75); --accent:#2563eb;
  --glass-blur:22px; --glass-sat:1.3;

  --ok:#E6F4EA;    --ok-fg:#145a2e;    --ok-bd:#2a7e4a;
  --warn:#FFF5D6;  --warn-fg:#6b4a09;  --warn-bd:#9a6a10;
  --bad:#FDECEA;   --bad-fg:#7a1e1e;   --bad-bd:#a33;

  --green:#1f6d3a; --green-bg:#193826; --green-fg:#b9ffd0;
  --blue:#2b3570;  --blue-bg:#1b2350; --blue-fg:#cfe0ff;
  --red:#7a2b2b;   --red-bg:#3a1d1d;  --red-fg:#ffd0d0;
  --vio:#5b41a6;   --vio-bg:#251c4b;  --vio-fg:#e4daff;

  --hdrH:64px;
}
:root.light{
  --bg:#f0f4ff;
  --panel:rgba(255,255,255,0.22); --panel-strong:rgba(255,255,255,0.3);
  --line:rgba(200,210,240,0.5); --text:#1a1e2e; --muted:#5b6b9d;
  --btn:rgba(255,255,255,0.6); --btnb:rgba(200,210,240,0.5); --btnh:rgba(255,255,255,0.85); --accent:#3658e6;
  --glass-blur:20px; --glass-sat:1.2;

  --ok:#dff6e4;    --ok-fg:#155d2c;   --ok-bd:#2a7e4a;
  --warn:#fff2cf;  --warn-fg:#694100; --warn-bd:#9a6a10;
  --bad:#ffe7e7;   --bad-fg:#7d1717;  --bad-bd:#a33;

  --green:#1f6d3a; --green-bg:#e9f6ed; --green-fg:#155d2c;
  --blue:#2b51d3;  --blue-bg:#eaf0ff;  --blue-fg:#233a96;
  --red:#b63a3a;   --red-bg:#ffe7e7;   --red-fg:#7d1717;
  --vio:#6f54d9;   --vio-bg:#efeaff;   --vio-fg:#3e2b8a;
}
/* Theme: Ocean */
:root.theme-ocean{
  --bg:#0a1628;
  --panel:rgba(20,60,100,0.35); --panel-strong:rgba(20,60,100,0.5);
  --line:rgba(80,140,200,0.3); --text:#e0f0ff; --muted:#8ab4d8;
  --btn:rgba(30,80,130,0.6); --btnb:rgba(60,120,180,0.4); --btnh:rgba(40,100,160,0.8); --accent:#4da6ff;
  --glass-blur:20px; --glass-sat:1.3;

  --ok:#1a3d2a;    --ok-fg:#7dffb3;   --ok-bd:#2a7e4a;
  --warn:#3d3520;  --warn-fg:#ffd966; --warn-bd:#9a6a10;
  --bad:#3d1a1a;   --bad-fg:#ff8080;  --bad-bd:#a33;

  --green:#2a9d5a; --green-bg:#1a3d2a; --green-fg:#7dffb3;
  --blue:#4da6ff;  --blue-bg:#0a2840;  --blue-fg:#a0d4ff;
  --red:#ff6b6b;   --red-bg:#3d1a1a;   --red-fg:#ffb3b3;
  --vio:#9d7aff;   --vio-bg:#1f1a3d;   --vio-fg:#d4c4ff;
}

/* Theme: Forest */
:root.theme-forest{
  --bg:#0f1f14;
  --panel:rgba(30,70,40,0.4); --panel-strong:rgba(30,70,40,0.55);
  --line:rgba(80,140,90,0.35); --text:#e0ffe8; --muted:#8dc49a;
  --btn:rgba(40,90,50,0.6); --btnb:rgba(60,120,70,0.4); --btnh:rgba(50,110,60,0.8); --accent:#5ddb6d;
  --glass-blur:20px; --glass-sat:1.25;

  --ok:#1a3d24;    --ok-fg:#7dffb3;   --ok-bd:#3a9e5a;
  --warn:#3d3820;  --warn-fg:#ffe066; --warn-bd:#9a7a10;
  --bad:#3d1a1a;   --bad-fg:#ff8080;  --bad-bd:#a33;

  --green:#3cb55c; --green-bg:#1a3d24; --green-fg:#a0ffb8;
  --blue:#5aafff;  --blue-bg:#1a2d3d;  --blue-fg:#a0d8ff;
  --red:#ff6b6b;   --red-bg:#3d1a1a;   --red-fg:#ffb3b3;
  --vio:#a87dff;   --vio-bg:#251a3d;   --vio-fg:#d4c4ff;
}

/* Theme: Sunset */
:root.theme-sunset{
  --bg:#1f1018;
  --panel:rgba(80,40,50,0.4); --panel-strong:rgba(80,40,50,0.55);
  --line:rgba(180,100,120,0.35); --text:#ffe8ec; --muted:#d4a0aa;
  --btn:rgba(100,50,60,0.6); --btnb:rgba(140,80,100,0.4); --btnh:rgba(120,70,80,0.8); --accent:#ff7a8a;
  --glass-blur:20px; --glass-sat:1.3;

  --ok:#2a3d1a;    --ok-fg:#b3ff7d;   --ok-bd:#5a9e3a;
  --warn:#3d3018;  --warn-fg:#ffcc66; --warn-bd:#b88a20;
  --bad:#3d1a1a;   --bad-fg:#ff8080;  --bad-bd:#c44;

  --green:#6dbd4d; --green-bg:#2a3d1a; --green-fg:#c4ffb0;
  --blue:#6aaeff;  --blue-bg:#1a283d;  --blue-fg:#b0d8ff;
  --red:#ff6b7d;   --red-bg:#3d1a1f;   --red-fg:#ffc0c8;
  --vio:#c47dff;   --vio-bg:#2d1a3d;   --vio-fg:#e0c8ff;
}
/* ---------- GLOBAL ---------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  max-width:100vw; overflow-x:hidden; line-height:1.45;
  position:relative;
}
body::before{
  content:""; position:fixed; inset:0; z-index:-1;
  background: url('backgrounds/2084.jpg') center/cover no-repeat;
  pointer-events:none;
}
body.custom-bg::before{
  background: var(--custom-bg-url) center/cover no-repeat;
}
a.link{ color:#1d4ed8; text-decoration:none; word-break:break-word; font-weight:500; }
a.link:hover{ text-decoration:underline; }
.muted{ color:#2a3045; font-size:13px; font-weight:500; }
.hidden{ display:none !important; }
.only-desktop{ display:inline-flex; }
@media (max-width:960px){ .only-desktop{ display:none !important; } }

/* ---------- HEADER ---------- */
.app-header{
  position: sticky; top: 0; z-index: 30;
  display:flex; gap:12px; align-items:center; padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,0.3); background:var(--panel-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  min-height:var(--hdrH);
}
.app-header h1{ margin:0; font-size:24px; display:flex; gap:8px; align-items:center; font-weight:700; }
.title-area{ display:flex; flex-direction:column; gap:2px; }
.title-area .clock{ font-size:12px; color:#3a4560; font-weight:500; }
.spacer{ flex:1; }

.toolbar, .quick-add{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.toolbar button, .quick-add button{
  background:rgba(255,255,255,0.5); color:var(--text); border:1px solid rgba(255,255,255,0.4);
  padding:8px 10px; border-radius:10px; cursor:pointer; white-space:nowrap;
  display:inline-flex; gap:8px; align-items:center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s;
}
.toolbar button:hover, .quick-add button:hover{ background:rgba(255,255,255,0.75); }

/* Dropdown menus */
.dropdown{ position:relative; }
.dropdown-toggle{ display:inline-flex; align-items:center; gap:6px; }
.dropdown-toggle .fi-rr-angle-small-down{ font-size:12px; opacity:0.7; }
.dropdown-menu{
  display:none; position:absolute; top:100%; left:0; margin-top:4px; z-index:50;
  background:rgba(255,255,255,0.95); border:1px solid rgba(200,210,230,0.6);
  border-radius:10px; padding:4px; min-width:160px;
  box-shadow:0 8px 24px rgba(0,0,0,0.15);
  backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
}
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu{ display:block; }
.dropdown-menu button{
  width:100%; text-align:left; background:transparent; border:none;
  padding:8px 12px; border-radius:6px; display:flex; align-items:center; gap:8px;
  color:var(--text); cursor:pointer; font-size:13px;
}
.dropdown-menu button:hover{ background:rgba(100,140,220,0.15); }
.quick-add input{
  background:rgba(255,255,255,0.5); color:var(--text); border:1px solid rgba(255,255,255,0.4);
  padding:8px 10px; border-radius:10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#qa_name{ width:200px; }
#qa_client{ width:160px; }
#qa_due{ width:200px; }

/* ---------- LAYOUT ---------- */
/* We use a single-column flow + an overlay drawer so the left list never gets compressed */
.layout{
  display:block; padding:12px; padding-right:16px;
}
.panel{
  background:var(--panel-strong); border:1px solid rgba(255,255,255,0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.45);
  backdrop-filter: blur(18px) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(18px) saturate(var(--glass-sat));
  border-radius:16px; min-height:0; display:flex; flex-direction:column;
}

/* ---------- DRAWER (right) ---------- */
.drawer{
  position: fixed; top: 0; right: 0; z-index: 40;
  width: min(520px, 95vw); height: 100vh; padding-top: var(--hdrH);
  background:var(--panel-strong); border-left:1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: -12px 0 32px rgba(0,0,0,.12);
  transform: translateX(0); transition: transform .25s ease;
  display:flex; flex-direction:column;
}
.drawer:not(.open){ transform: translateX(100%); box-shadow:none; pointer-events:none; }
.drawer-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:6px 12px; border-bottom:1px solid var(--line);
}
.drawer-title{ display:flex; align-items:center; gap:6px; font-weight:700; font-size:14px; }
.icon-btn{
  background:rgba(255,255,255,0.5); border:1px solid rgba(255,255,255,0.4); color:var(--text);
  padding:6px 8px; border-radius:10px; cursor:pointer;
  transition: background 0.15s;
}
.icon-btn:hover{ background:rgba(255,255,255,0.75); }

.tabs-wrap{ border:0; border-radius:0; height: 100%; }
.tabs-wrap .tabs-body{ padding:12px; height: calc(100% - 46px); overflow:auto; }

/* ---------- FILTERS ---------- */
.filters{
  display:grid; gap:10px; align-items:center; padding:10px 12px; border-bottom:1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-auto-flow: row dense;
}
.filters input, .filters select{
  background:rgba(255,255,255,0.5); color:var(--text); border:1px solid rgba(255,255,255,0.4);
  padding:8px 10px; border-radius:10px; min-width:0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.w-lg{ min-width:280px; grid-column: span 2; } /* keep search wide */
.filter-tips{ grid-column: 1 / -1; color:#2a3045; font-weight:500; }

/* ---------- CARD LIST ---------- */
.cards{ list-style:none; margin:16px; padding:0; display:flex; flex-direction:column; gap:12px; }
.card{
  background:rgba(255,255,255,0.18); border:1px solid rgba(255,255,255,0.3); border-radius:16px; padding:0;
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -1px 0 rgba(255,255,255,0.1);
  display:flex; flex-direction:row; cursor:pointer; max-width:100%; overflow:hidden;
  max-height:380px;
}
.card-content{
  flex:1; min-width:0; padding:12px; display:grid; gap:8px; overflow-y:auto; align-content:start;
}
.card-preview{
  width:20%; min-width:140px; max-width:350px; background:rgba(255,255,255,0.1);
  display:grid; grid-template-columns:repeat(2, 1fr); gap:4px; padding:6px;
  border-left:1px solid rgba(255,255,255,0.2);
  overflow-y:auto; overflow-x:hidden;
  position:relative; align-content:start;
}
.card-preview:hover{ background:rgba(255,255,255,0.15); }
.card-preview:empty{ display:none; }
.card-preview .preview-item{
  flex-shrink:0; border-radius:8px; overflow:hidden; background:rgba(0,0,0,0.3);
  cursor:pointer; transition: transform 0.15s; position:relative;
}
.card-preview .preview-item:hover{ transform:scale(1.02); }
.card-preview .preview-item:hover .preview-delete{ opacity:1; }
.card-preview .preview-item img,
.card-preview .preview-item video{
  width:100%; height:auto; display:block;
}
.preview-delete{
  position:absolute; top:4px; right:4px; background:rgba(180,50,50,0.85); border:none;
  color:#fff; width:24px; height:24px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:11px;
  opacity:0; transition:opacity 0.15s; z-index:5;
}
.preview-delete:hover{ background:rgba(220,60,60,0.95); }
.card-preview .more-badge{
  grid-column:1 / -1;
  background:rgba(0,0,0,0.7); color:#fff; text-align:center;
  padding:6px; font-size:12px; font-weight:600; border-radius:8px;
  backdrop-filter:blur(8px);
}
@media (max-width:640px){
  .card{ flex-direction:column; }
  .card-preview{ width:100%; max-width:none; min-height:100px; grid-template-columns:repeat(3, 1fr); border-left:none; border-top:1px solid rgba(255,255,255,0.15); }
}
.card:hover{ outline:1px solid var(--btnb); }

/* Row 1: Title + Status */
.card-content .row:nth-of-type(1){
  display:grid; grid-template-columns: max-content 1fr max-content; gap:10px; align-items:center;
}
.card .title{ font-weight:800; font-size:16.5px; overflow-wrap:anywhere; letter-spacing:.2px; }
.badge{
  justify-self:end; padding:5px 10px; border:1px solid rgba(255,255,255,0.35);
  border-radius:999px; font-size:11px; background:rgba(255,255,255,0.5); font-weight:600;
}
.badge.status-progress{ background:var(--blue-bg); border-color:var(--blue); color:var(--blue-fg); }
.badge.status-revision{ background:var(--vio-bg);  border-color:var(--vio);  color:var(--vio-fg); }
.badge.status-cancel{   background:var(--red-bg);  border-color:var(--red);  color:var(--red-fg); }
.badge.status-done{     background:var(--green-bg);border-color:var(--green);color:var(--green-fg); }

/* Completed project styling */
.card.completed-project{ opacity:0.7; }
.card.completed-project:hover{ opacity:0.85; }
.card.completed-project .card-content{ background:rgba(0,0,0,0.05); }

/* Status area with quick select */
.status-area{ display:flex; align-items:center; gap:8px; }
.status-select{
  appearance:none; background:rgba(255,255,255,0.4); border:1px solid rgba(255,255,255,0.3);
  padding:4px 8px; border-radius:6px; font-size:11px; cursor:pointer; color:var(--text);
}
.status-select:focus{ outline:2px solid var(--accent); }

/* Row 2: Client + Website */
.card-content .row:nth-of-type(2){
  display:grid; grid-template-columns: 1fr 1fr; gap:10px;
}
@media (max-width:780px){ .card-content .row:nth-of-type(2){ grid-template-columns:1fr; } }
.card-content .row:nth-of-type(2) .cell{ overflow-wrap:anywhere; }

/* Row 3: Dates */
.card-content .row:nth-of-type(3){
  display:grid; gap:8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  position:relative; padding-top:24px;
}
.card-content .row:nth-of-type(3)::before{
  content:"Dates"; position:absolute; top:0; left:0;
  font-size:12px; color:#2a3045; letter-spacing:.2px; font-weight:700;
}
@media (max-width:980px){ .card-content .row:nth-of-type(3){ grid-template-columns: repeat(2, minmax(140px, 1fr)); } }
@media (max-width:640px){ .card-content .row:nth-of-type(3){ grid-template-columns: 1fr; } }
.cell.dt{
  background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.15);
  border-radius:10px; padding:9px 10px;
}
.dt-item{ display:flex; flex-direction:column; gap:4px; }
.dt-h{ display:flex; align-items:center; gap:8px; font-size:12px; color:#2a3045; font-weight:600; }
.dt-h i{ font-size:14px; opacity:1; color:#3a4560; }
.dt-v{ font-weight:600; font-variant-numeric: tabular-nums; }

/* Row 4: Milestones (timers) */
.milestone-row{ display:flex; flex-direction:column; gap:8px; position:relative; padding-top:8px; }
.milestone-progress{
  display:flex; align-items:center; gap:10px;
}
.progress-bar{
  flex:1; max-width:200px; height:6px; background:rgba(0,0,0,0.15); border-radius:3px; overflow:hidden;
}
.progress-fill{
  height:100%; background:linear-gradient(90deg, var(--accent), #5ddb6d); border-radius:3px;
  transition:width 0.3s ease;
}
.progress-text{ font-size:12px; color:#3a4560; font-weight:600; }
.milestone-cells{
  display:grid !important; gap:8px; grid-template-columns: repeat(5, 1fr);
}
.milestone-cells .cell.timer{
  background:rgba(255,255,255,0.15); border:1px solid rgba(255,255,255,0.2);
  border-radius:12px; padding:12px; min-height:72px;
  display:flex; align-items:flex-start;
}
.milestone-cells.collapsed{ display:none; }
.all-done-badge{
  display:inline-flex; align-items:center; gap:6px; padding:8px 14px;
  background:var(--green-bg); color:var(--green-fg); border:1px solid var(--green);
  border-radius:10px; font-size:13px; font-weight:600;
}
.reset-milestones-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:8px;
  background:rgba(239,68,68,0.15); color:#ef4444; border:1px solid rgba(239,68,68,0.3);
  cursor:pointer; transition:all .15s;
}
.reset-milestones-btn:hover{ background:rgba(239,68,68,0.25); }
@media (max-width:1200px){ .milestone-cells{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width:820px){ .milestone-cells{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width:520px){ .milestone-cells{ grid-template-columns: 1fr; } }
.cell.timer{
  background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.15);
  border-radius:12px; padding:12px; min-width:0; min-height:70px;
  display:flex; align-items:stretch;
}
.timer-block{ display:flex; flex-direction:column; gap:4px; width:100%; position:relative; }
.timer-label{ display:flex; align-items:center; gap:6px; font-size:11px; color:#2a3045; font-weight:600; opacity:0.8; }
.timer-label i{ font-size:12px; }
.timer-value{
  font-weight:800; font-size:16px; letter-spacing:.2px; font-variant-numeric: tabular-nums;
  line-height:1.3; margin-top:auto;
}
.cell.timer.priority .timer-value{ font-size:18px; }

/* Urgency backgrounds (applied by JS) */
.timer-urg-low   { background: var(--ok);   border-color: var(--ok-bd);   color: var(--ok-fg); }
.timer-urg-med   { background: var(--warn); border-color: var(--warn-bd); color: var(--warn-fg); }
.timer-urg-high  { background: var(--bad);  border-color: var(--bad-bd);  color: var(--bad-fg); }
.timer-urg-over  { background: rgba(255,255,255,0.04); border-color: var(--line); color: var(--text); opacity:.85; }

/* Milestone completion states */
.timer-completed{ background:var(--green-bg); border-color:var(--green); }
.timer-completed .timer-label{ color:var(--green-fg); opacity:1; }
.timer-completed .timer-value{ color:var(--green-fg); font-size:13px; font-weight:600; }
.timer-failed{ background:rgba(239,68,68,0.15); border-color:rgba(239,68,68,0.4); }
.timer-failed .timer-label{ color:#f87171; opacity:1; }
.timer-failed .timer-value{ color:#ef4444; font-size:13px; font-weight:700; }

/* Mark complete / unmark buttons */
.mark-complete-btn, .unmark-btn{
  position:absolute; top:4px; right:4px;
  background:rgba(255,255,255,0.3); border:1px solid rgba(255,255,255,0.3);
  color:var(--text); width:22px; height:22px; border-radius:50%;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  font-size:10px; opacity:0; transition:opacity 0.15s;
}
.cell.timer:hover .mark-complete-btn,
.cell.timer:hover .unmark-btn{ opacity:1; }
.mark-complete-btn:hover{ background:var(--green-bg); border-color:var(--green); color:var(--green-fg); }
.unmark-btn:hover{ background:rgba(255,100,100,0.3); border-color:#a55; color:#faa; }

/* Row 5: INFO CHIPS (category, store type, price, http status, dev) */
.card-content .row.info{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:-2px;
}
.chip{
  display:inline-flex; align-items:center; gap:8px;
  background:rgba(255,255,255,0.2); border:1px solid rgba(255,255,255,0.25);
  padding:6px 10px; border-radius:999px; font-size:12px; color:#1a2035; font-weight:500;
}
.chip i{ font-size:14px; color:#3a4560; }
.chip.kv b{ opacity:.8; margin-right:4px; }
.chip.live{ background:var(--ok); color:var(--ok-fg); border-color:var(--ok-bd); }
.chip.dead{ background:var(--bad); color:var(--bad-fg); border-color:var(--bad-bd); }
.dev-chip{
  display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px;
  border:1px dashed rgba(100,120,160,0.5); font-size:12px; background:rgba(255,255,255,0.25);
  color:#1a2035; font-weight:500;
}
.dev-chip i{ color:#3a4560; }

/* Row 6: Actions */
.actions{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.actions button{
  background:rgba(255,255,255,0.5); color:var(--text); border:1px solid rgba(255,255,255,0.4);
  padding:8px 10px; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  transition: background 0.15s, transform 0.1s;
}
.actions button:hover{ background:rgba(255,255,255,0.75); transform:scale(1.05); }
.actions button i{ font-size:15px; }

/* ---------- TABS ---------- */
.tabs-bar{
  display:flex; gap:8px; padding:8px 10px; border-bottom:1px solid var(--line); overflow:auto;
}
.tab{
  display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:10px;
  background:rgba(255,255,255,0.45); border:1px solid rgba(255,255,255,0.35); cursor:pointer; white-space:nowrap; max-width:100%;
  transition: background 0.15s;
}
.tab.active{ background:rgba(255,255,255,0.7); border-color:rgba(100,140,220,0.5); }
.tab .close{ opacity:.75; cursor:pointer; }
.tab .close:hover{ opacity:1; }
.tabs-body{ padding:12px; }

/* Inner tabs */
.inner-tabs{ display:flex; gap:6px; margin-bottom:10px; flex-wrap:wrap; }
.inner-tab{
  padding:6px 10px; border-radius:8px; border:1px solid rgba(255,255,255,0.35); background:rgba(255,255,255,0.4); cursor:pointer;
  display:inline-flex; align-items:center; gap:8px;
  transition: background 0.15s;
}
.inner-tab.active{ background:rgba(255,255,255,0.7); }

/* ---------- FORMS ---------- */
.form{
  display:grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap:12px;
}
@media (max-width:780px){ .form{ grid-template-columns:1fr; } }
.form .full{ grid-column:1 / -1; }
.milestone-overrides{ background:rgba(255,255,255,0.05); border:1px dashed var(--line); border-radius:10px; padding:12px; }
.milestone-override-grid{ display:grid; grid-template-columns:repeat(2, 1fr); gap:10px; margin-top:8px; }
.milestone-override-grid > div{ display:flex; flex-direction:column; }
.milestone-override-grid label{ font-size:11px; color:var(--muted); margin-bottom:2px; display:block; }
.milestone-override-grid input{ width:100%; }
@media(max-width:400px){ .milestone-override-grid{ grid-template-columns:1fr; } }
label{
  font-size:13px; color:#2a3045; display:block; margin-bottom:4px;
  display:flex; align-items:center; gap:8px; font-weight:600;
}
input, textarea, select{
  width:100%; background:rgba(255,255,255,0.5); color:var(--text); border:1px solid rgba(255,255,255,0.4);
  border-radius:10px; padding:9px 10px; min-width:0;
}
textarea{ min-height:100px; resize:vertical; }
.input-row{ position:relative; }
.input-row .reveal, .input-row .copy{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  background:transparent; border:0; color:var(--muted); cursor:pointer;
}
.input-row .copy{ right:36px; }

.form-actions{ display:flex; gap:8px; margin-top:6px; flex-wrap:wrap; }
.btn-save{ background:#193826; border:1px solid #2b7a46; color:#b9ffd0; padding:8px 12px; border-radius:10px; }
.btn-delete{ background:#3a1d1d; border:1px solid #7a2b2b; color:#ffd0d0; padding:8px 12px; border-radius:10px; }

/* ---------- ATTACHMENTS ---------- */
.attachments{ display:flex; flex-direction:column; gap:8px; }
.attachments .att-row{ display:grid; grid-template-columns: 1fr 1fr max-content; gap:8px; }
.attachments input{ width:100%; }

/* ---------- PASSWORDS TAB ---------- */
.secrets{
  display:flex; flex-direction:column; gap:12px; border:1px dashed var(--line); padding:10px; border-radius:12px;
}
.secret-block{
  border:1px solid var(--line); border-radius:12px; padding:10px; background:rgba(255,255,255,0.02);
  display:grid; grid-template-columns: repeat(2, minmax(200px,1fr)); gap:10px;
}
@media (max-width:780px){ .secret-block{ grid-template-columns:1fr; } }
.secret-head{ grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
.secret-title{ display:flex; align-items:center; gap:8px; font-weight:700; }
.secret-actions button{
  background:var(--btn); border:1px solid var(--btnb); color:var(--text);
  padding:6px 8px; border-radius:8px; cursor:pointer; margin-left:6px;
}
.secret-actions button:hover{ background:var(--btnh); }

/* ---------- DEVELOPER TAB ---------- */
.dev-grid{
  display:grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap:12px;
}
@media (max-width:780px){ .dev-grid{ grid-template-columns:1fr; } }
.pay-pill{
  display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px; font-size:12px;
  border:1px solid var(--btnb); background:var(--btn);
}
.pay-pill.paid{ background:var(--ok); color:var(--ok-fg); border-color:var(--ok-bd); }
.pay-pill.unpaid{ background:var(--bad); color:var(--bad-fg); border-color:var(--bad-bd); }
.penalty-note{ font-size:12px; color:var(--muted); }

/* Developer list picker */
.dev-list{
  border:1px dashed var(--line); border-radius:12px; padding:10px; display:flex; flex-direction:column; gap:10px;
}
.dev-row{
  display:grid; grid-template-columns: repeat(2, 1fr); gap:8px; align-items:end;
}
.dev-row > div{ display:flex; flex-direction:column; }
.dev-row input, .dev-row select{ width:100%; }
.dev-row .mini{ font-size:12px; color:var(--muted); }
.dev-row .full{ grid-column:1 / -1; }

/* ---------- PREVIEW TAB (images/videos) ---------- */
.preview-wrap{ display:flex; flex-direction:column; gap:10px; }
.uploader{
  display:flex; gap:8px; flex-wrap:wrap; align-items:center; border:1px dashed var(--line);
  border-radius:12px; padding:10px; background:rgba(255,255,255,0.02);
}
.uploader input[type="file"]{ display:none; }
.uploader .btn{
  background:var(--btn); color:var(--text); border:1px solid var(--btnb);
  padding:7px 10px; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; gap:8px;
}
.uploader .btn:hover{ background:var(--btnh); }

.gallery-grid{
  display:grid; gap:10px;
  grid-template-columns: 1fr; /* 1-column view as requested */
}
.gallery-item{
  border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#000;
  display:flex; align-items:center; justify-content:center; aspect-ratio: 16 / 9;
  position:relative;
}
.gallery-item img, .gallery-item video{
  width:100%; height:100%; object-fit:cover; display:block;
}
.gallery-item .caption{
  position:absolute; left:8px; bottom:8px; background:rgba(0,0,0,.5); color:#fff;
  padding:4px 8px; border-radius:8px; font-size:12px;
}

/* Mini preview thumbs - now in card-preview sidebar */
.mini-previews{ display:none; }
.mini-thumb{
  width:140px; height:80px; border-radius:10px; overflow:hidden; border:1px solid var(--line); background:#000;
}
.mini-thumb img, .mini-thumb video{ width:100%; height:100%; object-fit:cover; display:block; }

/* ---------- ACTIVITY ---------- */
.activity{ border:1px dashed var(--line); border-radius:10px; padding:10px; font-size:13px; }
.activity .item{ padding:6px 0; border-bottom:1px dotted var(--line); }
.activity .item:last-child{ border-bottom:none; }

/* ---------- COMPACT MODE (default) ---------- */
body.compact .card{ padding:10px; gap:10px; }
body.compact .card .title{ font-size:15px; }
body.compact .cell.dt, body.compact .cell.timer{ padding:8px 9px; }
body.compact .timer-value{ font-size:16px; }
body.compact .cell.timer.priority .timer-value{ font-size:18px; }
body.compact .actions button{ padding:6px 8px; }
body.compact .filters{ gap:8px; }
body.compact .toolbar button, body.compact .quick-add button{ padding:6px 8px; }
body.compact .quick-add input{ padding:6px 8px; }
body.compact .chip{ padding:5px 8px; }

/* ---------- UTILITY ---------- */
.visually-hidden{ position:absolute !important; left:-10000px !important; top:auto !important; width:1px !important; height:1px !important; overflow:hidden !important; }

/* ---------- LIGHTBOX ---------- */
.lightbox{
  position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center;
}
.lightbox.hidden{ display:none !important; }
.lightbox-backdrop{
  position:absolute; inset:0; background:rgba(0,0,0,0.85);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
}
.lightbox-content{
  position:relative; max-width:90vw; max-height:90vh; display:flex; align-items:center; justify-content:center;
}
.lightbox-content img{
  max-width:90vw; max-height:90vh; object-fit:contain; border-radius:8px;
  box-shadow:0 12px 48px rgba(0,0,0,0.4);
}
.lightbox-close{
  position:absolute; top:-40px; right:0; background:rgba(255,255,255,0.2); border:none;
  color:#fff; width:36px; height:36px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:16px;
}
.lightbox-close:hover{ background:rgba(255,255,255,0.3); }
.lightbox-prev, .lightbox-next{
  position:absolute; top:50%; transform:translateY(-50%);
  background:rgba(255,255,255,0.2); border:none; color:#fff;
  width:44px; height:44px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:18px;
}
.lightbox-prev{ left:-60px; }
.lightbox-next{ right:-60px; }
.lightbox-prev:hover, .lightbox-next:hover{ background:rgba(255,255,255,0.3); }
@media(max-width:768px){
  .lightbox-prev{ left:10px; }
  .lightbox-next{ right:10px; }
}

/* ---------- MODAL ---------- */
.modal{
  position:fixed; inset:0; z-index:120;
  display:flex; align-items:center; justify-content:center;
}
.modal.hidden{ display:none !important; }
.modal-backdrop{
  position:absolute; inset:0; background:rgba(0,0,0,0.55);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
}
.modal-card{
  position:relative;
  width:min(520px, calc(100vw - 32px));
  border-radius:16px;
  padding:14px;
  background:var(--card);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}
.modal-title{ font-size:16px; font-weight:800; display:flex; align-items:center; gap:8px; }
.modal-card input{
  width:100%; margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.55);
}
.light .modal-card input{ background:rgba(255,255,255,0.9); }
.modal-card input:focus{ outline:2px solid var(--accent); }
.modal-actions{ margin-top:10px; display:flex; justify-content:flex-end; gap:10px; }
.btn-ghost{
  background:transparent;
  border:1px solid var(--line);
}
.btn-ghost:hover{ background:rgba(255,255,255,0.35); }

/* ---------- FAVORITE STAR ---------- */
.favorite-btn{
  background:transparent; border:none; cursor:pointer; padding:4px; font-size:18px;
  color:#d4a840; opacity:0.5; transition:opacity 0.15s, transform 0.15s;
}
.favorite-btn:hover{ opacity:0.8; transform:scale(1.15); }
.favorite-btn.active{ opacity:1; color:#f0c040; }
.favorite-btn.active i::before{ content:"\eb60"; } /* filled star */

/* Quick status dropdown */
.status-select{
  appearance:none; background:rgba(255,255,255,0.5); border:1px solid rgba(255,255,255,0.4);
  padding:4px 8px; border-radius:8px; font-size:11px; font-weight:600; cursor:pointer;
}
.status-select:focus{ outline:2px solid var(--accent); }
