/* obs/day-panel.css — Observatory restyle of the selected-day panel.
 *
 * Loaded after app.css, so equal-specificity rules here win: this file
 * overrides the day panel's chrome, header, breakdown rows, toolbar, quick
 * hours, week strip and override form to the mockup look. Markup contracts are
 * untouched — every .tl-* class, hx-* attribute and the timeline mount/JSON
 * islands keep their app.css/islands.css behavior; only presentation changes.
 *
 * Tokens (mockup): panel rgba(255,255,255,0.025) + 1px rgba(255,255,255,0.07)
 * radius 20px; controls rgba(255,255,255,0.04) + rgba(255,255,255,0.1); pills
 * radius 999px; Azeret Mono for numerals/micro-labels; muted ink ladder
 * #b9c2d1 #8b92a3 #6c7689 #4a5161 #3c4250 #2e3440.
 */

/* ---- panel chrome -------------------------------------------------------- */

.day-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 26px 30px;
}

.day-panel--empty {
  align-items: center;
  justify-content: center;
  min-height: 7rem;
  text-align: center;
  font-style: italic;
  color: #8b92a3;
}

/* ---- header grid: text + breakdown left, orrery right -------------------- */

.dp-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px 32px;
  align-items: center;
}

.dp-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.day-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  border: 0;
}

.dp-title-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.day-panel-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  min-width: 0;
}

.day-panel-date {
  font-size: 24px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-text, #e9edf4);
}

.day-panel-holiday {
  font-size: 13px;
  color: #ff8d7e;
  margin: 0;
}

.dp-meta {
  margin: 0;
  font-style: italic;
  font-size: 13px;
  color: #8b92a3;
}

/* Day-type pill: keeps the day-type ICON inside (color-blind mandate) and
 * reuses the day--<type> class names so pill tint + icon + label always agree
 * with the calendar cells. Explicit pill backgrounds override the cell-tint
 * gradients app.css attaches to the same classes. */
.dp-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-radius: 999px;
  padding: 4px 11px;
  background: rgba(255, 255, 255, 0.05);
  color: #b9c2d1;
  white-space: nowrap;
}
.dp-type-pill__icon { font-size: 9px; }

.dp-type-pill.day--workday    { background: rgba(94, 230, 200, 0.10);  color: #5ee6c8; }
.dp-type-pill.day--weekend    { background: rgba(233, 237, 244, 0.05); color: #8b92a3; }
.dp-type-pill.day--holiday    { background: rgba(255, 141, 126, 0.12); color: #ff8d7e; }
.dp-type-pill.day--klamdag    { background: rgba(232, 196, 107, 0.12); color: #e8c46b; }
.dp-type-pill.day--vacation   { background: rgba(232, 196, 107, 0.14); color: #e8c46b; }
.dp-type-pill.day--sick       { background: rgba(255, 141, 126, 0.10); color: #ff8d7e; }
.dp-type-pill.day--parental   { background: rgba(255, 158, 199, 0.12); color: #ff9ec7; }
.dp-type-pill.day--unpaid     { background: rgba(139, 146, 163, 0.12); color: #8b92a3; }
.dp-type-pill.day--manual     { background: rgba(111, 155, 255, 0.12); color: #6f9bff; }
.dp-type-pill.day--paid-leave { background: rgba(94, 230, 200, 0.12);  color: #5ee6c8; }

/* The big worked total + signed delta ("7h 48m   −12m of 8h"). */
.dp-total {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.dp-total__big {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  color: var(--color-text, #e9edf4);
}

.dp-total__delta {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.dp-total__of { color: #8b92a3; }

/* ---- quick-action chips row ("+ lunch" / "semester" / "clear day"…) ------ */

.day-panel-stats.dp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 11px;
}

/* ---- breakdown rows: 12×2 tick / name / mono range / duration / delete --- */

.span-filter-note {
  margin: 2px 0 0;
  font-size: 12px;
  color: #8b92a3;
}

.span-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.span-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  border-radius: 0;
  background: none;
}

.span-swatch {
  width: 12px;
  height: 2px;
  border-radius: 1px;
}

.span-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.span-label {
  font-size: 13px;
  color: var(--color-text, #e9edf4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.span-row--muted .span-label,
.span-row--muted .span-time,
.span-row--muted .span-mins {
  color: #8b92a3;
}

.span-id {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 9px;
  color: #6c7689;
}

.span-time {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 11px;
  color: #8b92a3;
}

.span-time--edit {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px dotted transparent;
}
.span-time--edit:hover,
.span-time--edit:focus-visible {
  color: #e9edf4;
  border-bottom-color: rgba(233, 237, 244, 0.4);
}

.span-note {
  font-size: 12px;
  color: #8b92a3;
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.span-addnote {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  font-style: italic;
  color: #8b92a3;
  cursor: pointer;
}
.span-addnote:hover { color: #b9c2d1; }

.span-mins {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 11px;
  min-width: 52px;
  text-align: right;
  margin-left: 0;
  color: var(--color-text, #e9edf4);
  font-variant-numeric: tabular-nums;
}

.span-del {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid transparent;
  background: none;
  color: #8b92a3;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease, border-color 140ms ease;
}
.span-row:hover .span-del,
.span-row:focus-within .span-del,
.span-del:focus-visible {
  opacity: 1;
}
.span-del:hover {
  color: #ff8d7e;
  border-color: rgba(255, 141, 126, 0.5);
}
@media (pointer: coarse) {
  .span-del { opacity: 1; }
}

/* Inline editor row keeps its flexible app.css layout under the new borders. */
.span-row--editing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.span-empty {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 0 2px;
  font-size: 13px;
  color: #8b92a3;
}
.span-empty p { margin: 0 0 2px; }
.span-empty .faint { color: var(--color-text-faint); font-size: 12px; }

/* ---- timeline toolbar: entry-type pills + history + day/fit/full --------- */

.tl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 18px;
  margin-bottom: 14px;
}

.tl-palette { gap: 8px; }

.tl-palette__hint {
  font-style: italic;
  font-size: 13px;
  color: #6c7689;
}

.tl-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--color-text, #e9edf4);
  font-size: 13px;
  font-weight: 500;
}
.tl-tool:hover {
  border-color: color-mix(in srgb, var(--tl-tool-color, #5ee6c8) 60%, transparent);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text, #e9edf4);
}
.tl-tool--armed {
  background: color-mix(in srgb, var(--tl-tool-color, #5ee6c8) 12%, transparent);
  border-color: color-mix(in srgb, var(--tl-tool-color, #5ee6c8) 55%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--tl-tool-color, #5ee6c8) 20%, transparent);
}
.tl-tool__dot { width: 7px; height: 7px; }
.tl-tool__mins {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 10px;
  color: #8b92a3;
}

.tl-history__btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #8b92a3;
  font-size: 13px;
}
.tl-history__btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.25);
  color: #e9edf4;
}
.tl-history__btn:disabled {
  color: #3c4250;
  opacity: 1;
}

.tl-modes {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.tl-mode {
  background: transparent;
  border: none;
  border-radius: 999px;
  color: #8b92a3;
  padding: 5px 13px;
  font-size: 11px;
  cursor: pointer;
}
.tl-mode:hover {
  border-color: transparent;
  color: #e9edf4;
}
.tl-mode--active,
.tl-mode--active:hover {
  background: #e9edf4;
  color: #0b0d12;
  font-weight: 600;
}

/* ---- hint line + undo bars ----------------------------------------------- */

.timeline-hint {
  margin: 10px 0 0;
  font-style: italic;
  font-size: 12px;
  color: var(--color-text-faint);
}

.tl-undo,
.day-undo {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
}

/* ---- quick hours: the mockup's single input row --------------------------- */

.quick-entry {
  margin: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  padding: 9px 14px 11px;
}

.quick-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.quick-entry-title {
  margin: 0;
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8b92a3;
}

.quick-entry-range {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 11px;
  color: #8b92a3;
}

.quick-entry-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.quick-entry-form .field-label {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8b92a3;
}

.quick-entry-form input,
.quick-entry-form select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--color-text, #e9edf4);
}
.quick-entry-form input::placeholder {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 12px;
  color: #6c7689;
}

/* Teal "apply ↵" submit (mockup). */
.quick-entry-form .quick-entry-apply {
  background: #5ee6c8;
  border: 1px solid #5ee6c8;
  border-radius: 8px;
  color: #07211b;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
}
.quick-entry-form .quick-entry-apply:hover {
  background: #7defd4;
  border-color: #7defd4;
  color: #07211b;
}
.quick-entry-form .quick-entry-apply:disabled {
  opacity: 0.4;
}

/* ---- footer: week strip + override share ONE ruled row (mockup) ----------- */

/* The mockup's bottom row: "week of 8 jun" + "show week ▾" left, the override
 * cluster right, under a single border-top. .week-strip joins via
 * display:contents so its bar sits in the row while the expanded per-day rows
 * break onto a full-width line beneath both. */
.dp-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
}

.week-strip { display: contents; }

.week-strip__bar {
  justify-content: flex-start;
  gap: 12px;
}

.week-strip__rows {
  order: 1;
  flex-basis: 100%;
  min-width: 0;
  margin-top: 0; /* the .dp-footer row-gap owns the spacing */
}

.week-strip__label {
  font-style: italic;
  font-size: 13px;
  color: #8b92a3;
}

.week-strip__toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #8b92a3;
  padding: 6px 14px;
  font-size: 12px;
}
.week-strip__toggle:hover {
  border-color: rgba(255, 255, 255, 0.1);
  color: #e9edf4;
}

.week-strip__arrow {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  color: #8b92a3;
}

.week-strip__hint {
  font-style: italic;
  font-size: 12px;
  color: #6c7689;
}

/* ---- override + note + save cluster (right side of .dp-footer) ------------ */

.override-form {
  margin: 0;
  border: none;
  padding: 0;
}

.override-form .field-label {
  font-family: var(--font-mono, 'Azeret Mono', monospace);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8b92a3;
  margin-bottom: 4px;
}

.override-form select,
.override-form input[type="text"],
.override-form input[type="number"] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12px;
  color: #b9c2d1;
}
.override-form input::placeholder { color: #6c7689; }

.override-form .field-inline {
  font-size: 12px;
  color: #8b92a3;
}

.override-form .btn-accent {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #b9c2d1;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
}
.override-form .btn-accent:hover {
  border-color: rgba(94, 230, 200, 0.5);
  background: rgba(255, 255, 255, 0.08);
  color: #e9edf4;
}

.override-form .btn-ghost {
  border-radius: 9px;
  font-size: 12px;
}

/* ---- responsive: collapse the header grid under ~900px -------------------- */

@media (max-width: 900px) {
  .day-panel { padding: 20px 18px; }
  .dp-grid { grid-template-columns: 1fr; }
  .dp-total__big { font-size: 26px; }
}
