/* =========================================================
   EVENT COUNTRY — TOUR CALENDAR & ALERTS v3
========================================================= */
#tour-calendar-view {
  --tca-orange: #ff5001;
  --tca-orange-dark: #dc4400;
  --tca-navy: #101828;
  --tca-text: #182230;
  --tca-muted: #667085;
  --tca-line: #e4e7ec;
  --tca-soft: #f8fafc;
  --tca-success: #067647;
  --tca-danger: #b42318;
  --tca-warning: #b54708;
  padding: 0 !important;
  color: var(--tca-text);
  background: #f5f7fa;
}

#tour-calendar-view *,
.tca-toast * { box-sizing: border-box; }

.tca-shell {
  max-width: 1700px;
  margin: 0 auto;
  padding: 16px;
}

.tca-hero,
.tca-panel,
.tca-critical-zone,
.tca-metrics > div,
.tca-day,
.tca-calendar-event,
.tca-tour-list article,
.tca-reminders article,
.tca-alert,
.tca-settings-grid input,
.tca-check {
  border-radius: 4px !important;
}

.tca-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  background: linear-gradient(115deg, #fff 0%, #fff7f2 100%);
  border: 1px solid #ffd4c0;
  box-shadow: 0 7px 24px rgba(16, 24, 40, .06);
}

.tca-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--tca-orange-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tca-hero h1,
.tca-panel h2,
.tca-tour-info h3 {
  margin: 0;
  color: var(--tca-navy);
}

.tca-hero h1 {
  font-size: clamp(27px, 3vw, 40px);
  letter-spacing: -.04em;
}

.tca-hero p {
  max-width: 820px;
  margin: 7px 0 0;
  color: var(--tca-muted);
  font-size: 12px;
  line-height: 1.55;
}

.tca-hero-actions,
.tca-inline-actions,
.tca-alert-actions,
.tca-settings-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.tca-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.tca-metrics > div {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--tca-line);
  box-shadow: 0 4px 15px rgba(16, 24, 40, .04);
}

.tca-metrics > div > .material-icons-outlined {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  color: var(--tca-orange-dark);
  background: #fff1e8;
  border-radius: 4px;
}

.tca-metrics > div.danger {
  color: #fff;
  background: #b42318;
  border-color: #b42318;
}

.tca-metrics > div.danger > .material-icons-outlined {
  color: #fff;
  background: rgba(255, 255, 255, .16);
}

.tca-metrics small,
.tca-metrics strong { display: block; }
.tca-metrics small { color: var(--tca-muted); font-size: 9px; text-transform: uppercase; }
.tca-metrics strong { margin-top: 3px; color: var(--tca-navy); font-size: 22px; }
.tca-metrics .danger small,
.tca-metrics .danger strong { color: #fff; }

.tca-nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  color: #fff;
  background: #d92d20;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.tca-critical-zone {
  margin: 12px 0;
  padding: 14px;
  color: #fff;
  background: linear-gradient(120deg, #b42318, #d92d20);
  border: 1px solid #912018;
  box-shadow: 0 10px 28px rgba(180, 35, 24, .22);
  animation: tcaCriticalPulse 1.8s ease-in-out infinite;
}

@keyframes tcaCriticalPulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(180, 35, 24, .20); }
  50% { box-shadow: 0 10px 36px rgba(180, 35, 24, .40); }
}

.tca-critical-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tca-critical-head > .material-icons-outlined {
  font-size: 31px;
  animation: tcaRing .75s ease-in-out infinite alternate;
}

@keyframes tcaRing {
  from { transform: rotate(-8deg); }
  to { transform: rotate(8deg); }
}

.tca-critical-head strong,
.tca-critical-head p { display: block; }
.tca-critical-head strong { font-size: 15px; }
.tca-critical-head p { margin: 2px 0 0; color: #fee4e2; font-size: 10px; }

.tca-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(310px, .65fr);
  gap: 12px;
  align-items: start;
}

.tca-layout main,
.tca-layout aside {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.tca-layout aside { position: sticky; top: 10px; }

.tca-panel {
  padding: 15px;
  background: #fff;
  border: 1px solid var(--tca-line);
  box-shadow: 0 5px 18px rgba(16, 24, 40, .045);
}

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

.tca-panel h2 { font-size: 17px; letter-spacing: -.02em; }

.tca-weekdays,
.tca-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tca-weekdays {
  background: #f9fafb;
  border: 1px solid var(--tca-line);
  border-bottom: 0;
}

.tca-weekdays span {
  padding: 8px;
  color: #667085;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.tca-calendar-grid {
  border-top: 1px solid var(--tca-line);
  border-left: 1px solid var(--tca-line);
}

.tca-day {
  min-width: 0;
  min-height: 128px;
  padding: 7px;
  background: #fff;
  border-right: 1px solid var(--tca-line);
  border-bottom: 1px solid var(--tca-line);
  border-radius: 0 !important;
}

.tca-day.outside { background: #fafafa; opacity: .58; }
.tca-day.today { box-shadow: inset 0 0 0 2px var(--tca-orange); }

.tca-day > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.tca-day > header > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #344054;
  font-size: 10px;
  font-weight: 900;
}

.tca-day.today > header > span {
  color: #fff;
  background: var(--tca-orange);
  border-radius: 50%;
}

.tca-day > header b {
  color: var(--tca-orange-dark);
  font-size: 9px;
}

.tca-day > div { display: grid; gap: 4px; }

.tca-calendar-event {
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 4px;
  width: 100%;
  padding: 5px;
  color: #344054;
  text-align: left;
  background: #fff4ed;
  border: 1px solid #ffd6ae;
  cursor: pointer;
}

.tca-calendar-event:hover { border-color: var(--tca-orange); }
.tca-calendar-event time { color: var(--tca-orange-dark); font-size: 8px; font-weight: 900; }
.tca-calendar-event span { overflow: hidden; font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tca-calendar-event.stage-published { color: #05603a; background: #ecfdf3; border-color: #abefc6; }
.tca-calendar-event.stage-scheduled { color: #175cd3; background: #eff8ff; border-color: #b2ddff; }
.tca-day > div > small { color: #667085; font-size: 8px; }

.tca-tour-list { display: grid; gap: 7px; }

.tca-tour-list article {
  display: grid;
  grid-template-columns: 53px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--tca-line);
}

.tca-date-block {
  display: grid;
  place-items: center;
  min-height: 51px;
  color: #fff;
  background: var(--tca-orange);
  border-radius: 4px;
}

.tca-date-block strong { font-size: 20px; line-height: 1; }
.tca-date-block span { font-size: 8px; font-weight: 900; text-transform: uppercase; }

.tca-tour-info { min-width: 0; }
.tca-tour-info h3 { margin-top: 4px; font-size: 13px; }
.tca-tour-info > p { margin: 3px 0; color: var(--tca-muted); font-size: 9px; line-height: 1.4; }
.tca-tour-info > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tca-tour-info > div span { display: inline-flex; align-items: center; gap: 3px; color: #667085; font-size: 8px; }
.tca-tour-info > div i { color: var(--tca-orange); font-size: 13px; }

.tca-stage {
  display: inline-flex;
  padding: 3px 6px;
  color: #475467;
  background: #f2f4f7;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}
.tca-stage.stage-published { color: #067647; background: #ecfdf3; }
.tca-stage.stage-scheduled { color: #175cd3; background: #eff8ff; }

.tca-reminders,
.tca-alerts { display: grid; gap: 6px; max-height: 430px; overflow: auto; }

.tca-reminders article {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 8px;
  padding: 9px;
  color: #344054;
  background: #f9fafb;
  border: 1px solid var(--tca-line);
}

.tca-reminders article > .material-icons-outlined { color: var(--tca-orange); font-size: 19px; }
.tca-reminders strong,
.tca-reminders p,
.tca-reminders small { display: block; }
.tca-reminders strong { font-size: 10px; }
.tca-reminders p { margin: 2px 0; color: var(--tca-muted); font-size: 9px; line-height: 1.35; }
.tca-reminders small { color: var(--tca-orange-dark); font-size: 8px; font-weight: 900; }
.tca-reminders .severity-critical,
.tca-reminders .severity-urgent { color: #912018; background: #fef3f2; border-color: #fecdca; }

.tca-alert {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--tca-line);
}

.tca-alert > .material-icons-outlined { color: var(--tca-orange); font-size: 20px; }
.tca-alert strong,
.tca-alert p,
.tca-alert small { display: block; }
.tca-alert strong { color: #344054; font-size: 10px; }
.tca-alert p { margin: 3px 0; color: #667085; font-size: 9px; line-height: 1.4; }
.tca-alert small { color: #98a2b3; font-size: 8px; }
.tca-alert-actions { grid-column: 1 / -1; padding-top: 7px; border-top: 1px solid #eaecf0; }
.tca-alert-actions .btn { min-height: 29px; padding: 5px 7px !important; font-size: 8px !important; }
.tca-alert.severity-critical { color: #912018; background: #fef3f2; border-color: #fecdca; }
.tca-alert.severity-critical > .material-icons-outlined { color: #d92d20; }
.tca-alert.severity-urgent { background: #fffaeb; border-color: #fedf89; }
.tca-alert.critical-card { margin-top: 7px; color: #101828; background: #fff; border-color: #fff; }

.tca-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  padding: 9px;
  background: #f9fafb;
  border: 1px solid var(--tca-line);
  cursor: pointer;
}

.tca-check input { width: 17px; height: 17px; accent-color: var(--tca-orange); }
.tca-check strong,
.tca-check small { display: block; }
.tca-check strong { color: #344054; font-size: 10px; }
.tca-check small { margin-top: 2px; color: #667085; font-size: 8px; line-height: 1.4; }

.tca-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.tca-settings-grid label { display: grid; gap: 4px; }
.tca-settings-grid label span { color: #475467; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.tca-settings-grid input {
  width: 100%;
  min-height: 36px;
  padding: 7px 8px;
  color: #182230;
  background: #fff;
  border: 1px solid #d0d5dd;
  outline: 0;
  font: inherit;
  font-size: 10px;
}
.tca-settings-grid input:focus { border-color: var(--tca-orange); box-shadow: 0 0 0 3px rgba(255, 80, 1, .10); }
.tca-help { margin: 7px 0; color: #667085; font-size: 8px; line-height: 1.4; }
.tca-settings-actions { margin-top: 8px; }

.tca-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 20px;
  color: #667085;
  text-align: center;
}
.tca-empty.compact { min-height: 100px; }
.tca-empty .material-icons-outlined { margin-bottom: 5px; color: #98a2b3; font-size: 30px; }
.tca-empty strong { color: #344054; font-size: 11px; }
.tca-empty p { max-width: 400px; margin: 4px 0 0; font-size: 9px; line-height: 1.4; }

.tca-toast {
  position: fixed;
  z-index: 999999;
  right: 18px;
  bottom: 18px;
  max-width: min(450px, calc(100vw - 36px));
  padding: 12px 15px;
  color: #fff;
  background: #067647;
  border-radius: 4px;
  box-shadow: 0 15px 40px rgba(16, 24, 40, .25);
  font-weight: 800;
}
.tca-toast.error { background: #b42318; }

@media (max-width: 1150px) {
  .tca-layout { grid-template-columns: 1fr; }
  .tca-layout aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #tca-settings-panel { grid-column: 1 / -1; }
}

@media (max-width: 850px) {
  .tca-hero { align-items: flex-start; flex-direction: column; }
  .tca-metrics { grid-template-columns: repeat(2, 1fr); }
  .tca-calendar-grid { min-width: 850px; }
  .tca-weekdays { min-width: 850px; }
  .tca-panel:has(.tca-calendar-grid) { overflow-x: auto; }
}

@media (max-width: 640px) {
  .tca-shell { padding: 8px; }
  .tca-metrics,
  .tca-layout aside,
  .tca-settings-grid { grid-template-columns: 1fr; }
  .tca-tour-list article { grid-template-columns: 48px 1fr; }
  .tca-tour-list article > .btn { grid-column: 1 / -1; width: 100%; }
  .tca-hero-actions .btn { width: 100%; }
}
