:root {
  color-scheme: light;
  --bg: #eef2ef;
  --panel: #ffffff;
  --panel-strong: #f8faf8;
  --text: #17211d;
  --muted: #5b6b61;
  --line: #d7ded8;
  --primary: #198754;
  --primary-strong: #11663e;
  --primary-soft: #dff4e8;
  --accent: #2457a6;
  --danger: #b42318;
  --warning: #a15c07;
  --shadow: 0 18px 44px rgba(21, 38, 28, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(140deg, rgba(25, 135, 84, 0.12), transparent 36%),
    linear-gradient(320deg, rgba(36, 87, 166, 0.11), transparent 40%),
    var(--bg);
  color: var(--text);
}

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

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

a {
  color: var(--accent);
}

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

.auth-page,
.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 22px;
}

.brand-row,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #18231f;
  color: #fff;
  font-weight: 900;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.eyebrow {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

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

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.panel,
.item-card,
.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

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

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

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

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

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

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-secondary {
  background: #1f2a35;
  color: #fff;
}

.btn-ghost {
  background: #edf1ee;
  color: #223029;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary-strong);
}

.banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel-strong);
  color: var(--text);
}

.banner.error {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff1f0;
  color: var(--danger);
}

.banner.success {
  border-color: rgba(25, 135, 84, 0.35);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 14px 0;
  backdrop-filter: blur(14px);
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-head {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 18px;
}

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

.item-card {
  padding: 14px;
  box-shadow: none;
}

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

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.tag.blue {
  background: #e6eefb;
  color: #204f99;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

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

.checkbox-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

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

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.detail-content {
  display: grid;
  gap: 14px;
}

.media-frame {
  border: 1px solid #1b2a24;
  border-radius: 8px;
  background: #0b2b25;
  overflow: hidden;
}

.media-frame img,
.media-frame video {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #071612;
}

.board-canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  border-radius: 8px;
  background: #0b2b25;
  touch-action: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 15, 12, 0.56);
}

.modal {
  width: min(940px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  padding: 20px;
}

.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .auth-grid,
  .dashboard-grid,
  .profile-grid,
  .split-fields {
    grid-template-columns: 1fr;
  }

  .brand-row,
  .topbar,
  .item-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-page,
  .page {
    width: min(100% - 20px, 1180px);
    padding: 16px 0;
  }
}
