/* KTM Voyage CRM — planning module styles [PLN]
   Release-deadline board (R1/R2/R3/overdue), small-group feed, notification centre.
   Uses the base.css tokens: --gold --dark --ink --paper --card --line --muted
   --muted-2 --ok --warn --bad --info --radius --shadow. */

/* ------------------------------------------------------------------ toolbar */
.pln-toolbar .pln-search {
  flex: 0 1 320px;
  min-width: 180px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font: inherit;
  color: var(--ink);
}
.pln-toolbar .pln-search:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(204, 181, 45, 0.18);
}
.pln-toolbar .pln-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.pln-toolbar .ntf-filter {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font: inherit;
  color: var(--ink);
}
.pln-toolbar .btn {
  min-height: 40px;
}

/* Live-search: hidden cards/items */
.plan-body .hide {
  display: none !important;
}

/* ------------------------------------------------------------------ summary */
.plan-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.plan-summary .ps-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 16px;
}
.plan-summary .ps-item b {
  font-size: 22px;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--dark);
}
.plan-summary .ps-item span {
  color: var(--muted);
  font-size: 13px;
}
.plan-summary .ps-item.bad b {
  color: var(--bad);
}
.plan-summary .ps-next {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  background: rgba(204, 181, 45, 0.12);
  border: 1px solid rgba(204, 181, 45, 0.4);
  border-radius: 999px;
  padding: 7px 14px;
}

/* ------------------------------------------------------------------ board */
.plan-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
  margin-bottom: 24px;
}
.plan-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.plan-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  border-top: 3px solid var(--line);
}
.col-r1 .plan-col-head { border-top-color: var(--info); }
.col-r2 .plan-col-head { border-top-color: var(--gold); }
.col-r3 .plan-col-head { border-top-color: var(--opt, #c98a1a); }
.col-overdue .plan-col-head { border-top-color: var(--bad); }
.plan-col-head b {
  display: block;
  font-size: 14px;
  color: var(--dark);
}
.plan-col-head small {
  color: var(--muted-2);
  font-size: 12px;
}
.plan-cnt {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.plan-cnt.alert {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.plan-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 64px;
}
.plan-col-empty {
  color: var(--muted-2);
  font-size: 13px;
  text-align: center;
  padding: 18px 8px;
}

/* Booking card — big click target, whole card navigates */
.plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.plan-card:hover,
.plan-card:focus-visible {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  outline: none;
}
.col-overdue .plan-card {
  background: #fdf3f1;
  border-color: rgba(202, 99, 80, 0.45);
}
.pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.pc-code {
  font-size: 14px;
  color: var(--dark);
}
.pc-name {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.pc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.pc-deadline {
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.pc-deadline b {
  color: var(--ink);
}

/* Days-remaining chips */
.chip-days {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-days.ok   { background: rgba(47, 158, 81, 0.12);  color: var(--ok); }
.chip-days.near { background: rgba(204, 181, 45, 0.18); color: #8c7a10; }
.chip-days.soon { background: rgba(201, 138, 26, 0.16); color: var(--opt, #c98a1a); }
.chip-days.now  { background: var(--gold); color: var(--dark); }
.chip-days.late { background: rgba(202, 99, 80, 0.16);  color: var(--bad); }

/* ------------------------------------------------------------------ small groups */
.sg-wrap {
  background: #fffaf0;
  border: 1px solid rgba(201, 138, 26, 0.35);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
}
.sg-title {
  font-size: 16px;
  color: var(--dark);
  margin: 0 0 4px;
}
.sg-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}
.sg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sg-item {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 14px;
  min-height: 44px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sg-item:hover,
.sg-item:focus-visible {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  outline: none;
}
.sg-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1 1 240px;
  min-width: 0;
}
.sg-main b {
  color: var(--dark);
  white-space: nowrap;
}
.sg-name {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sg-pax {
  font-weight: 700;
  color: var(--bad);
  font-size: 13px;
  white-space: nowrap;
}
.sg-date {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.sg-empty {
  color: var(--ok);
  font-size: 13.5px;
  padding: 6px 2px;
}

/* ------------------------------------------------------------------ notifications */
.ntf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ntf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 48px;
}
.ntf-item.unread {
  border-left-color: var(--gold);
  background: #fffdf4;
}
.ntf-ic {
  font-size: 20px;
  flex: 0 0 auto;
}
.ntf-main {
  flex: 1 1 auto;
  min-width: 0;
}
.ntf-t {
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.ntf-item.unread .ntf-t {
  font-weight: 700;
  color: var(--dark);
}
.ntf-new {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  background: var(--gold);
  color: var(--dark);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 999px;
  padding: 2px 8px;
}
.ntf-meta {
  color: var(--muted-2);
  font-size: 12.5px;
  margin-top: 3px;
}
.ntf-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ntf-actions .btn {
  min-height: 40px;
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .plan-board {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}
@media (max-width: 720px) {
  .plan-board {
    grid-template-columns: 1fr;
  }
  .plan-summary .ps-next {
    margin-left: 0;
  }
  .pln-toolbar .pln-search {
    flex: 1 1 100%;
    min-width: 0;
  }
  .ntf-item {
    flex-wrap: wrap;
  }
  .ntf-main {
    flex: 1 1 calc(100% - 34px);
  }
  .ntf-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    padding-left: 32px;
  }
}

/* ------------------------------------------------------------------ print */
@media print {
  .pln-toolbar .btn,
  .pln-toolbar .pln-search,
  .pln-toolbar .ntf-filter,
  .ntf-actions,
  .pagehead .btn {
    display: none !important;
  }
  .plan-board {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .plan-card,
  .plan-col,
  .ntf-item,
  .sg-item {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ---------- P2 polish: long codes/names never overflow ---------- */
.pc-code{overflow-wrap:anywhere}
.plan-summary .ps-next{overflow-wrap:anywhere}
