/* ======================================================
   Excelergy Base Styles
   VERSION: v2026-MODERN-LANDING-70
   ====================================================== */

:root {
  --bg: #f4f7fb;
  --bg-soft: #f8fafc;
  --card: rgba(255, 255, 255, 0.94);
  --card-solid: #ffffff;
  --border: #dfe7f0;
  --border-strong: #cbd5e1;
  --text: #071427;
  --muted: #64748b;
  --primary: #1769ff;
  --primary-dark: #0754dc;
  --primary-soft: #eaf2ff;
  --green: #16a34a;
  --purple: #7c3aed;
  --amber: #f59e0b;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 12px 32px rgba(15, 23, 42, 0.06);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, rgba(23, 105, 255, .13), transparent 28rem),
    radial-gradient(circle at 85% 16%, rgba(124, 58, 237, .09), transparent 26rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 58%, #eef3f9 100%);
}

button, input, select { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 86px;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(203, 213, 225, .7);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 40px);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 850;
  letter-spacing: -.04em;
}

.brand-icon {
  width: 42px;
  height: 42px;
  color: var(--primary);
  display: inline-grid;
  place-items: center;
}

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

.brand-icon svg path:last-child {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-nav {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

.topbar-nav a {
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
  text-decoration: none;
  padding: 9px 15px;
  border-radius: 999px;
}

.topbar-nav a.active,
.topbar-nav a:hover {
  color: var(--text);
  background: var(--card-solid);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

/* Landing / hero */
.hero {
  max-width: 1520px;
  margin: 0 auto;
  padding: 62px clamp(18px, 4vw, 56px) 34px;
}

.hero-inner {
  text-align: center;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 18px;
  color: var(--primary-dark);
  background: rgba(234, 242, 255, .9);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-weight: 800;
  font-size: 17px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.hero-pill span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}

.hero h1 {
  max-width: 980px;
  margin: 26px auto 0;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.08;
  letter-spacing: -.065em;
  font-weight: 900;
}

.hero-rule {
  width: 118px;
  height: 4px;
  margin: 28px auto 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #4f8bff);
}

.hero-copy {
  max-width: 720px;
  margin: 0 auto;
  color: #475569;
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 38px;
}

button,
.primary,
.secondary-link {
  min-height: 64px;
  padding: 0 32px;
  font-size: 18px;
  font-weight: 800;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, border-color .15s ease;
}

.primary {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 16px 32px rgba(23, 105, 255, .25);
}

.secondary-link {
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--border);
  color: #172033;
  box-shadow: var(--shadow-soft);
}

.primary:hover,
.secondary-link:hover {
  transform: translateY(-1px);
}

.primary:hover { filter: brightness(.98); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 58px;
}

.feature-card {
  min-height: 274px;
  padding: 32px 28px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.feature-icon {
  width: 74px;
  height: 74px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 24px;
  font-size: 34px;
  font-weight: 900;
}

.feature-blue { color: var(--primary); background: #eaf2ff; }
.feature-green { color: var(--green); background: #dcfce7; }
.feature-purple { color: var(--purple); background: #f3e8ff; }
.feature-amber { color: var(--amber); background: #fef3c7; }

.feature-card h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.03em;
}

.feature-card p {
  max-width: 260px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

/* Planner workspace */
.dashboard {
  max-width: 1520px;
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 22px;
  padding: 0 clamp(18px, 4vw, 56px) 36px;
  align-items: start;
}

.kpi-panel {
  position: sticky;
  top: 108px;
  align-self: start;
  background: var(--card);
  border: 1px solid rgba(219, 227, 237, .8);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.control-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
}

.accent-card {
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  border-color: #bfdbfe;
}

.control-form h3,
.panel h3 {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 0 0 10px;
  text-transform: uppercase;
}

.row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(92px, 118px) minmax(80px, 92px) minmax(72px, 86px);
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin-top: 7px;
}

.row.headers {
  font-size: 10px;
  font-weight: 850;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.row input,
.row select {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  text-align: right;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.row select { text-align: left; }

.row input:focus,
.row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 105, 255, .12);
}

.scenario-actions,
.row.buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.scenario-actions button,
.row.buttons button {
  flex: 1 1 105px;
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: 12px;
}

main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.scenario-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.panel {
  background: var(--card);
  border: 1px solid rgba(219, 227, 237, .82);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.panel.tile {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.panel.tile::after {
  content: "";
  position: absolute;
  inset: auto -30px -45px auto;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(23, 105, 255, .10);
}

.tile-label {
  width: fit-content;
  font-size: 10px;
  font-weight: 850;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 5px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.panel.tile h3 {
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 6px;
}

.panel.tile div {
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 850;
  letter-spacing: -.04em;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.section-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  letter-spacing: -.02em;
  text-transform: none;
}

.table-scroll {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

th,
td {
  padding: 10px 9px;
  text-align: right;
  border-bottom: 1px solid #edf2f7;
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: #475569;
  font-weight: 850;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tbody tr:hover { background: #f8fafc; }

th:first-child,
td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
  font-weight: 800;
}

thead th:first-child {
  z-index: 3;
  background: #f8fafc;
}

.footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 24px;
}

#eventList {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard { grid-template-columns: 1fr; }
  .kpi-panel { position: static; }
  .scenario-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar {
    min-height: auto;
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand { font-size: 24px; }

  .topbar-nav { width: 100%; }

  .topbar-nav a {
    flex: 1;
    text-align: center;
  }

  .hero {
    padding: 38px 16px 24px;
  }

  .hero h1 {
    font-size: clamp(36px, 12vw, 48px);
  }

  .hero-actions {
    gap: 12px;
  }

  .primary,
  .secondary-link {
    width: 100%;
    min-height: 56px;
    font-size: 16px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 36px;
  }

  .feature-card {
    min-height: auto;
    padding: 26px 22px;
  }

  .dashboard {
    padding: 0 16px 24px;
  }

  .scenario-tiles { grid-template-columns: 1fr; }

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

  .row.headers { display: none; }

  .table-scroll { max-height: 70vh; }
}

@media print {
  body { background: #fff; }
  .topbar, .hero, .kpi-panel, .scenario-tiles { display: none !important; }
  .dashboard {
    display: block;
    padding: 0;
    max-width: none;
  }
  .panel {
    display: block !important;
    box-shadow: none;
    border: 0;
    padding: 0;
  }
  .table-scroll {
    max-height: none !important;
    overflow: visible !important;
    border: 0;
  }
  table {
    width: 100% !important;
    font-size: 10px;
  }
  th, td { padding: 4px; }
  tr { page-break-inside: avoid; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* Event form refinements */
.form-card:has(#eventType) .row {
  grid-template-columns: 86px minmax(170px, 1fr) 78px 76px;
}

#eventType,
#eventDestination {
  min-width: 0;
  text-align: left;
}

#eventType {
  min-width: 170px;
}

#eventList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.event-summary {
  min-width: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-delete,
#eventList button {
  appearance: none;
  min-height: 30px !important;
  height: 30px !important;
  min-width: auto !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  border: 1px solid #fecaca !important;
  background: #fff5f5 !important;
  color: #b91c1c !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
}

.btn-delete:hover,
#eventList button:hover {
  background: #fee2e2 !important;
  transform: none !important;
}

.event-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
}

@media (max-width: 760px) {
  .form-card:has(#eventType) .row {
    grid-template-columns: 1fr 1fr;
  }
  #eventType { min-width: 0; }
}

/* ============================= */
/* Events: pill cards + inline edit */
/* ============================= */
#eventList {
    display: grid;
    gap: 10px;
}

.event-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #dbe6f4;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.event-pill-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.event-pill-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eaf2ff;
    color: #135ee8;
    font-weight: 900;
    font-size: 17px;
}

.event-pill-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.2;
}

.event-pill-meta {
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.event-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.btn-event-edit,
.btn-event-delete,
.btn-event-save,
.btn-event-cancel {
    width: auto !important;
    min-width: 0 !important;
    height: 30px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: pointer;
}

.btn-event-edit {
    color: #135ee8;
    background: #eef5ff;
    border: 1px solid #bfd7ff;
}

.btn-event-delete {
    color: #b91c1c;
    background: #fff1f1;
    border: 1px solid #fecaca;
}

.btn-event-save {
    color: #ffffff;
    background: #1565f9;
    border: 1px solid #1565f9;
}

.btn-event-cancel {
    color: #475569;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

.event-pill-editing {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
}

.event-edit-grid {
    display: grid;
    grid-template-columns: minmax(190px, 1.4fr) minmax(74px, .6fr);
    gap: 10px;
}

.event-edit-grid label {
    display: grid;
    gap: 5px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
}

.event-edit-grid input,
.event-edit-grid select {
    width: 100%;
    min-width: 0 !important;
    height: 36px;
    border-radius: 12px;
}

.event-edit-grid .event-edit-type,
.event-edit-grid .event-edit-destination {
    min-width: 170px !important;
}

@media (max-width: 720px) {
    .event-pill,
    .event-pill-editing {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .event-actions {
        justify-content: flex-end;
    }

    .event-edit-grid {
        grid-template-columns: 1fr;
    }

    .event-pill-meta {
        white-space: normal;
    }
}

/* ============================= */
/* Event form layout refinement  */
/* Type full row; details below  */
/* ============================= */
.form-card:has(#eventType) .row:not(.buttons):not(.headers) {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 86px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.form-card:has(#eventType) .row:not(.buttons):not(.headers) > *:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.form-card:has(#eventType) .row:not(.buttons):not(.headers) > *:nth-child(2) {
  grid-column: 2 / 5;
  grid-row: 1;
}

.form-card:has(#eventType) .row:not(.buttons):not(.headers) > *:nth-child(3) {
  grid-column: 1;
  grid-row: 2;
}

.form-card:has(#eventType) .row:not(.buttons):not(.headers) > *:nth-child(4) {
  grid-column: 2;
  grid-row: 2;
}

.form-card:has(#eventType) .row:not(.buttons):not(.headers) > *:nth-child(5) {
  grid-column: 3;
  grid-row: 2;
}

.form-card:has(#eventType) .row:not(.buttons):not(.headers) > *:nth-child(6) {
  grid-column: 4;
  grid-row: 2;
}

.form-card:has(#eventType) .row:not(.buttons):not(.headers) > *:nth-child(7) {
  grid-column: 1;
  grid-row: 3;
}

.form-card:has(#eventType) .row:not(.buttons):not(.headers) > *:nth-child(8) {
  grid-column: 2 / 5;
  grid-row: 3;
}

#eventType,
#eventDestination {
  width: 100%;
  min-width: 0 !important;
}

.form-card:has(#eventType) .row.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-card:has(#eventType) .row.buttons button {
  width: 100%;
}

@media (max-width: 760px) {
  .form-card:has(#eventType) .row:not(.buttons):not(.headers) {
    grid-template-columns: 1fr;
  }

  .form-card:has(#eventType) .row:not(.buttons):not(.headers) > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}
