/* Booking Links Dashboard - CSS */
/* Based on bubble/pages/booking-links-styles.css */

/* ===== FONTS ===== */
/* Load these in HTML head */

/* ===== CSS VARIABLES ===== */
:root {
  /* Primary Colors */
  --color-primary: #2b6cb0;
  --color-primary-hover: #2563eb;
  --color-primary-dark: #1e40af;

  /* Header/Nav */
  --color-nav-top: #0d1b2a;
  --color-header: #1a365d;
  --color-header-text: #ffffff;

  /* Status Colors */
  --color-success: #48bb78;
  --color-success-bg: #c6f6d5;
  --color-warning: #ecc94b;
  --color-danger: #e53e3e;

  /* Backgrounds */
  --color-bg-page: #edf2f7;
  --color-bg-card: #ffffff;
  --color-bg-input: #ffffff;
  --color-bg-form: #1a365d;

  /* Text */
  --color-text-primary: #2d3748;
  --color-text-secondary: #718096;
  --color-text-light: #a0aec0;
  --color-text-inverse: #ffffff;

  /* Borders */
  --color-border: #e2e8f0;
  --color-border-input: #cbd5e0;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Fonts */
  --font-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Iskra", "Inter", sans-serif;
  --font-serif: "Merriweather", Georgia, serif;

  /* Layout */
  --layout-sidebar-width: 260px;
  --layout-content-max: clamp(760px, 55vw, 1100px);
  --layout-shell-gap: 24px;
  --layout-shell-max: 1440px;
}

/* ===== BASE STYLES ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: var(--color-bg-page);
}

/* ===== APP HEADER ===== */
.app-header {
  background: #f0f3f7;
  height: 70px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

.app-header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle-bar {
  width: 18px;
  height: 2px;
  background: var(--color-header);
  border-radius: var(--radius-full);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-header);
}

.app-logo img {
  height: 32px;
  width: auto;
}

.app-nav {
  display: flex;
  gap: 20px;
}

.app-nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.app-nav a:hover {
  color: var(--color-primary);
}

.app-auth {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-secondary);
  font-size: 13px;
}

/* ===== HERO + WELCOME ===== */
.hero-banner {
  height: 390px;
  width: 100%;
  background: linear-gradient(120deg, #0f304f 0%, #1a4b7a 60%, #2b6cb0 100%);
  background-size: cover;
  background-position: center;
}

.welcome-bar {
  height: 120px;
  background: #012d53;
  display: flex;
  align-items: center;
}

.welcome-text {
  width: min(100%, var(--layout-content-max));
  margin: 0 auto;
  padding: 0 var(--layout-shell-gap);
  color: white;
  font-size: 22px;
  font-weight: 600;
  text-align: left;
}

/* ===== LAYOUT ===== */
.app-shell {
  display: grid;
  grid-template-columns: var(--layout-sidebar-width) minmax(0, 1fr);
  gap: var(--layout-shell-gap);
  padding: var(--layout-shell-gap);
}

body.layout-centered .app-shell {
  grid-template-columns:
    minmax(var(--layout-sidebar-width), 1fr)
    minmax(0, var(--layout-content-max))
    minmax(var(--layout-sidebar-width), 1fr);
  max-width: none;
  margin: 0;
}

body.layout-wide .app-shell {
  max-width: none;
  margin: 0;
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

body.layout-centered .sidebar {
  grid-column: 1;
  width: var(--layout-sidebar-width);
  justify-self: start;
}

body.layout-centered .main-content {
  grid-column: 2;
  min-width: 0;
}

@media (min-width: 1990px) {
  body.layout-centered .app-shell {
    grid-template-columns: var(--layout-sidebar-width) minmax(0, 1fr);
    max-width: var(--layout-shell-max);
    margin: 0 auto;
  }

  body.layout-centered .sidebar,
  body.layout-centered .main-content {
    grid-column: auto;
    width: auto;
  }

  .welcome-text {
    width: min(100%, var(--layout-shell-max));
    padding-left: calc(var(--layout-sidebar-width) + (2 * var(--layout-shell-gap)));
    padding-right: var(--layout-shell-gap);
  }
}

@media (max-width: 1340px) {
  body.layout-centered .app-shell {
    grid-template-columns: var(--layout-sidebar-width) minmax(0, 1fr);
  }

  body.layout-centered .sidebar,
  body.layout-centered .main-content {
    grid-column: auto;
    width: auto;
  }
}

@media (max-width: 980px) {
  .app-header-inner {
    max-width: none;
  }

  .nav-toggle {
    display: inline-flex;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 2101;
    box-shadow: var(--shadow-md);
  }

  .app-nav {
    display: none;
  }

  /* Must match specificity of body.layout-centered .app-shell */
  .app-shell,
  body.layout-centered .app-shell,
  body.layout-wide .app-shell {
    grid-template-columns: 1fr;
  }

  .main-content,
  body.layout-centered .main-content {
    width: 100%;
    grid-column: auto;
  }

  body.layout-centered .sidebar {
    grid-column: auto;
    width: min(82vw, 320px);
    justify-self: auto;
  }

  .main-content .container {
    max-width: none;
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
  }

  .welcome-text {
    width: 100%;
    margin: 0;
    padding: 0 24px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    height: 100vh;
    transform: translateX(-110%);
    transition: transform 0.25s ease;
    z-index: 2000;
    overflow-y: auto;
    border-radius: 0;
  }
}

body.nav-open {
  overflow: hidden;
}

body.nav-open .sidebar {
  transform: translateX(0);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1500;
}

body.nav-open .nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

.nav-group {
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

.nav-group:last-child {
  border-bottom: none;
}

.nav-group-toggle {
  width: 100%;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
  padding: 0;
  transition: color 0.15s ease;
}

.nav-group:hover .nav-group-toggle {
  color: var(--color-primary);
}

.nav-chevron {
  transition: transform 0.35s ease-out;
}

.nav-group:hover .nav-chevron {
  transform: rotate(180deg);
}

.nav-group-items {
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: max-height 0.4s ease-out, margin-top 0.35s ease-out;
}

.nav-group:hover .nav-group-items,
.nav-group.expanded .nav-group-items {
  max-height: 500px;
  margin-top: 8px;
}

.nav-group.expanded .nav-chevron {
  transform: rotate(180deg);
}

.nav-item {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.nav-item:hover {
  color: var(--color-primary);
}

.nav-item.active {
  color: var(--color-primary);
  font-weight: 600;
}

.nav-item.disabled {
  color: var(--color-text-light);
  cursor: default;
}

.nav-item.disabled:hover {
  color: var(--color-text-light);
}

.nav-tag {
  background: #e2e8f0;
  color: #4a5568;
  border-radius: var(--radius-full);
  font-size: 10px;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.main-content .container {
  margin: 0 auto;
}

/* ===== NAV EDITOR ===== */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.editor-panel {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

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

.editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-list-item {
  background: var(--color-bg-page);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.editor-list-item.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

.editor-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--color-bg-page);
}

.editor-item + .editor-item {
  margin-top: 12px;
}

.editor-item-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

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

.editor-full {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}
.badge-admin {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

/* ===== PAGE TITLE ===== */
.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-header);
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
}

/* ===== CREATE FORM (Dark Blue Card) ===== */
.create-form {
  background: var(--color-bg-form);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.create-form-title {
  color: var(--color-text-inverse);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

.create-form-row {
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-end;
  flex-wrap: wrap;
}

.create-form-main {
  align-items: center;
  flex-wrap: nowrap;
}

.create-form-main .form-group {
  margin-bottom: 0;
  min-width: 140px;
  flex: 0 0 auto;
}

.create-form-main .form-group-grow {
  flex: 1 1 200px;
  min-width: 200px;
}

.create-form-main .form-input {
  background: white;
}

.create-form-main .btn {
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .create-form-main {
    flex-direction: column;
    align-items: stretch;
  }
  .create-form-main .form-group,
  .create-form-main .form-group-grow,
  .create-form-main .form-group-daterange {
    width: 100%;
    min-width: unset;
    flex: none;
  }
  .create-form-main .btn {
    width: 100%;
  }
}

/* ===== BOOKING LINK CARD ===== */
.booking-link-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-md);
  gap: var(--spacing-md);
}

.booking-link-card .card-header {
  padding: var(--spacing-lg);
  background: #dce4ec;
  margin-bottom: 0;
}

.card-header-left {
  flex: 1;
  min-width: 0;
}

.card-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--spacing-sm);
}

.card-actions-top {
  font-size: 12px;
  margin-bottom: var(--spacing-xs);
}

.card-actions-top a {
  color: var(--color-text-secondary);
  text-decoration: underline;
}

.card-actions-top a:hover {
  color: var(--color-primary);
}

.card-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.card-actions a {
  color: var(--color-text-secondary);
  text-decoration: underline;
  font-size: 12px;
}

.card-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a365d;
  margin-bottom: var(--spacing-xs);
}

.card-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.card-subtitle-source {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

.card-warning {
  font-size: 13px;
  color: #c05621;
  font-weight: 500;
}

.card-body {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  padding: var(--spacing-lg);
  background: #ffffff;
}

.card-body-left {
  flex: 1;
  min-width: 280px;
}

.card-body-right {
  flex: 0 0 auto;
}

/* ===== URL DISPLAY BOX ===== */
.url-box {
  background: #ffffff;
  border: 2px solid #cbd5e0;
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  cursor: pointer;
  display: inline-block;
  margin: var(--spacing-md) 0;
}

.url-box:hover {
  border-color: var(--color-primary);
}

/* ===== TOGGLE SWITCH ===== */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: #c5d1dc;
  padding: 8px 14px;
  border-radius: var(--radius-full);
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-switch.active {
  background: var(--color-success);
}

.toggle-switch::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* ===== INFO BOXES (Travel Window, Booking Window, etc) ===== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.info-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: center;
}

.info-box-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}

.info-box-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

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

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

.btn-secondary {
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-link {
  background: none;
  color: var(--color-primary);
  padding: 0;
  text-decoration: underline;
}

.btn-wide {
  min-width: 200px;
  padding: 12px 32px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-link-danger {
  color: var(--color-danger);
  text-decoration: underline;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
}

.btn-link-danger:hover {
  color: #c53030;
}

.btn-link-muted {
  color: var(--color-text-secondary);
  text-decoration: underline;
  font-size: 14px;
}

/* ===== FORM INPUTS ===== */
.form-group {
  margin-bottom: var(--spacing-md);
  flex: 1;
  min-width: 180px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}

.form-select {
  appearance: none;
  background: white
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  padding-right: 40px;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  z-index: 1000;
}

.modal {
  background: white;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
}

.modal-confirm {
  max-width: 440px;
  text-align: center;
}

.modal-confirm .modal-body p {
  margin-bottom: var(--spacing-sm);
}

.modal-confirm .modal-footer {
  justify-content: center;
}

.modal-body-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xl);
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.confirm-warning {
  font-style: italic;
  color: var(--color-text-secondary);
  margin: 0 0 var(--spacing-md) 0;
}

.confirm-delete-link {
  color: var(--color-danger);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: var(--spacing-sm);
}

.confirm-delete-link:hover {
  text-decoration: underline;
}

.confirm-cancel-link {
  color: var(--color-text-primary);
  font-size: 14px;
  text-decoration: underline;
}

.modal-wide {
  max-width: 640px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--spacing-md);
}

@media (max-width: 600px) {
  .form-row-3 {
    grid-template-columns: 1fr 1fr;
  }
  .form-row-3 .form-group:last-child {
    grid-column: span 2;
  }
  
  /* Card responsive layout */
  .card-header {
    flex-direction: column;
    align-items: stretch;
  }
  .card-header-right {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }
  .card-warning {
    order: -1;
    width: 100%;
  }
  .card-body {
    flex-direction: column;
  }
  .card-body-left {
    min-width: unset;
  }
  .info-boxes {
    flex-direction: column;
  }
  .info-box {
    width: 100%;
  }
}

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-row-3 {
    grid-template-columns: 1fr;
  }
  .form-row-3 .form-group:last-child {
    grid-column: auto;
  }
}

.step-hint-inline {
  font-weight: 400;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.modal-subtitle {
  font-size: 14px;
  color: var(--color-primary);
  margin-top: var(--spacing-xs);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.modal-footer-centered {
  justify-content: center;
}

.modal-footer-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* ===== STEP INDICATOR ===== */
.step-badge {
  display: inline-block;
  background: var(--color-header);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: var(--spacing-md);
}

.step-badge-hint {
  font-weight: 400;
  opacity: 0.85;
}

/* ===== METADATA (Created by, Modified by) ===== */
.meta-text {
  font-size: 13px;
  color: #319795;
  margin-bottom: var(--spacing-md);
}

.meta-text a {
  color: var(--color-primary);
}

/* ===== CHECKBOX ===== */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.checkbox-label {
  font-size: 14px;
  color: var(--color-text-primary);
}

/* ===== LOCAL ADDITIONS ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.status-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--color-border);
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
}

.status-banner.success {
  background: var(--color-success-bg);
  color: #2f855a;
}

.inline-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: var(--spacing-sm);
}

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

.link-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.pill {
  background: var(--color-bg-page);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.empty-state {
  text-align: center;
  color: var(--color-text-secondary);
  padding: var(--spacing-xl) 0;
}

/* ===== CONFIGURE MODAL STEPS ===== */
.step-section {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.step-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.step-badge {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-sm);
}

.step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.step-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
}

.step-hint a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ===== SOURCE SEARCH ===== */
.source-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.form-group:has(.source-results) {
  position: relative;
}

.source-result-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
}

.source-result-item:last-child {
  border-bottom: none;
}

.source-result-item:hover,
.source-result-item.highlighted {
  background: #4a90c2;
  color: white;
}

.source-result-item.highlighted strong {
  color: white;
}

.source-result-item.muted,
.source-result-item.source-result-empty {
  cursor: default;
  color: var(--color-text-secondary);
}

.source-result-item.source-result-empty:hover {
  background: transparent;
  color: var(--color-text-secondary);
}

.source-result-item strong {
  font-weight: 700;
  color: inherit;
}

.form-input.selected {
  background: #e8f4fd;
  border-color: var(--color-primary);
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  animation: toast-in 0.2s ease;
}

.toast.success {
  background: #2f855a;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ===== FLATPICKR DATE RANGE PICKER ===== */

.form-group-daterange {
  min-width: 180px;
  flex-shrink: 0;
}

.daterange-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

/* Bounce animation for calendar open */
@keyframes flatpickr-bounce {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
  }
  50% {
    transform: scale(1.02) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.flatpickr-bounce {
  animation: flatpickr-bounce 0.25s ease-out;
}

/* Flatpickr theme overrides */
.flatpickr-calendar {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  font-family: var(--font-primary);
}

.flatpickr-calendar.open {
  animation: flatpickr-bounce 0.25s ease-out;
}

.flatpickr-months {
  padding: 8px;
}

.flatpickr-current-month {
  font-weight: 600;
  font-size: 1rem;
}

.flatpickr-day {
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.flatpickr-day.inRange {
  background: #dbeafe;
  border-color: #dbeafe;
  box-shadow: -5px 0 0 #dbeafe, 5px 0 0 #dbeafe;
}

.flatpickr-day:hover {
  background: #e2e8f0;
  border-color: #e2e8f0;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.flatpickr-day.today {
  border-color: var(--color-primary);
}

.flatpickr-day.today:hover {
  background: var(--color-primary);
  color: white;
}
