@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --ink: #1a1a1a;
  --muted: #6b7280;
  --paper: #ffffff;
  --canvas: #f1ede6;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --border: #e5e7eb;
  --shadow: 0 18px 40px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(244, 114, 182, 0.08), transparent 45%),
    radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.08), transparent 40%),
    linear-gradient(120deg, #f7f2ea 0%, #f1ede6 60%, #efe9df 100%);
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(160deg, #111827, #0f172a 55%, #1f2937);
  color: #f9fafb;
  padding: 1.75rem 1.35rem;
}

.sidebar h1 {
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  margin: 0 0 1.5rem 0;
}

.sidebar nav a {
  display: block;
  color: #d1d5db;
  text-decoration: none;
  padding: 0.5rem 0;
}


.sidebar nav a.active {
  color: #fff;
  font-weight: 700;
}

.sidebar nav a.disabled {
  color: #6b7280;
  pointer-events: none;
}

.sidebar .workspace {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

.content {
  padding: 2rem 3vw;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.card {
  background: var(--paper);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(17, 24, 39, 0.04);
  animation: card-rise 0.35s ease both;
}

.card h3, .card h2 {
  font-family: "Fraunces", serif;
}

.card.form-card {
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.workspace-list {
  display: grid;
  gap: 0.75rem;
}

.workspace-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fcfaf6;
}

.workspace-item.active {
  border-color: rgba(180, 83, 9, 0.4);
  background: var(--accent-soft);
}

.workspace-name {
  font-weight: 600;
}

.workspace-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-name {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid rgba(180, 83, 9, 0.2);
  font-weight: 600;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
  padding: 0;
}

button.danger {
  background: #b91c1c;
  color: #fff;
  border: 1px solid #b91c1c;
}

button.danger:hover {
  background: #991b1b;
  border-color: #991b1b;
}

.icon-button.danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.link-button {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.form-section {
  background: #fdfbf8;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  min-width: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.form-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.form-section.wide {
  grid-column: span 2;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
}

.form-section label {
  display: block;
  margin-bottom: 0.35rem;
}

.row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.row > div {
  flex: 1;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 0.95rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
}

input:disabled {
  background: #f3f4f6;
  color: var(--muted);
}

.static-field {
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

button {
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #fff;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}

button.secondary {
  background: #6b7280;
}

button:active {
  transform: translateY(1px);
}

.icon-button:active,
.secondary:active {
  transform: translateY(1px);
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.banner {
  background: #fee2e2;
  color: #7f1d1d;
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.banner-actions {
  display: flex;
  gap: 0.5rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 10;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  width: min(640px, 100%);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.password-field {
  position: relative;
}

.password-field .icon-button {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-25%);
  width: 32px;
  height: 32px;
}

.password-field svg {
  width: 18px;
  height: 18px;
}

.password-field input {
  padding-left: 3rem;
}

.password-actions {
  display: flex;
  gap: 0.5rem;
  align-items: end;
}
.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.page-hero {
  background: var(--paper);
  border-radius: 22px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(17, 24, 39, 0.06);
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
}

.page-hero h2 {
  margin: 0.25rem 0 0.5rem 0;
  font-family: "Fraunces", serif;
  font-size: 2rem;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

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

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.page-aside {
  position: sticky;
  top: 1.5rem;
}

.info-card {
  background: var(--accent-soft);
  border: 1px solid rgba(180, 83, 9, 0.2);
}

.muted {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.empty {
  color: #6b7280;
}

.cta {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #111827;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
}

.checkboxes label {
  display: inline-flex;
  align-items: center;
  margin-right: 0.75rem;
}

.negatives {
  margin-top: 0.75rem;
  background: #f9fafb;
  padding: 0.75rem;
  border-radius: 8px;
}

.negative-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.negative-input {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.negative-input select {
  min-width: 150px;
  max-width: 180px;
}

.negative-input input {
  flex: 1;
  min-width: 220px;
}

.status {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 0.85rem;
}

.error {
  color: #b91c1c;
}

.success {
  color: #047857;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

.table th, .table td {
  text-align: left;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.filter-col {
  position: relative;
}

.filter-trigger {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.filter-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.sort-trigger {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sort-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  color: var(--muted);
}

.sort-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.filter-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.4rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.75rem;
  z-index: 5;
  min-width: 180px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.filter-option input[type="checkbox"] {
  accent-color: #111827;
  width: 16px;
  height: 16px;
}

.filter-option span {
  line-height: 1.2;
}

.table td:last-child,
.table th:last-child {
  width: 120px;
}

.preview-stack {
  display: grid;
  gap: 1.5rem;
}

.campaign-card {
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: #fffdf9;
}

.campaign-title {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.campaign-title h3 {
  margin: 0;
}

.campaign-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.campaign-body {
  display: grid;
  gap: 1rem;
}

.campaign-field {
  display: grid;
  gap: 0.35rem;
}

.campaign-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1rem;
}

.ad-group-table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ad-group-item {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.ad-group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
}

.ad-group-negatives {
  margin-top: 0.75rem;
}


.negatives.compact {
  margin-top: 0;
}

.negatives.compact h4 {
  margin-top: 0;
  font-size: 0.9rem;
}

.negatives-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.75rem;
}

.negatives-stack {
  display: grid;
  gap: 0.75rem;
}

.warn {
  background: #fef3c7;
  padding: 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

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

  .form-section.wide {
    grid-column: span 1;
  }

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

  .page-aside {
    position: static;
  }

  .page-hero {
    grid-template-columns: 1fr;
  }
}
