/* =============================================================================
   css/modes/package-welcome.css
   Package Calls page + its Schedule dialog (js/modes/package-welcome/package-welcome.js).
   Every class is prefixed pw- so nothing here can leak into another mode.
   Amber is the only accent (same as components/ui.js); greys follow Tailwind's gray scale.
   ============================================================================= */

.pw-page { display: flex; flex-direction: column; gap: 16px; }
.pw-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.pw-muted { font-size: 12px; color: #6b7280; }
.pw-strong { font-weight: 700; color: #111827; }
.pw-bad { color: #b91c1c; }
.pw-nowrap { white-space: nowrap; }
.pw-link { color: #d97706; font-weight: 600; text-decoration: none; }
.pw-link:hover { text-decoration: underline; }
.pw-help { font-size: 11px; color: #9ca3af; margin-top: 6px; line-height: 1.45; }

/* pills */
.pw-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; background: #f3f4f6; color: #4b5563; white-space: nowrap; }
.pw-pill b { color: #111827; }
.pw-pill-amber { background: #fef3c7; color: #b45309; }
.pw-pill-type { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* form controls: one height everywhere so the filter row lines up */
.pw-control { width: 100%; height: 38px; padding: 0 12px; font-size: 13px; color: #111827; border: 1px solid #d1d5db; border-radius: 12px; background: #f9fafb; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.pw-control:focus { background: #fff; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.pw-control:disabled { opacity: .55; cursor: not-allowed; }
.pw-control-sm { height: 32px; font-size: 12px; width: auto; padding: 0 8px; }
.pw-label { display: block; font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.pw-field { min-width: 0; }

/* header */
.pw-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: linear-gradient(90deg, #fffbeb 0%, #fff 55%); }
.pw-eyebrow { font-size: 11px; font-weight: 700; color: #b45309; text-transform: uppercase; letter-spacing: .06em; }
.pw-header-day { font-size: 20px; font-weight: 800; color: #111827; margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pw-header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: #6b7280; }
.pw-header-meta b { color: #374151; }
.pw-header-nav { display: flex; align-items: center; gap: 8px; }
.pw-icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid #e5e7eb; background: #fff; font-size: 18px; font-weight: 700; color: #4b5563; cursor: pointer; }
.pw-icon-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.pw-dot { width: 8px; height: 8px; border-radius: 9999px; display: inline-block; }
.pw-dot-on { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.pw-dot-off { background: #9ca3af; }

/* stats */
.pw-stats { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: 16px; }
@media (max-width: 1100px) { .pw-stats { grid-template-columns: 1fr; } }
.pw-stat-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.pw-stat-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.pw-stat-head h3 { margin: 0; font-size: 13px; font-weight: 800; color: #111827; }
.pw-stat-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pw-tiles { display: grid; gap: 10px; }
.pw-tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pw-tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 720px) { .pw-tiles-4, .pw-tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pw-tile { border: 1px solid #f3f4f6; background: #f9fafb; border-radius: 12px; padding: 12px; min-width: 0; }
.pw-tile-value { font-size: 22px; line-height: 1.15; font-weight: 800; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-tile-label { margin-top: 2px; font-size: 12px; font-weight: 700; color: #374151; }
.pw-tile-sub { margin-top: 2px; font-size: 11px; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-tone-blue  { background: #eff6ff; border-color: #dbeafe; } .pw-tone-blue  .pw-tile-value { color: #1d4ed8; }
.pw-tone-amber { background: #fffbeb; border-color: #fde68a; } .pw-tone-amber .pw-tile-value { color: #b45309; }
.pw-tone-green { background: #ecfdf5; border-color: #d1fae5; } .pw-tone-green .pw-tile-value { color: #047857; }
.pw-tone-red   { background: #fef2f2; border-color: #fee2e2; } .pw-tone-red   .pw-tile-value { color: #b91c1c; }
.pw-tone-grey  .pw-tile-value { color: #6b7280; }

/* progress bars */
.pw-bar { display: flex; width: 100%; height: 8px; border-radius: 9999px; overflow: hidden; background: #f3f4f6; }
.pw-bar-thin { height: 6px; }
.pw-bar-seg { display: block; height: 100%; }
.pw-bar-delivered { background: #10b981; }
.pw-bar-cut { background: #ef4444; }
.pw-bar-missed { background: #9ca3af; }
.pw-bar-flight { background: #60a5fa; }
.pw-bar-idle { background: #e5e7eb; }
.pw-bar-empty { background: #f3f4f6; }

/* active runs */
.pw-runs { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.pw-run-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pw-run { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #f3f4f6; border-radius: 12px; padding: 10px 12px; background: #f9fafb; }
.pw-run-main { min-width: 0; }
.pw-run-main .pw-strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-run-progress { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 120px; }

/* filters: aligned grid, every control 38px */
.pw-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; align-items: end; padding: 16px 18px; }
.pw-span-2 { grid-column: span 2; }
@media (max-width: 720px) { .pw-span-2 { grid-column: span 1; } }
.pw-filter-actions { display: flex; gap: 8px; }
.pw-filter-actions button { height: 38px; flex: 1; }
/* Wide screens: search + 5 filters + buttons on ONE row. */
@media (min-width: 1280px) {
  .pw-filters { grid-template-columns: minmax(200px, 2fr) repeat(5, minmax(120px, 1fr)) auto; }
  .pw-span-2 { grid-column: span 1; }
  .pw-filter-actions button { flex: 0 0 auto; }
}

/* city dropdown */
.pw-dd { position: relative; }
.pw-dd-summary { display: flex; align-items: center; justify-content: space-between; gap: 6px; cursor: pointer; list-style: none; line-height: 36px; }
.pw-dd-summary::-webkit-details-marker { display: none; }
.pw-dd-caret { color: #9ca3af; font-size: 11px; }
.pw-dd-menu { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 12px 28px rgba(16,24,40,.14); padding: 6px; min-width: 180px; }
.pw-dd-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: #374151; cursor: pointer; }
.pw-dd-item:hover { background: #fffbeb; }

/* action bar */
.pw-actionbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; position: sticky; top: 8px; z-index: 20; }
.pw-actionbar-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* alerts */
.pw-alert { padding: 12px 16px; border-radius: 12px; font-size: 13px; border: 1px solid transparent; }
.pw-alert-ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.pw-alert-bad { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.pw-alert-sub { margin-top: 6px; font-size: 12px; color: #4b5563; }
.pw-alert-sub ul, .pw-skipped ul { margin: 4px 0 0 18px; list-style: disc; }

/* table */
.pw-table-wrap { overflow-x: auto; }
.pw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pw-table thead th { position: sticky; top: 0; background: #f9fafb; padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; border-bottom: 1px solid #e5e7eb; }
.pw-table td { padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #f3f4f6; color: #374151; }
.pw-table tbody tr:hover { background: #fffdf5; }
.pw-td-check { width: 36px; }
.pw-row-muted td { background: #fafafa; color: #6b7280; }
.pw-row-selected td { background: #fffbeb; }
.pw-cell-sub { font-size: 11px; color: #9ca3af; margin-top: 3px; }
.pw-clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; }
.pw-pager { display: flex; align-items: center; gap: 8px; }
.pw-empty { padding: 56px 16px; text-align: center; color: #9ca3af; font-size: 13px; }

/* schedule dialog */
.pw-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(17,24,39,.45); display: flex; align-items: center; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.pw-dialog { background: #fff; border-radius: 18px; width: 100%; max-width: 620px; box-shadow: 0 20px 50px rgba(16,24,40,.25); display: flex; flex-direction: column; max-height: calc(100vh - 48px); margin: auto; }
.pw-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #f3f4f6; }
.pw-dialog-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: #111827; }
.pw-dialog-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.pw-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #f3f4f6; }
.pw-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: #9ca3af; cursor: pointer; }
.pw-close:hover { color: #374151; }
.pw-dsec { border: 1px solid #f3f4f6; border-radius: 12px; padding: 12px 14px; }
.pw-dsec-title { font-size: 11px; font-weight: 800; color: #b45309; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.pw-radio, .pw-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: #374151; padding: 4px 0; }
.pw-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .pw-grid-2 { grid-template-columns: 1fr; } }
.pw-preview { border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pw-preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .pw-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pw-preview .pw-tile { background: #fff; }
.pw-preview .pw-tile-value { font-size: 16px; }
.pw-skipped summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #92400e; }
.pw-skipped li { font-size: 12px; color: #4b5563; }
