@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --line: #e3e7ee;
  --ink: #0f172a;
  --muted: #5d6676;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #dff3ee;
  --accent-glow: rgba(15, 118, 110, 0.18);
  --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 20px 50px rgba(15, 23, 42, 0.12);
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
}

:root[data-theme="mono"] {
  color-scheme: light;
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-strong: #f7f7f7;
  --line: #d6d6d6;
  --ink: #111111;
  --muted: #5a5a5a;
  --accent: #111111;
  --accent-strong: #000000;
  --accent-soft: #efefef;
  --accent-glow: rgba(17, 17, 17, 0.16);
}

:root[data-theme="ocean"] {
  color-scheme: light;
  --bg: #eff5ff;
  --surface: #ffffff;
  --surface-strong: #f5f8ff;
  --line: #d8e2f2;
  --ink: #0b1b33;
  --muted: #4c5f7a;
  --accent: #2563eb;
  --accent-strong: #1e40af;
  --accent-soft: #e0ebff;
  --accent-glow: rgba(37, 99, 235, 0.18);
}

:root[data-theme="sage"] {
  color-scheme: light;
  --bg: #f2f6f1;
  --surface: #ffffff;
  --surface-strong: #edf4ef;
  --line: #d9e3da;
  --ink: #1e2b24;
  --muted: #5d6b63;
  --accent: #2f7d5a;
  --accent-strong: #1f5c43;
  --accent-soft: #e2f1e7;
  --accent-glow: rgba(47, 125, 90, 0.18);
}

:root[data-theme="ember"] {
  color-scheme: light;
  --bg: #fff4f2;
  --surface: #ffffff;
  --surface-strong: #fff1ee;
  --line: #efd9d2;
  --ink: #2c1a17;
  --muted: #7a5d57;
  --accent: #e24a3b;
  --accent-strong: #b93225;
  --accent-soft: #fde7e4;
  --accent-glow: rgba(226, 74, 59, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(15, 118, 110, 0.12), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(59, 130, 246, 0.12), transparent 40%),
    var(--bg);
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  letter-spacing: -0.01em;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand__logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.brand__logo-frame {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #0f172a;
  display: grid;
  place-items: center;
  padding: 4px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

.brand__logo-img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: contain;
  background: transparent;
}

.brand__name {
  font-size: 1rem;
}

.topbar__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  position: relative;
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
}

.theme-switcher__label {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-switcher select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
  outline: none;
  appearance: none;
  padding-right: 18px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 12px) 52%, calc(100% - 7px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.user-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.user-summary__text {
  display: grid;
  gap: 2px;
}

.user-summary__name {
  font-weight: 600;
  font-size: 0.85rem;
}

.user-summary__title {
  font-size: 0.7rem;
  color: var(--muted);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-strong);
  display: block;
  transition: background 0.15s ease, width 0.15s ease;
}

.menu-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.menu-toggle:hover span {
  background: #fff;
  width: 20px;
}

.menu-toggle:active {
  transform: scale(0.96);
}

.menu-panel {
  position: absolute;
  top: 72px;
  right: 32px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  display: none;
  z-index: 20;
}

.menu-panel.is-open {
  display: grid;
  gap: 12px;
}

.menu-links {
  display: grid;
  gap: 6px;
}

.menu-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

.menu-links a.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.menu-section {
  display: grid;
  gap: 8px;
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.content {
  padding: 28px 48px 64px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
}

.section-head h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.kpi-card {
  background: var(--surface);
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  min-height: 140px;
  display: grid;
  gap: 8px;
}

.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
}

.kpi-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid currentColor;
}

.kpi-icon--danger { color: var(--danger); }
.kpi-icon--warn { color: var(--warning); }
.kpi-icon--accent { color: var(--accent); }
.kpi-icon--ok { color: #0ea5e9; }

.kpi-value {
  font-size: 1.8rem;
  margin: 0;
  font-weight: 700;
}

.kpi-sub a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.panel {
  background: var(--surface);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  min-height: 280px;
}

.panel--large {
  min-height: 320px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.panel-head a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.panel-empty {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  margin-top: 32px;
  color: var(--muted);
}

.panel-icon {
  font-size: 2rem;
  color: #c4c7cf;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  flex-wrap: wrap;
}

.toolbar--projects {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.toolbar--projects .search {
  background: var(--surface-strong);
}

.filter-group {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  min-width: 240px;
}

.search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-family: inherit;
}

.filter {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface);
}

.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 20px var(--accent-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 12px 24px var(--accent-glow);
  transform: translateY(-1px);
}

.secondary {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent-soft);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.secondary:hover {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
}

.table-wrap {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.data-table th {
  background: #f3f4f6;
  color: var(--muted);
  font-weight: 600;
}

.data-table td.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 12px;
}

.tabs {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  background: #f1f3f5;
  border-radius: 10px;
  margin: 16px 0;
}

.tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}

.tab.is-active {
  background: var(--surface);
  border: 1px solid var(--line);
}

.project-header {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

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

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.back-button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-decoration: none;
  color: inherit;
  padding: 4px 0;
}

.list-link:hover {
  color: var(--accent-strong);
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status--todo,
.status--draft {
  background: #eef2ff;
  color: #4338ca;
}

.status--in_progress,
.status--active,
.status--sent {
  background: #dcfce7;
  color: #15803d;
}

.status--review,
.status--revision,
.status--on_hold {
  background: #fae8ff;
  color: #7e22ce;
}

.status--done,
.status--completed,
.status--paid {
  background: #e0f2fe;
  color: #0369a1;
}

.status--overdue {
  background: #fee2e2;
  color: #b91c1c;
}

.phase {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status:hover,
.phase:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.phase--pre_production {
  background: #fef3c7;
  color: #b45309;
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.18);
}

.phase--production {
  background: #ccfbf1;
  color: #0f766e;
  box-shadow: 0 10px 20px rgba(13, 148, 136, 0.18);
}

.phase--post_production {
  background: #ede9fe;
  color: #6d28d9;
  box-shadow: 0 10px 20px rgba(109, 40, 217, 0.18);
}

.phase--done {
  background: #e2e8f0;
  color: #475569;
  box-shadow: 0 10px 20px rgba(71, 85, 105, 0.18);
}

.tasks-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.projects-view {
  display: grid;
  gap: 18px;
  position: relative;
}

.projects-view::before {
  content: "";
  position: absolute;
  inset: -20px -20px auto;
  height: 160px;
  background: radial-gradient(circle at 20% 20%, var(--accent-soft), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.projects-view > * {
  position: relative;
  z-index: 1;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.project-section {
  display: grid;
  gap: 16px;
  padding: 14px 0 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.project-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.project-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7faf9 100%);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  animation: cardIn 0.45s ease both;
  animation-delay: calc(var(--stagger, 0) * 70ms);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  opacity: 0.75;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
}

.project-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.project-card__head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.project-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px dashed var(--line);
}

.project-card__meta strong {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
}

.project-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}

.project-card__people {
  display: grid;
  gap: 10px;
}

.meta-block {
  display: grid;
  gap: 6px;
}

.meta-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  min-width: 160px;
}

.meta-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.meta-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.avatar--xs {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
}

.avatar-img--xs {
  width: 24px;
  height: 24px;
  border-radius: 999px;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack > .avatar,
.avatar-stack > .avatar-img {
  border: 2px solid var(--surface);
  margin-left: -8px;
}

.avatar-stack > .avatar:first-child,
.avatar-stack > .avatar-img:first-child {
  margin-left: 0;
}

.project-hero {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.project-hero__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.project-hero__top h2 {
  margin: 0;
}

.project-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.project-bubble {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.task-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  animation: cardIn 0.4s ease both;
  animation-delay: calc(var(--stagger, 0) * 60ms);
}

.task-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.task-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.task-card__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
}

.task-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-card__desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.task-card__people {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.task-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-status select,
.task-asset-form select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--surface);
  font-family: inherit;
}

.task-asset-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-card__assets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-card__refs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-asset-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-asset-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.note-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 60%);
}

.note-card__body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}

.note-card__meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.reference-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr) minmax(200px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 10px;
}

.mention-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mention-row--compact {
  margin-bottom: 16px;
}

.mention-chip {
  border: 1px dashed var(--line);
  background: var(--surface);
  color: var(--accent-strong);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.mention-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mention {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.member-list {
  display: grid;
  gap: 10px;
}

.member-list--stack {
  margin-top: 8px;
}

.member-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.member-pill__text {
  display: grid;
  gap: 2px;
}

.modal__body--stack {
  margin-top: 12px;
}

.reference-form input,
.reference-form select {
  width: 100%;
}

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

.reference-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.reference-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.reference-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0f172a;
}

.reference-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.reference-link {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent-strong);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 20, 0.55);
}

.modal__dialog {
  position: relative;
  background: #f8f9fb;
  border-radius: 16px;
  padding: 24px;
  width: min(720px, 90vw);
  max-height: 90vh;
  overflow: auto;
  z-index: 1;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal__body {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.modal__body label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.modal__body input,
.modal__body select,
.modal__body textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  background: #fff;
}

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

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.line-items {
  display: grid;
  gap: 10px;
  background: #f2f4f8;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
}

.line-items__head,
.line-items__row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.9fr 1fr;
  gap: 10px;
  align-items: center;
}

.line-items__head {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.line-items__row select,
.line-items__row input {
  width: 100%;
}

.invoice-sheet {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 28px;
  font-family: 'Manrope', sans-serif;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.invoice-header h1 {
  margin: 0 0 6px;
}

.invoice-logo img {
  width: 140px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
}

.invoice-meta {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.invoice-meta span {
  color: var(--muted);
  display: inline-block;
  width: 80px;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 8px;
  text-align: left;
}

.invoice-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  margin-top: 16px;
}

.icon-btn {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
}

.assistant {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  min-height: 520px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.assistant-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.assistant-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.assistant-body {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  padding: 18px;
  min-height: 320px;
  overflow-y: auto;
}

.assistant-empty {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 260px;
}

.assistant-hero {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.assistant-input {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.assistant-input input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  background: transparent;
}

.quote-builder {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.quote-builder__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.quote-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.quote-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background-color: #f8fafc;
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  border: 1px solid var(--line);
}

.quote-builder__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.quote-field {
  display: grid;
  gap: 8px;
}

.quote-field__label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.quote-field__stack {
  display: grid;
  gap: 8px;
}

.quote-builder input,
.quote-builder select,
.quote-sheet__fields input,
.quote-sheet__fields select,
.quote-sheet .quote-item-row input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
}

.quote-sheet__fields input,
.quote-sheet__fields select,
.quote-sheet .quote-item-row input {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--line);
  padding-left: 0;
  background: transparent;
}

.quote-total {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  text-align: right;
}

.quote-items {
  display: grid;
  gap: 10px;
}

.quote-items__head,
.quote-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.quote-items__head {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.quote-item-row input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
}

.quote-items__actions {
  display: flex;
  justify-content: flex-start;
}

.quote-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--surface);
  font-family: inherit;
}

.quote-list {
  margin-top: 24px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.quote-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.quote-card h4 {
  margin: 0;
}

.quote-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quote-card--archived {
  opacity: 0.7;
  border-style: dashed;
}

.quote-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.quote-sheet__status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quote-sheet__status form {
  margin: 0;
}

.quote-sheet__header {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(200px, 1fr) minmax(160px, 0.8fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.quote-sheet__brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.quote-sheet__logo {
  width: 180px;
  height: 90px;
  object-fit: contain;
  border-radius: 0;
  border: none;
  background: transparent;
}

.quote-sheet__logo-wrap {
  display: flex;
  align-items: flex-start;
}

.quote-sheet__title {
  display: grid;
  gap: 6px;
  text-align: center;
}

.quote-sheet__title h2 {
  margin: 0;
  font-size: 1.3rem;
}

.quote-sheet__meta {
  display: grid;
  gap: 8px;
  text-align: right;
}

.quote-sheet__client {
  margin: 10px 0 4px;
}

.branding-preview img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--line);
  background-color: #f8fafc;
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  margin: 12px 0;
}

.branding-block + .branding-block {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.branding-block h4 {
  margin: 0 0 4px;
}

.branding-block p {
  margin: 0 0 12px;
}

.quote-sheet__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
}

.quote-table th,
.quote-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.quote-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 700;
}

@media print {
  @page {
    margin: 16mm;
  }
  body {
    margin: 0;
  }
  .topbar,
  .page-header,
  .tabs,
  .quote-actions,
  .back-button,
  .quote-sheet__status,
  .quote-items__actions {
    display: none !important;
  }
  .content {
    padding: 0;
  }
  .quote-sheet {
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .quote-sheet__logo {
    width: 210px;
    height: 110px;
  }
  .quote-items__head,
  .quote-item-row {
    grid-template-columns: 2fr 1fr;
  }
  .quote-items__head span:last-child,
  .quote-item-row button {
    display: none !important;
  }
  .quote-sheet input,
  .quote-sheet select {
    border: none;
    padding: 0;
    background: transparent;
    appearance: none;
  }
}

.assistant-response {
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  white-space: pre-wrap;
}

.assistant-response pre {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  white-space: pre-wrap;
}

.chat {
  display: grid;
  gap: 16px;
}

.chat__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.chat__row--user {
  justify-content: flex-end;
}

.chat__row--assistant {
  justify-content: flex-start;
}

.chat__content {
  display: grid;
  gap: 6px;
}

.chat__row--user .chat__content {
  align-items: flex-end;
  text-align: right;
}

.chat__label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.chat__avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.chat__avatar--user {
  background: var(--accent);
  color: #fff;
}

.chat__bubble {
  max-width: 70%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.chat__bubble--user {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-color: transparent;
}

.chat__bubble--assistant {
  background: linear-gradient(135deg, var(--accent-soft), #ffffff 70%);
  border-color: var(--accent-soft);
}

.chat__bubble p {
  margin: 0;
  white-space: pre-wrap;
  font-family: 'Manrope', sans-serif;
}

select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  font-family: inherit;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  max-width: 360px;
  width: 100%;
}

.login-card form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-family: inherit;
}

.error {
  color: var(--danger);
}

.success {
  color: var(--success);
  font-weight: 600;
}

@media (max-width: 960px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar__right {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .content {
    padding: 24px;
  }
  .quote-sheet__header {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .quote-sheet__title {
    text-align: left;
  }
  .quote-sheet__meta {
    text-align: left;
  }
  .quote-builder__top {
    align-items: flex-start;
  }
  .reference-form {
    grid-template-columns: 1fr;
  }
  .project-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .project-card__people {
    width: 100%;
  }
  .project-hero__meta {
    align-items: stretch;
  }
}
