@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap");

:root {
  --bg: #f6f4ef;
  --shell: #fbfaf6;
  --panel: #fffdf8;
  --card: #ffffff;
  --elevated: #f1eee6;
  --fg: #11120d;
  --text: #33352c;
  --muted: #6f7167;
  --low: #96988c;
  --border: rgba(26, 28, 20, 0.12);
  --border-soft: rgba(26, 28, 20, 0.08);
  --overlay: rgba(26, 28, 20, 0.04);
  --accent: #2B2D42;
  --accent-strong: #202235;
  --accent-soft: rgba(43, 45, 66, 0.14);
  --danger: #b42318;
  --warn: #9a6700;
  --ok: #4d7015;
  --font-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  text-rendering: geometricPrecision;
}

body {
  min-width: 0;
  margin: 0;
  background:
    radial-gradient(circle at 12% -10%, rgba(43, 45, 66, 0.12), transparent 34rem),
    radial-gradient(circle at 88% 8%, rgba(17, 18, 13, 0.055), transparent 24rem),
    linear-gradient(180deg, var(--bg), var(--shell));
}

body.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

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

button { cursor: pointer; }

.page-shell {
  min-height: 100vh;
  padding: 16px clamp(12px, 3vw, 28px) 56px;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  width: min(1300px, 100%);
  min-height: 68px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 248, 241, 0.88));
  box-shadow: 0 24px 70px rgba(43, 42, 32, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  color: var(--fg);
  font-weight: 760;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.nav-pills {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(26, 28, 20, 0.035);
}

.nav-pills a,
.mobile-menu a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-pills a.active,
.mobile-menu a.active {
  background: var(--accent);
  color: #fff;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.account-copy {
  min-width: 0;
  text-align: right;
  line-height: 1.15;
}

.account-copy strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
}

.account-copy span {
  display: block;
  max-width: 180px;
  overflow: hidden;
  color: var(--low);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-button { display: none; }

.container {
  width: min(1300px, 100%);
  margin: 0 auto;
}

.narrow { width: min(920px, 100%); }
.stack { display: grid; gap: 24px; }
.stack-lg { display: grid; gap: 36px; }

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin: 0; }

h1 {
  max-width: 840px;
  font-size: clamp(30px, 4.4vw, 54px);
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.02;
}

.internal-title {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.12;
}

h2 {
  font-size: 24px;
  font-weight: 720;
  line-height: 1.2;
}

h3 {
  font-size: 18px;
  font-weight: 720;
  line-height: 1.3;
}

.lead {
  max-width: 680px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

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

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }

.card,
.panel {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--card);
}

.card { padding: clamp(18px, 2vw, 24px); }

.panel {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 253, 248, 0.98));
  box-shadow: 0 18px 55px rgba(43, 42, 32, 0.06);
}

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

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

.panel-body { padding: 20px; }

.metric {
  display: grid;
  gap: 16px;
  min-height: 150px;
}

.metric strong {
  font-size: clamp(32px, 4vw, 46px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.metric span,
.muted {
  color: var(--muted);
  line-height: 1.6;
}

.meta {
  color: var(--low);
  font-size: 12px;
  line-height: 1.45;
}

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

.btn,
.button,
.icon-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(26, 28, 20, 0.055);
  color: var(--fg);
  font-size: 14px;
  font-weight: 720;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover,
.button:hover,
.icon-btn:hover { background: rgba(26, 28, 20, 0.08); }
.btn:active,
.button:active,
.icon-btn:active { transform: translateY(1px); }

.btn.primary,
.button.primary {
  background: var(--fg);
  color: #fff;
}

.btn.accent,
.button,
.button.accent {
  background: var(--accent);
  color: #fff;
}

.btn.secondary,
.button.secondary { border-color: var(--border); background: rgba(255, 255, 255, 0.62); color: var(--fg); }

.btn.danger,
.button.danger {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.07);
  color: var(--danger);
}

.icon-btn {
  width: 42px;
  padding: 0;
  border-color: var(--border);
}

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

.field label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.input,
.select,
.textarea,
.search,
input:not([type="checkbox"]):not([type="hidden"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--fg);
  outline: none;
}

input[type="file"] {
  min-height: auto;
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.textarea,
textarea {
  min-height: 108px;
  padding: 14px;
  resize: vertical;
}

.input::placeholder,
.search::placeholder { color: var(--low); }

.input:focus,
.select:focus,
.textarea:focus,
.search:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--low);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 14px;
}

tr:last-child td { border-bottom: 0; }

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

.row-title strong {
  color: var(--fg);
  font-weight: 740;
}

.pill,
.status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.status.published,
.status.active,
.status.file { color: var(--ok); background: rgba(77, 112, 21, 0.12); }
.status.draft,
.status.paused,
.status.link { color: var(--warn); background: rgba(245, 158, 11, 0.10); }
.status.inactive { color: var(--danger); background: rgba(180, 35, 24, 0.08); }

.switch,
.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.switch {
  width: 50px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(26, 28, 20, 0.06);
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch span {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 18, 13, 0.18);
  transition: transform 180ms ease, background 180ms ease;
}

.switch input:checked + span {
  transform: translateX(20px);
  background: var(--accent);
}

.auth-card {
  width: min(30rem, calc(100vw - 32px));
  padding: clamp(24px, 5vw, 34px);
  border: 1px solid var(--border-soft);
  border-radius: 32px;
  background:
    radial-gradient(circle at 12% 0%, rgba(43, 45, 66, 0.10), transparent 14rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 253, 248, 0.98));
  box-shadow: 0 32px 90px rgba(43, 42, 32, 0.16);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(26, 28, 20, 0.04);
}

.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 720;
}

.auth-tabs button.active {
  background: var(--accent);
  color: #fff;
}

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

.split-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.module-list,
.deliverable-list {
  display: grid;
  gap: 12px;
}

.module-row,
.deliverable-row,
.deliverable-item,
.project-card,
.project-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.56);
}

.module-row,
.deliverable-row,
.deliverable-item,
.project-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

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

.project-card {
  min-height: 220px;
  align-content: space-between;
}

.project-cover,
.project-cover-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(26, 28, 20, 0.06);
}

.project-cover-preview {
  margin-bottom: 10px;
}

.project-card:hover,
.project-item:hover,
.deliverable-row:hover,
.deliverable-item:hover {
  border-color: rgba(43, 45, 66, 0.32);
  background: rgba(43, 45, 66, 0.06);
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(26, 28, 20, 0.08);
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 50%);
  background: var(--accent-strong);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 30px;
  border: 1px dashed rgba(26, 28, 20, 0.20);
  border-radius: 28px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop,
.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(17, 18, 13, 0.36);
  backdrop-filter: blur(8px);
}

.modal-backdrop.open,
.mobile-backdrop.open { display: grid; }

.modal {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 30px 100px rgba(43, 42, 32, 0.22);
}

.mobile-menu {
  width: min(420px, 100%);
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  max-width: min(380px, calc(100vw - 32px));
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--fg);
  color: #fff;
  box-shadow: 0 20px 70px rgba(43, 42, 32, 0.20);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.flash {
  width: min(1300px, 100%);
  margin: 0 auto 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.70);
}

.flash.success { color: var(--ok); background: rgba(77, 112, 21, 0.12); }
.flash.error { color: var(--danger); background: rgba(180, 35, 24, 0.07); }

[hidden] { display: none !important; }

@media (max-width: 1080px) {
  .nav-pills { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .menu-button { display: inline-flex; }
  .account-copy { display: none; }
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 { grid-column: span 6; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page-shell { padding-top: 12px; }
  .topbar {
    top: 10px;
    min-height: 62px;
    margin-bottom: 24px;
    padding: 8px 10px 8px 12px;
    border-radius: 26px;
  }
  .page-head {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .toolbar { width: 100%; }
  .toolbar .btn,
  .toolbar .button,
  .toolbar .search,
  .toolbar .select { flex: 1 1 100%; }
  .grid { grid-template-columns: 1fr; }
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 { grid-column: 1; }
  .panel-head,
  .panel-foot,
  .module-row,
  .deliverable-row,
  .deliverable-item,
  .project-item {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .panel-head,
  .panel-foot {
    display: grid;
  }
  .project-grid { grid-template-columns: 1fr; }
  .split-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .split-actions .btn,
  .split-actions .button { width: 100%; }
  h1 { font-size: clamp(30px, 10vw, 42px); }
}
