/* PHTH-LOG theme — "Onyx & Teal", built on the customer (PROSPIRA) logo:
   teal #05b2c1, black, white. Onyx chrome with a teal hairline, clean white
   cards on a soft porcelain ground, teal kept for accents and states.
   Contrast note: white text on #05b2c1 is weak, so teal fills carry onyx text,
   and teal *text* on white uses --brand-700. */
:root {
  /* teal — the logo colour */
  --brand-50:  #ecfafb;
  --brand-100: #cff2f5;
  --brand-300: #5fd4de;
  --brand-500: #05b2c1;   /* logo teal */
  --brand-600: #0499a6;
  --brand-700: #037b86;   /* teal for text on white (AA) */
  --teal-deep: #04545c;
  /* onyx — the logo black; brand-800/900 are the dark chrome everywhere */
  --brand-800: #1a1f23;
  --brand-900: #0b0d0f;

  --ink:   #0b0d0f;
  --ink-2: #2e3439;
  --muted: #6b7378;
  --faint: #9aa2a7;
  --bg:    #f4f5f5;
  --card:  #ffffff;
  --line:  #e4e7e8;
  --line-2:#eff1f1;

  --ok:   #12925a;  --ok-bg:   #e7f6ee;
  --warn: #c27406;  --warn-bg: #fdf3e1;
  --bad:  #d0342c;  --bad-bg:  #fcebea;
  --run:  #037b86;  --run-bg:  #e2f6f8;
  --idle: #6b7378;  --idle-bg: #eef0f0;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 13, 15, .05), 0 1px 1px rgba(11, 13, 15, .03);
  --shadow:    0 14px 34px -16px rgba(11, 13, 15, .28), 0 2px 6px rgba(11, 13, 15, .05);
  --shadow-lg: 0 28px 64px -24px rgba(11, 13, 15, .55);
  --glow:      0 10px 28px -12px rgba(5, 178, 193, .75);
  --hairline:  linear-gradient(90deg, transparent 0%, var(--brand-500) 22%, var(--brand-300) 50%, var(--brand-500) 78%, transparent 100%);

  --font: "Noto Sans Thai", "Leelawadee UI", "Segoe UI", Tahoma, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--brand-100); color: var(--ink); }
a { color: var(--brand-700); }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
.mono { font-family: var(--mono); font-size: .9em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.pl-topbar {
  position: sticky; top: 0; z-index: 50;
  background:
    radial-gradient(600px 120px at 92% -40px, rgba(5, 178, 193, .22), transparent 70%),
    linear-gradient(180deg, #121518 0%, var(--brand-900) 100%);
  color: #fff;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .7);
}
.pl-topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--hairline); opacity: .9; }
.pl-topbar-in {
  max-width: 1440px; margin: 0 auto; padding: 0 20px;
  height: 66px; display: flex; align-items: center; gap: 18px;
}
.pl-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex: none; }
.pl-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(145deg, var(--brand-300) 0%, var(--brand-500) 55%, var(--brand-600) 100%);
  display: grid; place-items: center; color: var(--brand-900); font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 20px -8px rgba(5, 178, 193, .8);
}
.pl-brand-text b { display: block; font-size: 18px; letter-spacing: .02em; font-weight: 900; line-height: 1.1; }
.pl-brand-text b em { font-style: normal; color: var(--brand-500); }
.pl-brand-text small { display: block; font-size: 10px; opacity: .55; letter-spacing: .22em; text-transform: uppercase; margin-top: 2px; }

.pl-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pl-nav::-webkit-scrollbar { display: none; }
.pl-nav a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  color: rgba(255, 255, 255, .66); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 8px 12px; border-radius: 9px; transition: background .15s, color .15s;
}
.pl-nav a i { font-size: 13px; opacity: .8; }
.pl-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.pl-nav a.on { background: rgba(5, 178, 193, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(5, 178, 193, .35); }
.pl-nav a.on i { color: var(--brand-500); opacity: 1; }
.pl-nav .sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .14); margin: 0 6px; flex: none; }

.pl-user { display: flex; align-items: center; gap: 10px; flex: none; }
.pl-clock { font-variant-numeric: tabular-nums; font-size: 13px; opacity: .7; letter-spacing: .03em; }
.pl-userchip {
  display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px;
}
.pl-avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-500); color: var(--brand-900); font-weight: 900; font-size: 13px;
}
.pl-userchip .who { font-size: 13px; line-height: 1.15; padding-right: 4px; }
.pl-userchip .who small { display: block; opacity: .55; font-size: 11px; }
.pl-iconbtn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: rgba(255, 255, 255, .75); display: grid; place-items: center;
}
.pl-iconbtn:hover { background: rgba(255, 255, 255, .1); color: var(--brand-300); }
.pl-burger { display: none; }
.pl-simbadge {
  font-size: 10px; font-weight: 800; letter-spacing: .14em; padding: 4px 10px; border-radius: 999px;
  background: rgba(245, 180, 40, .14); color: #f6c453; border: 1px solid rgba(246, 196, 83, .45);
}

@media (max-width: 1520px) {
  .pl-clock, .pl-userchip .who { display: none; }
}
@media (max-width: 860px) {
  .pl-burger { display: grid; }
  .pl-nav {
    position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--brand-900); padding: 10px 14px 16px; gap: 2px; display: none; overflow: visible;
    border-bottom: 2px solid var(--brand-500);
  }
  .pl-nav.open { display: flex; }
  .pl-nav .sep { width: auto; height: 1px; margin: 6px 0; }
  .pl-nav a { border-radius: 10px; }
}

@media (max-width: 600px) {
  .pl-topbar-in { gap: 10px; padding: 0 12px; }
  .pl-brand-text small { display: none; }
  .pl-brand-text b { font-size: 16px; }
  .pl-user { margin-left: auto; gap: 6px; }
  .pl-simbadge { font-size: 9px; padding: 2px 7px; }
  .pl-userchip { padding: 2px; }
  .pl-main { padding: 18px 16px 40px; gap: 16px; }
  .pl-head h1 { font-size: 22px; }
  .pl-head h1 .ico { width: 36px; height: 36px; font-size: 15px; }
  .pl-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .pl-summary { gap: 10px; padding: 12px 14px; }
  .pl-summary .end b { font-size: 15px; }
  .pl-card-h, .pl-card-b, .pl-toolbar { padding-left: 14px; padding-right: 14px; }
  .pl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pl-kpi { padding: 12px 14px; }
  .pl-kpi .v { font-size: 26px; }
}

/* ------------------------------------------------------------- page frame */
.pl-main { max-width: 1440px; margin: 0 auto; padding: 30px 20px 64px; display: flex; flex-direction: column; gap: 22px; }
.pl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pl-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 14px; }
.pl-head h1 .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 18px;
  color: var(--brand-500); background: linear-gradient(150deg, #22292e, var(--brand-900));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 22px -10px rgba(11, 13, 15, .7);
}
.pl-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pl-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pl-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-700); }

/* ------------------------------------------------------------------ cards */
.pl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.pl-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.pl-card-h h2 { font-size: 16px; font-weight: 800; letter-spacing: -.005em; display: flex; align-items: center; gap: 10px; }
.pl-card-h h2 i { color: var(--brand-600); }
.pl-card-b { padding: 18px 20px; }
.pl-grid { display: grid; gap: 22px; }
.pl-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pl-grid.side { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 1100px) { .pl-grid.side, .pl-grid.cols-2 { grid-template-columns: minmax(0, 1fr); } }

/* KPI strip */
.pl-kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pl-kpi {
  position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px 15px; box-shadow: var(--shadow-sm);
}
.pl-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--brand-500)); opacity: .85; }
.pl-kpi .l { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; letter-spacing: .02em; }
.pl-kpi .l i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; color: var(--c, var(--brand-700)); background: var(--cb, var(--brand-50)); }
.pl-kpi .v { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pl-kpi .s { font-size: 12px; color: var(--faint); margin-top: 2px; }
.pl-kpi.hero {
  background:
    radial-gradient(260px 160px at 100% 0%, rgba(5, 178, 193, .38), transparent 70%),
    linear-gradient(150deg, #20272c 0%, var(--brand-900) 100%);
  color: #fff; border: 0; box-shadow: var(--shadow);
}
.pl-kpi.hero::before { background: var(--brand-500); opacity: 1; }
.pl-kpi.hero .v { color: #fff; }
.pl-kpi.hero .l, .pl-kpi.hero .s { color: rgba(255, 255, 255, .62); }
.pl-kpi.hero .l i { background: rgba(5, 178, 193, .18); color: var(--brand-300); }

/* ---------------------------------------------------------------- buttons */
.pl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-size: 14px; line-height: 1; letter-spacing: .01em;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: var(--brand-500); color: var(--brand-900); text-decoration: none; white-space: nowrap;
  transition: transform .12s, box-shadow .15s, background .15s, color .15s;
  box-shadow: var(--glow);
}
.pl-btn:hover { background: var(--brand-300); transform: translateY(-1px); }
.pl-btn:active { transform: none; }
.pl-btn:focus-visible, .pl-input:focus-visible, .pl-select:focus-visible { outline: 3px solid rgba(5, 178, 193, .4); outline-offset: 2px; }
.pl-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.pl-btn.dark { background: var(--brand-900); color: #fff; box-shadow: 0 10px 22px -12px rgba(11, 13, 15, .9); }
.pl-btn.dark i { color: var(--brand-500); }
.pl-btn.dark:hover { background: #22292e; }
.pl-btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); box-shadow: var(--shadow-sm); }
.pl-btn.ghost:hover { background: #fff; border-color: var(--brand-500); color: var(--brand-700); }
.pl-btn.danger { background: #fff; color: var(--bad); border-color: #f1c4c1; box-shadow: none; }
.pl-btn.danger:hover { background: var(--bad-bg); }
.pl-btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.pl-btn.lg { padding: 15px 26px; font-size: 16px; border-radius: 12px; }

/* ------------------------------------------------------------------ forms */
.pl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pl-field > label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pl-field .hint { font-size: 12px; color: var(--muted); }
.pl-input, .pl-select, .pl-textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  padding: 10px 12px; border: 1px solid #d9dddf; border-radius: 9px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.pl-input:hover, .pl-select:hover, .pl-textarea:hover { border-color: #c4cacd; }
.pl-input:focus, .pl-select:focus, .pl-textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(5, 178, 193, .16); }
.pl-form { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pl-form .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .pl-form { grid-template-columns: minmax(0, 1fr); } }

.pl-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.pl-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.pl-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; }
.pl-search .pl-input { padding-left: 34px; }
.pl-toolbar .pl-select, .pl-toolbar .pl-input[type="date"] { width: auto; }
.pl-toolbar .spacer { flex: 1; }

/* segmented filter chips */
.pl-seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--line-2); border: 1px solid var(--line); border-radius: 11px; flex-wrap: wrap; }
.pl-seg button {
  font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); background: transparent;
  border: 0; padding: 7px 12px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.pl-seg button:hover { color: var(--ink); }
.pl-seg button.on { background: var(--brand-900); color: #fff; box-shadow: 0 4px 12px -6px rgba(11, 13, 15, .7); }
.pl-seg button.on .n { color: var(--brand-300); }
.pl-seg .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--brand-500)); }
.pl-seg .n { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* switch */
.pl-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.pl-switch input { opacity: 0; width: 0; height: 0; }
.pl-switch span { position: absolute; inset: 0; background: #d3d8da; border-radius: 999px; cursor: pointer; transition: .15s; }
.pl-switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 2px 6px rgba(11, 13, 15, .25); }
.pl-switch input:checked + span { background: var(--brand-500); }
.pl-switch input:checked + span::before { transform: translateX(20px); }
.pl-switch input:focus-visible + span { outline: 3px solid rgba(5, 178, 193, .4); outline-offset: 2px; }

/* ----------------------------------------------------------------- tables */
.pl-tablewrap { overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pl-table th {
  text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: #f8f9f9; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.pl-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.pl-table tbody tr { transition: background .12s; }
.pl-table tbody tr:hover td { background: #f7fbfb; }
.pl-table tr.live td { background: #f1fafb; }
.pl-table tr.live td:first-child { box-shadow: inset 3px 0 0 var(--brand-500); }
.pl-table tr.stall td { background: #fff8ec; }
.pl-table .nowrap { white-space: nowrap; }
.pl-table .route { display: flex; align-items: center; gap: 10px; }
.pl-table .route b { display: block; font-weight: 700; }
.pl-table .route small { display: block; color: var(--faint); font-family: var(--mono); font-size: 11px; }
.pl-table .route .arrow { color: var(--brand-500); }
.pl-table .msg { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 320px; }

/* status chips */
.pl-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; color: var(--c); background: var(--cb);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 18%, transparent);
}
.pl-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pl-chip.s1 { --c: var(--run);  --cb: var(--run-bg); }
.pl-chip.s1::before { background: var(--brand-500); box-shadow: 0 0 0 3px rgba(5, 178, 193, .22); animation: pl-pulse 1.4s ease-in-out infinite; }
.pl-chip.s2 { --c: var(--ok);   --cb: var(--ok-bg); }
.pl-chip.s3 { --c: var(--bad);  --cb: var(--bad-bg); }
.pl-chip.s4 { --c: var(--idle); --cb: var(--idle-bg); }
.pl-chip.s5 { --c: var(--warn); --cb: var(--warn-bg); }
.pl-chip.ok   { --c: var(--ok);   --cb: var(--ok-bg); }
.pl-chip.warn { --c: var(--warn); --cb: var(--warn-bg); }
.pl-chip.bad  { --c: var(--bad);  --cb: var(--bad-bg); }
.pl-chip.idle { --c: var(--idle); --cb: var(--idle-bg); }
.pl-chip.run  { --c: var(--run);  --cb: var(--run-bg); }
@keyframes pl-pulse { 50% { opacity: .35; } }

.pl-tag { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; padding: 2px 8px; border-radius: 5px; border: 1px solid currentColor; white-space: nowrap; }
.pl-tag.PICK { color: var(--brand-700); }
.pl-tag.DROP { color: var(--ink); }
.pl-tag.BOTH { color: #7a5c12; }
.pl-prio { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 800; background: var(--line-2); color: var(--ink-2); }
.pl-prio.hi { background: var(--brand-900); color: var(--brand-300); }

/* -------------------------------------------------------- location tiles */
.pl-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pl-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg-full { background: linear-gradient(140deg, var(--brand-500), var(--teal-deep)); }
.lg-empty { background: #fff; border: 1.5px dashed #b9c0c4; }
.lg-reserved { background: #fdf3e1; border: 1.5px solid #e0a43a; }
.lg-disabled { background: repeating-linear-gradient(45deg, #e6e9ea 0 4px, #f5f6f6 4px 8px); }

.pl-group { display: flex; flex-direction: column; gap: 12px; }
.pl-group + .pl-group { margin-top: 24px; }
.pl-group-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-group-h .bar { width: 4px; height: 20px; border-radius: 3px; background: var(--c, var(--brand-500)); }
.pl-group-h h3 { font-size: 15px; font-weight: 800; }
.pl-group-h .code { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.pl-group-h .stats { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.pl-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.pl-tile {
  position: relative; text-align: left; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px dashed #c9cfd2; border-radius: 12px; padding: 11px 12px 10px;
  min-height: 82px; display: flex; flex-direction: column; gap: 3px; cursor: default;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.pl-tile .nm { font-weight: 800; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.pl-tile .pt { font-family: var(--mono); font-size: 11px; color: var(--faint); overflow-wrap: anywhere; }
.pl-tile .st { margin-top: auto; padding-right: 52px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.pl-tile .rl { position: absolute; bottom: 9px; right: 9px; }
.pl-tile.full {
  background: linear-gradient(140deg, var(--brand-600) 0%, var(--teal-deep) 100%);
  border: 1.5px solid transparent; color: #fff; box-shadow: 0 12px 24px -14px rgba(4, 84, 92, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.pl-tile.full .pt, .pl-tile.full .st { color: rgba(255, 255, 255, .8); }
.pl-tile.full .pl-tag { color: #fff; border-color: rgba(255, 255, 255, .55); }
.pl-tile.reserved { background: #fffaf0; border: 1.5px solid #e0a43a; }
.pl-tile.reserved .st { color: #9a5b04; }
.pl-tile.disabled { background: repeating-linear-gradient(45deg, #eef0f0 0 6px, #f7f8f8 6px 12px); border: 1.5px solid #e3e6e7; color: var(--faint); }
.pl-tile.clickable { cursor: pointer; }
.pl-tile.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-500); }
.pl-tile.full.clickable:hover { border-color: var(--brand-300); }
.pl-tile.dim { opacity: .35; cursor: not-allowed; }
.pl-tile.dim:hover { transform: none; box-shadow: none; }
.pl-tile.picked { outline: 3px solid var(--brand-900); outline-offset: 2px; }
.pl-tile.picked::after {
  content: "\f00c"; font-family: "Font Awesome 5 Free"; font-weight: 900; position: absolute; right: -8px; top: -8px;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
  background: var(--brand-900); color: var(--brand-500); box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
}
.pl-tile.mini { min-height: 0; padding: 7px 9px; border-radius: 9px; }
.pl-tile.mini .nm { font-size: 12px; }
.pl-tiles.mini { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }

/* ----------------------------------------------------------------- robots */
.pl-robots { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pl-robot { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-sm); }
.pl-robot-h { display: flex; align-items: center; gap: 12px; }
.pl-robot-h .av {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(150deg, #22292e, var(--brand-900)); color: var(--brand-500); flex: none;
}
.pl-robot.off .pl-robot-h .av { background: var(--idle-bg); color: var(--faint); }
.pl-robot-h b { font-size: 17px; display: block; }
.pl-robot-h small { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.pl-robot-h .pl-chip { margin-left: auto; }
.pl-batt { display: flex; align-items: center; gap: 10px; }
.pl-batt .track { flex: 1; height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.pl-batt .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-600), var(--brand-300)); }
.pl-batt.low .fill { background: linear-gradient(90deg, var(--bad), #f08a84); }
.pl-batt.mid .fill { background: linear-gradient(90deg, var(--warn), #f3c05d); }
.pl-batt b { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.pl-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.pl-kv dt { color: var(--muted); }
.pl-kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.pl-job { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.pl-job b { color: var(--teal-deep); }
.pl-alarm { background: var(--bad-bg); color: #8f1f19; border-radius: 10px; padding: 9px 12px; font-size: 13px; }

.pl-robotstrip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pl-robotmini { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pl-robotmini .av { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-900); color: var(--brand-500); flex: none; }
.pl-robotmini.off .av { background: var(--idle-bg); color: var(--faint); }
.pl-robotmini .info { flex: 1; min-width: 0; }
.pl-robotmini .info b { display: block; font-size: 14px; }
.pl-robotmini .info span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-robotmini .bt { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; }

/* --------------------------------------------------------------- call page */
.pl-steps { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .pl-steps { grid-template-columns: minmax(0, 1fr); } }
.pl-stepnum {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 900;
  background: var(--brand-500); color: var(--brand-900); flex: none; box-shadow: 0 0 0 4px var(--brand-50);
}
.pl-summary {
  position: sticky; bottom: 16px; z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background:
    radial-gradient(420px 140px at 0% 100%, rgba(5, 178, 193, .22), transparent 70%),
    linear-gradient(150deg, #1d2328, var(--brand-900));
  color: #fff; border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow-lg);
}
.pl-summary .ends { display: flex; align-items: center; gap: 14px; flex: 1 1 360px; min-width: 0; }
.pl-summary .end { min-width: 0; }
.pl-summary .end small { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--brand-300); opacity: .9; }
.pl-summary .end b { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-summary .end b.none { opacity: .35; font-weight: 600; }
.pl-summary .arrow { font-size: 18px; color: var(--brand-500); flex: none; }
.pl-summary .prio { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pl-summary .prio .pl-select { width: auto; background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .18); }
.pl-summary .prio .pl-select option { color: var(--ink); }
.pl-summary .pl-btn { background: var(--brand-500); color: var(--brand-900); box-shadow: var(--glow); }
.pl-summary .pl-btn:hover { background: var(--brand-300); }
.pl-summary .pl-btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .22); box-shadow: none; }
.pl-summary .pl-btn.ghost:hover { border-color: var(--brand-500); color: var(--brand-300); }

/* ------------------------------------------------------------ misc pieces */
.pl-empty { text-align: center; color: var(--faint); padding: 44px 16px; }
.pl-empty i { font-size: 30px; display: block; margin-bottom: 10px; color: #cfd5d8; }
.pl-note { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--teal-deep); border-radius: 11px; padding: 12px 14px; font-size: 13px; }
.pl-note i { color: var(--brand-600); margin-top: 3px; }
.pl-note.warn { background: var(--warn-bg); border-color: #f4dcae; color: #7a4703; }
.pl-note.warn i { color: var(--warn); }
.pl-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.pl-pager .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pl-pager button { font: inherit; font-size: 13px; min-width: 34px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2); }
.pl-pager button:hover:not([disabled]):not(.on) { border-color: var(--brand-500); color: var(--brand-700); }
.pl-pager button.on { background: var(--brand-900); color: #fff; border-color: var(--brand-900); }
.pl-pager button[disabled] { opacity: .4; cursor: default; }

.pl-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.pl-bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.pl-bars .b span { width: 100%; max-width: 22px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, var(--brand-300), var(--brand-600)); min-height: 2px; }
.pl-bars .b.now span { background: linear-gradient(180deg, #3a434a, var(--brand-900)); box-shadow: inset 0 2px 0 var(--brand-500); }
.pl-bars .b em { font-style: normal; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.pl-bars .b b { font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 13px; }

.pl-occ { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.pl-occ span { display: block; height: 100%; }

/* modal (native <dialog>) */
dialog.pl-modal { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); overflow: hidden; }
dialog.pl-modal::before { content: ""; display: block; height: 3px; background: var(--hairline); }
dialog.pl-modal::backdrop { background: rgba(11, 13, 15, .55); backdrop-filter: blur(3px); }
.pl-modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.pl-modal-h h3 { font-size: 18px; font-weight: 800; }
.pl-modal-b { padding: 20px 22px; }
.pl-modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #f8f9f9; }
.pl-modal-h .pl-iconbtn { color: var(--muted); }
.pl-modal-h .pl-iconbtn:hover { background: var(--line-2); color: var(--ink); }

.pl-log { font-family: var(--mono); font-size: 12.5px; }
.pl-log td { padding: 6px 12px; vertical-align: top; }
.pl-log .t { white-space: nowrap; color: var(--muted); }
.pl-log .m { white-space: pre-wrap; word-break: break-word; }
.pl-lv { font-weight: 800; font-size: 11px; }
.pl-lv.INFO { color: var(--brand-700); }
.pl-lv.WARNING { color: var(--warn); }
.pl-lv.ERROR { color: var(--bad); }

.swal2-popup { font-family: var(--font) !important; border-radius: 16px !important; }
.swal2-styled.swal2-confirm { background: var(--brand-900) !important; color: #fff !important; border-radius: 10px !important; }
.swal2-styled.swal2-cancel { border-radius: 10px !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
