/* =========================================================================
   ProjectFlow Pro — Design System
   Brand: Space Grotesk (display) · Inter (UI) · JetBrains Mono (IDs)
   ========================================================================= */

:root {
  /* Brand */
  --primary:        #5b5bd6;   /* Iris */
  --primary-strong: #4a48c4;
  --primary-soft:   #ecedfb;
  --primary-ring:   rgba(91, 91, 214, .35);

  /* Neutrals — Light */
  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --surface-2: #f1f3f7;
  --surface-3: #e9ecf2;
  --border:    #e4e7ee;
  --border-strong: #d4d9e3;
  --text:      #1a1d27;
  --text-soft: #4b5160;
  --text-muted:#8b92a3;

  /* Status palette */
  --c-backlog:   #8b92a3;
  --c-todo:      #5b8def;
  --c-progress:  #f0a020;
  --c-review:    #a45bd6;
  --c-testing:   #16b1c4;
  --c-done:      #1faf6b;

  /* Priority */
  --p-lowest:  #8b92a3;
  --p-low:     #5b8def;
  --p-medium:  #f0a020;
  --p-high:    #f06a3f;
  --p-highest: #e23b4e;

  /* Semantic */
  --success: #1faf6b;
  --warning: #f0a020;
  --danger:  #e23b4e;
  --info:    #5b8def;

  /* Geometry */
  --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;  --r-xl: 20px;
  --sb-w: 248px;   --sb-w-collapsed: 72px;   --top-h: 60px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --shadow-md: 0 4px 16px rgba(16,24,40,.08), 0 2px 4px rgba(16,24,40,.04);
  --shadow-lg: 0 18px 50px rgba(16,24,40,.18);
  --ring: 0 0 0 3px var(--primary-ring);

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

[data-theme="dark"] {
  --primary:        #8888f2;
  --primary-strong: #9a9af5;
  --primary-soft:   #23233a;
  --primary-ring:   rgba(136,136,242,.30);

  --bg:        #0d0f14;
  --surface:   #15181f;
  --surface-2: #1b1f29;
  --surface-3: #232838;
  --border:    #262b37;
  --border-strong: #333a49;
  --text:      #e8eaf0;
  --text-soft: #b4bac8;
  --text-muted:#7e8597;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 22px rgba(0,0,0,.45);
  --shadow-lg: 0 22px 60px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
h1,h2,h3,h4,h5 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; margin: 0; color: var(--text); }
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
::selection { background: var(--primary-ring); }

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: padding-box; }

/* Mono identifier chips — the signature device */
.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.id-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--primary-strong);
  background: var(--primary-soft);
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

/* ===================== Auth ===================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-aside {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 600px at 18% 12%, rgba(255,255,255,.16), transparent 55%),
    radial-gradient(700px 500px at 90% 90%, rgba(16,182,196,.45), transparent 50%),
    linear-gradient(135deg, #4a48c4, #5b5bd6 45%, #7c5bd6);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-aside .brand-mark { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.auth-aside h1 { color: #fff; font-size: 40px; line-height: 1.1; max-width: 14ch; }
.auth-aside p { color: rgba(255,255,255,.82); max-width: 42ch; font-size: 15px; }
.auth-stats { display: flex; gap: 36px; }
.auth-stats .num { font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.auth-stats .lbl { color: rgba(255,255,255,.72); font-size: 12.5px; }
.auth-glass-card {
  position: absolute; right: -40px; bottom: 90px; width: 320px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-lg);
}
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; margin-bottom: 4px; }
.auth-card .sub { color: var(--text-muted); margin-bottom: 26px; }

/* ===================== Form controls ===================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
.textarea { resize: vertical; min-height: 84px; }
.input-group { position: relative; }
.input-group .toggle-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 4px; display: grid; place-items: center;
}
.hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.err-msg { font-size: 12px; color: var(--danger); margin-top: 5px; min-height: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); }
.checkbox-row input { accent-color: var(--primary); width: 15px; height: 15px; }

/* Password strength */
.pw-meter { height: 5px; border-radius: 4px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--r-md);
  padding: 9px 15px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--ring); outline: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-subtle { background: var(--surface-2); color: var(--text-soft); }
.btn-subtle:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ===================== App shell ===================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sb-w); flex: 0 0 var(--sb-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  transition: width .2s, transform .2s; z-index: 40;
}
.app.collapsed .sidebar { width: var(--sb-w-collapsed); flex-basis: var(--sb-w-collapsed); }
.app.collapsed .sidebar .nav-label, .app.collapsed .ws-switch .ws-meta, .app.collapsed .sb-foot-text { display: none; }
.app.collapsed .nav-item { justify-content: center; }

.sb-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); height: var(--top-h); }
.sb-brand .logo {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  background: linear-gradient(135deg, var(--primary), #7c5bd6);
  display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700;
}
.sb-brand .name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.app.collapsed .sb-brand .name { display: none; }

.ws-switch { margin: 12px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r-md); display: flex; align-items: center; gap: 10px; cursor: pointer; background: var(--surface-2); }
.ws-switch:hover { border-color: var(--border-strong); }
.ws-switch .ws-ava { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: 0 0 28px; }
.ws-switch .ws-meta { overflow: hidden; }
.ws-switch .ws-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-switch .ws-sub { font-size: 11.5px; color: var(--text-muted); }

.nav { padding: 6px 12px; overflow-y: auto; flex: 1; }
.nav-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 14px 10px 6px; }
.app.collapsed .nav-section-label { text-align: center; font-size: 9px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-md);
  color: var(--text-soft); font-weight: 500; font-size: 13.5px; cursor: pointer; margin-bottom: 2px;
  transition: background .12s, color .12s; position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.nav-item.active svg { color: var(--primary-strong); }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--text-muted); }
.nav-item .badge-count { margin-left: auto; background: var(--surface-3); color: var(--text-soft); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; }
.app.collapsed .nav-item .badge-count { display: none; }

.sb-foot { padding: 12px; border-top: 1px solid var(--border); }

/* Main column */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 20px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30;
}
.topbar .menu-btn { display: none; }
.search-box { flex: 1; max-width: 440px; position: relative; }
.search-box input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--r-md); padding: 8px 12px 8px 36px; font-size: 13.5px; outline: none;
}
.search-box input:focus { border-color: var(--primary); box-shadow: var(--ring); background: var(--surface); }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }
.search-box .kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn { width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--text-soft); display: grid; place-items: center; cursor: pointer; position: relative; transition: background .12s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.avatar { border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 600; flex: 0 0 auto; background: var(--primary); font-size: 12px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.md { width: 34px; height: 34px; font-size: 13px; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Page content */
.content { padding: 22px 26px 60px; flex: 1; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .titles h1 { font-size: 23px; }
.page-head .titles p { color: var(--text-muted); margin: 3px 0 0; font-size: 13.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; }

/* Stat widgets */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 17px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 12px; }
.stat .ico svg { width: 19px; height: 19px; }
.stat .val { font-family: var(--font-display); font-size: 27px; font-weight: 600; line-height: 1; }
.stat .lbl { color: var(--text-muted); font-size: 12.5px; margin-top: 5px; }
.stat .delta { font-size: 11.5px; font-weight: 600; margin-top: 8px; display: inline-flex; align-items: center; gap: 3px; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-dash { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

/* Pills & tags */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--surface-3); color: var(--text-soft); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.prio svg { width: 14px; height: 14px; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.tbl tbody tr { transition: background .1s; cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }


/* SVG */
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Toolbar / filters */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.mini-search { position: relative; }
.mini-search input { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 7px 10px 7px 30px; font-size: 13px; color: var(--text); width: 220px; outline: none; }
.mini-search input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.mini-search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-muted); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 2px; }
.seg button { background: transparent; border: 0; color: var(--text-soft); padding: 6px 12px; font-size: 12.5px; font-weight: 600; border-radius: 7px; cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { flex: 0 0 290px; width: 290px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 600; font-size: 13px; }
.kcol-head .cnt { margin-left: auto; color: var(--text-muted); font-size: 12px; background: var(--surface-3); padding: 1px 8px; border-radius: 20px; }
.kcol-head .bar { width: 8px; height: 8px; border-radius: 50%; }
.kcards { padding: 4px 10px 10px; overflow-y: auto; flex: 1; min-height: 60px; }
.kcol.drag-over { outline: 2px dashed var(--primary); outline-offset: -3px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 11px 12px; margin-bottom: 9px; box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow .12s, transform .08s, opacity .12s;
}
.kcard:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.kcard .kc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kcard .kc-title { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 10px; }
.kcard .kc-foot { display: flex; align-items: center; gap: 8px; }
.kcard .kc-foot .spacer { flex: 1; }
.type-ico { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; flex: 0 0 16px; }
.type-ico svg { width: 11px; height: 11px; color: #fff; }
.pts { font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-soft); padding: 1px 6px; border-radius: 5px; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(10,12,18,.5); backdrop-filter: blur(3px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; }
.overlay.open { display: flex; animation: fade .15s ease; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); width: 100%; max-width: 560px; max-height: 90vh; overflow: hidden; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .18s ease; }
.modal.lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* Drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(10,12,18,.5); backdrop-filter: blur(3px); z-index: 110; display: none; }
.drawer-overlay.open { display: block; animation: fade .15s ease; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 560px; max-width: 94vw; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 120; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }

/* Toasts */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; gap: 11px; min-width: 280px; max-width: 360px; animation: slideIn .25s ease; }
.toast.success { border-left-color: var(--success); } .toast.danger { border-left-color: var(--danger); } .toast.warning { border-left-color: var(--warning); }
.toast .t-ico { flex: 0 0 18px; margin-top: 1px; } .toast .t-ico svg { width: 18px; height: 18px; }
.toast .t-title { font-weight: 600; font-size: 13.5px; } .toast .t-msg { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }

/* Dropdown / context */

.dropdown { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); min-width: 200px; padding: 6px; z-index: 150; animation: pop .12s ease; }
.dropdown .dd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--text-soft); cursor: pointer; }
.dropdown .dd-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown .dd-item.danger { color: var(--danger); }
.dropdown .dd-item svg { width: 16px; height: 16px; }
.dropdown .dd-sep { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown .dd-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 6px 10px 3px; font-weight: 600; }

#ddLayer{
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

#ddLayer .dropdown{
    pointer-events: auto;
}

/* Empty state */
.empty { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty .e-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .e-ico svg { width: 26px; height: 26px; color: var(--text-muted); }
.empty h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 38ch; margin: 0 auto 16px; font-size: 13.5px; }

/* Progress */
.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s; }

/* Activity feed */
.feed-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .f-body { font-size: 13px; color: var(--text-soft); }
.feed-item .f-time { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: 11.5px; font-weight: 500; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 300; pointer-events: none;
}

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.cal-dow { background: var(--surface-2); padding: 9px; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.cal-cell { background: var(--surface); min-height: 104px; padding: 7px; position: relative; }
.cal-cell.dim { background: var(--surface-2); }
.cal-cell.today .cal-num { background: var(--primary); color: #fff; }
.cal-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.cal-ev { font-size: 11px; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px; color: #fff; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Gantt */
.gantt-row { display: grid; grid-template-columns: 180px 1fr; gap: 0; align-items: center; border-bottom: 1px solid var(--border); }
.gantt-label { padding: 10px 12px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-track { position: relative; height: 44px; }
.gantt-bar { position: absolute; top: 11px; height: 22px; border-radius: 6px; display: flex; align-items: center; padding: 0 8px; font-size: 11px; color: #fff; font-weight: 600; overflow: hidden; }
.gantt-head { display: grid; grid-template-columns: 180px 1fr; border-bottom: 1px solid var(--border); }
.gantt-months { display: flex; }
.gantt-month { flex: 1; padding: 8px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-align: center; border-left: 1px solid var(--border); }

/* Subtasks */
.subtask { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.subtask input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; }
.subtask.done .st-text { text-decoration: line-through; color: var(--text-muted); }

/* Comments */
.comment { display: flex; gap: 11px; padding: 12px 0; }
.comment .c-body { flex: 1; }
.comment .c-name { font-weight: 600; font-size: 13px; }
.comment .c-time { font-size: 11.5px; color: var(--text-muted); margin-left: 6px; }
.comment .c-text { font-size: 13px; color: var(--text-soft); margin-top: 3px; }
.mention { color: var(--primary-strong); font-weight: 600; background: var(--primary-soft); padding: 0 4px; border-radius: 4px; }

/* Animations */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* Focus visibility */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Responsive */
@media (max-width: 1100px) { .grid-dash { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .sidebar { position: fixed; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: translateX(0); }
  .topbar .menu-btn { display: grid; }
  .search-box .kbd { display: none; }
}
@media (max-width: 560px) {
  .content { padding: 16px 14px 60px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-head .actions { width: 100%; }
  .mini-search input { width: 100%; }
  .modal-foot { flex-wrap: wrap; }
}
.hide { display: none !important; }
.flex { display: flex; } .items-center { align-items: center; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mb-0{margin-bottom:0}.ml-auto{margin-left:auto}.text-muted{color:var(--text-muted)}.text-soft{color:var(--text-soft)}
.fw-600{font-weight:600}.fs-12{font-size:12px}.fs-13{font-size:13px}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
