/* assets/app.css */

body { background: #f4f5f7; }

.auth-bg { min-height: 100vh; display: flex; align-items: center; padding: 24px 0; }
.auth-card {
  max-width: 440px;
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
}
.auth-logo { width: 84px; height: 84px; margin: 0 auto 8px; display: block; }
.nav-logo  { width: 32px; height: 32px; vertical-align: middle; }

/* iPhone notch / home bar when running as the app */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
main { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }

.list-group-item .form-select-sm { min-width: 120px; }

.user-menu { min-width: 240px; }

/* ── Panels page (same controls as the ALTC schedule admin) ── */
.pos-swatch { width:20px; height:20px; border-radius:4px; display:inline-block; border:1px solid rgba(0,0,0,.15); vertical-align:middle; }
.pos-tablewrap { max-height:420px; overflow:auto; }
.pos-table thead th { position:sticky; top:0; background:#fff; z-index:1; }
.pos-table td, .pos-table th { white-space:nowrap; }
#btnActive { min-width:92px; font-weight:600; }
#btnActive.act-on  { background:#198754; border-color:#198754; color:#fff; }
#btnActive.act-off { background:#6c757d; border-color:#6c757d; color:#fff; }
.p-timefield { max-width:126px; }

/* Color control: one button that opens a popover holding the square, hue,
   hex, RGB and presets, so it reads as a single field. */
.colour-trigger {
  width:100%; display:flex; align-items:center; gap:8px;
  border:1px solid #ced4da; border-radius:.25rem; background:#fff;
  padding:3px 8px; height:31px;
}
.colour-trigger:hover { border-color:#9cb6e0; }
.colour-chip {
  width:20px; height:20px; border-radius:4px; flex:0 0 auto;
  border:1px solid rgba(0,0,0,.2); background:#0D6EFD;
}
.colour-hexlabel { font-family:monospace; font-size:.8rem; color:#3b4149; }
.colour-pop {
  display:none; position:absolute; z-index:1090;
  background:#fff; border:1px solid #ced4da; border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.18); padding:12px;
}
.colour-pop.show { display:block; }
.colour-pop-inner { display:flex; flex-direction:column; gap:10px; width:224px; }
.cp-sv {
  position:relative; width:100%; height:130px; border-radius:6px;
  cursor:crosshair; overflow:hidden; background:#0D6EFD; border:1px solid #dee2e6;
}
.cp-sv-white, .cp-sv-black { position:absolute; inset:0; }
.cp-sv-white { background:linear-gradient(to right, #fff, rgba(255,255,255,0)); }
.cp-sv-black { background:linear-gradient(to top, #000, rgba(0,0,0,0)); }
.cp-dot {
  position:absolute; width:12px; height:12px; border-radius:50%;
  border:2px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,.4);
  transform:translate(-50%, -50%); pointer-events:none;
}
.cp-hue {
  -webkit-appearance:none; appearance:none; width:100%; height:12px;
  border-radius:6px; outline:none; border:1px solid #dee2e6;
  background:linear-gradient(to right,#f00 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,#f00 100%);
}
.cp-hue::-webkit-slider-thumb {
  -webkit-appearance:none; width:14px; height:14px; border-radius:50%;
  background:#fff; border:2px solid #6c757d; cursor:pointer;
}
.cp-hue::-moz-range-thumb {
  width:14px; height:14px; border-radius:50%;
  background:#fff; border:2px solid #6c757d; cursor:pointer;
}
.cp-row { display:flex; align-items:center; gap:8px; }
.cp-preview {
  width:30px; height:30px; border-radius:6px; flex:0 0 auto;
  border:1px solid rgba(0,0,0,.2); background:#0D6EFD;
}
.cp-hexrow { display:flex; align-items:center; flex:1; border:1px solid #ced4da; border-radius:6px; padding:4px 8px; }
.cp-hexrow.bad { border-color:#dc3545; }
.cp-hash { color:#8d949c; font-family:monospace; margin-right:2px; }
.cp-hexrow input { border:none; outline:none; width:100%; font-family:monospace; text-transform:uppercase; font-size:.9rem; padding:0; }
.cp-rgb { display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; }
.cp-rgb label { display:flex; align-items:center; gap:4px; font-size:.72rem; font-weight:700; color:#6c757d; }
.cp-rgb input { width:100%; border:1px solid #ced4da; border-radius:5px; padding:3px 4px; font-size:.8rem; text-align:center; }
.colour-swatches { display:grid; grid-template-columns:repeat(8, 1fr); gap:4px; }
.colour-swatches button { height:20px; border:1px solid rgba(0,0,0,.15); border-radius:4px; padding:0; }

/* ── Schedule calendar ───────────────────────────────────────── */
.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: #dee2e6; border: 1px solid #dee2e6; border-radius: 8px; overflow: hidden;
}
.cal-head {
  background: #212529; color: #fff; border: 0; padding: 6px 2px;
  font-size: .8rem; font-weight: 600; text-align: center;
}
.cal-head:hover { background: #343a40; }
.cal-cell {
  background: #fff; min-height: 104px; padding: 4px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.cal-cell.outside { background: #f8f9fa; }
.cal-cell.outside .cal-daynum { color: #adb5bd; }
.cal-cell.past { background: #fbfbfb; }
.cal-cell.today .cal-daynum span {
  background: #0d6efd; color: #fff; border-radius: 10px; padding: 0 6px;
}
.cal-cell.sel { background: #e7f1ff; box-shadow: inset 0 0 0 2px #0d6efd; }
.cal-daynum { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 600; }
.sel-check { color: #0d6efd; display: none; }
.cal-cell.sel .sel-check { display: inline; }
.cal-note {
  font-size: .68rem; background: #fff3cd; color: #664d03; border-radius: 4px; padding: 1px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-note.closed { background: #f8d7da; color: #58151c; }

.chip {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 5px;
  background: var(--c); color: var(--t); padding: 2px 5px; line-height: 1.2;
  font-size: .72rem; overflow: hidden;
}
.chip .c-pos, .chip .c-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .c-pos { font-weight: 600; }
.chip .c-meta { opacity: .9; }
.chip.draft {
  background: repeating-linear-gradient(135deg, var(--c), var(--c) 6px, color-mix(in srgb, var(--c) 75%, #fff) 6px, color-mix(in srgb, var(--c) 75%, #fff) 12px);
  outline: 1px dashed rgba(0,0,0,.35); outline-offset: -1px;
}
.chip:hover { filter: brightness(1.08); }

@media (max-width: 575.98px) {
  .cal-cell { min-height: 76px; padding: 2px; }
  .chip { font-size: .62rem; padding: 1px 3px; }
  .chip .c-meta { display: none; }
}

/* Bottom bar when days are selected */
.sel-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  background: #0d6efd; color: #fff; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: none; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  box-shadow: 0 -4px 16px rgba(0,0,0,.15);
}
.sel-bar.show { display: flex; }
