@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  color-scheme: light;
  font-family: "Inter", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e1e1e;
  background: #fff9f4;
  font-synthesis: none;
  --ink: #1e1e1e;
  --muted: #777777;
  --line: #f1ddd6;
  --panel: #ffffff;
  --bg-page: #fff9f4;
  --secondary-bg: #fffdfb;
  --primary: #d72638;
  --primary-dark: #b71c2d;
  --primary-glow: rgba(215, 38, 56, 0.10);
  --soft-red: #fce7e9;
  --hover-border: #d72638;
  --green: #28c76f;
  --green-bg: #e6f4ea;
  --red: #ea5455;
  --red-bg: #fce4e4;
  --amber: #ff9f43;
  --amber-bg: #fff4e5;
  --cyan: #00bad1;
  --cyan-bg: #e3f2fd;
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 8px 32px rgba(215, 38, 56, 0.04);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg-page); overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(440px, 660px);
  align-content: center;
  justify-content: center;
  padding: 32px;
  box-sizing: border-box;
}

.auth-brand {
  min-height: 600px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  background: linear-gradient(145deg, #fff9f4 0%, #fce7e9 100%);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 20px 0 0 20px;
  box-sizing: border-box;
}

.auth-brand-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.brand-mark-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand-mark-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-mark-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--ink);
  line-height: 1;
}

.brand-tagline {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--primary);
  margin-top: 3px;
}

.auth-brand h1 {
  max-width: 360px;
  margin: 24px 0 10px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.auth-brand h1 .highlight-red { color: var(--primary); }
.auth-brand h1 .dot { color: var(--ink); }

.auth-brand p {
  max-width: 350px;
  margin: 0 0 16px;
  color: #555555;
  font-size: 14px;
  line-height: 1.6;
}

.auth-features-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 12px 0 20px;
}

.auth-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.auth-feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #FEECE7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-feature-item strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.auth-feature-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.auth-3d-illustration {
  margin: 12px 0 24px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-3d-illustration img {
  width: 100%;
  max-width: 340px;
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(215, 38, 56, 0.12));
}

.auth-lock-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 12px;
  color: #555555;
  box-shadow: var(--shadow-xs);
}

.auth-panel {
  min-height: 600px;
  display: grid;
  place-items: center;
  padding: 36px 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0 20px 20px 0;
  box-shadow: 0 20px 60px rgba(215, 38, 56, 0.06);
  box-sizing: border-box;
}

.auth-card { width: 100%; }
.auth-card h2 { margin: 0 0 6px; color: var(--ink); font-size: 26px; font-weight: 800; }
.auth-card > p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Auth form input wraps & pill buttons */
.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input-wrap .field-icon {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  pointer-events: none;
  z-index: 2;
}

.field-input-wrap input,
.field-input-wrap select,
.field-input-wrap textarea {
  padding-left: 48px !important;
}

.field-input-wrap textarea {
  padding-top: 14px !important;
}

.field-input-wrap .password-toggle-btn {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  z-index: 2;
}

.field-input-wrap .password-toggle-btn:hover {
  color: var(--primary);
}

.upload-field-container {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border: 1.5px dashed #F5C6C6;
  border-radius: 14px;
  background: #FFFDFD;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-field-container:hover {
  background: var(--soft-red);
  border-color: var(--primary);
}

.upload-field-icon {
  color: var(--primary);
  display: flex;
  align-items: center;
}

.upload-field-btn {
  padding: 8px 18px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}

.upload-field-filename {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.btn-pill-red {
  height: 48px;
  padding: 0 28px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 16px rgba(215, 38, 56, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-pill-red:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(215, 38, 56, 0.35);
  transform: translateY(-1px);
}

.btn-pill-white {
  height: 48px;
  padding: 0 24px;
  background: #ffffff;
  color: #475569;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #E2E8F0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-pill-white:hover {
  background: var(--bg-page);
  border-color: var(--primary);
  color: var(--primary);
}

/* Main application shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); background: var(--bg-page); }
.brand-mark { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 20px; font-weight: 800; letter-spacing: -0.3px; text-decoration: none; }
.brand-mark img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; box-shadow: var(--shadow-xs); flex-shrink: 0; }
.sidebar { height: 100vh; position: sticky; top: 0; padding: 28px 20px; color: var(--ink); background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.sidebar .brand-mark { padding: 0 8px 28px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: #555555;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
}
.nav a:hover { color: var(--primary); background: var(--soft-red); }
.nav a.active { color: #ffffff; background: var(--primary); font-weight: 600; box-shadow: 0 4px 14px rgba(215, 38, 56, 0.25); }
.nav a .nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; color: #6b7280; flex-shrink: 0; }
.nav a:hover .nav-icon { color: var(--primary); }
.nav a.active .nav-icon { color: #ffffff; }
.nav a.active .nav-icon svg { stroke: #ffffff; }
.bottom-nav, .mobile-sheet-overlay { display: none; }
.main { min-width: 0; }
.topbar {
  min-height: 72px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-mobile-brand { display: none; align-items: center; text-decoration: none; flex-shrink: 0; }
.topbar-mobile-brand img { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.topbar h1 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 13px; font-weight: 600; flex-shrink: 0; }
.btn-landing-link {
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-landing-link svg { color: var(--muted); transition: color 0.2s ease; }
.btn-landing-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--soft-red);
}
.btn-landing-link:hover svg { color: var(--primary); }
.topbar-user-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .btn, #logout {
  height: 38px;
  padding: 0 18px;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.user-chip .btn:hover, #logout:hover {
  background: var(--primary);
  color: #ffffff;
}
.mobile-sheet-landing-link {
  border: 1px dashed rgba(215, 38, 56, 0.35) !important;
  background: rgba(215, 38, 56, 0.04) !important;
  color: var(--primary) !important;
  margin-bottom: 6px;
}
.mobile-sheet-landing-link .sheet-link-icon {
  color: var(--primary) !important;
}
.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 28px; }
.bottom-nav { display: none; }

/* Layout and cards */
.grid { display: grid; gap: 20px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card h2, .card h3 { margin: 0 0 14px; color: var(--ink); }
.card h2 { font-size: 18px; font-weight: 700; }
.card h3 { font-size: 16px; font-weight: 700; }
.stats .card { min-height: 122px; position: relative; overflow: hidden; }
.stats .card::before { content: ""; width: 4px; position: absolute; inset: 0 auto 0 0; background: var(--primary); }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.stat-value { margin-top: 10px; color: var(--ink); font-size: 30px; font-weight: 800; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.empty { padding: 48px 24px; color: var(--muted); text-align: center; }

/* Messages */
.notice {
  margin: 14px 0;
  padding: 14px 18px;
  color: var(--muted);
  background: var(--bg-page);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.notice.error { color: var(--red); background: var(--red-bg); border-color: rgba(234, 84, 85, 0.2); }
.notice.success { color: var(--green); background: var(--green-bg); border-color: rgba(40, 199, 111, 0.2); }
.todo { padding: 14px 18px; color: #9a5b1a; background: var(--amber-bg); border: 1px solid rgba(255, 159, 67, 0.2); border-left: 4px solid var(--amber); border-radius: 14px; font-size: 13px; line-height: 1.5; }

.payment-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 18px;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-page) 0%, var(--secondary-bg) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.payment-summary strong:last-child { margin-left: auto; color: var(--primary); font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }

.payment-box { margin-top: 20px; padding: 24px; background: var(--secondary-bg); border: 1px solid var(--line); border-radius: 16px; }
.payment-box h3 { margin: 0 0 8px; }
.payment-box p { margin: 0; color: var(--muted); }
.upload-progress { height: 8px; margin-top: 16px; overflow: hidden; background: var(--line); border-radius: 99px; }
.upload-progress span { display: block; width: 0; height: 100%; background: var(--primary); transition: width 0.25s ease; }
.campaign-upload-status { margin-top: 8px; }
.placement-help { margin: 0; grid-column: 1 / -1; }
.campaign-card { padding: 28px; }
.campaign-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.campaign-heading h2 { margin-bottom: 6px; font-size: 22px; font-weight: 800; }
.campaign-heading p { margin: 0; }

.campaign-form-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(215, 38, 56, 0.25);
}

.upload-container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 2px dashed var(--primary);
  border-radius: 14px;
  background: var(--bg-page);
  cursor: pointer;
  transition: background 0.25s ease;
}
.upload-container:hover { background: var(--soft-red); }
.upload-icon { color: var(--primary); display: flex; align-items: center; }
.upload-filename { font-size: 13px; color: var(--muted); font-weight: 500; }

.campaign-builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 24px; align-items: start; }
.campaign-form { min-width: 0; }
.campaign-media-preview { width: 100%; max-height: 360px; object-fit: contain; margin-top: 10px; border-radius: 14px; background: var(--bg-page); border: 1px solid var(--line); }
.campaign-payment-note { margin-top: 16px; }

.campaign-panel-picker {
  min-width: 0;
  position: sticky;
  top: 96px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.campaign-panel-picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.campaign-panel-picker-head h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.campaign-panel-picker-head p { margin: 0; color: var(--muted); font-size: 12px; }
.campaign-panel-count { flex: 0 0 auto; padding: 6px 14px; color: #ffffff; background: var(--primary); border-radius: 99px; font-size: 12px; font-weight: 700; }
.campaign-panel-actions { display: flex; gap: 8px; margin: 12px 0; }
.campaign-panel-actions .btn { height: 34px; padding: 0 14px; font-size: 12px; border-radius: 8px; }

.campaign-panel-list {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.campaign-panel-option {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  white-space: normal;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.campaign-panel-option:hover { background: var(--bg-page); border-color: var(--primary); }
.campaign-panel-option:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(215, 38, 56, 0.08); }
.campaign-panel-option.selected { background: var(--soft-red); border-color: var(--primary); }
.campaign-panel-option input { width: 1px; height: 1px; position: absolute; opacity: 0; pointer-events: none; }
.campaign-panel-check { width: 18px; height: 18px; margin-top: 2px; display: grid; place-items: center; border: 2px solid #dddddd; border-radius: 5px; background: #ffffff; flex-shrink: 0; transition: all 0.2s ease; }
.campaign-panel-option.selected .campaign-panel-check { color: #ffffff; background: var(--primary); border-color: var(--primary); }
.campaign-panel-option.selected .campaign-panel-check::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #ffffff; border-bottom: 2px solid #ffffff; transform: translateY(-1px) rotate(-45deg); }
.campaign-panel-option strong { display: block; font-size: 13px; font-weight: 700; color: var(--ink); word-break: break-word; white-space: normal; overflow: visible; }
.campaign-panel-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; word-break: break-word; }
.campaign-panel-validation { margin-top: 10px; color: var(--red); font-size: 12px; font-weight: 600; }

.campaign-panel-price {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding: 18px;
  background: linear-gradient(135deg, var(--bg-page) 0%, var(--secondary-bg) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.campaign-panel-price strong:first-child { color: var(--ink); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.campaign-panel-price strong:last-child { margin: 4px 0 0; font-size: 24px; font-weight: 800; color: var(--primary); }
.campaign-panel-details summary { cursor: pointer; color: var(--primary-dark); font-weight: 700; }
.campaign-panel-details div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.campaign-panel-details span { padding: 3px 6px; color: #555555; background: var(--bg-page); border-radius: 5px; font-size: 10px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field textarea { height: auto; min-height: 110px; padding: 14px 16px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #bbbbbb; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(215, 38, 56, 0.08); }
.field input[type="checkbox"] { width: auto; height: auto; accent-color: var(--primary); }
.field label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 9px; text-transform: none; letter-spacing: 0; color: #555555; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Buttons */
.btn {
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  color: #555555;
  background: #ffffff;
  border: 1.5px solid #e0e0e0;
  border-radius: 14px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}
.btn:hover { color: var(--primary); background: var(--soft-red); border-color: var(--primary); }
.btn.primary { color: #ffffff; background: var(--primary); border: none; border-radius: 14px; box-shadow: 0 4px 14px rgba(215, 38, 56, 0.25); }
.btn.primary:hover { background: var(--primary-dark); box-shadow: 0 6px 20px rgba(215, 38, 56, 0.35); transform: translateY(-1px); }
.btn.success { color: var(--green); background: var(--green-bg); border: none; border-radius: 14px; }
.btn.success:hover { color: #ffffff; background: var(--green); }
.btn.danger { color: var(--red); background: var(--red-bg); border: none; border-radius: 14px; }
.btn.danger:hover { color: #ffffff; background: var(--red); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.btn:active { transform: scale(0.98); }

/* Tables and status */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 14px 16px; color: var(--ink); border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; font-size: 13px; }
th { color: var(--muted); background: var(--bg-page); font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-page); }
.badge { display: inline-flex; align-items: center; padding: 5px 12px; color: #555555; background: var(--line); border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.badge.active, .badge.approved, .badge.redeemed, .badge.done, .badge.online, .badge.processed { color: var(--green); background: var(--green-bg); }
.badge.pending, .badge.applied, .badge.pending_approval, .badge.offered, .badge.warning { color: var(--amber); background: var(--amber-bg); }
.badge.suspended, .badge.rejected, .badge.offline, .badge.failed { color: var(--red); background: var(--red-bg); }
.metric-bar { height: 8px; overflow: hidden; background: var(--line); border-radius: 99px; }
.metric-bar span { display: block; height: 100%; background: var(--primary); }
.camera-box { min-height: 300px; display: grid; place-items: center; overflow: hidden; color: #ffffff; background: #1e1e1e; border-radius: 14px; }
.camera-box video { width: 100%; max-height: 420px; object-fit: cover; }

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: minmax(0, 680px); padding: 24px; }
  .auth-brand { min-height: auto; padding: 28px 32px; border-right: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; }
  .auth-brand h1 { margin: 28px 0 10px; font-size: 30px; }
  .auth-brand small { margin-top: 20px; }
  .auth-panel { min-height: auto; padding: 36px 32px; border-radius: 0 0 20px 20px; }
  .app-shell { display: block; padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .sidebar { display: none; }
  .bottom-nav {
    position: fixed;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: 14px;
    right: 14px;
    margin: 0 auto;
    max-width: 460px;
    width: calc(100% - 28px);
    z-index: 1000;
    height: 64px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 26px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.04);
  }
  .bottom-nav .dock-tab {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 6px 0 4px;
    text-decoration: none;
    color: #64748b;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease;
    user-select: none;
  }
  .bottom-nav .dock-tab .dock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: #64748b;
    transition: color 0.15s ease, transform 0.15s ease;
  }
  .bottom-nav .dock-tab .dock-icon svg {
    width: 22px;
    height: 22px;
    display: block;
  }
  .bottom-nav .dock-tab .dock-label {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    letter-spacing: -0.1px;
    line-height: 1.1;
    text-align: center;
    transition: color 0.15s ease;
  }
  .bottom-nav .dock-tab:active {
    transform: scale(0.92);
  }
  .bottom-nav .dock-tab.active {
    color: #1d4ed8;
  }
  .bottom-nav .dock-tab.active .dock-icon {
    color: #1d4ed8;
  }
  .bottom-nav .dock-tab.active .dock-label {
    color: #1d4ed8;
    font-weight: 700;
  }

  /* Mobile More Sheet Drawer */
  .mobile-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  .mobile-sheet-overlay[hidden] {
    display: none;
  }
  .mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mobile-sheet-panel {
    position: relative;
    z-index: 1201;
    background: #ffffff;
    border-radius: 28px 28px 0 0;
    padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 82vh;
    display: flex;
    flex-direction: column;
  }
  .mobile-sheet-overlay.open .mobile-sheet-backdrop {
    opacity: 1;
  }
  .mobile-sheet-overlay.open .mobile-sheet-panel {
    transform: translateY(0);
  }
  .mobile-sheet-handle {
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 4px auto 14px;
  }
  .mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 10px;
  }
  .mobile-sheet-user {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mobile-sheet-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: grid;
    place-items: center;
  }
  .mobile-sheet-meta strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-sheet-meta small {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.5px;
  }
  .mobile-sheet-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    display: grid;
    place-items: center;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease;
  }
  .mobile-sheet-close:active {
    background: #e2e8f0;
  }
  .mobile-sheet-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 48vh;
    padding: 6px 0;
    scrollbar-width: none;
  }
  .mobile-sheet-links::-webkit-scrollbar {
    display: none;
  }
  .mobile-sheet-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-sheet-link:active {
    background: #f1f5f9;
  }
  .mobile-sheet-link.active {
    color: #1d4ed8;
    background: #eff6ff;
  }
  .mobile-sheet-link .sheet-link-icon {
    display: flex;
    align-items: center;
    color: #64748b;
  }
  .mobile-sheet-link.active .sheet-link-icon {
    color: #1d4ed8;
  }
  .mobile-sheet-link .sheet-link-label {
    flex: 1;
  }
  .sheet-link-active-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1d4ed8;
  }
  .mobile-sheet-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
  }
  .btn-sheet-logout {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1.5px solid #fee2e2;
    background: #fff5f5;
    color: #dc2626;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .btn-sheet-logout:active {
    background: #fee2e2;
  }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campaign-builder { grid-template-columns: 1fr; }
  .campaign-panel-picker { position: static; }
  .campaign-panel-list { max-height: 300px; }
  .topbar-mobile-brand { display: flex; }
}

@media (max-width: 620px) {
  .auth-shell { padding: 14px; }
  .auth-brand { padding: 24px; }
  .auth-brand h1 { font-size: 26px; }
  .auth-panel { padding: 28px 22px; }
  .topbar { min-height: 64px; padding: 12px 16px; }
  .topbar h1 { font-size: 18px; }
  .user-chip span { display: none; }
  .content { padding: 16px; }
  .stats, .two-col, .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .card { padding: 20px; }
  .actions .btn { flex: 1 1 auto; }
}

/* Playable Ads Customizer Styles */
.campaign-type-tabs {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.campaign-type-tabs .btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.campaign-type-tabs .btn:hover {
  border-color: var(--primary);
  background: var(--bg-page);
}
.campaign-type-tabs .btn.active {
  background: var(--soft-red);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(215, 38, 56, 0.12);
}

.playable-config-section {
  margin-top: 24px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}
.playable-config-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, #ff6b6b 100%);
}

.playable-section-header {
  margin-bottom: 20px;
}
.playable-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.playable-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.playable-badge-hot {
  background: var(--soft-red);
  color: var(--primary);
  border-color: rgba(215, 38, 56, 0.2);
}
.playable-section-header h4 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.playable-section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

/* Customizer Subgroups */
.playable-subgroup {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #f1f3f8;
}
.playable-subgroup:first-of-type {
  margin-top: 14px;
  padding-top: 0;
  border-top: none;
}
.playable-subgroup-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.playable-subgroup-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Asset Cards */
.playable-asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.playable-preview { position: relative; overflow: hidden; min-height: 170px; margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; background: #101827; color: #fff; display: grid; place-items: center; }
.playable-preview-bg { position: absolute; inset: 0; background: linear-gradient(120deg, #14213d, #3a0f3f); background-size: cover; background-position: center; opacity: .72; }
.playable-preview img { position: relative; z-index: 1; width: 100px; height: 100px; object-fit: contain; animation: playable-preview-float 2.8s ease-in-out infinite; }
.playable-preview-copy { position: absolute; z-index: 2; inset: auto 14px 14px; display: flex; align-items: end; justify-content: space-between; gap: 16px; text-shadow: 0 2px 8px rgba(0,0,0,.75); }
.playable-preview-copy strong { font-size: 18px; }
.playable-preview-copy span { border: 1px solid rgba(255,255,255,.6); border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 800; letter-spacing: .04em; background: rgba(0,0,0,.3); }
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
@keyframes playable-preview-float { 50% { transform: translateY(-8px) rotate(4deg); } }
.playable-asset-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: var(--bg-page);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 94px;
  user-select: none;
}
.playable-asset-card:hover {
  border-color: var(--primary);
  background: var(--soft-red);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(215, 38, 56, 0.08);
}
.playable-asset-card:active {
  transform: scale(0.99);
}
.playable-asset-card.has-file {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-bg);
}
.playable-asset-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.playable-asset-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 1px solid var(--line);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.playable-asset-icon.primary {
  color: var(--primary);
  background: #ffffff;
}
.playable-asset-card:hover .playable-asset-icon {
  color: var(--primary);
  border-color: var(--primary);
}
.playable-asset-card.has-file .playable-asset-icon {
  color: var(--green);
  border-color: var(--green);
}
.playable-asset-meta {
  min-width: 0;
  flex: 1;
}
.playable-asset-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.playable-asset-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.playable-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.playable-pill.required {
  background: var(--soft-red);
  color: var(--primary);
}
.playable-pill.optional {
  background: #edf2f7;
  color: #64748b;
}
.playable-file-text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playable-asset-card.has-file .playable-file-text {
  color: #15803d;
  font-weight: 600;
}
.playable-asset-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.35;
}

/* Playable Form Grid */
.playable-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.playable-form-grid .field small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}
.playable-code-input-wrap input {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 860px) {
  .campaign-builder {
    grid-template-columns: 1fr;
  }
  .campaign-panel-picker {
    position: static;
    margin-top: 24px;
  }
}

@media (max-width: 720px) {
  .campaign-type-tabs {
    flex-direction: column;
  }
  .playable-config-section {
    padding: 18px 14px;
    border-radius: 16px;
  }
  .playable-asset-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .playable-form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .playable-asset-card {
    min-height: auto;
    padding: 14px;
  }
  .playable-asset-desc {
    margin-top: 8px;
  }
  .field input, .field select, .field textarea {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    height: 48px;
  }
  .actions {
    flex-direction: column;
  }
  .actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .playable-section-header h4 {
    font-size: 16px;
  }
  .playable-section-header p {
    font-size: 12.5px;
  }
  .playable-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
}

