/* logbook-events.css — styles for the Event Log table (logbook-events.js), shared by the customer portal
   (digital-logbook.html) and the admin customer page's Logbook tab. Nov 2026.
   --nav-top is the height of whichever top bar the page has (customer-nav.js / admin-nav.js keep it current), so
   the pinned filter bar sits directly beneath it. */
.sr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.section-tab-panel[hidden]{ display:none; }
/* Event Log: pinned filter bar -> pinned add row -> pinned column headings. Offsets are summed from heights that
   logbook-events.js measures (--ev-bar-h, --ev-add-h) because the bar wraps differently at every width. */
.ev-bar{ position:sticky; top:var(--nav-top,60px); z-index:42; background:var(--bg,#fcfbf9); padding:14px 0 12px; border-bottom:1px solid var(--border,#e4dfd6); display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; }
/* wide screens: search, filters and sort all flow as one wrapping row (the two wrapper divs only matter on phones) */
.ev-bar-main, .ev-filters{ display:contents; }
.ev-search{ order:0; } .ev-filters > *{ order:1; } .ev-f-sort, #events-sort-dir{ order:2; }
.ev-f[hidden]{ display:none; }
.ev-f{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.ev-f > span{ font-family:var(--mono); font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--grey-dim); }
.ev-ctl{ box-sizing:border-box; height:38px; padding:0 10px; border:1px solid var(--border-strong,#cfc9bd); background:var(--bg-raised,#fff); color:var(--ink,#111); font:inherit; font-size:14px; border-radius:var(--radius-sm,6px); max-width:100%; }
.ev-f .ev-ctl{ max-width:200px; }
.ev-ctl:focus{ outline:2px solid var(--amber); outline-offset:-1px; border-color:var(--amber); }
.ev-btn{ cursor:pointer; padding:0 14px; white-space:nowrap; }
.ev-btn:hover{ border-color:var(--amber); color:var(--amber); }
.ev-search{ position:relative; flex:1 1 150px; min-width:130px; display:block; }
.ev-search svg{ position:absolute; left:11px; top:50%; width:16px; height:16px; margin-top:-8px; color:var(--grey-dim); pointer-events:none; }
.ev-search input{ width:100%; padding-left:34px; }
.ev-toggle{ display:none; }
.ev-link{ background:none; border:0; padding:0; color:var(--amber); font:inherit; font-size:13px; cursor:pointer; text-decoration:underline; align-self:center; }
.ev-clear{ margin-left:2px; padding-bottom:10px; }
.ev-add-in{ display:flex; align-items:center; gap:14px; }
.ev-count{ margin-left:auto; font-family:var(--mono); font-size:12px; font-weight:400; color:var(--grey-dim); text-transform:none; letter-spacing:0; white-space:nowrap; }

.ev-table{ width:100%; border-collapse:separate; border-spacing:0; }
.ev-table th, .ev-table td{ text-align:left; padding:12px 14px; border-bottom:1px solid var(--border,#e4dfd6); vertical-align:top; }
.ev-table thead th{ position:sticky; background:var(--bg-raised,#fff); z-index:36; }
.ev-add-row th{ top:calc(var(--nav-top,60px) + var(--ev-bar-h,110px) - 1px); z-index:38; padding:8px 14px; border-bottom:1px dashed var(--border-strong,#cfc9bd); }
.ev-add-cell{ font-weight:400; }
.ev-add-btn{ padding:8px 16px; font-size:12px; }
.ev-add-hint{ font-size:12.5px; color:var(--grey-dim); font-weight:400; }
.ev-head-row th{ top:calc(var(--nav-top,60px) + var(--ev-bar-h,110px) + var(--ev-add-h,56px) - 2px); font-family:var(--mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--grey-dim); font-weight:600; cursor:pointer; user-select:none; border-bottom:1px solid var(--border-strong,#cfc9bd); padding-top:10px; padding-bottom:10px; }
.ev-head-row th:hover{ color:var(--ink); }
.ev-head-row th:focus-visible{ outline:2px solid var(--amber); outline-offset:-2px; }
.ev-arrow{ font-size:9px; color:var(--amber); margin-left:3px; }
.ev-table tbody tr:hover td{ background:var(--bg-raised,#fff); }
.ev-date{ white-space:nowrap; font-family:var(--mono); font-size:13px; color:var(--grey); }
.ev-type{ font-weight:600; font-size:14.5px; }
.ev-details{ color:var(--ink); font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.ev-status{ white-space:nowrap; }
.ev-by{ font-size:13.5px; color:var(--grey); }
.ev-dim{ color:var(--grey-dim); }
.ev-date-inline{ display:none; font-family:var(--mono); font-weight:400; font-size:11.5px; color:var(--grey-dim); margin-top:2px; }
.ev-signed-inline{ display:none; font-size:12px; color:var(--grey-dim); margin-top:2px; }
.ev-empty td{ padding:34px 14px; text-align:center; color:var(--grey); }
.ev-new td{ animation:evFlash 2.4s ease-out; }
@keyframes evFlash{ 0%,35%{ background:color-mix(in srgb, var(--amber) 22%, white); } 100%{ background:transparent; } }
.ev-toast{ position:fixed; z-index:300; left:50%; bottom:26px; transform:translate(-50%,30px); opacity:0; pointer-events:none; background:#15181e; color:#fff; padding:11px 20px; border-radius:8px; font-size:14px; box-shadow:0 8px 30px rgba(0,0,0,.3); transition:opacity .2s, transform .2s; }
.ev-toast.show{ opacity:1; transform:translate(-50%,0); }

@media (max-width:720px){
  .ev-bar{ flex-direction:column; align-items:stretch; padding:10px 0; gap:8px; }
  .ev-bar-main{ display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; }
  .ev-search, .ev-f-sort, #events-sort-dir{ order:0; }
  .ev-search{ flex:1 1 100%; }
  .ev-f-sort > span{ display:none; }
  .ev-f .ev-ctl{ max-width:none; }
  #events-sort-dir{ flex:none; }
  .ev-toggle{ display:inline-block; }
  .ev-filters{ display:none; }
  .ev-bar.ev-open .ev-filters{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .ev-bar.ev-open .ev-filters .ev-f:first-child{ grid-column:1 / -1; }
  .ev-f-sort{ flex:1 1 100px; }
  .ev-table th.ev-by, .ev-table td.ev-by, .ev-table th[data-sort=date], .ev-table td.ev-date{ display:none; }
  .ev-table th[data-sort=type]{ width:34%; }
  .ev-date-inline, .ev-signed-inline{ display:block; }
  .ev-table td{ overflow-wrap:anywhere; }
  .ev-table th, .ev-table td{ padding:10px 8px; }
  .ev-add-hint{ display:none; }
  .ev-type{ font-size:13.5px; }
  .ev-details{ font-size:13px; }
}
@media (prefers-reduced-motion: reduce){ .ev-new td{ animation:none; } .ev-toast{ transition:none; } }
.ev-clear-log{ background:none; border:0; padding:0 0 0 4px; font:inherit; font-size:12px; color:var(--red,#c0392b); text-decoration:underline; cursor:pointer; white-space:nowrap; }
.ev-clear-log:hover{ opacity:.8; }
