/* ============================================================
   Tasklane — application stylesheet
   "Compact and focused" theme. Dark theme by default for new
   visitors (opt out any time via the theme toggle) via
   <html data-theme="dark">; light theme via data-theme="light".
   ============================================================ */

:root {
  --bg: #f5f6f9;
  --panel: #ffffff;
  --panel-2: #eff0f5;
  --border: #e2e4ec;
  --text: #1a1d29;
  --muted: #7d8296;
  --accent: #5b6ee1;
  --accent-hover: #4a5cd0;
  --accent-soft: #eef0fd;
  --danger: #e0524f;
  --danger-soft: #fdeeee;
  --ok: #3f9d67;
  --ok-soft: #e9f7ef;
  --warn: #dd8a3d;
  --warn-soft: #fbf1e4;
  --radius: 9px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px rgba(16, 24, 40, .04);
  --shadow-pop: 0 4px 10px rgba(16, 24, 40, .08), 0 10px 26px rgba(16, 24, 40, .10);
  --shadow-hover: 0 3px 8px rgba(16, 24, 40, .06), 0 8px 20px rgba(16, 24, 40, .07);
}

[data-theme="dark"] {
  --bg: #0c0d11;
  --panel: #131519;
  --panel-2: #191b21;
  --border: #24262d;
  --text: #e4e5ea;
  --muted: #7c8194;
  --accent: #7285f0;
  --accent-hover: #8595f4;
  --accent-soft: #1c2036;
  --danger: #e5605d;
  --danger-soft: #2e1d1d;
  --ok: #4aa877;
  --ok-soft: #172821;
  --warn: #d68a4a;
  --warn-soft: #2c2013;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-pop: 0 4px 14px rgba(0, 0, 0, .5), 0 12px 28px rgba(0, 0, 0, .4);
  --shadow-hover: 0 3px 10px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -.006em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.012em; }
h1 { font-size: 21px; }
h2 { font-size: 17px; }
p { margin: 0 0 .8em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.link {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--accent); cursor: pointer;
}
.link:hover { text-decoration: underline; }

::selection { background: var(--accent-soft); color: var(--accent); }

/* Slim modern scrollbars (Firefox + WebKit/Blink). Purely cosmetic — falls
   back to the platform default anywhere unsupported. */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

/* ---------- boot splash ---------- */

.boot-splash {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
}
.boot-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  animation: bootpulse 1s ease-in-out infinite;
}
@keyframes bootpulse {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.6); opacity: 1; }
}

/* ---------- forms ---------- */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px; font-weight: 600;
  margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}
.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 7px;
  border-left: 3px solid var(--danger);
  padding: 9px 11px;
  font-size: 13px;
  margin-bottom: 14px;
}
.form-success {
  background: var(--ok-soft);
  color: var(--ok);
  border-radius: 7px;
  border-left: 3px solid var(--ok);
  padding: 9px 11px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 13px;
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .15s, transform .08s;
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--border);
}
.btn:hover { background: var(--border); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 3px 10px rgba(91, 110, 225, .25); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; pointer-events: none; }

/* Uniform icon-button system. Every icon glyph in the app is an inline SVG
   from assets/js/icons.js (never an emoji or HTML entity — those render
   inconsistently across OS/browser and can't be sized/colored reliably), and
   every icon button uses one of these two fixed sizes so nothing looks
   randomly tiny or oversized next to its neighbors. */
.icon-btn, .icon-btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  border-radius: 7px;
  border: none; background: transparent;
  color: var(--muted); cursor: pointer;
  padding: 0;
  transition: background .12s, color .12s;
}
.icon-btn:hover, .icon-btn-sm:hover { background: var(--panel-2); color: var(--text); }
.icon-btn { width: 32px; height: 32px; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn-sm { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn-sm svg { width: 14px; height: 14px; }
.icon-btn-danger:hover, .icon-btn-sm.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- auth pages ---------- */

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
           calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card .auth-sub { margin-bottom: 20px; }
.auth-foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
  text-align: center;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px;
  color: var(--text);
  margin-bottom: 22px;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent); color: #fff;
  flex: none;
}
.brand-mark svg { width: 16px; height: 16px; }

/* ---------- app shell ---------- */

:root { --topbar-h: 48px; }

.app-layout { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 8px;
  min-height: var(--topbar-h);
  padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { margin: 0; font-size: 14px; }
.spacer { flex: 1; }

.main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.empty-state { text-align: center; padding: 48px 24px; }

/* ---------- avatar & user menu ---------- */

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
  border: none; cursor: pointer;
  flex: none;
}
.user-menu { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-pop);
  padding: 5px;
  z-index: 50;
  animation: menuIn .12s cubic-bezier(.2,.8,.2,1);
  transform-origin: top right;
}
.menu-left { transform-origin: top left; }
@keyframes menuIn {
  from { opacity: 0; transform: scale(.97) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.menu-head {
  display: flex; flex-direction: column;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}
.menu-head .muted { font-size: 12px; }
.menu-item {
  display: block; width: 100%; text-align: left;
  font: inherit; font-size: 13px;
  padding: 7px 10px;
  border: none; border-radius: 6px;
  background: none; color: var(--text);
  cursor: pointer;
  transition: background .1s;
}
.menu-item:hover { background: var(--panel-2); }
.menu-item.danger { color: var(--danger); }

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 100;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  padding: 10px 14px;
  font-size: 13px;
  animation: toastin .18s ease-out;
}
.toast-error { border-color: var(--danger); }
.toast-success { border-color: var(--ok); }
@keyframes toastin {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- org switcher & top nav ---------- */

a.brand { text-decoration: none; color: var(--text); }

.org-switcher { position: relative; margin-left: 4px; }
.switcher-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  cursor: pointer;
  max-width: 200px;
  transition: border-color .12s, background .12s;
}
.switcher-btn:hover { border-color: var(--accent); background: var(--panel); }
.chev { color: var(--muted); font-size: 10px; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 3px; }
.switcher-item { display: flex; justify-content: space-between; gap: 12px; }
.switcher-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-check { color: var(--accent); font-weight: 700; }

.topnav { display: flex; gap: 3px; margin-left: 8px; }
.topnav a {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.topnav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topnav a.active { color: var(--accent); background: var(--accent-soft); }

/* ---------- page & settings layout ---------- */

.page-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.page-title { margin: 0; font-weight: 700; }
.proj-title-input {
  font: inherit; font-size: 20px; font-weight: 700;
  color: var(--text); background: var(--panel-2);
  border: 1px solid var(--accent); border-radius: 7px;
  padding: 2px 7px; margin: -2px 0;
  outline: none; min-width: 120px; max-width: 420px;
}
.badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
  text-transform: capitalize;
}

.badge-ok { color: var(--ok); background: var(--ok-soft); }
.badge-warn { color: var(--warn); background: var(--warn-soft); }
.badge-admin { color: var(--danger); background: var(--danger-soft); text-transform: none; }
.badge-you { color: var(--muted); background: var(--accent-soft); text-transform: none; }

/* ---------- admin: user administration ---------- */
.admin-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.admin-head .page-title { flex: 1; min-width: 160px; }
.admin-search {
  width: 260px; max-width: 100%;
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel); color: var(--text);
}
.admin-intro { margin: 0 0 16px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user-text { min-width: 0; }
.admin-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-email { font-size: 12px; }
.admin-date { white-space: nowrap; }
.admin-th-actions { width: 1%; }
.admin-actions { white-space: nowrap; text-align: right; }
.admin-actions .btn { margin-left: 6px; }
.admin-empty { text-align: center; padding: 24px; }

.section { margin-bottom: 16px; }
.section h3 { margin-bottom: 12px; }
.narrow-card { max-width: 460px; margin: 36px auto; }

.row-list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.row:first-child { border-top: none; }
.row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-main .muted { font-size: 12px; }

.form-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.form-inline input[type="text"],
.form-inline input[type="email"] {
  flex: 1; min-width: 180px;
  padding: 7px 10px;
  font: inherit; color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.form-inline input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.role-select {
  font: inherit; font-size: 13px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 9px;
  outline: none;
  transition: border-color .12s;
}
.role-select:focus { border-color: var(--accent); }

.btn-small { padding: 6px 10px; font-size: 12px; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.danger-zone h3 { color: var(--danger); }

.check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check-label input { width: 15px; height: 15px; accent-color: var(--accent); }

/* ---------- avatars ---------- */

.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-static { cursor: default; }
.avatar-lg { width: 50px; height: 50px; font-size: 17px; }

/* ---------- sidebar layout ---------- */

.app-body { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: 210px; flex: none;
  background: var(--panel-2);
  border-right: 1px solid var(--border);
  padding: 10px 8px;
  overflow-y: auto;
}
.side-nav { display: flex; flex-direction: column; gap: 1px; margin-bottom: 14px; }
.side-nav a, .side-proj {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .12s, color .12s, box-shadow .12s;
}
.side-nav a:hover, .side-proj:hover { background: var(--panel); text-decoration: none; }
.side-nav a.active, .side-proj.active {
  background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted);
  padding: 0 8px 5px;
}
.side-add {
  border: none; background: none; color: var(--muted);
  font-size: 16px; line-height: 1; cursor: pointer;
  border-radius: 5px; padding: 2px 6px;
}
.side-add:hover { background: var(--panel); color: var(--text); }
.side-proj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-empty { font-size: 12px; padding: 0 8px; }

.side-proj-grip {
  display: inline-flex; flex: none; color: var(--muted);
  opacity: 0; cursor: grab; margin-left: -4px;
  transition: opacity .12s;
}
.side-proj-grip svg { width: 13px; height: 13px; }
.side-proj:hover .side-proj-grip { opacity: 1; }
.side-proj.dragging { opacity: .4; }
.side-proj.drag-over { box-shadow: inset 0 2px 0 var(--accent); background: var(--panel); }
.hamburger { display: none; }
.sidebar-backdrop { display: none; }

.proj-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.proj-dot-lg { width: 14px; height: 14px; border-radius: 4px; }

/* ---------- home project grid ---------- */

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.proj-card {
  display: flex; flex-direction: column; gap: 5px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px;
  color: var(--text);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.proj-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); text-decoration: none; }
.proj-card-bar { height: 4px; border-radius: 3px; width: 36px; margin-bottom: 3px; }
.proj-card-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.proj-card .muted { font-size: 12px; }
.proj-card-new { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); }
.proj-card-plus { font-size: 24px; line-height: 1; }
.status-chip {
  align-self: flex-start;
  font-size: 11px; font-weight: 600;
  border-radius: 5px;
  padding: 2px 7px;
  text-transform: capitalize;
}
.status-on_track { background: var(--ok-soft); color: var(--ok); }
.status-at_risk { background: var(--warn-soft); color: var(--warn); }
.status-off_track { background: var(--danger-soft); color: var(--danger); }
.status-archived { background: var(--panel-2); color: var(--muted); }

/* ---------- project page & task list ---------- */

.proj-head { flex-wrap: wrap; }
.proj-desc { max-width: 700px; margin-top: -6px; }
.proj-desc p { margin: 0 0 .4em; }
.status-select { font-weight: 600; }
.member-stack { display: flex; }
.member-stack .avatar { margin-left: -6px; border: 2px solid var(--bg); }
.member-stack .avatar:first-child { margin-left: 0; }
.avatar-sm { width: 23px; height: 23px; font-size: 10px; }

.list-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

.section-block { margin-bottom: 18px; }
.section-head {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 2px 5px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1px;
}
.section-head h3 { margin: 0; font-size: 13px; font-weight: 700; }
.section-head h3.group-overdue { color: var(--danger); }
.section-head h3.group-today { color: var(--accent); }

.task-row {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.task-row:hover { background: var(--panel-2); }
.task-row.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-row.dragging { opacity: .4; }
.task-row.drag-over { box-shadow: inset 0 2px 0 var(--accent); }
.row-grip {
  display: inline-flex; flex: none; color: var(--muted);
  opacity: 0; cursor: grab; transition: opacity .12s;
}
.row-grip svg { width: 13px; height: 13px; }
.task-row:hover .row-grip { opacity: 1; }
.section-end-drop { height: 6px; margin: -3px 0; border-radius: 3px; }
.section-end-drop.drag-over { background: var(--accent); }
.task-check {
  width: 19px; height: 19px; flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: transparent;
  color: transparent;
  font-size: 11px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.task-check:hover { border-color: var(--ok); color: var(--ok); }
.task-check.checked { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-title {
  flex: 1; min-width: 0;
  text-align: left;
  font: inherit; font-size: 13px;
  background: none; border: none; padding: 0;
  color: var(--text);
  cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-title:hover { text-decoration: underline; }

.chip {
  flex: none;
  font-size: 11px; font-weight: 600;
  border-radius: 5px;
  padding: 2px 7px;
  background: var(--panel-2);
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prio-high { background: var(--danger-soft); color: var(--danger); }
.prio-medium { background: var(--warn-soft); color: var(--warn); }
.prio-low { background: var(--accent-soft); color: var(--accent); }
.due-chip.due-overdue { background: var(--danger-soft); color: var(--danger); }
.due-chip.due-today { background: var(--accent-soft); color: var(--accent); }
.proj-chip .proj-dot { width: 7px; height: 7px; }

.task-add input {
  width: 100%;
  font: inherit; font-size: 13px;
  padding: 7px 2px;
  background: none;
  border: none; outline: none;
  color: var(--text);
}
.task-add input::placeholder { color: var(--muted); }

.color-row { display: flex; gap: 7px; flex-wrap: wrap; }
.color-swatch {
  width: 27px; height: 27px;
  border-radius: 7px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s;
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch.selected { border-color: var(--text); }
.color-swatch-sm { width: 20px; height: 20px; border-radius: 6px; }

/* ---------- task drawer ---------- */

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 11, 15, .4);
  z-index: 60;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  z-index: 61;
  padding: calc(14px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right))
           calc(14px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.drawer-top { display: flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.btn-complete { background: var(--ok); border-color: var(--ok); color: #fff; }
.drawer-title {
  font: inherit; font-size: 18px; font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  background: none;
  border: 1px solid transparent; border-radius: 7px;
  padding: 5px 7px; margin: 0 -7px 12px;
  outline: none;
  transition: background .1s, border-color .1s;
}
.drawer-title:hover, .drawer-title:focus { border-color: var(--border); background: var(--panel-2); }
.drawer-grid {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 14px;
}
.drawer-grid label { font-size: 12px; font-weight: 600; color: var(--muted); }
.drawer-grid select, .drawer-grid input {
  font: inherit; font-size: 13px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 9px;
  outline: none;
  width: 100%;
  transition: border-color .12s;
}
.drawer-grid select:focus, .drawer-grid input:focus { border-color: var(--accent); }
.drawer-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.drawer-section-desc { margin-top: 5px; }
.drawer-desc {
  display: block; width: 100%;
  font: inherit; font-size: 13px; line-height: 1.5;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 12px;
  min-height: 100px;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color .12s, box-shadow .12s;
}
.drawer-desc::placeholder { color: var(--muted); }
.drawer-desc:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.drawer-meta { font-size: 11px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 11px;
  outline: none;
  resize: vertical;
  transition: border-color .12s, box-shadow .12s;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- notification bell ---------- */

.notif { position: relative; }
.notif-btn svg { width: 18px; height: 18px; }
.notif-badge {
  position: absolute; top: 0; right: 0;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 15px;
  text-align: center; border-radius: 8px;
  pointer-events: none;
}
.notif-menu {
  width: 320px; max-width: calc(100vw - 24px);
  max-height: 420px; overflow-y: auto;
  padding: 0;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel);
}
.notif-item {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  text-align: left; font: inherit;
  background: none; border: none; border-bottom: 1px solid var(--border);
  padding: 9px 12px; cursor: pointer; color: var(--text);
  transition: background .1s;
}
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item.unread:hover { background: var(--accent-soft); filter: brightness(0.98); }
.notif-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; margin-top: 6px; flex: none; }
.notif-dot.on { background: var(--accent); }
.notif-text { flex: 1; font-size: 12px; line-height: 1.4; }
.notif-task { color: var(--muted); }
.notif-time { font-size: 10px; flex: none; }
.notif-empty { padding: 20px 12px; text-align: center; font-size: 12px; }

/* ---------- global search ---------- */

.search-box { position: relative; }
.search-box input {
  width: 190px;
  font: inherit; font-size: 13px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  outline: none;
  transition: border-color .12s, box-shadow .12s, width .15s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); width: 240px; }
.search-menu {
  left: 0; right: auto; width: 300px; max-width: calc(100vw - 24px);
  max-height: 400px; overflow-y: auto; padding: 4px;
}
.search-group {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 7px 9px 3px;
}
.search-item {
  display: flex; align-items: center; gap: 7px; width: 100%;
  text-align: left; font: inherit; font-size: 13px;
  background: none; border: none; border-radius: 6px;
  padding: 7px 9px; cursor: pointer; color: var(--text);
  transition: background .1s;
}
.search-item:hover { background: var(--panel-2); }
.search-item.done .search-task-title { color: var(--muted); text-decoration: line-through; }
.search-task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 14px 12px; text-align: center; font-size: 12px; }

/* ---------- filter bar ---------- */

.filter-bar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar .role-select { font-size: 12px; padding: 5px 7px; }

/* ---------- view tabs ---------- */

.view-tabs {
  display: flex; align-items: center; gap: 3px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.view-tabs button {
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  padding: 7px 12px; margin-bottom: -1px;
  cursor: pointer;
  transition: color .12s;
}
.view-tabs button:hover { color: var(--text); }
.view-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.view-tabs .spacer { flex: 1; }

/* ---------- tags ---------- */

.tag-pill {
  flex: none;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.tag-x {
  border: none; background: none; cursor: pointer;
  color: inherit; opacity: .6;
  font-size: 13px; line-height: 1; padding: 0;
}
.tag-x:hover { opacity: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tag-adder, .dep-adder { position: relative; }
.tag-add-btn {
  font: inherit; font-size: 11px; font-weight: 600;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.tag-add-btn:hover { color: var(--text); border-color: var(--accent); }
.tag-menu, .dep-menu {
  left: 0; right: auto;
  max-height: 220px; overflow-y: auto;
  min-width: 170px;
}

/* ---------- custom fields ---------- */

.cf-grid { display: grid; grid-template-columns: 100px 1fr; gap: 8px 10px; align-items: center; }
.cf-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.cf-grid input[type="text"], .cf-grid input[type="number"], .cf-grid input[type="date"], .cf-grid select {
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 9px; outline: none; width: 100%;
  transition: border-color .12s;
}
.cf-grid input:focus, .cf-grid select:focus { border-color: var(--accent); }
.cf-check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ---------- status editor modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(10, 11, 15, .45);
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  padding: 18px; width: 100%; max-width: 360px;
  animation: menuIn .14s cubic-bezier(.2,.8,.2,1);
}
.modal h3 { margin: 0 0 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- share project modal ---------- */
.share-add { display: flex; gap: 8px; margin: 12px 0 6px; }
.share-add input { flex: 1; min-width: 0; }
.share-list { margin-top: 6px; max-height: 260px; overflow-y: auto; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.share-row:first-child { border-top: 0; }
.share-who { flex: 1; min-width: 0; }
.share-who > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-sub { font-size: 12px; }
.share-role { font-size: 12px; text-transform: capitalize; }

/* ---------- kanban board ---------- */

.board-col-bar { height: 3px; border-radius: 3px 3px 0 0; margin: -8px -8px 6px; }
.col-done { color: var(--ok); font-weight: 700; }

.board {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: flex-start;
}
.board-col {
  flex: 0 0 246px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  transition: background .12s, outline-color .12s;
  outline: 2px solid transparent;
}
.board-col.drag-over { outline-color: var(--accent); background: var(--accent-soft); }
.board-col-head {
  display: flex; align-items: center; gap: 7px;
  padding: 2px 3px 8px;
}
.board-col-head h3 { margin: 0; font-size: 13px; font-weight: 700; }
.board-col-body { display: flex; flex-direction: column; gap: 6px; min-height: 12px; }
.board-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.board-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.board-card.done .board-card-title { color: var(--muted); text-decoration: line-through; }
.board-card-top { display: flex; align-items: flex-start; gap: 7px; }
.board-card-title { font-size: 13px; flex: 1; }
.board-card-tags { display: flex; flex-wrap: wrap; gap: 3px; margin: 7px 0 0 27px; }
.board-card-foot { display: flex; align-items: center; gap: 5px; margin: 7px 0 0 27px; flex-wrap: wrap; }
.board-card-foot .spacer { flex: 1; }
.board-add { margin-top: 6px; }
.board-add input {
  background: var(--panel); border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px;
}
.task-check-sm { width: 16px; height: 16px; font-size: 9px; }
.subtask-chip { background: var(--panel-2); color: var(--muted); }

/* ---------- drawer relationships ---------- */

.drawer-section { margin-bottom: 14px; }
.subtask-row, .dep-row {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 0;
}
.subtask-row.done .subtask-title { color: var(--muted); text-decoration: line-through; }
.subtask-title, .dep-title { flex: 1; font-size: 13px; }
.dep-title.done { color: var(--muted); text-decoration: line-through; }
.dep-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); flex: none;
}
.dep-dot.done { background: var(--ok); }
.dep-cand { white-space: normal; }

/* ---------- comments, attachments, activity ---------- */

.drawer-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.task-activity { display: flex; flex-direction: column; }

.af-head { display: flex; align-items: center; justify-content: space-between; }
.af-upload { position: relative; overflow: hidden; }

.attach-row { display: flex; align-items: center; gap: 7px; padding: 5px 0; }
.attach-icon { flex: none; }
.attach-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { font-size: 11px; flex: none; }

.af-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin: 5px 0 10px; }
.af-tabs button {
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--muted); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 5px 9px; cursor: pointer;
  transition: color .12s;
}
.af-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.comment { display: flex; gap: 8px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-bottom: 2px; }
.comment-meta .muted { font-size: 11px; }
.comment-del {
  margin-left: auto; border: none; background: none; color: var(--muted);
  cursor: pointer; font-size: 15px; line-height: 1; opacity: 0;
  transition: opacity .12s, color .12s;
}
.comment:hover .comment-del { opacity: 1; }
.comment-del:hover { color: var(--danger); }
.comment-text { font-size: 13px; }
.comment-text p { margin: 0 0 .4em; }
.comment-text [data-mention], .mention {
  background: var(--accent-soft); color: var(--accent);
  border-radius: 4px; padding: 0 3px; font-weight: 600;
}

.composer { margin-top: 4px; }
.composer-wrap { position: relative; }
.composer textarea { width: 100%; font: inherit; font-size: 13px; resize: vertical; }
.composer-actions { display: flex; justify-content: flex-end; margin-top: 7px; }
.mention-menu {
  position: absolute; left: 7px; bottom: 100%; z-index: 5;
  min-width: 190px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-pop);
  padding: 4px; margin-bottom: 4px;
}
.mention-item {
  display: flex; align-items: center; gap: 7px; width: 100%;
  font: inherit; font-size: 13px; text-align: left;
  background: none; border: none; border-radius: 6px;
  padding: 5px 7px; cursor: pointer; color: var(--text);
}
.mention-item.active, .mention-item:hover { background: var(--panel-2); }

.activity-list { display: flex; flex-direction: column; gap: 9px; }
.activity-item { display: flex; align-items: baseline; gap: 7px; font-size: 12px; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); flex: none; transform: translateY(-1px); }
.activity-text { flex: 1; }
.activity-time { font-size: 11px; flex: none; }

/* ---------- dashboard ---------- */

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 23px; font-weight: 700; letter-spacing: -.01em; }
.stat-num.stat-ok { color: var(--ok); }
.stat-num.stat-danger { color: var(--danger); }
.stat-num.stat-warn { color: var(--warn); }
.stat-lbl { font-size: 12px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.dash-card { padding: 15px; }
.dash-card h3 { margin: 0 0 13px; font-size: 14px; }
.dash-wide { grid-column: 1 / -1; }

.donut-wrap { position: relative; width: 124px; margin: 0 auto; }
.donut { width: 124px; height: 124px; }
.donut-track { fill: none; stroke: var(--panel-2); stroke-width: 11; }
.donut-value { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-pct { font-size: 23px; font-weight: 700; }

.hbar-list, .prio-bars { display: flex; flex-direction: column; gap: 8px; }
.hbar-row, .prio-row { display: flex; align-items: center; gap: 9px; }
.hbar-name, .prio-name { width: 84px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.prio-name { text-transform: capitalize; }
.hbar-track { flex: 1; height: 8px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: 5px; transition: width .4s ease; min-width: 2px; }
.hbar-fill.hbar-muted { background: var(--muted); }
.prio-fill-high { background: var(--danger); }
.prio-fill-medium { background: var(--warn); }
.prio-fill-low { background: var(--ok); }
.prio-fill-none { background: var(--muted); }
.hbar-val { width: 22px; text-align: right; font-size: 12px; font-weight: 600; flex: none; }

.trend { display: flex; align-items: flex-end; gap: 3px; height: 66px; }
.trend-col { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.trend-bar { width: 100%; max-width: 14px; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; transition: height .3s ease; }

/* ---------- time tracking (drawer) ---------- */

.time-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.time-tracked { font-weight: 600; font-size: 13px; }
.time-est { font-size: 12px; }
.btn-timer-on { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.timer-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); display: inline-block; margin-right: 4px; animation: bootpulse 1s ease-in-out infinite; }
.time-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 9px; }
.time-est-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.time-est-input { width: 58px; padding: 5px 7px; font: inherit; font-size: 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.time-log-form { display: flex; align-items: center; gap: 5px; }
.time-note-input { width: 118px; padding: 5px 7px; font: inherit; font-size: 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.time-entries { margin-top: 9px; display: flex; flex-direction: column; gap: 4px; }
.time-entry { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 2px 0; }
.time-entry-dur { font-weight: 600; min-width: 48px; }
.time-entry-who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- email test ---------- */

.email-test { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.test-result { flex-basis: 100%; border-radius: 7px; padding: 9px 11px; font-size: 13px; }
.test-sent { background: var(--ok-soft); color: var(--ok); }
.test-disabled { background: var(--accent-soft); color: var(--accent); }
.test-failed { background: var(--danger-soft); color: var(--danger); }

/* ---------- timeline / gantt ---------- */

.timeline { }
.tl-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.tl-inner { position: relative; min-width: 100%; }

.tl-months { display: flex; border-bottom: 1px solid var(--border); }
.tl-month { font-size: 11px; font-weight: 700; color: var(--muted); padding: 5px 7px; border-right: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.tl-days { display: flex; border-bottom: 1px solid var(--border); }
.tl-day { font-size: 10px; color: var(--muted); text-align: center; padding: 3px 0; flex: none; border-right: 1px solid var(--panel-2); }
.tl-day.weekend { background: var(--panel-2); }
.tl-day.month-start { border-left: 1px solid var(--border); font-weight: 700; color: var(--text); }
.tl-day.today { background: var(--accent); color: #fff; border-radius: 4px; }

.tl-body { position: relative; }
.tl-col { position: absolute; top: 0; bottom: 0; }
.tl-col.weekend { background: var(--panel-2); opacity: .5; }
.tl-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .6; z-index: 3; }
.tl-deps { position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none; }
.tl-dep-path { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: .7; }

.tl-bar {
  position: absolute; height: 23px; z-index: 4;
  display: flex; align-items: center;
  background: var(--accent); color: #fff;
  border-radius: 5px; padding: 0 7px;
  cursor: pointer; box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tl-bar:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.tl-bar.done { opacity: .55; }
.tl-bar.prio-bar-high { background: var(--danger); }
.tl-bar.prio-bar-medium { background: var(--warn); }
.tl-bar.prio-bar-low { background: var(--ok); }
.tl-bar-label { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tl-milestone { position: absolute; z-index: 4; display: flex; align-items: center; gap: 5px; cursor: pointer; height: 14px; }
.tl-diamond { width: 12px; height: 12px; background: var(--accent); transform: rotate(45deg); border-radius: 3px; flex: none; box-shadow: var(--shadow); }
.tl-ms-label { font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--text); }

.tl-undated { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.tl-undated-chip { cursor: pointer; background: var(--panel-2); border: 1px solid var(--border); }
.tl-undated-chip:hover { border-color: var(--accent); }

.btn-milestone { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ---------- calendar ---------- */

.cal-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.cal-month { font-size: 15px; min-width: 140px; text-align: center; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.cal-head { margin-bottom: 5px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 3px 0; }
.cal-grid + .cal-grid { margin-top: 5px; }
.cal-cell {
  min-height: 78px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 5px;
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
}
.cal-cell.out-month { background: var(--panel-2); opacity: .6; }
.cal-cell.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-daynum { font-size: 11px; font-weight: 600; color: var(--muted); }
.cal-task {
  font: inherit; font-size: 11px; text-align: left;
  background: var(--accent-soft); color: var(--accent);
  border: none; border-radius: 4px;
  padding: 2px 5px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-task:hover { filter: brightness(0.95); }
.cal-task.due-overdue { background: var(--danger-soft); color: var(--danger); }
.cal-task.due-today { background: var(--accent); color: #fff; }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .sidebar {
    position: fixed; top: calc(var(--topbar-h) + env(safe-area-inset-top)); bottom: 0; left: 0;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .18s ease-out;
    box-shadow: var(--shadow-pop);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed; inset: calc(var(--topbar-h) + env(safe-area-inset-top)) 0 0 0;
    background: rgba(10, 11, 15, .35);
    z-index: 39;
  }
  .hamburger { display: inline-flex; }
}

@media (max-width: 640px) {
  .auth-card { padding: 22px 18px; }
  .main { padding: 14px 12px; }
  .brand-name { display: none; }
  .switcher-btn { max-width: 120px; }
  .search-box { display: none; }

  /* iOS Safari auto-zooms the whole page when a focused input/select/textarea
     has font-size under 16px, and often doesn't reset cleanly on blur — this
     is what makes the page look "too big" after tapping any field. Every
     component sets its own smaller size, so override with !important here
     rather than duplicate every selector. */
  input, select, textarea { font-size: 16px !important; }
}
