@font-face {
  font-family: "Outfit";
  src: url("/assets/fonts/outfit-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --accent: #ff6b57;
  --accent-hover: #ef5d49;
  --accent-soft: rgba(255, 107, 87, .11);
  --bg: #f2f2f4;
  --surface: rgba(255, 255, 255, .76);
  --surface-solid: #fff;
  --surface-raised: rgba(255, 255, 255, .94);
  --subtle: rgba(32, 32, 38, .045);
  --border: rgba(24, 24, 28, .09);
  --border-strong: rgba(24, 24, 28, .15);
  --text: #1c1c1e;
  --secondary: #73737c;
  --tertiary: #a3a3aa;
  --danger: #d84843;
  --shadow-sm: 0 1px 2px rgba(20, 20, 24, .035), 0 8px 28px rgba(20, 20, 24, .045);
  --shadow-lg: 0 24px 70px rgba(20, 20, 25, .14);
  --radius-md: 16px;
  color-scheme: light;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

.dark {
  --bg: #111113;
  --surface: rgba(31, 31, 34, .78);
  --surface-solid: #202023;
  --surface-raised: rgba(40, 40, 44, .94);
  --subtle: rgba(255, 255, 255, .055);
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #f5f5f7;
  --secondary: #a6a6af;
  --tertiary: #72727b;
  --shadow-sm: 0 12px 32px rgba(0, 0, 0, .18);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .42);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 18% -5%, rgba(255, 107, 87, .09), transparent 29rem), var(--bg);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, a { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: not-allowed; opacity: .55; transform: none !important; }
[x-cloak] { display: none !important; }
::selection { color: var(--text); background: rgba(255, 107, 87, .22); }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.icon-sm { width: 15px; height: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mobile-only { display: none !important; }

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 28px 18px 20px;
  border-right: 1px solid var(--border);
  background: rgba(248, 248, 250, .68);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}
.dark .sidebar { background: rgba(20, 20, 22, .7); }
.workspace { display: flex; min-width: 0; min-height: 100vh; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 680; letter-spacing: -.025em; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 7px 12px rgba(255, 107, 87, .16)); }
.brand-word { transform: translateY(-1px); }
.nav { display: grid; gap: 3px; margin-top: 34px; }
.nav a { display: flex; min-height: 42px; align-items: center; gap: 11px; padding: 0 12px; border-radius: 12px; color: var(--secondary); font-size: 14px; font-weight: 520; transition: color .16s ease, background .16s ease; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--subtle); }
.nav a.active { font-weight: 620; }
.spacer { flex: 1; }
.user-row { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 16px 8px 0; border-top: 1px solid var(--border); }
.user-name { min-width: 0; overflow: hidden; color: var(--secondary); text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; width: 32px; height: 32px; place-items: center; flex: none; border: 1px solid rgba(255, 107, 87, .16); border-radius: 50%; color: #bf4c3c; background: var(--accent-soft); font-size: 11px; font-weight: 700; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 10px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.topbar-title { max-width: 280px; overflow: hidden; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.content { width: 100%; max-width: 1380px; margin: 0 auto; padding: 42px 42px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 4px 0 0; font-size: clamp(28px, 3vw, 38px); font-weight: 650; line-height: 1.08; letter-spacing: -.045em; }
.page-head p { margin: 9px 0 0; color: var(--secondary); }
.section-head { margin: 46px 0 14px; }
.section-head h2 { margin: 4px 0 0; font-size: 21px; font-weight: 620; letter-spacing: -.025em; }
.eyebrow { color: var(--secondary); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--secondary); }
.small { font-size: 12px; }

.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 11px; color: var(--text); background: var(--surface-raised); box-shadow: 0 1px 2px rgba(20, 20, 24, .025); font-size: 13px; font-weight: 600; transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.button:hover { background: var(--surface-solid); box-shadow: 0 5px 15px rgba(20, 20, 24, .07); transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(.985); }
.button.primary { color: #fff; border-color: transparent; background: var(--accent); box-shadow: 0 7px 18px rgba(230, 83, 64, .2); }
.button.primary:hover { background: var(--accent-hover); box-shadow: 0 9px 24px rgba(230, 83, 64, .26); }
.button.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.button.ghost:hover { background: var(--subtle); box-shadow: none; }
.button.danger { color: var(--danger); }
.button.full { width: 100%; }
.icon-button { display: inline-grid; width: 38px; height: 38px; padding: 0; place-items: center; flex: none; border: 1px solid var(--border); border-radius: 11px; color: var(--secondary); background: var(--surface); transition: color .16s ease, background .16s ease, transform .16s ease; }
.icon-button:hover { color: var(--text); background: var(--surface-solid); }
.icon-button:active { transform: scale(.96); }

.field { display: grid; gap: 7px; }
.field label, .field-label { color: var(--secondary); font-size: 12px; font-weight: 600; }
input, textarea, select { width: 100%; min-height: 42px; padding: 9px 12px; outline: none; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface-solid); transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
input::placeholder, textarea::placeholder { color: var(--tertiary); }
input:focus, textarea:focus, select:focus { border-color: rgba(255, 107, 87, .62); box-shadow: 0 0 0 4px rgba(255, 107, 87, .11); }
textarea { min-height: 118px; resize: vertical; }
.select-compact { width: auto; min-width: 66px; min-height: 38px; padding: 7px 28px 7px 10px; font-size: 12px; }
.workspace-select { width: min(220px, 28vw); font-weight: 580; }
.search { position: relative; width: min(390px, 32vw); margin-left: 5px; }
.search .icon { position: absolute; top: 50%; left: 12px; color: var(--tertiary); pointer-events: none; transform: translateY(-50%); }
.search input { padding-left: 38px; border-color: transparent; background: var(--subtle); }
.search input:focus { border-color: var(--border-strong); background: var(--surface-solid); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.board-tile { position: relative; min-height: 158px; overflow: hidden; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.board-tile::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--board-color, var(--accent)); content: ""; }
.board-tile:hover { border-color: var(--border-strong); background: var(--surface-raised); box-shadow: 0 14px 34px rgba(20, 20, 24, .08); transform: translateY(-2px); }
.board-tile h3 { margin: 18px 0 6px; font-size: 17px; font-weight: 630; letter-spacing: -.02em; }
.board-tile p { margin-bottom: 0; }
.activity-list { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.activity-item { display: flex; min-height: 58px; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
a.activity-item:hover { background: var(--subtle); }
.activity-copy { min-width: 0; }
.empty-state { display: grid; min-height: 320px; place-items: center; align-content: center; padding: 54px 20px; text-align: center; }
.empty-state.compact { min-height: 180px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.empty-state h1, .empty-state h2 { margin: 10px 0 7px; font-size: 25px; font-weight: 630; letter-spacing: -.035em; }
.empty-state p { max-width: 420px; margin: 0 0 18px; color: var(--secondary); }
.loading-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.skeleton { height: 158px; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--subtle), var(--surface), var(--subtle)); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

.kanban-content { display: flex; min-height: 0; flex: 1; flex-direction: column; padding: 24px 28px 30px; }
.board-toolbar { display: flex; align-items: center; gap: 10px; padding: 0 0 20px; }
.board-toolbar h1 { max-width: 420px; margin: 0 12px 0 0; overflow: hidden; font-size: 25px; font-weight: 650; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.board-filters { display: flex; gap: 7px; margin-left: auto; }
.board-filters select, .board-filters input { min-width: 126px; min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 12px; }
.kanban { display: flex; min-height: 0; flex: 1; align-items: flex-start; gap: 13px; overflow: auto; padding: 1px 1px 18px; scrollbar-color: var(--border-strong) transparent; }
.column { display: flex; width: 294px; min-width: 294px; max-height: 100%; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--subtle); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; font-size: 13px; font-weight: 620; }
.count { padding: 1px 7px; border: 1px solid var(--border); border-radius: 99px; color: var(--secondary); background: var(--surface); font-size: 10px; }
.card-list { display: grid; min-height: 55px; gap: 8px; overflow: auto; padding: 3px 8px 8px; }
.task-card { padding: 13px; border: 1px solid var(--border); border-radius: 13px; outline: 0; background: var(--surface-solid); box-shadow: 0 1px 2px rgba(20, 20, 24, .035); cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.task-card:hover, .task-card:focus-visible { border-color: rgba(255, 107, 87, .34); box-shadow: 0 8px 20px rgba(20, 20, 24, .065); transform: translateY(-1px); }
.task-card[draggable="true"] { cursor: grab; }
.task-card.dragging { opacity: .35; transform: scale(.98); }
.task-card h4 { margin: 8px 0 11px; font-size: 13px; font-weight: 580; line-height: 1.4; }
.label-row { display: flex; flex-wrap: wrap; gap: 4px; }
.label-dot { width: 30px; height: 5px; border-radius: 99px; }
.card-meta { display: flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 10px; }
.priority { font-size: 9px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.priority.urgent { color: #d83e43; }.priority.high { color: #ca6b25; }.priority.medium { color: #665fc7; }.priority.low { color: #248565; }
.avatar-stack { display: flex; margin-left: auto; }
.avatar-stack .avatar { width: 24px; height: 24px; margin-left: -6px; border: 2px solid var(--surface-solid); font-size: 8px; }
.add-card { margin: 0 8px 8px; padding: 8px 9px; border: 0; border-radius: 9px; color: var(--secondary); background: transparent; text-align: left; font-size: 12px; }
.add-card:hover { color: var(--text); background: var(--surface); }
.new-column { width: 294px; min-width: 294px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: transparent; }

.modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(18, 18, 22, .32); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.modal-card { width: min(760px, 100%); max-height: 92vh; overflow: auto; padding: 24px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 22px; background: var(--surface-raised); box-shadow: var(--shadow-lg); }
.modal-card.narrow { width: min(430px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h2 { margin: 3px 0 0; font-size: 23px; font-weight: 640; letter-spacing: -.03em; }
.modal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 24px; }
.form-stack { display: grid; gap: 15px; }
.invite-form { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.choice { min-height: 32px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface-solid); font-size: 11px; }
.choice.active { border-color: rgba(255, 107, 87, .55); background: var(--accent-soft); }
.comments { display: grid; gap: 9px; }
.comment { padding: 11px; border-radius: 11px; background: var(--subtle); font-size: 13px; }
.card-title-input { min-height: 38px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
.card-title-input:focus { box-shadow: none; }
.security-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-card { min-height: 250px; }
.settings-card::before { display: none; }
.recovery-codes { display: block; padding: 10px; white-space: pre-wrap; border-radius: 10px; background: var(--subtle); font-size: 12px; }

.auth-page { display: grid; min-height: 100vh; grid-template-columns: minmax(320px, 500px) 1fr; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px; background: color-mix(in srgb, var(--bg) 72%, transparent); }
.auth-card { width: min(390px, 100%); }
.auth-card .brand { margin-bottom: 58px; }
.auth-card h1 { margin: 0 0 8px; font-size: 34px; font-weight: 650; line-height: 1.08; letter-spacing: -.045em; }
.auth-card form { display: grid; gap: 14px; margin-top: 28px; }
.auth-card .button { min-height: 43px; }
.auth-aside { position: relative; display: flex; min-height: 100vh; align-items: flex-end; overflow: hidden; padding: 56px; border-left: 1px solid var(--border); background: #242427; }
.auth-aside::before { position: absolute; width: 32rem; height: 32rem; top: -13rem; right: -10rem; border-radius: 50%; background: rgba(255, 107, 87, .84); filter: blur(2px); content: ""; }
.auth-aside::after { position: absolute; width: 24rem; height: 24rem; right: 15%; bottom: -14rem; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; background: rgba(255,255,255,.035); backdrop-filter: blur(16px); content: ""; }
.auth-aside-copy { position: relative; z-index: 1; max-width: 520px; color: white; }
.auth-aside-copy h2 { margin: 0 0 12px; font-size: clamp(34px, 4vw, 58px); font-weight: 560; line-height: .98; letter-spacing: -.052em; }
.auth-aside-copy p { max-width: 420px; margin: 0; color: rgba(255,255,255,.62); font-size: 16px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--tertiary); font-size: 11px; }
.divider::before, .divider::after { height: 1px; flex: 1; background: var(--border); content: ""; }
.auth-footer { margin-top: 22px; color: var(--secondary); text-align: center; font-size: 13px; }
.auth-footer a, .text-link { color: var(--accent-hover); font-weight: 600; }
.auth-actions { display: grid; gap: 8px; }
.form-error { margin: 0; color: var(--danger); font-size: 13px; }

.toast-wrap { position: fixed; z-index: 140; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 230px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow-lg); font-size: 13px; }
.toast.error { border-color: rgba(216, 72, 67, .35); }

@media (max-width: 980px) {
  .topbar { padding-right: 20px; padding-left: 20px; }
  .content { padding: 34px 26px 74px; }
  .board-filters { max-width: 55vw; overflow-x: auto; }
  .auth-page { grid-template-columns: minmax(0, 1fr); }
  .auth-panel { min-height: 100vh; padding: 32px 24px; }
  .auth-aside { display: none; }
}

@media (max-width: 760px) {
  .shell { display: block; padding-bottom: 72px; }
  .sidebar { position: fixed; z-index: 90; right: 10px; bottom: 10px; left: 10px; min-height: 0; padding: 7px; border: 1px solid var(--border); border-radius: 17px; background: var(--surface-raised); box-shadow: var(--shadow-lg); }
  .sidebar .brand, .sidebar .spacer, .sidebar .user-row { display: none; }
  .nav { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
  .nav a { justify-content: center; min-height: 48px; gap: 5px; padding: 0 5px; font-size: 11px; }
  .workspace { min-height: calc(100vh - 72px); }
  .topbar { min-height: 64px; padding: 10px 14px; }
  .topbar .search { order: 10; width: 100%; margin: 2px 0 0; }
  .dashboard-topbar { flex-wrap: wrap; }
  .workspace-select { width: 100%; max-width: none; }
  .dashboard-topbar .spacer, .desktop-only { display: none !important; }
  .mobile-only { display: inline-grid !important; }
  .content { padding: 28px 16px 50px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head .button.primary { width: 100%; }
  .grid, .loading-grid, .security-grid { grid-template-columns: 1fr; }
  .kanban-content { padding: 18px 12px 22px; }
  .board-toolbar { align-items: flex-start; flex-direction: column; }
  .board-filters { width: 100%; max-width: none; margin-left: 0; overflow-x: auto; }
  .column, .new-column { width: 82vw; min-width: 82vw; }
  .modal { padding: 10px; }
  .modal-card { max-height: 95vh; padding: 18px; border-radius: 18px; }
  .modal-grid { grid-template-columns: 1fr; }
  .invite-form { grid-template-columns: 1fr; }
  .member-row { align-items: flex-start; flex-wrap: wrap; }
  .member-row select { width: calc(100% - 48px) !important; margin-left: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
