:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-2: #fff7ed;
  --surface-3: #f8fafc;
  --input: #ffffff;
  --text: #171717;
  --muted: #737373;
  --border: #e5ddd3;
  --primary: #f97316;
  --primary-2: #ea580c;
  --primary-soft: #fff1e6;
  --primary-soft-2: #fed7aa;
  --primary-text: #9a3412;
  --primary-ring: rgba(249, 115, 22, 0.18);
  --success: #059669;
  --success-soft: #d1fae5;
  --success-text: #065f46;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --warning-text: #92400e;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --danger-text: #991b1b;
  --sidebar: rgba(255, 255, 255, 0.84);
  --sidebar-soft: rgba(249, 115, 22, 0.10);
  --sidebar-text: #292524;
  --sidebar-muted: #78716c;
  --sidebar-border: rgba(120, 113, 108, 0.18);
  --shadow: 0 18px 50px rgba(28, 25, 23, 0.10);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #070707;
  --surface-2: #111111;
  --surface-3: #0b0b0b;
  --input: #050505;
  --text: #f7f7f7;
  --muted: #9b9b9b;
  --border: #222222;
  --primary: #fb923c;
  --primary-2: #f97316;
  --primary-soft: rgba(251, 146, 60, 0.14);
  --primary-soft-2: rgba(251, 146, 60, 0.28);
  --primary-text: #fed7aa;
  --primary-ring: rgba(251, 146, 60, 0.25);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.15);
  --success-text: #a7f3d0;
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.16);
  --warning-text: #fde68a;
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.16);
  --danger-text: #fecdd3;
  --sidebar: #000000;
  --sidebar-soft: rgba(251, 146, 60, 0.10);
  --sidebar-text: #ffffff;
  --sidebar-muted: #9b9b9b;
  --sidebar-border: #202020;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.68);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% -10%, var(--primary-soft) 0, transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  min-height: 100vh;
}

.boot-screen,
.login-screen,
.install-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-screen {
  color: var(--muted);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: 0 12px 28px var(--primary-ring);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.login-card,
.install-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-screen {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.16), transparent 32%),
    linear-gradient(315deg, rgba(5, 150, 105, 0.08), transparent 30%),
    var(--bg);
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 7% auto auto 8%;
  width: min(520px, 48vw);
  height: min(520px, 48vw);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  filter: blur(90px);
  pointer-events: none;
}

.login-card {
  position: relative;
  isolation: isolate;
  width: min(980px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  grid-template-rows: auto 1fr auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--border) 76%, transparent);
  box-shadow: 0 28px 90px rgba(28, 25, 23, 0.18);
}

.login-card::before,
.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-card::before {
  right: 42%;
  z-index: -2;
  background:
    linear-gradient(145deg, rgba(249, 115, 22, 0.96), rgba(194, 65, 12, 0.92)),
    var(--primary);
}

.login-card::after {
  left: 55%;
  z-index: -1;
  background: var(--surface);
  border-left: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
}

.login-card > .brand-mark {
  grid-column: 1;
  margin: 52px 52px 0;
  box-shadow: none;
  position: relative;
}

.login-card > h1 {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  margin: 84px 52px 0;
  max-width: 400px;
  color: white;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 0.96;
  letter-spacing: 0;
}

.login-card > p:first-of-type {
  grid-column: 1;
  grid-row: 3;
  max-width: 390px;
  margin: 14px 52px 52px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
}

.login-card > p:first-of-type::after {
  content: "Gantt  |  PDF  |  Malbibliotek";
  display: flex;
  width: fit-content;
  margin-top: 24px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: white;
  background: rgba(255, 255, 255, 0.11);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-card .theme-toggle-login {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(28, 25, 23, 0.10);
}

.login-card .notice,
.login-card .stack-form {
  grid-column: 2;
  width: min(100% - 64px, 380px);
  justify-self: center;
}

.login-card .notice {
  grid-row: 1;
  align-self: end;
  margin: 82px 0 12px;
}

.login-card .stack-form {
  grid-row: 1 / 4;
  align-self: center;
  gap: 18px;
}

.login-card .stack-form::before {
  content: "Logg inn";
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.login-card .stack-form::after {
  content: "Fortsett til prosjektoversikten med kontoen din.";
  order: -1;
  display: block;
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.login-card .stack-form label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: relative;
}

.login-card .stack-form input {
  min-height: 46px;
  border-radius: 8px;
  padding: 12px 13px 12px 42px;
}

.login-card .stack-form label::before {
  content: "";
  position: absolute;
  left: 13px;
  bottom: 13px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}

.login-card .stack-form label:nth-of-type(1)::before {
  border: 2px solid currentColor;
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 45%, currentColor 46%, currentColor 54%, transparent 55%) 0 0 / 50% 100% no-repeat,
    linear-gradient(45deg, transparent 45%, currentColor 46%, currentColor 54%, transparent 55%) 100% 0 / 50% 100% no-repeat;
}

.login-card .stack-form label:nth-of-type(2)::before {
  border: 2px solid currentColor;
  border-radius: 4px;
  background: linear-gradient(currentColor, currentColor) center 7px / 6px 2px no-repeat;
}

.login-card .stack-form label:nth-of-type(2)::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 28px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--muted);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  pointer-events: none;
  z-index: 1;
}

.login-card .stack-form button[type="submit"] {
  min-height: 46px;
  margin-top: 2px;
  font-size: 13px;
  box-shadow: 0 14px 28px var(--primary-ring);
}

:root[data-theme="dark"] .login-screen {
  background:
    linear-gradient(135deg, rgba(251, 146, 60, 0.14), transparent 32%),
    linear-gradient(315deg, rgba(20, 184, 166, 0.08), transparent 30%),
    #000000;
}

:root[data-theme="dark"] .login-card {
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.78);
}

:root[data-theme="dark"] .login-card::before {
  background:
    linear-gradient(145deg, rgba(154, 52, 18, 0.96), rgba(67, 20, 7, 0.94)),
    var(--primary);
}

.login-card .brand-mark,
.install-card .brand-mark {
  margin-bottom: 20px;
}

.login-card > .brand-mark {
  margin: 52px 52px 0;
}

.login-card h1,
.install-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.05;
}

.login-card p,
.install-card p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.login-card > h1 {
  margin: 84px 52px 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 0.96;
  color: white;
}

.login-card > p:first-of-type {
  margin: 14px 52px 52px;
  color: rgba(255, 255, 255, 0.82);
}

.login-card .stack-form label:focus-within::before,
.login-card .stack-form label:focus-within::after {
  color: var(--primary);
  border-color: var(--primary);
}

.stack-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

textarea {
  resize: vertical;
}

.stack-form button,
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn,
.primary-link {
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.stack-form button,
.primary-btn,
.primary-link {
  background: var(--primary);
  color: white;
}

.stack-form button:hover,
.primary-btn:hover,
.primary-link:hover {
  background: var(--primary-2);
}

.secondary-btn {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.ghost-btn,
.icon-btn {
  background: var(--surface-2);
  color: var(--text);
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-btn {
  min-width: 36px;
  padding: 0 10px;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 13px;
}

.notice.success {
  color: var(--success-text);
  background: var(--success-soft);
}

.notice.danger,
.toast.danger {
  color: var(--danger-text);
  background: var(--danger-soft);
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.layout.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.layout.sidebar-collapsed .sidebar {
  display: none;
}

.sidebar-floating-toggle {
  border: 0;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  gap: 3px;
  padding: 8px;
}

.sidebar-floating-toggle span,
.sidebar-toggle span {
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  display: block;
}

.icon-svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.icon-svg path,
.icon-svg circle,
.icon-svg rect {
  vector-effect: non-scaling-stroke;
}

.sidebar-toggle {
  gap: 3px;
}

.sidebar-floating-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 40;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sidebar-floating-toggle .icon-svg {
  width: 18px;
  height: 18px;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 34%),
    var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(18px);
  height: 100vh;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.28), 18px 0 48px rgba(28, 25, 23, 0.06);
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.sidebar-brand-card {
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  padding: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), transparent 62%),
    var(--surface);
  box-shadow: 0 12px 30px rgba(28, 25, 23, 0.07);
}

.sidebar-brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-head .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 12px;
}

.sidebar-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sidebar-title strong {
  color: var(--sidebar-text);
  font-size: 14px;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-title span {
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}

.sidebar-icon-button {
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  color: var(--sidebar-muted);
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.sidebar-icon-button:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--sidebar-border));
  transform: translateY(-1px);
}

.sidebar-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sidebar-summary span {
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  padding: 9px 10px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 800;
}

.sidebar-summary strong {
  display: block;
  color: var(--sidebar-text);
  font-size: 16px;
  line-height: 1.05;
}

.sidebar-org-switcher {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--sidebar-border);
  border-radius: 9px;
  padding: 6px 8px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.sidebar-org-label {
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-select-wrap {
  position: relative;
  display: grid;
  align-items: center;
}

.sidebar-select-wrap .org-color-dot {
  position: absolute;
  left: 9px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--org-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--org-color) 16%, transparent);
  pointer-events: none;
  z-index: 1;
}

.sidebar-select-wrap select {
  width: 100%;
  min-height: 30px;
  appearance: none;
  border: 0;
  border-radius: 7px;
  padding: 5px 28px 5px 28px;
  background:
    linear-gradient(45deg, transparent 50%, var(--sidebar-muted) 50%) right 14px center / 5px 5px no-repeat,
    linear-gradient(135deg, var(--sidebar-muted) 50%, transparent 50%) right 9px center / 5px 5px no-repeat,
    transparent;
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 650;
}

.sidebar-select-wrap select:focus {
  outline: 2px solid var(--primary-ring);
}

.sidebar-block {
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.sidebar-block .sidebar-section-title {
  margin-bottom: 8px;
}

.theme-icon {
  position: relative;
  width: 15px;
  height: 15px;
  display: block;
}

.theme-icon-moon {
  border-radius: 999px;
  box-shadow: inset -5px 0 0 currentColor;
  transform: rotate(-18deg);
}

.theme-icon-sun {
  border: 2px solid currentColor;
  border-radius: 999px;
}

.theme-icon-sun::before,
.theme-icon-sun::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 22px;
  background: currentColor;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.theme-icon-sun::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.theme-toggle-login {
  width: 36px;
  min-height: 36px;
  margin: 0 0 16px;
  padding: 0;
  font-size: 0;
}

.theme-toggle-login::before {
  content: "";
  width: 15px;
  height: 15px;
  display: block;
  color: var(--text);
  border-radius: 999px;
  box-shadow: inset -5px 0 0 currentColor;
  transform: rotate(-18deg);
}

:root[data-theme="dark"] .theme-toggle-login::before {
  border: 2px solid currentColor;
  box-shadow: none;
  transform: none;
}

.nav-buttons {
  display: grid;
  gap: 7px;
  padding: 0;
  border-radius: 10px;
}

.nav-button,
.project-button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--sidebar-muted);
  border-radius: 8px;
  min-height: 44px;
  padding: 9px 10px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-button.active,
.nav-button:hover,
.project-button.active,
.project-button:hover {
  background: var(--sidebar-soft);
  color: var(--sidebar-text);
}

.nav-button.active,
.project-button.active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 26%, transparent);
}

.nav-button:hover,
.project-button:hover {
  transform: translateX(1px);
}

.nav-button.active::before,
.project-button.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.nav-copy,
.project-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-copy strong,
.project-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-copy small,
.project-copy small {
  color: var(--sidebar-muted);
  font-size: 10.5px;
  font-weight: 800;
}

.nav-button > span:not(.nav-icon):not(.nav-copy) {
  display: none;
}

.nav-icon {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--sidebar-muted);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.nav-icon .icon-svg {
  width: 16px;
  height: 16px;
}

.nav-button.active .nav-icon,
.nav-button:hover .nav-icon {
  background: var(--primary);
  color: white;
}

.project-button.active .project-avatar,
.project-button:hover .project-avatar {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 10px 22px color-mix(in srgb, var(--project-color) 26%, transparent);
}

.nav-icon::before,
.nav-icon::after {
  content: none;
  display: block;
}

.nav-icon-dashboard::before {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: 6px 0 0 -3px currentColor, 0 6px 0 -3px currentColor;
}

.nav-icon-planner::before {
  width: 13px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 4px 0 currentColor;
}

.nav-icon-plus::before {
  width: 12px;
  height: 2px;
  background: currentColor;
}

.nav-icon-plus::after {
  position: absolute;
  width: 2px;
  height: 12px;
  background: currentColor;
}

.nav-icon-logout::before {
  width: 12px;
  height: 10px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 3px 0 0 3px;
}

.project-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 auto;
}

.project-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--project-color) 90%, white), var(--project-color));
  color: white;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.project-avatar span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.project-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-section-title {
  margin: 0;
  color: var(--sidebar-muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-section-subtitle {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 800;
}

.sidebar-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 10px;
}

.sidebar-section-row .sidebar-section-title {
  margin: 0;
}

.sidebar-mini-button {
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--sidebar-muted);
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-mini-button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.sidebar-mini-button .icon-svg {
  width: 14px;
  height: 14px;
}

.sidebar-projects {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  padding: 10px 8px 10px 10px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.project-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 1px 4px 1px 0;
}

.project-nav::-webkit-scrollbar {
  width: 6px;
}

.project-nav::-webkit-scrollbar-thumb {
  background: var(--sidebar-border);
  border-radius: 999px;
}

.project-button {
  min-height: 50px;
  padding: 9px 10px;
  background: transparent;
}

.project-button.active {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary) 13%, transparent), transparent),
    var(--sidebar-soft);
}

.project-button:hover:not(.active) {
  background: var(--surface-2);
}

.project-empty {
  border: 1px dashed var(--sidebar-border);
  border-radius: 8px;
  padding: 12px;
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  background: var(--surface-2);
}

.sidebar-footer {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 84%, transparent), var(--sidebar));
  z-index: 3;
}

.user-pill {
  width: 100%;
  border: 1px solid transparent;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--sidebar-text);
  text-align: left;
  box-shadow: 0 8px 22px rgba(28, 25, 23, 0.06);
}

.user-pill:hover,
.user-pill.active {
  border-color: var(--primary);
  background:
    linear-gradient(90deg, var(--primary-soft), transparent),
    var(--surface);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #dc2626);
  color: white;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
}

.user-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.user-pill strong {
  color: var(--sidebar-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.user-pill span {
  color: var(--sidebar-muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chevron {
  color: var(--sidebar-muted);
  display: grid;
  place-items: center;
}

.user-chevron .icon-svg {
  width: 14px;
  height: 14px;
  transition: transform 0.16s ease;
}

.user-pill.active .user-chevron .icon-svg {
  transform: rotate(180deg);
}

.user-popover {
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  padding: 6px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(28, 25, 23, 0.16);
}

.logout-button {
  color: var(--danger-text);
}

.logout-button .nav-icon {
  color: var(--danger-text);
  background: var(--danger-soft);
}

.content {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
}

.topbar p {
  color: var(--muted);
  margin: 4px 0 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.segmented button {
  border: 0;
  border-radius: 6px;
  padding: 8px 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.gantt-today-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.gantt-today-toggle span {
  width: 8px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}

.gantt-today-toggle.active {
  border-color: color-mix(in srgb, #ef4444 38%, var(--border));
  background: color-mix(in srgb, #ef4444 9%, var(--surface));
  color: var(--text);
}

.gantt-today-toggle.active span {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card,
.panel,
.task-card,
.project-card,
.deadline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card strong {
  font-size: 30px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.project-card {
  padding: 16px;
  text-align: left;
  border-color: var(--border);
}

.project-card h3 {
  margin: 12px 0 6px;
  font-size: 17px;
}

.project-card p {
  color: var(--muted);
  min-height: 42px;
  margin: 0 0 12px;
  line-height: 1.45;
}

.archived-panel {
  margin-top: 18px;
}

.project-card-archived {
  display: grid;
  gap: 10px;
  opacity: 0.82;
  background: var(--surface-3);
}

.project-card-archived h3 {
  margin-top: 0;
}

.project-card-archived .ghost-btn {
  justify-self: start;
}

.organization-panel .panel-head p {
  margin: 4px 0 0;
}

.organization-switcher,
.organization-members-panel {
  margin-bottom: 18px;
}

.org-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.org-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
}

.org-tab span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--org-color);
}

.org-tab.active {
  border-color: color-mix(in srgb, var(--org-color) 55%, var(--border));
  background: color-mix(in srgb, var(--org-color) 12%, var(--surface));
}

.member-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.member-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.member-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 650;
}

.member-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.member-copy strong,
.member-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-copy small {
  color: var(--muted);
}

.organization-tree {
  display: grid;
  gap: 14px;
}

.org-node {
  position: relative;
  display: grid;
  gap: 10px;
}

.org-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--org-color) 18%, var(--border));
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--org-color-soft), transparent 50%),
    var(--surface);
}

.org-card::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  border-radius: 999px;
  background: var(--org-color);
}

.org-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--org-color);
  color: white;
  font-size: 12px;
  font-weight: 650;
}

.org-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.org-copy h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-copy p {
  margin: 0;
  color: var(--muted);
}

.org-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.org-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
}

.org-actions {
  display: flex;
  gap: 6px;
}

.org-children {
  position: relative;
  display: grid;
  gap: 10px;
  margin-left: 28px;
  padding-left: 18px;
}

.org-children::before {
  content: "";
  position: absolute;
  left: 0;
  top: -10px;
  bottom: 24px;
  width: 1px;
  background: var(--border);
}

.org-children > .org-node::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 26px;
  width: 18px;
  height: 1px;
  background: var(--border);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.deadline-list,
.task-list {
  display: grid;
  gap: 10px;
}

.task-list-wide {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.deadline-card {
  padding: 12px;
}

.deadline-card strong {
  display: block;
  margin-bottom: 4px;
}

.muted {
  color: var(--muted);
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 26px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-3);
}

.planner-shell {
  display: grid;
  gap: 16px;
}

.plan-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 800;
}

.plan-tab.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.planner-stack {
  display: grid;
  gap: 16px;
}

.task-card {
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.task-card-milestone {
  border-color: var(--task-color, var(--primary));
}

.task-card-phase {
  border-color: var(--task-color, var(--primary));
}

.task-card-milestone::before,
.task-card-phase::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--task-color, var(--primary));
}

.task-card-phase::before {
  background: var(--task-color, var(--primary));
}

.task-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.task-title-line {
  min-width: 0;
}

.task-title-line h3 {
  margin: 6px 0 6px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.task-actions {
  display: flex;
  gap: 6px;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
}

.status-gjoremal {
  color: var(--muted);
  background: var(--surface-2);
}

.status-i-arbeid {
  color: var(--primary-text);
  background: var(--primary-soft);
}

.status-fullfort {
  color: var(--success-text);
  background: var(--success-soft);
}

.status-forsinket {
  color: var(--danger-text);
  background: var(--danger-soft);
}

.tag {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.tag-milestone,
.tag-phase {
  border: 1px solid currentColor;
  color: var(--task-color, var(--primary));
  background: var(--task-color-soft, var(--primary-soft));
}

.tag-milestone::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.tag-phase {
  color: var(--task-color, var(--primary));
  background: var(--task-color-soft, var(--primary-soft));
}

.tag-phase::before {
  content: "";
  width: 20px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  background: linear-gradient(to bottom, transparent 4px, currentColor 4px, currentColor 6px, transparent 6px);
}

.task-progress-row {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.task-progress-row input[type="range"] {
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--primary);
}

.gantt-panel {
  min-width: 0;
  overflow: hidden;
}

.gantt-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.gantt-scroll {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.gantt-canvas {
  position: relative;
  min-height: 420px;
}

.gantt-dependencies {
  position: absolute;
  left: var(--gantt-label-width, 180px);
  top: 42px;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.gantt-dependency-path {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

.gantt-dependency-head {
  fill: var(--muted);
}

.gantt-header,
.gantt-row {
  display: grid;
  grid-template-columns: var(--gantt-label-width, 180px) 1fr;
}

.gantt-header {
  position: sticky;
  top: 0;
  z-index: 24;
  height: 42px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.gantt-label-resizer {
  position: absolute;
  top: 0;
  left: calc(var(--gantt-label-width, 180px) - 5px);
  z-index: 32;
  width: 10px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: col-resize;
  padding: 0;
}

.gantt-label-resizer::before {
  content: "";
  position: absolute;
  inset: 7px 3px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.15s ease, transform 0.15s ease;
}

.gantt-label-resizer:hover::before,
.gantt-canvas.resizing-label .gantt-label-resizer::before {
  background: var(--primary);
  transform: scaleX(1.25);
}

.gantt-left,
.gantt-label {
  position: sticky;
  left: 0;
  z-index: 22;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 10px 0 18px rgba(28, 25, 23, 0.06);
}

.gantt-left {
  grid-column: 1;
  grid-row: 1;
  z-index: 30;
  padding: 10px 22px 10px 12px;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gantt-resize-hint {
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.75;
}

.gantt-label {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
}

.gantt-label::before {
  content: "";
  width: 3px;
  align-self: stretch;
  border-radius: 999px;
  background: var(--task-color, var(--primary));
  box-shadow: 0 0 0 4px var(--task-color-soft, transparent);
  flex: 0 0 auto;
}

.gantt-sort-label {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.gantt-sort-label:hover {
  background: var(--task-color-soft, var(--surface-2));
}

.gantt-label-milestone {
  background: linear-gradient(90deg, var(--task-color-soft, var(--primary-soft)), var(--surface) 44px);
}

.gantt-label-phase {
  background: linear-gradient(90deg, var(--task-color-soft, var(--primary-soft)), var(--surface) 44px);
}

.gantt-drag-grip {
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  flex: 0 0 auto;
}

.gantt-kind-marker {
  width: 18px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--task-color, var(--primary));
}

.gantt-kind-milestone::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--task-color, var(--primary));
  transform: rotate(45deg);
  box-shadow: 0 0 0 2px var(--surface);
}

.gantt-kind-phase::before {
  content: "";
  width: 18px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  background: linear-gradient(to bottom, transparent 4px, currentColor 4px, currentColor 6px, transparent 6px);
}

.gantt-label span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-canvas.resizing-label,
.gantt-canvas.resizing-label * {
  cursor: col-resize !important;
  user-select: none;
}

.muted-control {
  opacity: 0.62;
}

.gantt-date-row,
.gantt-track {
  position: relative;
}

.gantt-date-row {
  grid-column: 2;
  grid-row: 1;
  height: 42px;
}

.gantt-date-label {
  position: absolute;
  top: 0;
  height: 42px;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.gantt-row {
  position: relative;
  height: 48px;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
}

.gantt-row.row-dragging {
  opacity: 0.58;
}

.gantt-row.row-dragging .gantt-sort-label {
  cursor: grabbing;
  background: var(--primary-soft);
}

.gantt-row.drop-before::before,
.gantt-row.drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  z-index: 8;
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.gantt-row.drop-before::before {
  top: -1px;
}

.gantt-row.drop-after::after {
  bottom: -1px;
}

.gantt-track {
  height: 48px;
  min-height: 48px;
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px);
}

.gantt-add-row .gantt-label,
.gantt-add-track {
  background: var(--surface-3);
}

.gantt-add-track {
  cursor: crosshair;
}

.gantt-add-track:hover {
  background-color: var(--primary-soft);
}

.gantt-add-text {
  position: sticky;
  left: 16px;
  top: 13px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 16px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.gantt-weekend {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(226, 232, 240, 0.5);
}

.gantt-bar {
  position: absolute;
  top: 13px;
  height: 20px;
  border: 0;
  border-radius: 6px;
  background: var(--task-color-soft, var(--primary-soft-2));
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.11);
  cursor: grab;
  padding: 0;
  touch-action: none;
  z-index: 3;
}

.gantt-bar.phase {
  top: 20px;
  height: 2px;
  border-radius: 0;
  background: var(--muted);
  overflow: visible;
}

.gantt-bar.phase .gantt-handle {
  top: -8px;
  height: 18px;
}

.gantt-bar.dragging,
.gantt-milestone.dragging {
  cursor: grabbing;
  outline: 3px solid var(--primary-ring);
  z-index: 5;
}

.gantt-bar.phase::before,
.gantt-bar.phase::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 2px;
  height: 12px;
  background: var(--muted);
}

.gantt-bar.phase::before {
  left: 0;
}

.gantt-bar.phase::after {
  right: 0;
}

.gantt-fill {
  display: block;
  height: 100%;
  background: var(--task-color, var(--primary));
  pointer-events: none;
}

.gantt-bar.fullfort .gantt-fill {
  background: var(--success);
}

.gantt-bar.forsinket .gantt-fill {
  background: var(--danger);
}

.gantt-milestone {
  position: absolute;
  top: 12px;
  width: 22px;
  height: 22px;
  transform: rotate(45deg);
  background: var(--warning);
  border: 3px solid var(--surface);
  box-shadow: 0 7px 18px rgba(217, 119, 6, 0.24);
  cursor: grab;
  padding: 0;
  touch-action: none;
  z-index: 3;
}

.gantt-handle {
  position: absolute;
  top: 0;
  z-index: 2;
  width: 12px;
  height: 100%;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.gantt-handle-start {
  left: 0;
  border-radius: 6px 0 0 6px;
  cursor: ew-resize;
}

.gantt-handle-end {
  right: 0;
  border-radius: 0 6px 6px 0;
  cursor: ew-resize;
}

.gantt-bar:hover .gantt-handle,
.gantt-bar.dragging .gantt-handle {
  opacity: 1;
}

.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 2;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 26px 90px rgba(15, 23, 42, 0.28);
}

.modal-head,
.modal-foot {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-title-block {
  display: grid;
  gap: 4px;
}

.modal-title-block h2 {
  font-size: 26px;
}

.modal-title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.modal-eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-body {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.modal-foot {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full {
  grid-column: 1 / -1;
}

.task-modal {
  width: min(980px, 100%);
  max-height: min(92vh, 940px);
}

.task-modal .modal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background:
    linear-gradient(90deg, var(--task-color-soft, transparent), transparent 52%),
    var(--surface);
}

.task-modal .modal-head::before {
  content: "";
  width: 5px;
  align-self: stretch;
  border-radius: 999px;
  background: var(--task-color, var(--primary));
}

.task-modal .modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
}

.task-form-grid {
  gap: 18px 20px;
}

.task-modal .modal-body {
  padding: 22px 24px;
}

.task-modal input[type="range"] {
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--task-color, var(--primary));
}

.task-modal .dependency-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}

.field-large input {
  min-height: 56px;
  font-size: 20px;
  font-weight: 900;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.checkbox-line input {
  width: auto;
}

.option-card {
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.option-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--task-color, var(--primary));
}

.task-color-panel {
  border: 1px solid color-mix(in srgb, var(--selected-color, var(--primary)) 24%, var(--border));
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 13px;
  background:
    linear-gradient(135deg, var(--selected-color-soft, var(--primary-soft)), transparent 54%),
    var(--surface-2);
}

.task-color-head,
.task-color-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.task-color-head h3 {
  margin: 0;
  font-size: 15px;
}

.task-color-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-color-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--selected-color, var(--primary)) 34%, var(--border));
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.task-color-badge span,
.task-color-preview {
  background: var(--selected-color, var(--primary));
}

.task-color-badge span {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.task-color-picker {
  justify-content: flex-start;
}

.task-color-preview {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--selected-color, var(--primary)) 40%, var(--border));
  box-shadow: 0 12px 28px var(--selected-color-soft, var(--primary-ring));
  flex: 0 0 auto;
}

.task-color-picker label {
  min-width: min(260px, 100%);
  gap: 6px;
}

.task-color-picker input[type="color"] {
  height: 42px;
  padding: 4px;
  cursor: pointer;
}

.task-color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-color-swatch {
  width: 34px;
  height: 34px;
  border: 2px solid var(--surface);
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}

.task-color-swatch.active {
  box-shadow: 0 0 0 2px var(--text), 0 0 0 5px var(--surface);
}

.color-project-toggle {
  align-self: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.task-color-panel.using-project-color .task-color-badge::after {
  content: "Prosjekt";
  color: var(--primary-text);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.dependency-list {
  display: grid;
  gap: 7px;
  max-height: 180px;
  overflow: auto;
  padding: 2px;
}

.segment-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.segment-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.segment-editor-head h3 {
  margin: 0;
  font-size: 14px;
}

.segment-editor-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segment-list {
  display: grid;
  gap: 9px;
}

.segment-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 36px;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.segment-number {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 3px;
}

.segment-row label {
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.segment-row input {
  font-size: 13px;
  font-weight: 800;
}

.segment-row input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.segment-remove {
  align-self: end;
  color: var(--danger);
  background: var(--danger-soft);
}

.segment-empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 13px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.hidden {
  display: none !important;
}

.modal-narrow {
  width: min(560px, 100%);
}

.plan-choice-list {
  display: grid;
  gap: 9px;
}

.report-plan-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}

.report-plan-option:hover {
  border-color: var(--primary);
}

.report-plan-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.report-plan-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.report-plan-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-plan-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

/* Typography tune: keep emphasis clear without making the whole UI feel heavy. */
body {
  font-size: 14px;
  line-height: 1.45;
}

h1,
h2,
h3,
strong {
  font-weight: 650;
}

label,
.checkbox-line,
.stack-form button,
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn,
.primary-link,
.plan-tab,
.segmented button,
.nav-button,
.project-button,
.sidebar-mini-button,
.user-pill,
.status-pill,
.tag {
  font-weight: 600;
}

label,
button,
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.primary-link,
.nav-button,
.project-button,
.plan-tab {
  font-size: 13px;
}

input,
select,
textarea {
  font-size: 14px;
}

.topbar h1 {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 650;
}

.login-card > h1 {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 650;
}

.login-card h1,
.install-card h1 {
  font-weight: 650;
}

.panel-head h2,
.panel-head h3,
.modal-head h2,
.modal-title-block h2 {
  font-size: 20px;
  font-weight: 650;
}

.project-card h3,
.task-title-line h3,
.task-color-head h3,
.segment-editor-head h3 {
  font-size: 15px;
  font-weight: 650;
}

.stat-card span,
.sidebar-section-title,
.modal-eyebrow,
.gantt-left,
.gantt-resize-hint {
  font-weight: 650;
  letter-spacing: 0.04em;
}

.stat-card strong {
  font-size: 26px;
  font-weight: 650;
}

.sidebar-title strong,
.sidebar-summary strong,
.nav-copy strong,
.project-name,
.user-pill strong,
.project-avatar span,
.user-avatar,
.task-color-badge strong,
.segment-number,
.segment-empty,
.report-plan-option strong {
  font-weight: 650;
}

.sidebar-title span,
.sidebar-summary span,
.sidebar-section-subtitle,
.nav-copy small,
.project-copy small,
.user-pill span,
.field-hint,
.gantt-hint,
.task-color-head p,
.segment-editor-head p,
.report-plan-option small {
  font-weight: 500;
}

.gantt-label {
  font-size: 13px;
  font-weight: 600;
}

.field-large input {
  font-size: 18px;
  font-weight: 600;
}

.segment-row input,
.task-color-picker input,
input,
select,
textarea {
  font-weight: 500;
}

.status-pill,
.tag,
.task-meta,
.gantt-hint,
.field-hint {
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .planner-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-screen {
    align-items: start;
    place-items: start center;
    padding: 16px;
  }

  .login-card {
    min-height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .login-card::before {
    right: 0;
    bottom: auto;
    height: 220px;
  }

  .login-card::after {
    display: none;
  }

  .login-card > .brand-mark,
  .login-card > h1,
  .login-card > p:first-of-type,
  .login-card .notice,
  .login-card .stack-form {
    grid-column: 1;
    grid-row: auto;
    width: auto;
    justify-self: stretch;
  }

  .login-card > .brand-mark {
    margin: 24px 24px 0;
  }

  .login-card > h1 {
    margin: 46px 24px 0;
    font-size: 34px;
  }

  .login-card > p:first-of-type {
    margin: 10px 24px 28px;
  }

  .login-card .stack-form {
    margin: 28px 24px 0;
    padding-top: 0;
  }

  .login-card .notice {
    margin: 24px 24px 0;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .layout:not(.sidebar-collapsed)::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 45;
    width: min(86vw, 330px);
    height: 100dvh;
    padding: 14px;
    border-right: 1px solid var(--sidebar-border);
    border-radius: 0 10px 10px 0;
    box-shadow: 22px 0 70px rgba(15, 23, 42, 0.28);
  }

  .sidebar-brand-card {
    padding: 10px;
  }

  .sidebar-title strong {
    font-size: 14px;
  }

  .sidebar-title span {
    font-size: 10px;
  }

  .nav-button,
  .project-button {
    min-height: 50px;
    font-size: 13px;
  }

  .nav-icon {
    width: 32px;
    height: 32px;
  }

  .project-nav {
    max-height: none;
  }

  .sidebar-summary {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar-block,
  .sidebar-projects,
  .sidebar-footer {
    border-radius: 10px;
  }

  .sidebar-footer {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }

  .sidebar-floating-toggle {
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    width: 40px;
    height: 40px;
    z-index: 44;
  }

  .content {
    padding: 64px 16px 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .org-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .member-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .member-row .icon-btn {
    grid-column: 1 / -1;
    justify-self: start;
    margin-left: 46px;
  }

  .org-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 50px;
  }

  .org-children {
    margin-left: 12px;
    padding-left: 14px;
  }

  .segment-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .segment-editor-head .secondary-btn {
    width: 100%;
  }

  .task-color-head,
  .task-color-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .task-color-badge {
    align-self: flex-start;
  }

  .task-color-picker label {
    min-width: 0;
    width: 100%;
  }

  .task-color-preview {
    width: 100%;
    height: 44px;
  }

  .segment-row {
    grid-template-columns: 28px minmax(0, 1fr) 36px;
  }

  .segment-row label {
    grid-column: 2 / -1;
  }

  .segment-remove {
    grid-column: 3;
    grid-row: 1;
  }

}
