/* Additions for the Laravel admin screens. Builds on app.css tokens; keep it small. */

.field select,
.field input[type="number"],
.field textarea {
  min-width: 0;
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); }
.field textarea { min-height: 80px; resize: vertical; }

.field-error { font-size: 12.5px; color: #b91c1c; }
.field-hint { font-size: 12.5px; color: var(--text-muted); }

/* Main navigation lives in the control bar. */
.ctrl-btn.is-active { color: var(--primary); border-color: var(--primary-line); background: var(--primary-soft); }
.ctrl-user { font-size: 13px; color: var(--text-muted); }
.ctrl-user strong { color: var(--text); font-weight: 600; }
.inline-form { display: inline; margin: 0; }

/* Sub-navigation for the setup area. */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 32px; border-bottom: 1px solid var(--border); background: var(--bg); }
.subnav a { font-size: 13px; font-weight: 600; color: var(--text-muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.subnav a:hover { color: var(--primary); }
.subnav a.is-active { color: var(--primary); background: var(--primary-soft); }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; align-items: start; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.panel-form { margin-bottom: 26px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }

.check-list { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 6px 0; }
.check-list label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

.status-tag--active { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.status-tag--on_hold, .status-tag--planned { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.status-tag--completed { color: var(--primary); background: var(--primary-soft); border-color: var(--primary-line); }
.cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.cat-dot--productive { background: var(--cat-productive); }
.cat-dot--standby { background: var(--cat-standby); }
.cat-dot--mechanical { background: var(--cat-mechanical); }
.cat-dot--downtime { background: var(--cat-downtime); }

.log-table--admin td { padding: 11px 12px; font-size: 14px; }
.log-table--admin { min-width: 640px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.site-card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; background: var(--surface); }
.site-card h3 { margin: 0 0 4px; font-size: 17px; }
.site-card .meta { font-size: 13px; color: var(--text-muted); }
.site-card ul { margin: 10px 0 0; padding-left: 18px; font-size: 14px; }

.pager a, .pager span.disabled { font-weight: 600; font-size: 14px; color: var(--primary); text-decoration: none; }
.pager span.disabled { color: var(--border); }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
  .subnav { padding: 10px 14px; }
}

/* Links are charcoal like the text, so mark them with a quiet underline. */
a.row-action { text-decoration: underline; text-decoration-color: var(--primary-line); text-underline-offset: 3px; }
a.row-action:hover { text-decoration-color: currentColor; }

/* ============ DASHBOARD ============ */
.kpi-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.chart-panel:hover { box-shadow: var(--shadow-soft); }

/* Hole stages: one ordinal blue ramp, validated (light end 2.54:1 on white). */
.stage--planned { background: #60a5fa; }
.stage--active { background: #2563eb; }
.stage--completed { background: #1e3a8a; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 13px; color: var(--text-muted); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.hbar-list { display: flex; flex-direction: column; gap: 16px; }
.hbar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.hbar-total { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* 2px surface gap between segments; rounded data-end, square baseline. */
.hbar { display: flex; gap: 2px; height: 16px; }
.hbar-seg { position: relative; min-width: 6px; flex-basis: 0; }
.hbar-seg:first-child { border-radius: 0; }
.hbar-seg:last-child { border-radius: 0 4px 4px 0; }
.hbar-values { display: flex; gap: 12px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.vbar-list { display: flex; flex-direction: column; gap: 12px; }
.vbar-row { display: grid; grid-template-columns: minmax(0, 170px) 1fr; align-items: center; gap: 12px; font-size: 14px; }
.vbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.vbar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vbar-fill { position: relative; height: 16px; min-width: 6px; background: var(--accent-blue); border-radius: 0 4px 4px 0; }
.vbar-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Per-mark tooltip on hover and keyboard focus (values are also printed as text). */
[data-tip]:hover, [data-tip]:focus-visible { filter: brightness(1.25); outline: none; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; z-index: 20; pointer-events: none;
  padding: 5px 9px; border-radius: var(--r-sm);
  background: var(--charcoal); color: #fff; font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow-hover);
}

.attention-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.attention-list li { display: flex; align-items: center; gap: 10px; }
.attention-dot { width: 8px; height: 8px; border-radius: 50%; background: #d97706; flex: none; }

.site-card { text-decoration: none; color: inherit; transition: border-color 0.2s ease; }
.site-card:hover { border-color: var(--primary-line); }

@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .vbar-row { grid-template-columns: minmax(0, 110px) 1fr; }
}

/* ============ SECTION TOOLBAR + FORM POPUP ============ */
.section-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.section-bar { flex-wrap: wrap; }

.modal-card--form {
  max-width: 640px; max-height: calc(100vh - 32px);
  align-items: stretch; gap: 0; padding: 0; text-align: left; overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-card--form .modal-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-close { border: none; background: none; font-size: 24px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 2px 6px; border-radius: var(--r-sm); }
.modal-close:hover { color: var(--text); background: var(--bg); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-body .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg); }

@media (max-width: 600px) {
  .modal-body .form-grid { grid-template-columns: 1fr; }
}
.toolbar-search { font: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-md); min-width: 220px; background: var(--surface); }
.toolbar-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); }
.section-actions .btn-ghost { padding: 8px 16px; }
@media (max-width: 600px) { .toolbar-search { min-width: 0; flex: 1; } .section-actions { width: 100%; } }

/* ============ APP SHELL: sidebar + top header ============ */
[x-cloak] { display: none !important; }
.app-body { padding: 0; display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app-body::before, .app-body::after { display: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: var(--charcoal); color: #cbd5e1;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; color: #fff; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-brand small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8; }
.diamond-logo--sm { width: 28px; height: 28px; border-radius: 8px; background: #fff; box-shadow: none; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-md);
  color: #cbd5e1; text-decoration: none; font-size: 14px; font-weight: 500;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-nav a.is-active { background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 600; }
.sidebar-nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-group { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #7f93b0; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 28px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-menu { display: none; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); padding: 6px; cursor: pointer; }
.topbar-menu svg { width: 20px; height: 20px; display: block; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; }

.profile-menu { position: relative; }
.profile-button { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; font: inherit; color: var(--text); }
.profile-button:hover, .profile-button[aria-expanded="true"] { border-color: var(--border); background: var(--bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--charcoal); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.profile-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.profile-text strong { font-size: 13.5px; font-weight: 600; }
.profile-text small { font-size: 12px; color: var(--text-muted); }
.chevron { width: 16px; height: 16px; fill: none; stroke: var(--text-muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-hover); padding: 6px;
}
.profile-dropdown-head { padding: 8px 10px 10px; font-size: 12.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; word-break: break-all; }
.profile-dropdown a, .profile-dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: none; background: none;
  font: inherit; font-size: 14px; color: var(--text); text-decoration: none; border-radius: var(--r-sm); cursor: pointer;
}
.profile-dropdown a:hover, .profile-dropdown button:hover { background: var(--bg); }
.profile-dropdown form { margin: 0; }

.page { padding: 24px 28px 64px; }
/* Each section is a card on the page background. */
.page .log-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft); margin-bottom: 20px;
}
.page .log-section:last-of-type { border-bottom: 1px solid var(--border); }
.page .section-bar { padding: 18px 22px 6px; }
.page .section-body { padding: 10px 22px 22px; }
.page .notice-bar { border: 1px solid var(--primary-line); border-radius: var(--r-md); margin-bottom: 16px; padding: 10px 16px; }
.page .notice-bar--ok { border-color: #a7f3d0; }

.sidebar-backdrop { display: none; }

@media (max-width: 960px) {
  .app-body { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.is-open { transform: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, 0.5); }
  .topbar-menu { display: block; }
  .topbar { padding: 0 14px; }
  .page { padding: 16px 12px 48px; }
  .profile-text, .chevron { display: none; }
}
.segmented--modal { display: flex; width: 100%; margin-bottom: 18px; }
.segmented--modal .seg-btn { flex: 1; white-space: nowrap; }
.profile-form { max-width: 860px; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 18px 0 0; font-size: 14px; }
.profile-facts dt { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.profile-facts dd { margin: 2px 0 0; }

/* Sub-page tabs (e.g. Users > Admins / Clients / …) */
.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--text); border-bottom-color: var(--charcoal); }

/* ============ REPORTS ============ */
.report-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 14px 18px; align-items: end; margin-bottom: 18px; }
.report-filters .field input[type="date"] { min-width: 0; width: 100%; font: inherit; font-size: 14px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--r-md); }
.report-filters .field select { font-size: 14px; padding: 9px 10px; }
.filter-clear { height: 40px; }
.is-loading { opacity: 0.55; transition: opacity 0.15s ease; }
.ctrl-btn:disabled, .btn-ghost:disabled { opacity: 0.45; cursor: default; }

/* Report statuses: color only where it means something. */
.report-status--draft { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.report-status--submitted { color: var(--text); background: var(--primary-soft); border-color: var(--primary-line); }
.report-status--released { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.report-status--changes_requested { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.report-status--approved { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }

@media (max-width: 960px) { .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sidebar-nav--bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-nav--bottom .sidebar-group { margin-top: 4px; }
.nowrap { white-space: nowrap; }
.subform { padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); gap: 12px; }

/* ============ SITE SETUP POPUP (wide, sectioned) ============ */
.modal-card--wide { max-width: 920px; }
.form-section { padding: 16px 0 18px; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: none; padding-top: 0; }
.form-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.form-section-head h4 { margin: 0; font-size: 15px; font-weight: 700; }
.form-section-head .field-hint { margin: 0; }
.row-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.entry-row { display: grid; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.entry-row--new { background: var(--bg); }
.entry-row input, .entry-row select {
  width: 100%; min-width: 0; font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
}
.entry-row input:focus, .entry-row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); }
.entry-row .field-error { grid-column: 1 / -1; }
.entry-person { display: flex; flex-direction: column; line-height: 1.3; font-size: 14px; }
.entry-person small { color: var(--text-muted); font-size: 12.5px; }
.cols-person { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.cols-new-contact { grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; }
.cols-new-person { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.cols-rig { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.2fr) auto; }
.cols-hole { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.primary-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.primary-pick input { width: auto; }
.row-remove { border: none; background: none; font-size: 20px; line-height: 1; padding: 4px 8px; color: var(--text-muted); cursor: pointer; border-radius: var(--r-sm); }
.row-remove:hover { background: var(--bg); color: #b91c1c; }
.add-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.add-bar select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-md); min-width: 240px; max-width: 100%; background: var(--surface); }
.btn-small { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.btn-small:hover { border-color: var(--primary); }
.rig-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; margin-bottom: 10px; font-size: 14px; }
.rig-checks label { display: flex; gap: 8px; align-items: baseline; }
.rig-checks .cell-small { display: block; }
@media (max-width: 760px) {
  .cols-new-contact, .cols-new-person, .cols-rig, .cols-hole { grid-template-columns: 1fr; }
}
.modal-body .form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .modal-body .form-grid--3 { grid-template-columns: 1fr; } }

/* ============ CLIENTS ============ */
.breadcrumb { margin: 0 0 6px; font-size: 13px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.tab-count { margin-left: 6px; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--text-muted); }
.tab-soon { margin-left: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 28px; margin: 0; }
.profile-grid dt { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.profile-grid dd { margin: 3px 0 0; font-size: 15px; word-break: break-word; }
.profile-grid-wide { grid-column: 1 / -1; }
.primary-badge { display: inline-block; margin: 2px 0 0 6px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--charcoal); color: #fff; }
.coming-soon { text-align: center; padding: 36px 16px; color: var(--text-muted); }
.coming-soon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.coming-soon h3 { margin: 8px 0 6px; color: var(--text); font-size: 18px; }
.coming-soon p { margin: 0 auto; max-width: 460px; font-size: 14px; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } }

.slug-input { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.slug-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); }
.slug-prefix { padding: 10px 2px 10px 12px; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); background: var(--bg); white-space: nowrap; }
.field .slug-input input[type="text"] { border: none; box-shadow: none; border-radius: 0; font-family: var(--font-mono); font-size: 14px; }
.toolbar-select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }

/* ============ ACTIVITY LOG ============ */
.activity-filters { grid-template-columns: repeat(6, minmax(0, 1fr)) auto; }
.activity-filters .field input[type="text"] { font-size: 14px; padding: 9px 10px; }
.activity-table { min-width: 900px; }
.activity-table td { vertical-align: top; }
.block { display: block; }
.activity-details { min-width: 260px; }
.change-list { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-muted); }
.change-list li { margin: 2px 0; word-break: break-word; }
.change-old { text-decoration: line-through; }
.change-new { color: var(--text); font-weight: 600; }
.event-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.event-tag--created { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.event-tag--deleted, .event-tag--login_failed, .event-tag--login_locked { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
@media (max-width: 960px) { .activity-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.logs-summary { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline > li { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.timeline-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.timeline-when { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }

/* Collapsible "Configurations" group in the sidebar. */
.nav-group-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: none; border-radius: var(--r-md); background: none;
  color: #cbd5e1; font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
}
.nav-group-toggle:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-group-toggle.is-current { color: #fff; font-weight: 600; }
.nav-group-toggle svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-group-toggle .nav-chevron { width: 14px; height: 14px; margin-left: auto; transition: transform 0.15s ease; }
.nav-group-toggle .nav-chevron.is-open { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 2px 19px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.12); }
.sidebar-nav .nav-sub a { padding: 7px 10px; font-size: 13.5px; }

.status-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.status-count { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 14px; }
.status-count:hover { border-color: var(--primary); }

/* ============ STATS: per-day column chart ============ */
.daily-chart { margin-top: 4px; }
.daily-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.daily-chart-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.daily-cols { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--border); }
.daily-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.daily-bar { width: 100%; max-width: 24px; background: var(--accent-blue); border-radius: 4px 4px 0 0; }
.daily-col:hover .daily-bar, .daily-col:focus-visible .daily-bar { background: #1e3a8a; }
.daily-bar.is-zero { height: 2px !important; background: var(--border); border-radius: 0; }
.daily-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.kpi-grid--compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.report-summary { margin-bottom: 20px; }

/* ============ ANALYTICS ============ */
.analytics-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin-bottom: 16px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.analytics-filters .field { min-width: 160px; }
.analytics-filters .field select, .analytics-filters .field input[type="date"] { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.analytics-range { margin: 0 0 8px auto; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.analytics-charts { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.analytics-note { font-size: 13px; color: var(--text-muted); text-align: center; margin: 4px 0 0; }
.status-bar { height: 18px; margin: 6px 0 14px; }
.status-bar .hbar-seg:first-child { border-radius: 4px 0 0 4px; }
.status-bar .hbar-seg:last-child { border-radius: 0 4px 4px 0; }
.status-bar .hbar-seg:only-child { border-radius: 4px; }
.status-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.status-legend li { display: grid; grid-template-columns: 14px 1fr auto 44px; align-items: center; gap: 8px; }
.status-legend strong { font-variant-numeric: tabular-nums; }
.status-legend .cell-small { text-align: right; }
/* Status colors as fills (same meaning as the status tags). */
.seg--draft { background: #f59e0b; }
.seg--submitted { background: #a16207; }   /* validated: chroma, CVD and normal-vision separation pass */
.seg--released { background: #3b82f6; }
.seg--changes_requested { background: #ef4444; }
.seg--approved { background: #10b981; }
.meter { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.meter-track { flex: 1; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--accent-blue); border-radius: 999px; }
.meter-value { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
@media (max-width: 960px) { .analytics-charts { grid-template-columns: 1fr; } .analytics-range { margin-left: 0; } }

/* Ocean blue sidebar: tinted icons, blue marker on the active page. */
.sidebar-nav a, .nav-group-toggle { position: relative; }
.sidebar-nav a.is-active { background: rgba(255, 255, 255, 0.10); }
.sidebar-nav a.is-active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #60a5fa; }
[data-tint="blue"] svg { color: #93c5fd; }
[data-tint="amber"] svg { color: #fcd34d; }
[data-tint="green"] svg { color: #6ee7b7; }
[data-tint="teal"] svg { color: #5eead4; }
[data-tint="sky"] svg { color: #7dd3fc; }
[data-tint="rose"] svg { color: #fda4af; }
[data-tint="red"] svg { color: #fca5a5; }
[data-tint="slate"] svg:first-child { color: #cbd5e1; }
.diamond-logo--sm { background: linear-gradient(135deg, #ffffff 0%, #bfdbfe 100%); }

/* Stat tiles: colored icon chip + label. */
.kpi-tile--icon .kpi-head { display: flex; align-items: center; gap: 10px; }
.kpi-chip { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.kpi-chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tone-blue .kpi-chip { background: #dbeafe; color: #1d4ed8; }
.tone-green .kpi-chip { background: #d1fae5; color: #047857; }
.tone-amber .kpi-chip { background: #fef3c7; color: #b45309; }
.tone-red .kpi-chip { background: #fee2e2; color: #b91c1c; }
.tone-teal .kpi-chip { background: #ccfbf1; color: #0f766e; }
.tone-sky .kpi-chip { background: #e0f2fe; color: #0369a1; }
.tone-slate .kpi-chip { background: #e2e8f0; color: #334155; }

/* ============ DONUT + LINE CHARTS ============ */
.donut-body { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-figure { position: relative; width: 168px; height: 168px; flex: none; }
.donut-figure svg { width: 100%; height: 100%; display: block; }
.donut-seg { cursor: pointer; transition: opacity 0.15s ease; outline: none; }
.donut-seg.is-dim { opacity: 0.35; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center strong { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; }
.donut-center span { display: block; font-size: 12px; color: var(--text-muted); max-width: 100px; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.donut-legend li { display: grid; grid-template-columns: 14px 1fr auto 40px; align-items: center; gap: 8px; padding: 3px 6px; border-radius: var(--r-sm); }
.donut-legend li.is-active { background: var(--primary-soft); }
.donut-legend strong { font-variant-numeric: tabular-nums; }
.donut-legend .cell-small { text-align: right; }
.donut-legend-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.line-legend { list-style: none; margin: -4px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--text-muted); }
.line-legend li { display: inline-flex; align-items: center; gap: 6px; }
.line-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.line-figure { position: relative; }
.line-svg { width: 100%; height: auto; display: block; outline: none; overflow: visible; }
.line-svg:focus-visible { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); border-radius: var(--r-md); }
.line-grid { stroke: var(--border); stroke-width: 1; }
.line-tick { font-size: 11px; fill: var(--text-muted); font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.line-cross { stroke: #94a3b8; stroke-width: 1; }
.line-dot { stroke: #fff; stroke-width: 2; }
.line-tooltip { position: absolute; top: 4px; z-index: 5; pointer-events: none; min-width: 150px; padding: 8px 10px; border-radius: var(--r-md); background: var(--charcoal); color: #fff; font-size: 12.5px; box-shadow: var(--shadow-hover); }
.line-tooltip-date { font-size: 11.5px; color: #cbd5e1; margin-bottom: 4px; }
.line-tooltip-row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 6px; }
.line-tooltip-row strong { font-variant-numeric: tabular-nums; }
.line-tooltip-row span:last-child { color: #cbd5e1; white-space: nowrap; }
.chart-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
@media (max-width: 960px) { .chart-row { grid-template-columns: 1fr; } }

/* ---- Confirmation dialog (components/confirm-dialog) ---- */
.confirm-card { max-width: 420px; gap: 10px; padding: 30px 28px 24px; }
.confirm-card h3 { margin: 4px 0 0; font-size: 19px; font-weight: 700; line-height: 1.3; }
.confirm-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.confirm-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.confirm-icon--danger { background: #fee2e2; color: #dc2626; }
.confirm-message { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.confirm-actions { display: flex; gap: 10px; width: 100%; margin-top: 14px; }
.confirm-actions > * { flex: 1; justify-content: center; }
.btn-ghost.btn-danger { background: #dc2626; }
.btn-ghost.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.status-tag--closed { color: var(--text-muted); background: var(--bg); border-color: var(--border); }
.form-note { margin: 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.closed-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--r-md, 10px); background: #f1f5f9; border: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
.closed-banner strong { color: var(--text); }

/* ---- Shift report form (livewire/reports/form) ---- */
.report-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-card, none); }
.report-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 32px; border-bottom: 1px solid var(--border); }
.report-strip .ctrl-spacer { flex: 1; }
.report-chip { font-family: var(--font-mono); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); }
.report-chip--new, .report-chip--draft { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.report-chip--submitted { color: #a16207; background: #fefce8; border-color: #fde68a; }
.report-chip--released { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.report-chip--changes_requested { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.report-chip--approved { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.report-saved { font-size: 13px; color: var(--text-muted); }
.report-saved.is-dirty { color: #b45309; font-weight: 600; }
.report-form > .notice-bar { margin: 12px 32px 0; }
.report-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.report-fieldset:disabled input, .report-fieldset:disabled select { color: var(--text); cursor: default; }
.report-header-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.field-static { display: block; padding: 10px 0; font-family: var(--font-mono); font-size: 14px; color: var(--text); }
.cell-error { display: block; padding: 0 12px 8px; font-size: 12px; }
.cell-unit { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); padding: 0 12px !important; }
.grid-error { margin: 0 32px 10px; }
.grid-moved { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--primary); }

/* 15-minute grid: 96 slots; hour lines strong, half-hour faint, quarter barely there */
.gantt--15 { grid-template-columns: var(--label-w) repeat(96, minmax(11px, 1fr)) var(--total-w); min-width: 1500px; }
.gantt--15 .g-hour { grid-column: span 4; }
.gantt--15 .g-cell { border-left-color: rgba(203, 213, 225, 0.35); min-height: 28px; }
.gantt--15 .g-cell--half { border-left-color: var(--border-faint); }
.gantt--15 .g-cell--hour { border-left-color: #cbd5e1; }
.gantt--15 .g-cell.is-on[data-cat="productive"] { background: var(--cat-productive); }
.gantt--15 .g-cell.is-on[data-cat="standby"] { background: var(--cat-standby); }
.gantt--15 .g-cell.is-on[data-cat="mechanical"] { background: var(--cat-mechanical); }
.gantt--15 .g-cell.is-on[data-cat="downtime"] { background: var(--cat-downtime); }
.gantt--15.is-readonly .g-cell { cursor: default; }
.gantt--15.is-readonly .g-cell:hover:not(.is-on) { background: none; }

.report-summary-bar { border-radius: 0 0 var(--r-xl) var(--r-xl); }
.btn-outline-light { font-family: var(--font-display); font-weight: 600; font-size: 14px; padding: 10px 18px; background: transparent; color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: var(--r-md); cursor: pointer; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.version-changes summary { cursor: pointer; font-size: 13px; color: var(--primary); margin-top: 4px; }
.change-field { font-weight: 600; color: var(--text); }
@media (max-width: 760px) {
  .report-strip { padding: 12px 16px; }
  .report-form > .notice-bar { margin: 12px 16px 0; }
}
/* Category bars span the whole grid; keep their name + hours pinned left while it scrolls. */
.gantt--15 .g-cat { position: relative; }
.gantt--15 .g-cat-pin { position: sticky; left: 12px; display: inline-flex; gap: 12px; align-items: baseline; }
.gantt--15 .g-cat-hrs { margin-left: 0; opacity: 0.9; }
.col-qty { width: 90px; }
.col-actions-sm { width: 130px; }
.status-tag--damaged { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.status-tag--retired { color: var(--text-muted); background: var(--bg); border-color: var(--border); }
.status-tag--available { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.check-field { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
.check-field input { width: auto; }
.photo-preview { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.photo-preview img { max-width: 220px; max-height: 160px; border-radius: var(--r-md); border: 1px solid var(--border); object-fit: cover; }
.block { display: block; }

/* ---- Report workflow panel (livewire/reports/workflow) ---- */
.workflow { padding: 16px 32px; border-bottom: 1px solid var(--border); background: var(--bg); }
.workflow-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.workflow-head > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.workflow-next { font-size: 14px; color: var(--text-muted); }
.workflow-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-ghost--approve { background: #059669; }
.btn-ghost--approve:hover:not(:disabled) { background: #047857; }
.workflow-request { margin-top: 12px; padding: 12px 16px; border-radius: var(--r-md); background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.workflow-request strong { margin-right: 8px; }
.workflow-request p { margin: 6px 0 0; white-space: pre-line; }
.workflow-steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.workflow-step { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; max-width: 420px; }
.workflow-step strong { display: block; color: var(--text); }
.workflow-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--primary); flex: none; }
.workflow-step--approve .workflow-dot { background: #10b981; }
.workflow-step--request_changes .workflow-dot { background: #ef4444; }
.workflow-step--correction .workflow-dot { background: #f59e0b; }
.workflow-step--submit .workflow-dot { background: #a16207; }
.workflow-comment { margin: 2px 0 0; color: var(--text-muted); white-space: pre-line; }
.correction-bar { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 260px; }
.correction-bar input { flex: 1; min-width: 180px; padding: 9px 12px; border-radius: var(--r-md); border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.08); color: #fff; }
.correction-bar input::placeholder { color: #cbd5e1; }
.correction-bar .field-error { color: #fecaca; }
@media (max-width: 760px) { .workflow { padding: 14px 16px; } }
.correction-error { flex-basis: 100%; color: #fecaca; text-align: right; }
.col-check { width: 36px; text-align: center; }
.batch-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-md); background: #ecfdf5; border: 1px solid #a7f3d0; font-size: 14px; font-weight: 600; color: #065f46; }
.todo-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.todo-item { padding: 10px 16px; border-radius: var(--r-md); font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid; }
.todo-item--blue { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.todo-item--amber { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.todo-item--red { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.todo-item:hover { filter: brightness(0.97); }

/* ---- Price lists (sites/rates) + charges (reports/form) + rig summary ---- */
.rate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rate-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface); }
.rate-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rate-card-head h3 { margin: 0 0 8px; font-size: 16px; }
.rate-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rate-table td { padding: 4px 0; border-bottom: 1px solid var(--border-faint); }
.rate-table td:last-child { text-align: right; }
.entry-row.cols-band { grid-template-columns: 1fr 1fr 1fr 32px; }
.entry-row.cols-material-rate { grid-template-columns: 2fr 1fr 32px; }
.charges-table td.num, .charges-table th.num { text-align: right; }
.charges-table tfoot td { font-weight: 700; }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-faint); font-size: 13.5px; }
.kv-row:last-child { border-bottom: 0; }
.charges-table td { padding: 9px 12px; font-size: 14px; }
.kpi-subhead { margin: 18px 0 10px; font-size: 15px; font-weight: 700; }
.price-settings { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--border); font-size: 13.5px; }
.price-settings strong { margin-right: 6px; color: var(--text-muted); font-weight: 600; }
.rate-card-actions { display: flex; gap: 12px; white-space: nowrap; }
.rate-card-head h3 { margin-bottom: 2px; }
.rate-card-sub { margin: 0 0 8px; }
.col-size { min-width: 88px; }
.export-buttons { display: inline-flex; align-items: center; gap: 8px; }
.export-buttons .is-busy { opacity: 0.75; cursor: progress; }
.rig-report-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 4px 0 14px; }
.rig-report-head h3 { margin: 0; font-size: 18px; }
.rig-report-head .ctrl-btn { margin-left: auto; }
/* Sign-in card on phones: the brand title must fit (it overflowed at ~400px wide). */
.auth-brand h1 { font-size: clamp(22px, 7vw, 32px); }
.auth-brand { min-width: 0; }
.auth-brand > div { min-width: 0; }
/* Export ▾ menu (livewire/reports/exports) */
.export-menu { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.export-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-hover, 0 10px 30px rgba(15, 39, 68, 0.15)); }
.report-strip .export-list { left: 0; right: auto; }
.export-list a, .export-list button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); text-decoration: none; font: inherit; text-align: left; cursor: pointer; }
.export-list a:hover, .export-list button:hover { background: var(--primary-soft); }
.export-list strong { font-size: 14px; }
.export-list small { font-size: 12px; color: var(--text-muted); }
.export-scope { margin: 2px 10px 6px; font-size: 12px; color: var(--text-muted); }
.export-scope span { display: block; font-size: 11px; }
.export-menu .is-busy { opacity: 0.75; cursor: progress; }

/* ---- Time log sized to the site's shift (e.g. 48 slots for 12 h) + task periods view ---- */
.gantt--15 { grid-template-columns: var(--label-w) repeat(var(--slots, 48), minmax(14px, 1fr)) var(--total-w); min-width: calc(300px + var(--slots, 48) * 14px); }
.gantt--15 .g-hour { font-size: 10px; padding-left: 3px; }
.segmented--small .seg-btn { padding: 6px 12px; font-size: 12.5px; }
.timelog-totals { display: flex; align-items: flex-end; gap: 36px; flex-wrap: wrap; padding: 6px 32px 14px; }
.timelog-totals span { display: block; font-size: 12px; color: var(--text-muted); }
.timelog-totals b { font-size: 20px; font-family: var(--font-display); }
.timelog-totals .grid-moved { margin-left: auto; align-self: center; }
.timelog-list { padding: 0 32px 8px; }
.timelog-sub { margin: 4px 0 12px; font-size: 16px; }
.period-row { display: grid; grid-template-columns: 1fr 28px; column-gap: 12px; row-gap: 4px; margin-bottom: 14px; }
.period-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.period-head span { color: var(--text-muted); font-size: 13px; }
.period-track { grid-column: 1; position: relative; height: 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border-faint); }
.period-bar { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.period-time { grid-column: 1; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.period-remove { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.period-remove:hover { background: #fef2f2; color: #b91c1c; }
.period-form { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border); max-width: 720px; }
.period-form .field { margin-bottom: 12px; }
.period-times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.period-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 760px) {
  .timelog-totals, .timelog-list { padding-left: 16px; padding-right: 16px; }
  .timelog-totals { gap: 20px; }
}
.period-times-list { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.period-chip { display: inline-flex; align-items: center; gap: 4px; }
.period-chip button { border: 0; background: none; color: var(--text-muted); font-size: 14px; line-height: 1; padding: 0 2px; cursor: pointer; border-radius: 4px; }
.period-chip button:hover { color: #b91c1c; background: #fef2f2; }
/* Draggable period bars: middle moves, edges resize (task-periods view) */
.period-track { height: 16px; }
.period-bar.is-editable { cursor: grab; touch-action: none; outline-offset: 2px; }
.period-bar.is-editable:hover, .period-bar.is-editable:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary-line); }
.period-bar.is-dragging { cursor: grabbing; opacity: 0.85; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); z-index: 2; }
.bar-handle { position: absolute; top: -3px; bottom: -3px; width: 10px; cursor: ew-resize; }
.bar-handle--start { left: -4px; }
.bar-handle--end { right: -4px; }
.period-bar.is-editable:hover .bar-handle::after, .period-bar.is-dragging .bar-handle::after { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: 2px; border-radius: 2px; background: #fff; }
.period-chip.is-dragging { color: var(--primary); font-weight: 600; }
/* Task line: times as info beside the name; each bar's time + delete appear under it on hover/focus. */
.period-row { row-gap: 6px; margin-bottom: 18px; }
.period-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.period-info { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); font-weight: 400; }
.period-total { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.period-remove { grid-row: 1 / span 2; }
.bar-tip { position: absolute; top: 100%; left: 0; z-index: 5; display: none; align-items: center; gap: 6px; padding: 8px 0 0; white-space: nowrap; }
.bar-tip > span { padding: 3px 8px; border-radius: 6px; background: var(--charcoal); color: #fff; font-family: var(--font-mono); font-size: 11.5px; box-shadow: 0 4px 12px rgba(15, 39, 68, 0.2); }
.bar-tip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fef2f2; color: #b91c1c; font-size: 15px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(15, 39, 68, 0.15); }
.bar-tip button:hover { background: #fee2e2; }
.period-bar.tip-right .bar-tip { left: auto; right: 0; }
.period-bar:hover .bar-tip, .period-bar:focus-visible .bar-tip, .period-bar:focus-within .bar-tip, .period-bar.is-dragging .bar-tip { display: inline-flex; }
.period-bar:hover, .period-bar:focus-within { z-index: 4; }
.period-bar:not(.is-editable) { cursor: default; }
/* Timeline header above the task lines (same width as the bars' track). */
.period-axis { display: grid; grid-template-columns: 1fr 28px; column-gap: 12px; margin: 0 0 10px; }
.period-axis-track { position: relative; height: 22px; border-bottom: 1px solid var(--border); }
.axis-tick { position: absolute; bottom: 0; height: 6px; border-left: 1px solid #cbd5e1; }
.axis-tick > span { position: absolute; bottom: 8px; left: 0; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.axis-tick:first-child > span { transform: none; }
.axis-tick.is-last > span { transform: translateX(-100%); }
.period-track { background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / var(--hours, 12) - 1px), rgba(203, 213, 225, 0.6) calc(100% / var(--hours, 12) - 1px), rgba(203, 213, 225, 0.6) calc(100% / var(--hours, 12))); }
@media (max-width: 900px) { .axis-tick.is-odd > span { display: none; } }
/* Summary line under the hour axis: every task in one bar, gaps (not logged) striped. */
.period-axis { row-gap: 6px; margin-bottom: 18px; }
.period-summary { grid-column: 1; position: relative; height: 18px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border-faint); overflow: visible; }
.summary-seg { position: absolute; top: 0; bottom: 0; box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.85); }
.summary-seg:first-child { border-radius: 5px 0 0 5px; }
.summary-gap { position: absolute; top: 0; bottom: 0; cursor: pointer; border-radius: 3px;
  background: repeating-linear-gradient(135deg, #fde68a 0 4px, #fffbeb 4px 8px); box-shadow: inset 0 0 0 1px #f59e0b; }
.summary-gap:focus-visible { box-shadow: inset 0 0 0 2px #b45309; z-index: 4; }
.summary-legend { grid-column: 1; justify-self: end; font-size: 11.5px; font-weight: 600; color: #b45309; }
.gap-popup { max-width: 480px; }
.gap-popup .modal-head h3 { margin: 0; }
.gap-popup .modal-head p { margin: 2px 0 0; }
.summary-gap { cursor: pointer; }
.timelog-subhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.timelog-subhead .timelog-sub { margin: 4px 0; }
.timelog-totals .timelog-add { margin-left: auto; align-self: center; }
.timelog-totals .grid-moved + .timelog-add { margin-left: 12px; }
/* Selecting part of a gap on the summary line (press, drag, release → Add a task). */
.summary-gap { touch-action: none; }
.summary-gap.is-selecting { cursor: ew-resize; }
.summary-select { position: absolute; top: -2px; bottom: -2px; z-index: 6; border-radius: 4px; background: rgba(217, 119, 6, 0.55); box-shadow: inset 0 0 0 2px #b45309; pointer-events: none; }
.summary-select.is-dragging { background: rgba(180, 83, 9, 0.6); box-shadow: inset 0 0 0 2px #92400e; }
.summary-select .bar-tip { display: inline-flex; }
.summary-select .bar-tip.tip-right { left: auto; right: 0; }
