/* ================================================================
   Tasker AI v6.0.8 — Native Trello / Atlassian Design System
   DARK BY DEFAULT. Matches Trello dark mode (Atlassian DS dark).
   Add data-theme="light" on <html> to opt into the light palette.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Atlassian dark-mode brand palette */
  --brand-50:  #1c2b41;
  --brand-100: #1d3a5c;
  --brand-300: #4c9aff;
  --brand-500: #579dff;   /* Atlassian dark primary */
  --brand-600: #85b8ff;
  --brand-700: #cfe1ff;
  --accent:    #579dff;
  --accent-2:  #9f8fef;

  /* Surfaces — Trello dark neutrals */
  --bg:        #1d2125;
  --bg-1:      #22272b;
  --bg-2:      #282e33;
  --bg-3:      #2c333a;
  --bg-card:   #22272b;
  --bg-overlay: rgba(0,0,0,.65);
  --border:    #38414a;
  --border-2:  #4c5560;

  /* Text */
  --fg:        #b6c2cf;
  --fg-2:      #9fadbc;
  --fg-3:      #8c9bab;
  --fg-4:      #738496;

  /* Semantic */
  --success:   #4bce97;
  --warning:   #f5cd47;
  --danger:    #f87168;
  --info:      #579dff;

  /* Effects */
  --radius-sm: 3px;
  --radius:    4px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --shadow-sm: 0 1px 1px rgba(3,4,4,.5);
  --shadow:    0 1px 1px rgba(3,4,4,.5), 0 0 1px rgba(0,0,0,.6);
  --shadow-lg: 0 8px 12px rgba(3,4,4,.5), 0 0 1px rgba(3,4,4,.6);
  --glow:      0 0 0 2px rgba(87,157,255,.35);

  /* Spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Motion */
  --ease: cubic-bezier(.2,0,0,1);
  --t-fast: 100ms;
  --t: 180ms;
  --t-slow: 300ms;
}

/* Components themed for dark surfaces */
.btn--primary { color: #1d2125; }
.btn--primary:hover { background: var(--brand-600); }
.btn--danger  { background: #42221f; color: #ff8f73; border-color: #5d1f1a; }
.badge--brand   { background: #1c2b41; color: #85b8ff; border-color: #1d3a5c; }
.badge--success { background: #164b35; color: #7ee2b8; border-color: #1f6e4a; }
.badge--warn    { background: #533f04; color: #f5cd47; border-color: #7f5f01; }
.badge--danger  { background: #42221f; color: #ff8f73; border-color: #5d1f1a; }
.badge--ai      { background: #1c2b41; color: #85b8ff; border-color: #1d3a5c; }
.tq__pri--p0    { background: #42221f; color: #ff8f73; border-color: #5d1f1a; }
.tq__pri--p1    { background: #533f04; color: #f5cd47; border-color: #7f5f01; }
.tq__pri--p2    { background: #1c2b41; color: #85b8ff; border-color: #1d3a5c; }
.tq__pri--p3    { background: #2c333a; color: #9fadbc; border-color: #4c5560; }
.nav a.active   { background: #1c2b41; color: #85b8ff; }
.action-tile .action-tile__ic { background: #1c2b41; color: #85b8ff; }

/* Optional light theme — opt-in via data-theme="light" */
[data-theme="light"] {
  --brand-50:  #deebff;
  --brand-100: #b3d4ff;
  --brand-300: #4c9aff;
  --brand-500: #0052cc;
  --brand-600: #0747a6;
  --brand-700: #053673;
  --accent:    #0079bf;
  --accent-2:  #5243aa;

  --bg:        #fafbfc;
  --bg-1:      #ffffff;
  --bg-2:      #f4f5f7;
  --bg-3:      #ebecf0;
  --bg-card:   #ffffff;
  --bg-overlay: rgba(9,30,66,0.54);
  --border:    #dfe1e6;
  --border-2:  #c1c7d0;

  --fg:        #172b4d;
  --fg-2:      #42526e;
  --fg-3:      #5e6c84;
  --fg-4:      #7a869a;

  --success:   #00875a;
  --warning:   #ff8b00;
  --danger:    #de350b;
  --info:      #0052cc;

  --shadow-sm: 0 1px 1px rgba(9,30,66,.25);
  --shadow:    0 1px 1px rgba(9,30,66,.25), 0 0 1px rgba(9,30,66,.31);
  --shadow-lg: 0 8px 16px -4px rgba(9,30,66,.25), 0 0 1px rgba(9,30,66,.31);
  --glow:      0 0 0 2px var(--brand-100);
}
[data-theme="light"] .btn--primary { color: #ffffff; }
[data-theme="light"] .btn--danger  { background: #de350b; color: #ffffff; border-color: #de350b; }
[data-theme="light"] .badge--brand   { background: #deebff; color: #0747a6; border-color: #b3d4ff; }
[data-theme="light"] .badge--success { background: #e3fcef; color: #006644; border-color: #abf5d1; }
[data-theme="light"] .badge--warn    { background: #fffae6; color: #974f0c; border-color: #ffe380; }
[data-theme="light"] .badge--danger  { background: #ffebe6; color: #bf2600; border-color: #ffbdad; }
[data-theme="light"] .badge--ai      { background: #deebff; color: #0747a6; border-color: #b3d4ff; }
[data-theme="light"] .tq__pri--p0    { background: #ffebe6; color: #bf2600; border-color: #ffbdad; }
[data-theme="light"] .tq__pri--p1    { background: #fffae6; color: #974f0c; border-color: #ffe380; }
[data-theme="light"] .tq__pri--p2    { background: #deebff; color: #0747a6; border-color: #b3d4ff; }
[data-theme="light"] .tq__pri--p3    { background: #f4f5f7; color: #42526e; border-color: #dfe1e6; }
[data-theme="light"] .nav a.active   { background: #deebff; color: #0747a6; }
[data-theme="light"] .action-tile .action-tile__ic { background: #deebff; color: #0747a6; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.02em; color: var(--fg); }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
h4 { font-size: 14px; font-weight: 600; }
.muted { color: var(--fg-3); }
.tiny { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; }

/* ---------- Layout primitives ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.app--narrow { grid-template-columns: 1fr; max-width: 1200px; margin: 0 auto; padding: var(--s-6); }
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: var(--s-5) var(--s-3);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.sidebar__brand {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-3);
}
.sidebar__brand .logo {
  width: 28px; height: 28px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.sidebar__brand .name { font-weight: 600; letter-spacing: -.01em; color: var(--fg); }
.sidebar__brand .tag { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .08em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__group { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-4); padding: var(--s-4) var(--s-3) var(--s-2); }
.nav a {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius-sm);
  color: var(--fg-2); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav a:hover { background: var(--bg-2); color: var(--fg); }
.nav a.active { background: var(--brand-50); color: var(--brand-600); }
.nav a .ic { width: 16px; height: 16px; opacity: .85; }

.main { padding: var(--s-6) var(--s-8); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: var(--s-5); margin-bottom: var(--s-6);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 20px; }
.topbar__actions { display: flex; gap: var(--s-2); align-items: center; }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.card:hover { border-color: var(--border-2); }
.card--hover:hover { box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
.card__title { font-weight: 600; }
.card__sub { color: var(--fg-3); font-size: 12px; }

.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* ---------- Stat / KPI ---------- */
.stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--s-5);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.stat__label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); }
.stat__value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--fg); }
.stat__delta { font-size: 12px; color: var(--success); display: inline-flex; align-items: center; gap: 4px; }
.stat__delta.down { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--bg-3);
  color: var(--fg);
  font: inherit; font-weight: 500; font-size: 13px;
  cursor: pointer; user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { background: var(--border); }
.btn:active { background: var(--border-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary {
  background: var(--brand-500);
  border-color: transparent; color: #fff;
  box-shadow: none;
}
.btn--primary:hover { background: var(--brand-600); filter: none; box-shadow: var(--shadow); }
.btn--ghost { background: transparent; }
.btn--danger { background: #ffebe6; border-color: #ffbdad; color: var(--danger); }
.btn--sm { padding: 4px 10px; font-size: 12px; }
.btn--lg { padding: 10px 18px; font-size: 14px; }
.btn--block { width: 100%; }

/* ---------- Inputs ---------- */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--fg);
  font: inherit; font-size: 13px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 2px var(--brand-100);
}
.textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.label { display: block; font-size: 12px; font-weight: 500; color: var(--fg-2); margin-bottom: 6px; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 600;
  background: var(--bg-3); color: var(--fg-2);
  border: 1px solid var(--border);
}
.badge--brand   { background: var(--brand-50);  color: var(--brand-600); border-color: var(--brand-100); }
.badge--success { background: #e3fcef; color: var(--success); border-color: #abf5d1; }
.badge--warn    { background: #fff7e6; color: #ff8b00; border-color: #ffe0b3; }
.badge--danger  { background: #ffebe6; color: var(--danger); border-color: #ffbdad; }
.badge--ai      { background: var(--brand-50);  color: var(--brand-600); border-color: var(--brand-100); }
.dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; background: currentColor; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: var(--s-3) var(--s-4); text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--fg-3); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.table tr:hover td { background: var(--bg-2); }

/* ---------- Toasts ---------- */
.toast-host { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast {
  padding: 12px 16px;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: var(--shadow); font-size: 13px;
  display: flex; gap: 10px; align-items: center; min-width: 240px;
  animation: slide-in var(--t) var(--ease);
}
.toast--success { border-color: rgba(16,185,129,.4); }
.toast--error { border-color: rgba(239,68,68,.4); }
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Skeletons ---------- */
.sk { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%; border-radius: var(--radius-sm); animation: sk 1.4s linear infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Spinner ---------- */
.spin { width: 16px; height: 16px; border: 2px solid var(--border-2); border-top-color: var(--brand-500); border-radius: 999px; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); padding: var(--s-12) var(--s-6); color: var(--fg-3); text-align: center; }
.empty .ic { font-size: 36px; opacity: .6; }

/* ---------- AI shimmer ---------- */
.ai-text {
  background: linear-gradient(90deg, var(--brand-300), var(--accent), var(--accent-2), var(--brand-300));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
  font-weight: 600;
}
@keyframes shimmer { from { background-position: 0 0; } to { background-position: 300% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: var(--s-4); }
}

/* ---------- Utilities ---------- */
.row { display: flex; gap: var(--s-3); align-items: center; }
.col { display: flex; flex-direction: column; gap: var(--s-3); }
.between { justify-content: space-between; }
.center { justify-content: center; align-items: center; }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); } .gap-4 { gap: var(--s-4); } .gap-6 { gap: var(--s-6); }
.mt-2 { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); }
.mb-2 { margin-bottom: var(--s-2); } .mb-4 { margin-bottom: var(--s-4); } .mb-6 { margin-bottom: var(--s-6); }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.scroll { overflow: auto; }
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--fg-4); }

/* ================================================================
   v6.0.4 — Icon system + Tasker AI Triage components
   Replaces emoji with consistent Lucide-style stroke icons.
   ================================================================ */
.ic { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -2px; }
.ic--lg  { width: 20px; height: 20px; }
.ic--xl  { width: 28px; height: 28px; }
.ic--brand { color: var(--brand-500); }
.ic--accent { color: var(--accent); }
.ic--success { color: var(--success); }
.ic--warn { color: var(--warning); }
.ic--danger { color: var(--danger); }

.btn .ic { color: currentColor; }
.btn--block { width: 100%; justify-content: flex-start; padding: 12px 14px; }
.btn--lg { padding: 12px 18px; font-size: 14px; }
.btn--sm { padding: 6px 10px; font-size: 12px; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--bg-2); border-color: var(--border-2); }

.action-tile {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-radius: var(--radius);
  background: var(--bg-1); border: 1px solid var(--border);
  color: var(--fg); cursor: pointer; text-align: left;
  font: inherit; font-weight: 500;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.action-tile:hover { background: var(--bg-2); border-color: var(--border-2); }
.action-tile .action-tile__ic {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--brand-50);
  color: var(--brand-500);
}
.action-tile .action-tile__body { display: flex; flex-direction: column; min-width: 0; }
.action-tile .action-tile__title { font-weight: 600; color: var(--fg); }
.action-tile .action-tile__sub { font-size: 11px; color: var(--fg-3); }

/* Triage queue row — the unique value prop */
.tq {
  display: grid; grid-template-columns: 32px 1fr auto auto;
  gap: var(--s-3); align-items: center;
  padding: var(--s-3) var(--s-4); border-radius: var(--radius);
  background: var(--bg-1); border: 1px solid var(--border);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.tq + .tq { margin-top: 6px; }
.tq:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.tq__pri {
  width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center;
  font-weight: 700; font-size: 12px; letter-spacing: -.01em;
}
.tq__pri--p0 { background: #ffebe6; color: var(--danger);  border: 1px solid #ffbdad; }
.tq__pri--p1 { background: #fff7e6; color: #ff8b00;        border: 1px solid #ffe0b3; }
.tq__pri--p2 { background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100); }
.tq__pri--p3 { background: var(--bg-3); color: var(--fg-3); border: 1px solid var(--border-2); }
.tq__title { font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.tq__meta  { font-size: 11px; color: var(--fg-3); display: flex; gap: var(--s-3); margin-top: 2px; }
.tq__meta .ic { width: 12px; height: 12px; }
.tq__chip {
  font-size: 10px; padding: 2px 8px; border-radius: 3px;
  background: var(--bg-2); color: var(--fg-2); border: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.tq__chip--ai     { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }
.tq__chip--risk   { background: #ffebe6; color: var(--danger);   border-color: #ffbdad; }
.tq__chip--quick  { background: #e3fcef; color: var(--success);  border-color: #abf5d1; }

.empty {
  text-align: center; padding: var(--s-10) var(--s-5); color: var(--fg-3);
  border: 1px dashed var(--border-2); border-radius: var(--radius-lg);
}
.empty .ic { width: 32px; height: 32px; opacity: .5; margin-bottom: var(--s-3); }

/* Brand mark — replaces emoji-feeling logo */
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--accent) 100%);
  position: relative; box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.brand-mark::before {
  content: 'T'; position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.02em;
}
.brand-mark--lg { width: 40px; height: 40px; border-radius: var(--radius-lg); }
.brand-mark--lg::before { font-size: 20px; }

.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }