/* Aross Tasks: boje i fontovi po stilu agencije (Inter Tight + JetBrains Mono, plava #3D7BFF). */

:root {
  --font: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar-w: 256px;
  --green: #10B981; --red: #EF4444; --amber: #F59E0B; --purple: #8B5CF6;
}

:root, html[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F4F0;
  --surface: #FFFFFF;
  --surface-2: #EFEEE9;
  --surface-3: #E6E5DF;
  --border: #E4E3DD;
  --border-strong: #CFCEC7;
  --text: #0A0E1A;
  --text-2: #464D5E;
  --text-3: #8A8F9C;
  --accent: #3D7BFF;
  --accent-hover: #2A5AE0;
  --accent-soft: #E8F0FF;
  --accent-text: #2A5AE0;
  --green-soft: #D1FAE5; --green-text: #047857;
  --red-soft: #FEE2E2; --red-text: #B91C1C;
  --amber-soft: #FEF3C7; --amber-text: #A15C07;
  --purple-soft: #EDE9FE; --purple-text: #6D28D9;
  --gray-soft: #EFEEE9; --gray-text: #5B6170;
  --shadow-sm: 0 1px 2px rgba(10, 14, 26, .05);
  --shadow: 0 1px 2px rgba(10, 14, 26, .04), 0 6px 20px rgba(10, 14, 26, .06);
  --shadow-lg: 0 24px 60px rgba(10, 14, 26, .18), 0 2px 8px rgba(10, 14, 26, .08);
  --overlay: rgba(10, 14, 26, .32);
  --sb-bg: #0E1729;
  --sb-text: #E8ECF5;
  --sb-text-2: #8D97AE;
  --sb-hover: rgba(255, 255, 255, .06);
  --sb-active: rgba(61, 123, 255, .18);
  --sb-border: rgba(255, 255, 255, .08);
  --scroll: rgba(10, 14, 26, .16);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0E1A;
  --surface: #111829;
  --surface-2: #161F33;
  --surface-3: #1D2840;
  --border: #1F2A42;
  --border-strong: #2C3A58;
  --text: #E9EDF6;
  --text-2: #A6AFC3;
  --text-3: #6E7891;
  --accent: #4D88FF;
  --accent-hover: #6B9CFF;
  --accent-soft: rgba(77, 136, 255, .15);
  --accent-text: #8DB2FF;
  --green-soft: rgba(16, 185, 129, .15); --green-text: #34D399;
  --red-soft: rgba(239, 68, 68, .15); --red-text: #F87171;
  --amber-soft: rgba(245, 158, 11, .15); --amber-text: #FBBF24;
  --purple-soft: rgba(139, 92, 246, .18); --purple-text: #B49CFF;
  --gray-soft: rgba(148, 163, 184, .12); --gray-text: #A6AFC3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
  --overlay: rgba(2, 4, 10, .6);
  --sb-bg: #070A13;
  --sb-text: #E9EDF6;
  --sb-text-2: #7C869E;
  --sb-hover: rgba(255, 255, 255, .05);
  --sb-active: rgba(77, 136, 255, .16);
  --sb-border: rgba(255, 255, 255, .06);
  --scroll: rgba(255, 255, 255, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color .2s var(--ease);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Tipografija ---------- */
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.muted { color: var(--text-3); }
.grow { flex: 1; }

/* ---------- Dugmad i polja ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(61, 123, 255, .3); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-danger { color: var(--red-text); }
.btn-danger:hover { background: var(--red-soft); border-color: transparent; }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #DC2626; border-color: #DC2626; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8F9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.form-grid { display: grid; gap: 16px; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.password-wrap .icon-btn { position: absolute; right: 2px; top: 2px; }

/* ---------- Čipovi, avatari ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--gray-soft); color: var(--gray-text);
  white-space: nowrap;
}
.chip.red { background: var(--red-soft); color: var(--red-text); }
.chip.amber { background: var(--amber-soft); color: var(--amber-text); }
.chip.green { background: var(--green-soft); color: var(--green-text); }
.chip.blue { background: var(--accent-soft); color: var(--accent-text); }
.chip.purple { background: var(--purple-soft); color: var(--purple-text); }
.chip.ghost { background: transparent; padding: 0; color: var(--text-3); }
.chip.ghost.red { color: var(--red-text); }
.chip.ghost.amber { color: var(--amber-text); }

.avatar {
  --size: 28px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c, var(--accent));
  color: #fff;
  font-size: calc(var(--size) * .38);
  font-weight: 700;
  letter-spacing: .02em;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--surface);
  user-select: none;
}
.avatar.has-img { background: var(--surface-3); overflow: hidden; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .spinner { width: 40%; height: 40%; }
.avatar.empty { background: transparent; border: 1.5px dashed var(--border-strong); box-shadow: none; color: var(--text-3); }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -7px; }
.avatars .more { background: var(--surface-3); color: var(--text-2); }

.pdot { width: 8px; height: 8px; border-radius: 3px; background: var(--c, var(--accent)); flex-shrink: 0; display: inline-block; }
.pbadge {
  --size: 36px;
  width: var(--size); height: var(--size);
  border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
  font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}
.pbadge.lg { --size: 48px; border-radius: 14px; font-size: 20px; }

/* ---------- Učitavanje ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 10px;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Prijava ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand {
  position: relative; overflow: hidden;
  background: #0A0E1A;
  color: #fff;
  padding: 44px 52px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-brand::before {
  content: ''; position: absolute; inset: auto -20% -40% auto; width: 80%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(61, 123, 255, .35), transparent);
  pointer-events: none;
}
.auth-brand::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .logo { height: 40px; width: auto; align-self: flex-start; object-fit: contain; }
.auth-brand h1 { font-size: clamp(40px, 4.6vw, 64px); line-height: 1.02; letter-spacing: -.045em; }
.auth-brand h1 span { color: #6E9BFF; }
.auth-brand .mono { color: rgba(255, 255, 255, .5); }
.auth-brand .lead { color: rgba(255, 255, 255, .66); font-size: 16px; max-width: 420px; margin-top: 18px; }
.auth-main { display: flex; flex-direction: column; padding: 28px; }
.auth-main .top { display: flex; justify-content: flex-end; }
.auth-form { width: 100%; max-width: 380px; margin: auto; display: grid; gap: 18px; }
.auth-form h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.auth-form p { margin: 6px 0 0; color: var(--text-2); }
.auth-form .btn { height: 44px; }
.auth-form .input { height: 44px; }
.form-error {
  display: none; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--red-soft); color: var(--red-text); font-weight: 500;
}
.form-error.show { display: flex; }
.auth-mobile-logo { display: none; height: 30px; width: auto; }

/* ---------- Okvir aplikacije ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--sb-bg); color: var(--sb-text);
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  overflow-y: auto;
  z-index: 40;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.sidebar .brand img { height: 30px; width: auto; }
.sidebar .brand .tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  color: var(--sb-text-2); border: 1px solid var(--sb-border); border-radius: 6px; padding: 2px 6px;
}
.nav { display: grid; gap: 2px; }
.nav a, .nav button.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 10px;
  border-radius: 9px;
  color: var(--sb-text-2);
  font-weight: 600;
  border: 0; background: transparent; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav button.nav-item:hover { background: var(--sb-hover); color: var(--sb-text); }
.nav a.active { background: var(--sb-active); color: #fff; }
.nav a.active svg { color: #7FA6FF; }
.nav .count {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  color: var(--sb-text-2);
}
.nav .count.red { color: #F87171; }
.sb-section { margin-top: 26px; }
.sb-section .mono { color: var(--sb-text-2); padding: 0 10px 8px; display: flex; align-items: center; justify-content: space-between; }
.sb-section .mono a { color: var(--sb-text-2); letter-spacing: .04em; text-transform: none; font-size: 11px; }
.sb-section .mono a:hover { color: var(--sb-text); }
.sb-projects a { height: 34px; font-weight: 500; }
.sb-projects .pdot { width: 9px; height: 9px; }
.sb-projects .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--sb-border); display: flex; align-items: center; gap: 10px; }
.sb-foot .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding: 6px; border-radius: 10px; }
.sb-foot .who:hover { background: var(--sb-hover); }
.sb-foot .who .avatar { box-shadow: none; }
.sb-foot .who .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-foot .who .role { font-size: 12px; color: var(--sb-text-2); }
.sb-foot .icon-btn { color: var(--sb-text-2); }
.sb-foot .icon-btn:hover { background: var(--sb-hover); color: var(--sb-text); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 62px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; color: var(--text-2); }
.topbar .crumbs a:hover { color: var(--text); }
.topbar .crumbs .sep { color: var(--text-3); }
.topbar .crumbs .cur { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .menu-btn { display: none; }
.kbd {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent); opacity: .75;
}

.view { padding: 28px 28px 60px; width: 100%; max-width: 1320px; margin: 0 auto; }
.view.wide { max-width: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 8px; font-size: 15px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Kartice i paneli ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.panel-body { padding: 8px 12px 14px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
}
.stat .num { font-size: 38px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.stat .num small { font-size: 14px; font-weight: 600; color: var(--text-3); letter-spacing: 0; margin-left: 6px; }
.stat.red .num { color: var(--red-text); }
.stat.amber .num { color: var(--amber-text); }
.stat.green .num { color: var(--green-text); }
.stat::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.stat.red::after { background: var(--red); }
.stat.amber::after { background: var(--amber); }
.stat.green::after { background: var(--green); }
.stat.zero .num { color: var(--text-3); }

.dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.dash aside { display: grid; gap: 20px; }

/* Grupe taskova na početnoj */
.tgroup + .tgroup { margin-top: 8px; }
.tgroup-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 6px; }
.tgroup-head .mono { color: var(--text-2); }
.tgroup-head.red .mono { color: var(--red-text); }
.tgroup-head.amber .mono { color: var(--amber-text); }
.tgroup-head .n { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

.trow {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
}
.trow:hover { background: var(--surface-2); }
.trow-main { flex: 1; min-width: 0; }
.trow-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.trow-sub svg { color: var(--text-3); }
.trow .chips { display: flex; align-items: center; gap: 8px; }
.trow.is-done .trow-title { color: var(--text-3); text-decoration: line-through; }

.check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: transparent; color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
  transition: all .15s;
}
.check:hover { border-color: var(--green); color: var(--green); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.check:disabled { opacity: .35; pointer-events: none; }

.plist { display: grid; gap: 2px; padding: 6px 8px 12px; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; transition: background .12s; }
.pitem:hover { background: var(--surface-2); }
.pitem .info { flex: 1; min-width: 0; }
.pitem .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .bar { margin-top: 7px; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); transition: width .4s var(--ease); }
.pitem .pct { font-family: var(--mono); font-size: 11px; color: var(--text-3); width: 34px; text-align: right; }

.team-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; }
.team-row:hover { background: var(--surface-2); }
.team-row .info { flex: 1; min-width: 0; }
.team-row .name { font-weight: 600; }
.team-row .role { font-size: 12px; color: var(--text-3); }
.team-row .open { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

.empty { text-align: center; padding: 42px 20px; color: var(--text-3); }
.empty .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 340px; }

/* ---------- Projekti ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.tabs a, .tabs button {
  height: 32px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent;
  font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 7px;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs .n { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; }
.pcard {
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
  position: relative; overflow: hidden;
}
.pcard::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); opacity: 0; transition: opacity .18s; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.pcard:hover::before { opacity: 1; }
.pcard-top { display: flex; gap: 12px; align-items: flex-start; }
.pcard-top .info { flex: 1; min-width: 0; }
.pcard-name { font-size: 17px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.pcard-top .mono { margin-top: 4px; }
.pcard-progress { display: flex; align-items: center; gap: 12px; }
.pcard-progress .bar { flex: 1; }
.pcard-progress .pct { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.pcard-foot { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; }
.pcard-desc { color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: -6px 0 0; }

.proj-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.proj-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.proj-title h1 { font-size: 28px; }
.proj-actions { display: flex; align-items: center; gap: 10px; }
.proj-progress { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; font-weight: 600; padding: 0 6px; }
.proj-progress .bar { width: 90px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search { position: relative; flex: 0 1 280px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 34px; height: 36px; }
.toolbar .select { width: auto; height: 36px; min-width: 150px; }

/* ---------- Kanban ---------- */
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr);
  gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start;
}
.column {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 8px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 230px);
  min-height: 160px;
  transition: background .15s, box-shadow .15s;
}
.column.drop-target { background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; font-weight: 700; }
.column-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.column-head .count { font-family: var(--mono); font-size: 11px; color: var(--text-3); font-weight: 500; }
.column-head .icon-btn { margin-left: auto; }
.column-cards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 2px; min-height: 24px; flex: 1; }
.add-card {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; height: 36px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--text-3); font-weight: 600;
}
.add-card:hover { background: var(--surface-3); color: var(--text); }
.quick-add { margin-top: 6px; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 8px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.quick-add textarea { width: 100%; border: 0; background: transparent; resize: none; outline: none; font-weight: 600; min-height: 40px; }
.quick-add .qa-foot { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.quick-add .qa-foot .muted { margin-right: auto; font-size: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: box-shadow .15s, border-color .15s, transform .15s, opacity .15s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card[data-draggable="1"] { cursor: grab; }
.card.press { transform: scale(.98); }
.card.placeholder { opacity: .3; border-style: dashed; box-shadow: none; }
.card.ghost {
  position: fixed; z-index: 1000; pointer-events: none; margin: 0;
  transform: rotate(2.5deg) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  cursor: grabbing;
}
.card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.card-title { font-weight: 600; line-height: 1.38; word-break: break-word; }
.card.is-done .card-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 11px; color: var(--text-3); font-size: 12px; min-height: 22px; }
.meta-i { display: inline-flex; align-items: center; gap: 4px; }
.card-meta .card-people { margin-left: auto; display: inline-flex; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none !important; }

/* ---------- Lista ---------- */
.list { display: grid; gap: 18px; }
.lgroup { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.lgroup-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 700; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.lgroup-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.lgroup-head .count { font-family: var(--mono); font-size: 11px; color: var(--text-3); font-weight: 500; }
.lrow {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) 180px 110px 96px;
  align-items: center; gap: 14px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.lrow:last-of-type { border-bottom: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow .t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lrow .t .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .icons { display: inline-flex; gap: 8px; color: var(--text-3); font-size: 12px; }
.lrow .who { display: flex; align-items: center; gap: 8px; color: var(--text-2); min-width: 0; }
.lrow .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .who .avatar { --size: 24px; }
.lrow.is-done .title { color: var(--text-3); text-decoration: line-through; }
.lgroup .add-card { margin: 4px 8px 8px; }
.lgroup .quick-add { margin: 8px; }
.lgroup-empty { padding: 14px 16px; color: var(--text-3); font-size: 13px; }

/* ---------- Bočni panel taska ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity .22s var(--ease); z-index: 60; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(620px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(104%);
  transition: transform .28s var(--ease);
  z-index: 61;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer.dropping::after {
  content: 'Pusti fajlove da ih dodaš'; position: absolute; inset: 12px; border-radius: 16px;
  border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  display: grid; place-items: center; font-weight: 700; color: var(--accent-text); font-size: 16px;
}
.drawer-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--border); }
.drawer-head .crumb { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2); padding: 6px 8px; margin-left: -8px; border-radius: 8px; }
.drawer-head .crumb:hover { background: var(--surface-2); color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 26px 40px; }
.title-input {
  width: 100%; border: 0; background: transparent; resize: none; overflow: hidden;
  font-size: 24px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2;
  padding: 4px 8px; margin: 0 -8px; border-radius: 10px;
}
.title-input:hover:not([readonly]) { background: var(--surface-2); }
.title-input:focus { outline: none; background: var(--surface-2); }
.notice { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 500; }
.props { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; align-items: center; margin: 20px 0 8px; }
.props > label { color: var(--text-3); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.props .select, .props .input { height: 36px; border-color: transparent; background-color: transparent; font-weight: 600; }
.props .select:hover, .props .input:hover { background-color: var(--surface-2); border-color: transparent; }
.props .select:focus, .props .input:focus { background-color: var(--surface); border-color: var(--accent); }
.props .select:disabled, .props .input:disabled { opacity: 1; color: var(--text-2); background-image: none; cursor: default; }
.props .rep-hint { grid-column: 2; font-size: 12px; color: var(--text-3); margin: -2px 0 4px 12px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.desc { min-height: 120px; background: var(--surface); }
.files { display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; transition: border-color .15s; }
.file:hover { border-color: var(--border-strong); }
.file .thumb { width: 44px; height: 44px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--text-2); text-transform: uppercase; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .info { flex: 1; min-width: 0; }
.file .info a { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.file .info a:hover { color: var(--accent-text); }
.file .sub { font-size: 12px; color: var(--text-3); }
.file.uploading { opacity: .7; }
.drop-hint { font-size: 12px; color: var(--text-3); margin-top: 8px; }

.comments { display: grid; gap: 16px; margin-bottom: 16px; }
.comment { display: flex; gap: 12px; }
.comment .avatar { --size: 30px; }
.comment .body { flex: 1; min-width: 0; }
.comment .head { display: flex; align-items: center; gap: 8px; }
.comment .head b { font-weight: 700; }
.comment .head .time { font-size: 12px; color: var(--text-3); }
.comment .head .icon-btn { margin-left: auto; opacity: 0; }
.comment:hover .head .icon-btn { opacity: 1; }
.comment .text { margin-top: 3px; white-space: pre-wrap; word-break: break-word; color: var(--text-2); line-height: 1.55; }
.comment .text a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.comment-form { display: flex; gap: 12px; align-items: flex-start; }
.comment-form .avatar { --size: 30px; margin-top: 4px; }
.comment-form .box { flex: 1; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.comment-form .box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.comment-form textarea { width: 100%; border: 0; background: transparent; resize: none; outline: none; padding: 10px 12px 4px; min-height: 44px; line-height: 1.5; }
.comment-form .foot { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px 12px; font-size: 12px; color: var(--text-3); }
.meta-foot { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

/* ---------- Modali ---------- */
.modal-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal-root .overlay { z-index: 0; }
.modal {
  position: relative; z-index: 1;
  width: 100%; max-width: 540px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.98); opacity: 0;
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
.modal.sm { max-width: 420px; }
.modal.lg { max-width: 680px; }
.modal-root.open .modal { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 4px; }
.modal-head h3 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }
.modal-foot .left { margin-right: auto; }
.modal p { margin: 0; color: var(--text-2); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 9px; background: var(--c); border: 0; padding: 0; position: relative; transition: transform .12s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.member-list { display: grid; gap: 2px; max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.member-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.member-opt:hover { background: var(--surface-2); }
.member-opt input { width: 16px; height: 16px; accent-color: var(--accent); }
.member-opt .avatar { --size: 26px; box-shadow: none; }
.member-opt .name { font-weight: 600; flex: 1; }
.member-opt .role { font-size: 12px; color: var(--text-3); }
.member-list.compact { max-height: 170px; }
.member-row { display: flex; align-items: center; gap: 8px; padding-right: 6px; border-radius: 8px; }
.member-row:hover { background: var(--surface-2); }
.member-row .member-opt { flex: 1; min-width: 0; }
.member-row .member-opt:hover { background: transparent; }
.mgr-toggle {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-3);
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.mgr-toggle input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.mgr-toggle:hover { border-color: var(--border-strong); color: var(--text-2); }
.mgr-toggle:has(input:checked) { background: var(--purple-soft); color: var(--purple-text); border-color: transparent; }
.mgr-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.apick { position: relative; min-width: 0; }
.apick-btn {
  width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px;
  padding: 4px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  font-weight: 600; text-align: left; color: var(--text);
}
.apick-btn:hover:not(:disabled) { background: var(--surface-2); }
.apick-btn:disabled { cursor: default; color: var(--text-2); }
.apick-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apick-pop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 4px; max-height: 300px; overflow-y: auto;
}
.avatar-edit { display: flex; align-items: center; gap: 18px; }
.avatar-edit .avatar { box-shadow: none; }
.avatar-actions { display: flex; gap: 6px; margin: 10px 0 6px; flex-wrap: wrap; }
.proj-managers { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.proj-managers svg { color: var(--text-3); }
.date-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.date-quick button { height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--text-2); }
.date-quick button:hover { border-color: var(--accent); color: var(--accent-text); }

.cred { display: grid; gap: 10px; margin: 6px 0 4px; }
.cred-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.cred-row .mono { margin-bottom: 3px; }
.cred-row code { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--text); letter-spacing: .02em; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-text); font-size: 13px; font-weight: 500; margin-top: 14px; }

/* ---------- Tim ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; padding: 12px 16px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.inactive td { opacity: .55; }
.tbl .person { display: flex; align-items: center; gap: 12px; }
.tbl .person .avatar { --size: 34px; }
.tbl .person b { display: block; font-weight: 700; }
.tbl .person .uname { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.tbl .actions { display: flex; justify-content: flex-end; gap: 4px; }
.roles-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.roles-info .panel { padding: 16px 18px; }
.roles-info h3 { margin: 8px 0 6px; font-size: 15px; }
.roles-info p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }

/* ---------- Nalog ---------- */
.account { display: grid; gap: 18px; max-width: 640px; }
.account .panel { padding: 22px; }
.account h2 { margin-bottom: 16px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 12px; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Toast ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  min-width: 240px; max-width: 380px;
  padding: 12px 14px; border-radius: 12px;
  background: #0E1729; color: #fff;
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  animation: toast-in .25s var(--ease);
}
html[data-theme="dark"] .toast { background: #1D2840; border: 1px solid var(--border-strong); }
.toast svg { color: #34D399; }
.toast.error svg { color: #F87171; }
.toast .act { margin-left: auto; color: #8DB2FF; font-weight: 700; background: none; border: 0; padding: 0 0 0 10px; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .25s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.sb-backdrop { display: none; }
.modal-root.open .overlay { opacity: 1; pointer-events: auto; }
html[data-theme="dark"] .only-light, html[data-theme="light"] .only-dark { display: none !important; }

/* ---------- Telefon i tablet ---------- */
@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash aside { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px; height: auto;
    transform: translateX(-102%); transition: transform .25s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .sb-backdrop { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sb-backdrop.open { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 14px; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .new-label { display: none; }
  .topbar .btn-primary { width: 38px; padding: 0; }
  .view { padding: 20px 16px 60px; }
  h1 { font-size: 26px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat .num { font-size: 30px; }
  .board { grid-auto-columns: 84vw; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .column { scroll-snap-align: start; max-height: calc(100vh - 250px); }
  .lrow { grid-template-columns: 24px minmax(0, 1fr) auto auto; }
  .lrow .who span, .lrow .prio { display: none; }
  .roles-info { grid-template-columns: minmax(0, 1fr); }
  .tbl .hide-sm { display: none; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar .select { flex: 1; min-width: 0; }
  .proj-actions .proj-progress, .proj-actions .avatars { display: none; }
  .props { grid-template-columns: 104px minmax(0, 1fr); }
  .drawer-body { padding: 18px 18px 40px; }
  #toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}
@media (max-width: 760px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: block; }
  .auth-main .top { justify-content: space-between; align-items: center; }
}

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