/* ── Fonts: self-hosted (no request to Google; works offline; nothing third-party sees the visitor) ───── */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 100 700; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/barlow-semi-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/barlow-semi-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/barlow-semi-condensed-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2'); }

/* The HTML "hidden" attribute must always win — otherwise a rule like .form-group { display: flex } would show hidden things. */
[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════════
   Sri Charan Constructions — light theme
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────────────────────── */
:root {
  --ink:          #1B2433;
  --steel:        #5B6779;
  --steel-light:  #94A0B2;
  --paper:        #F3F5F9;
  --panel:        #FFFFFF;
  --line:         #E4E8EF;

  --hazard:       #E2740A;          /* brand orange */
  --hazard-deep:  #B85A00;
  --hazard-tint:  #FFF3E6;
  --hazard-mid:   #F6CDA0;
  --caution:      #C7A400;

  --moss:         #2E7D4F;
  --moss-tint:    #E7F5EC;
  --brick:        #B4372A;
  --brick-tint:   #FDECEA;
  --sky:          #2B7BB9;
  --sky-tint:     #E6F1FA;

  /* legacy aliases used throughout the markup / app.js */
  --orange:       var(--hazard);
  --orange-light: var(--hazard-tint);
  --orange-mid:   var(--hazard-mid);
  --dark:         var(--ink);
  --mid:          var(--steel);
  --muted:        var(--steel-light);
  --border:       var(--line);
  --bg:           var(--paper);
  --white:        var(--panel);
  --green:        var(--moss);
  --green-light:  var(--moss-tint);
  --red:          var(--brick);
  --red-light:    var(--brick-tint);

  --radius:       12px;
  --shadow:       0 1px 2px rgba(16,24,40,.05), 0 6px 20px rgba(16,24,40,.06);
  --shadow-lg:    0 24px 60px rgba(16,24,40,.28), 0 6px 16px rgba(16,24,40,.12);

  --font-display: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  /* One shared page width: header, tabs and content all line up on it */
  --page-w: 1360px;
  --gutter: max(20px, calc((100% - var(--page-w)) / 2 + 20px));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-body);
  color: var(--ink);
  min-height: 100%;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body {
  background-color: var(--paper);
  background-image: radial-gradient(900px 320px at 88% -80px, rgba(226,116,10,.10), transparent 70%);
  background-repeat: no-repeat;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.hazard-stripe {
  height: 5px;
  background: repeating-linear-gradient(-45deg, var(--hazard), var(--hazard) 10px, var(--ink) 10px, var(--ink) 20px);
}

/* ── Top bar (header + tabs stick together) ─────────────────────────────────── */
.app-top {
  position: sticky; top: 0; z-index: 200;
  background: var(--panel);
  box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(16,24,40,.05);
}
.app-top::before {                       /* thin brand-colour accent along the very top */
  content: ''; display: block; height: 4px;
  background: linear-gradient(90deg, var(--hazard), #F6A65A 45%, var(--hazard) 70%, var(--ink));
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--panel);
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-box {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-box img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.18)); }
.brand h1 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800; line-height: 1.1;
  letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--hazard);                 /* brand name: orange only */
}
.brand p {
  font-size: 10.5px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--steel-light); margin-top: 3px;
}
.header-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.header-date  { font-size: 12.5px; color: var(--steel); font-weight: 500; white-space: nowrap; }
.header-user  {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  padding: 6px 13px 6px 11px; border-radius: 999px; white-space: nowrap;
}
.header-user::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #2EB872; box-shadow: 0 0 0 3px rgba(46,184,114,.18);
}
.header-user:empty { display: none; }
.logout-btn svg { width: 15px; height: 15px; }

/* Records table columns that only Admin can act on (Edit / Delete) */
body:not(.is-admin) .admin-only-col { display: none; }

/* ── Tabs ───────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0 var(--gutter);
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;                 /* no stray scrollbar in the tab bar */
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 13.5px; font-weight: 600;
  color: var(--steel);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: color .15s, background-color .15s;
}
.tab svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; }
.tab::after {                            /* animated underline */
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px;
  background: var(--hazard); border-radius: 3px 3px 0 0;
  transform: scaleX(0); transition: transform .22s ease;
}
.tab:hover:not(.active) { color: var(--ink); background: var(--paper); }
.tab.active            { color: var(--ink); }
.tab.active svg        { color: var(--hazard); }
.tab.active::after     { transform: scaleX(1); }

/* ── Main / Sections ─────────────────────────────────────────────────────────── */
main { padding: 26px var(--gutter) 64px; }
.section { display: none; }
.section.active { display: block; animation: sectionIn .35s ease both; }
@keyframes sectionIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Card ────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 22px;
  position: relative;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 10px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; letter-spacing: .2px;
  color: var(--ink);
  display: flex; align-items: center; gap: 11px;
}
.ic {                                    /* icon chip in card titles */
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hazard-tint); color: var(--hazard);
  border-radius: 5px;
}
.ic svg { width: 18px; height: 18px; }
.badge {
  background: var(--hazard-tint);
  color: var(--hazard-deep);
  font-family: var(--font-body);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; letter-spacing: 0.6px;
}

/* ── Form ────────────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));   /* fixed 4-up on desktop so every row fills evenly */
  gap: 24px 18px;
  align-items: start;
}
.modal-card .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group          { display: flex; flex-direction: column; gap: 6px; position: relative; }
.form-group.full     { grid-column: 1 / -1; }
.form-group.span-2   { grid-column: span 2; }

label { font-size: 12px; font-weight: 600; color: var(--steel); letter-spacing: .2px; }

input[type="text"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
  padding: 11px 13px;
  border: 1px solid #D5DBE5;
  border-radius: 5px;
  font-size: 14px;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  background: #FFFFFF;
  color: var(--ink);
  width: 100%;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input::placeholder, textarea::placeholder { color: #A8B1C0; }
input:hover, select:hover, textarea:hover { border-color: #B9C2D0; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--hazard);
  box-shadow: 0 0 0 4px rgba(226,116,10,.14);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 46px; height: 46px; line-height: 1.4; }
.calc-hint {                             /* under "Working Hours" without stretching its row */
  position: absolute; left: 2px; top: 100%; margin-top: 3px;
  font-size: 11px; font-weight: 500; color: var(--moss); white-space: nowrap; line-height: 1.3;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, translate .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover  { translate: 0 -1px; }
.btn:active { translate: 0 1px; }
.btn-primary {
  background: linear-gradient(#F08A1E, #E2740A);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 6px 14px rgba(226,116,10,.28);
}
.btn-primary:hover { box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 10px 20px rgba(226,116,10,.36); }
.btn-outline { background: #fff; border-color: #D5DBE5; color: var(--steel); }
.btn-outline:hover { border-color: var(--hazard); color: var(--hazard-deep); background: var(--hazard-tint); }
.btn-danger  { background: var(--brick-tint); color: var(--brick); border-color: #F6D3CE; }
.btn-danger:hover { background: var(--brick); color: #fff; border-color: var(--brick); }
.btn-green   { background: var(--moss-tint); color: var(--moss); border-color: #C9E6D3; }
.btn-green:hover { background: var(--moss); color: #fff; border-color: var(--moss); }
.btn-sm      { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-group   { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn:disabled { opacity: .5; cursor: not-allowed; translate: none; }

/* ── Table ───────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
thead th {
  background: #F8FAFC;
  color: var(--steel);
  font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  padding: 13px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid #EEF1F6;
  color: var(--ink);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;                 /* vehicle numbers / times never break mid-value */
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color .12s; }
tbody tr:hover td      { background: #FFFAF4; }
.empty-row td          { text-align: center; color: var(--steel-light); padding: 44px; font-style: italic; background: none !important; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill-own    { background: var(--sky-tint);    color: var(--sky); }
.pill-rental { background: var(--hazard-tint); color: var(--hazard-deep); }

/* Records table: 15 columns, so tighten it, let prose columns wrap, and pin Edit / Delete */
#records-table thead th, #records-body td { padding-left: 12px; padding-right: 12px; }
#records-body tr:not(.empty-row) td:nth-child(3),      /* Site     */
#records-body tr:not(.empty-row) td:nth-child(11) {    /* Operator */
  white-space: normal; min-width: 96px;
}
@media (min-width: 721px) {          /* pinned right-hand columns: desktop / tablet only */
  #records-table { --act-w: 74px; }
  #records-table .hist-col, #records-table .edit-col, #records-table .del-col {
    position: sticky; width: var(--act-w); min-width: var(--act-w);
    text-align: center; background: #fff; z-index: 2;
  }
  #records-table thead th.hist-col, #records-table thead th.edit-col, #records-table thead th.del-col { background: #F8FAFC; }
  #records-table .hist-col { right: 0; box-shadow: -10px 0 10px -10px rgba(16,24,40,.18); }
  /* History is always there; Edit and Delete are pinned next to it only for people who have them */
  body.can-records-edit #records-table .hist-col, body.can-records-delete #records-table .hist-col { right: var(--act-w); }
  body.can-records-edit.can-records-delete #records-table .hist-col { right: calc(var(--act-w) * 2); }
  body.can-records-edit #records-table .edit-col { right: 0; }
  body.can-records-edit.can-records-delete #records-table .edit-col { right: var(--act-w); }
  body.can-records-delete #records-table .del-col { right: 0; }
  #records-body tr:hover td.hist-col, #records-body tr:hover td.edit-col, #records-body tr:hover td.del-col { background: #FFFAF4; }
}

/* ── Stats ───────────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.stat-card {
  position: relative; overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px 16px;
  transition: box-shadow .2s, translate .2s;
}
.stat-card:hover { box-shadow: var(--shadow); translate: 0 -2px; }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--hazard); }
.stat-card:nth-child(2)::before { background: var(--ink); }
.stat-card:nth-child(3)::before { background: var(--moss); }
.stat-card:nth-child(4)::before { background: var(--sky); }
.stat-label { font-size: 11px; font-weight: 700; color: var(--steel); letter-spacing: .7px; text-transform: uppercase; margin-bottom: 8px; }
.stat-val   { font-family: var(--font-display); font-size: 36px; font-weight: 700; line-height: 1.05; color: var(--ink); }
.stat-unit  { font-size: 12px; color: var(--steel-light); margin-top: 4px; }


/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px; right: 24px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 5px solid var(--moss);
  box-shadow: var(--shadow-lg);
  padding: 14px 20px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: transform .3s, opacity .3s;
  max-width: 340px;
}
.toast.show        { transform: translateY(0); opacity: 1; }
.toast.is-error    { border-left-color: var(--brick); }

/* ── Loading ─────────────────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 40px; color: var(--steel); }
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--hazard);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login page (3D) ─────────────────────────────────────────────────────────── */
.login-wrap {
  --rx: 0deg; --ry: 0deg;          /* card tilt   (set by login.html script) */
  --bx: 0px;  --by: 0px;           /* bg parallax                            */
  --gx: 50%;  --gy: 30%;           /* glare centre                           */
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;              /* phones: ignore the collapsing browser toolbar */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: var(--ink);          /* visible while the photo loads */
}

/* Background: parallax layer (moves with the mouse) > zoom layer (slow drift) */
.login-bg {
  position: absolute; inset: -6%;
  transform: translate3d(var(--bx), var(--by), 0);
  will-change: transform;
}
.login-bg-img {
  position: absolute; inset: 0;
  background: url('/img/login-bg.jpg') center 62% / cover no-repeat;
  animation: bgDrift 26s ease-in-out infinite alternate;
}
@keyframes bgDrift {
  from { transform: scale(1.00); }
  to   { transform: scale(1.09); }
}
.login-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(20,18,14,0) 35%, rgba(12,10,8,0.62) 100%),
    linear-gradient(rgba(20,18,14,0.18), rgba(20,18,14,0.42));
}

/* Floating dust specks */
.login-dust { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.login-dust i {
  position: absolute; bottom: -12px; border-radius: 50%;
  background: rgba(255, 214, 160, 0.75);
  box-shadow: 0 0 8px rgba(255, 170, 70, 0.6);
  opacity: 0;
  animation: dustRise linear infinite;
}
@keyframes dustRise {
  0%   { transform: translate3d(0, 0, 0);              opacity: 0; }
  12%  { opacity: 0.85; }
  85%  { opacity: 0.55; }
  100% { transform: translate3d(var(--drift), -105vh, 0); opacity: 0; }
}

/* 3D stage: perspective + entrance / exit animation */
.login-stage {
  position: relative; z-index: 2;
  width: 100%; max-width: 410px;
  perspective: 1200px;
  animation: stageIn 0.9s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes stageIn {
  from { opacity: 0; transform: translateY(60px) rotateX(-28deg) scale(.92); }
  to   { opacity: 1; transform: none; }
}
.login-stage.leaving {
  animation: stageOut 0.48s cubic-bezier(.5,0,.75,0) both;
}
@keyframes stageOut {
  to { opacity: 0; transform: translateY(-40px) rotateX(18deg) scale(1.08); }
}
.login-wrap.leaving .login-bg-img { transition: transform .5s ease-in, opacity .5s; transform: scale(1.25); opacity: .6; }

/* Card */
.login-card {
  position: relative;
  background: #FFFFFF;
  border-radius: 6px;
  text-align: center;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  box-shadow:
    0 30px 70px rgba(0,0,0,0.45),
    0 8px 20px rgba(0,0,0,0.25),
    0 0 0 1px rgba(255,255,255,0.6) inset;
  will-change: transform;
}
.login-card::before {                 /* hazard stripe along the top edge */
  content: '';
  display: block; height: 8px;
  border-radius: 6px 14px 0 0;
  background-color: var(--hazard);
  background-image: linear-gradient(135deg,
    var(--hazard) 25%, var(--ink) 25%, var(--ink) 50%,
    var(--hazard) 50%, var(--hazard) 75%, var(--ink) 75%);
  background-size: 22px 22px;
  animation: stripeSlide 1.2s linear infinite;
}
@keyframes stripeSlide { to { background-position: 22px 0; } }

.login-glare {                        /* soft light that follows the mouse */
  position: absolute; inset: 0; border-radius: 6px; pointer-events: none;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255,255,255,0.75), rgba(255,255,255,0) 55%);
  mix-blend-mode: soft-light;
  opacity: .9;
}
.login-card-body { padding: 30px 38px 26px; transform-style: preserve-3d; }

/* Elements float at different depths above the card */
.login-logo   { transform: translateZ(60px); }
.login-card h2 { transform: translateZ(34px); }
.login-tagline { transform: translateZ(22px); }
.login-field   { transform: translateZ(14px); }
.login-btn     { transform: translateZ(26px); }

.login-logo {
  width: 116px; height: 116px;
  margin: 0 auto 16px;
  perspective: 600px;
  animation: logoFloat 4.5s ease-in-out infinite;
}
.login-coin {
  width: 100%; height: 100%;
  animation: coinSpin 1.3s 0.35s cubic-bezier(.2,.8,.2,1) both;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.30));
}
.login-coin img { width: 100%; height: 100%; object-fit: contain; display: block; }
@keyframes coinSpin  { from { transform: rotateY(-360deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes logoFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -7px; } }

.login-card h2 {
  font-family: var(--font-display);
  font-size: 23px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.15;
  text-wrap: balance;
  color: var(--hazard);
  margin-bottom: 6px;
}
.login-tagline {
  font-size: 11px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--steel-light);
}
.login-divider {
  height: 1px; margin: 18px auto 20px; width: 70%;
  background: linear-gradient(90deg, transparent, var(--hazard-mid), transparent);
}

/* PIN field */
.login-field { text-align: left; margin-bottom: 16px; }
.login-field label {
  display: block; text-align: center; margin-bottom: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--steel);
}
.pin-wrap { position: relative; }
.login-card input {
  width: 100%;
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 13px 46px;               /* equal side padding keeps the dots centred */
  text-align: center; letter-spacing: 9px;
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  transition: border-color .2s, box-shadow .2s;
}
.login-card input:focus {
  border-color: var(--hazard);
  box-shadow: 0 0 0 4px rgba(226,116,10,0.16), 0 6px 16px rgba(226,116,10,0.12);
  outline: none;
}
.login-card input.is-error { border-color: var(--brick); box-shadow: 0 0 0 4px rgba(140,51,39,0.13); }
.pin-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 6px; cursor: pointer; color: var(--steel-light);
  transition: color .2s, background .2s;
}
.pin-toggle:hover { color: var(--hazard); background: var(--hazard-tint); }

/* Login button: chunky 3D key with a light sweep */
.login-card .login-btn {
  position: relative; overflow: hidden; width: 100%;
  justify-content: center;
  border-radius: 8px; padding: 14px 16px; font-size: 15px; letter-spacing: .6px;
  background: linear-gradient(#F08A1E, #E2740A);
  border: 0;
  box-shadow: 0 5px 0 #B65A07, 0 12px 22px rgba(226,116,10,0.35);
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.login-card .login-btn::after {
  content: ''; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  animation: btnShine 3.6s 1.2s ease-in-out infinite;
}
@keyframes btnShine { 0%,55% { left: -80%; } 100% { left: 150%; } }
.login-card .login-btn:hover  { filter: brightness(1.06); }
.login-card .login-btn:active { transform: translateZ(26px) translateY(4px); box-shadow: 0 1px 0 #B65A07, 0 4px 10px rgba(226,116,10,0.3); }
.login-card .login-btn:disabled { cursor: progress; filter: saturate(.8); }
.login-card .login-btn.is-busy .login-btn-text::after {
  content: ''; display: inline-block; width: 13px; height: 13px; margin-left: 9px; vertical-align: -2px;
  border: 2px solid rgba(35,32,25,.35); border-top-color: var(--ink); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-error { color: var(--brick); font-size: 13px; font-weight: 600; margin-top: 14px; min-height: 18px; }
.login-foot {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid #EFEAE0;
  font-size: 11px; color: var(--steel-light); letter-spacing: .3px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* Wrong-PIN shake (uses `translate`, so it doesn't fight the 3D tilt) */
.login-card.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { translate: -3px 0; }
  20%, 80% { translate: 6px 0; }
  30%, 50%, 70% { translate: -10px 0; }
  40%, 60% { translate: 10px 0; }
}

/* Touch devices have no mouse to tilt with — give the card a slow idle sway instead */
.login-card.idle-sway { animation: idleSway 7s ease-in-out infinite; }
@keyframes idleSway {
  0%,100% { transform: rotateX(2deg) rotateY(-4deg); }
  50%     { transform: rotateX(-2deg) rotateY(4deg); }
}

@media (max-width: 480px) {
  .login-card-body { padding: 26px 22px 22px; }
  .login-card h2   { font-size: 20px; }
  .login-logo      { width: 100px; height: 100px; }
}

/* Short screens (phones held sideways): compact layout so the whole card fits */
@media (max-height: 470px) {
  .login-wrap      { padding: 10px; }
  .login-stage     { max-width: 380px; }
  .login-card-body { padding: 14px 26px 12px; }
  .login-logo      { width: 62px; height: 62px; margin-bottom: 6px; }
  .login-card h2   { font-size: 18px; margin-bottom: 0; }
  .login-tagline, .login-foot { display: none; }
  .login-divider   { margin: 8px auto 10px; }
  .login-field     { margin-bottom: 10px; }
  .login-field label { margin-bottom: 5px; }
  .login-card input { padding: 8px 46px; font-size: 19px; }
  .login-card .login-btn { padding: 10px 16px; }
  .login-error     { margin-top: 8px; min-height: 16px; }
}

/* Respect "reduce motion" system setting */
@media (prefers-reduced-motion: reduce) {
  .login-stage, .login-coin, .login-logo, .login-bg-img, .login-dust i,
  .login-card::before, .login-btn::after, .login-card.idle-sway { animation: none !important; }
  .login-dust { display: none; }
  .login-card { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Activity logs, history timeline, "reason" popup
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Records: labelled search & filter bar */
.rec-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rec-filters {
  margin: 0 0 20px; padding: 16px 18px 18px;
  background: #F8FAFC; border: 1px solid var(--line); border-radius: 6px;
}
.rec-filters-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--steel);
}
.rec-filters-title svg { width: 15px; height: 15px; color: var(--hazard); }
.rec-filters-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 16px; }
.rec-count { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--steel-light); }
.filter-field.is-active label { color: var(--hazard-deep); }
.filter-field.is-active select, .filter-field.is-active input { border-color: var(--hazard); background-color: var(--hazard-tint); }
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-field select, .filter-field input { width: 100%; }

/* Status pills */
.pill-green  { background: var(--moss-tint);    color: var(--moss); }
.pill-red    { background: var(--brick-tint);   color: var(--brick); }
.pill-gray   { background: #EEF1F6;             color: var(--steel); text-transform: capitalize; }
.pill-sky    { background: var(--sky-tint);     color: var(--sky); }
.pill-orange { background: var(--hazard-tint);  color: var(--hazard-deep); }

/* History button in the Records table */
.hist-btn { gap: 5px; padding: 6px 10px; }
.hist-btn .hist-count { font-weight: 700; font-size: 12px; }
.hist-btn .hist-count:empty { display: none; }
.hist-btn.has-edits { border-color: var(--hazard-mid); color: var(--hazard-deep); background: var(--hazard-tint); }

/* Before → after change lines */
.chg-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.chg      { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 12.5px; line-height: 1.45; white-space: normal; }
.chg-field { font-weight: 700; color: var(--ink); min-width: 96px; }
.chg-from  { background: var(--brick-tint); color: var(--brick); padding: 1px 9px; border-radius: 6px; text-decoration: line-through; text-decoration-color: rgba(180,55,42,.4); word-break: break-word; }
.chg-to    { background: var(--moss-tint);  color: var(--moss);  padding: 1px 9px; border-radius: 6px; font-weight: 600; word-break: break-word; }
.chg-arrow { color: var(--steel-light); }
.chg-none  { color: var(--steel-light); }

/* Snapshots (created / deleted) */
.log-snap { margin-top: 6px; font-size: 12.5px; white-space: normal; }
.log-snap summary { cursor: pointer; color: var(--hazard-deep); font-weight: 600; }
.log-snap[open] summary { margin-bottom: 4px; }
.snap   { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px dashed #EEF1F6; }
.snap-f { min-width: 100px; color: var(--steel); font-weight: 600; }
.snap-v { color: var(--ink); word-break: break-word; }

/* The reason, shown wherever it was given */
.tl-reason {
  margin-top: 8px; padding: 9px 12px; white-space: normal;
  background: var(--hazard-tint); border-left: 3px solid var(--hazard); border-radius: 0 8px 8px 0;
  font-size: 13px; color: var(--ink); word-break: break-word;
}
.tl-reason span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--hazard-deep); margin-bottom: 2px; }

/* Activity Logs tab */
.log-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.log-filters select { width: 190px; }
.log-filters input[type="date"] { width: 160px; }
.log-filters input[type="text"] { flex: 1; min-width: 220px; }
.log-table tbody td  { vertical-align: top; }
.log-time    { color: var(--steel); font-size: 12.5px; }
.log-details { white-space: normal; min-width: 300px; max-width: 580px; }
.log-label   { font-weight: 600; }
.log-device  { font-size: 12px; color: var(--steel); }
.log-more    { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--steel); font-size: 12.5px; min-height: 30px; }
.log-empty   { padding: 34px 10px; text-align: center; color: var(--steel); }
.log-empty small { color: var(--steel-light); }

/* Entry history popup */
.modal-narrow { max-width: 700px; }
.history-entry {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 11px 15px; margin-bottom: 18px;
  background: var(--paper); border-radius: 6px; color: var(--steel); font-size: 13px;
}
.history-entry strong { color: var(--ink); font-size: 14.5px; }
.history-entry span::before { content: '·'; margin-right: 10px; color: var(--steel-light); }
.timeline { list-style: none; position: relative; margin: 4px 0 0; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 24px; }
.tl-item:last-child { padding-bottom: 4px; }
.tl-dot {
  position: absolute; left: -28px; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--steel-light);
}
.dot-sky { border-color: var(--sky); } .dot-orange { border-color: var(--hazard); } .dot-red { border-color: var(--brick); }
.tl-head  { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tl-title { font-weight: 700; font-size: 14.5px; }
.tl-by    { color: var(--steel); font-size: 13px; }
.tl-time  { margin-left: auto; color: var(--steel-light); font-size: 12px; font-variant-numeric: tabular-nums; }

/* "Reason for Changes" popup — sits above the Edit dialog */
.modal-overlay.modal-top { z-index: 600; align-items: center; }
.modal-small { max-width: 560px; }
.reason-intro { color: var(--steel); font-size: 13.5px; line-height: 1.55; margin-bottom: 14px; }
#reason-changes .chg-list { margin-top: 0; padding: 13px 15px; background: var(--paper); border-radius: 6px; max-height: 200px; overflow: auto; }
#reason-text { height: 96px; resize: vertical; }
.reason-hint { font-weight: 500; color: var(--steel-light); }
.reason-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; font-size: 12px; min-height: 18px; }
#reason-error { color: var(--brick); font-weight: 600; }
#reason-count { margin-left: auto; color: var(--steel-light); font-variant-numeric: tabular-nums; }
#reason-count.is-ok { color: var(--moss); font-weight: 600; }
.btn-danger-solid { background: var(--brick); color: #fff; border-color: var(--brick); box-shadow: 0 6px 14px rgba(180,55,42,.28); }
.btn-danger-solid:hover { background: #9C2E23; }
.is-danger .modal-card { border-top-color: var(--brick); }
.is-danger .ic { background: var(--brick-tint); color: var(--brick); }

/* ═══════════════════════════════════════════════════════════════════════════════
   Photo proof (Starting / Closing reading)
   ═══════════════════════════════════════════════════════════════════════════════ */
.photo-field { margin-top: 2px; }
.photo-field [hidden], .photo-viewer [hidden] { display: none !important; }

.photo-add {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  background: var(--hazard-tint); color: var(--hazard-deep);
  border: 1.5px dashed var(--hazard-mid); border-radius: 5px;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.photo-add:hover { background: #FFE9D2; border-color: var(--hazard); }

.photo-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px 6px 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
.photo-thumb {
  width: 42px; height: 42px; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--hazard);
  border: 1px solid var(--line); border-radius: 5px; overflow: hidden;
  cursor: zoom-in;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-status { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--moss); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-chip.is-busy .photo-status { color: var(--steel); }
.photo-chip.is-busy .photo-status::before {
  content: ''; display: inline-block; width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px;
  border: 2px solid var(--line); border-top-color: var(--hazard); border-radius: 50%;
  animation: spin .7s linear infinite;
}
.photo-replace, .photo-x {
  background: none; border: 0; cursor: pointer; border-radius: 7px;
  font-family: var(--font-body); transition: background-color .15s, color .15s;
}
.photo-replace { padding: 5px 8px; font-size: 12px; font-weight: 600; color: var(--hazard-deep); }
.photo-replace:hover:not(:disabled) { background: var(--hazard-tint); }
.photo-x { width: 28px; height: 28px; font-size: 13px; color: var(--steel-light); }
.photo-x:hover:not(:disabled) { background: var(--brick-tint); color: var(--brick); }
.photo-replace:disabled, .photo-x:disabled { opacity: .45; cursor: not-allowed; }
.photo-err { margin-top: 5px; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--brick); }
.photo-err:empty { display: none; }

/* Camera button next to a reading in the Records table */
.reading-cell { display: inline-flex; align-items: center; }
.photo-view {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-left: 7px; padding: 0;
  background: var(--hazard-tint); color: var(--hazard-deep);
  border: 0; border-radius: 7px; cursor: pointer;
  transition: background-color .15s;
}
.photo-view:hover { background: var(--hazard-mid); }

/* Full-size photo viewer */
.photo-viewer { z-index: 700; }
.photo-card { max-width: 860px; padding: 20px 22px 22px; }
.photo-card .card-header { margin-bottom: 14px; padding-bottom: 12px; }
.photo-actions { display: flex; gap: 8px; }
.photo-stage {
  position: relative; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  background: #0F1520; border-radius: 6px; overflow: hidden;
}
.photo-stage img { max-width: 100%; max-height: 72vh; display: block; }
.photo-msg { color: #CBD5E1; font-size: 13px; padding: 44px 24px; text-align: center; line-height: 1.5; }
.photo-msg:empty { display: none; }

@media print { .photo-field, .photo-view { display: none !important; } }

/* ═══════════════════════════════════════════════════════════════════════════════
   Export menu (Records)
   ═══════════════════════════════════════════════════════════════════════════════ */
.export-menu { position: relative; display: inline-block; }
.export-menu .caret { margin-left: 6px; font-size: 11px; opacity: .75; }
.export-menu .btn[aria-expanded="true"] { border-color: var(--hazard); color: var(--hazard-deep); background: var(--hazard-tint); }
.export-menu .btn.is-busy { cursor: progress; opacity: 1; }
.export-menu .btn.is-busy .caret { display: none; }
.export-menu .btn.is-busy::before {
  content: ''; width: 12px; height: 12px;
  border: 2px solid var(--hazard-mid); border-top-color: var(--hazard); border-radius: 50%;
  animation: spin .7s linear infinite;
}

.export-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 292px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow-lg);
  animation: popIn .16s ease-out both;
}
.export-pop[hidden] { display: none !important; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.export-pop button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 10px; text-align: left;
  background: none; border: 0; border-radius: 5px; cursor: pointer;
  font-family: var(--font-body); color: var(--ink);
  transition: background-color .12s;
}
.export-pop button:hover, .export-pop button:focus-visible { background: var(--hazard-tint); outline: none; }
.export-pop button:focus-visible { box-shadow: 0 0 0 2px rgba(226,116,10,.35); }
.fmt {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: .4px; color: #fff;
}
.fmt-xlsx { background: #1D7A46; }
.fmt-pdf  { background: #C4392B; }
.fmt-csv  { background: #5B6779; }
.fmt-text strong { display: block; font-size: 13.5px; line-height: 1.25; }
.fmt-text small  { display: block; margin-top: 1px; font-size: 11.5px; line-height: 1.35; color: var(--steel); }

@media (max-width: 720px) {
  /* On a phone the toolbar wraps, so anchor the menu to the whole toolbar (full width) — never off-screen */
  .rec-actions { position: relative; }
  .export-menu { position: static; }
  .export-pop { left: 0; right: 0; width: auto; }
}
@media print { .export-menu { display: none !important; } }

/* ═══════════════════════════════════════════════════════════════════════════════
   Sub-sections (Inventory), form helpers for the new dialogs, Activity-Log selection
   ═══════════════════════════════════════════════════════════════════════════════ */
.sub-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; width: fit-content; max-width: 100%;
  margin: 0 0 18px; padding: 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
.sub-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border: 0; border-radius: 6px; background: none; cursor: pointer;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--steel);
  transition: background-color .15s, color .15s;
}
.sub-tab:hover { background: var(--paper); color: var(--ink); }
.sub-tab:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(226,116,10,.4); }
.sub-tab.active { background: var(--hazard-tint); color: var(--hazard-deep); }
.sub-tab .count {
  min-width: 22px; padding: 1px 7px; border-radius: 99px; text-align: center;
  background: var(--paper); color: var(--steel); font-size: 11.5px; font-weight: 700;
}
.sub-tab.active .count { background: var(--hazard); color: #fff; }
.inv-panel[hidden] { display: none; }

.form-grid.one-col, .modal-card .form-grid.one-col { grid-template-columns: 1fr; }
.form-grid.two-col, .modal-card .form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.two-col .span-2 { grid-column: 1 / -1; }
.form-hint  { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--steel); }
.form-hint[hidden] { display: none; }
.form-error { margin-top: 10px; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--brick); }
.form-error:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.log-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-bottom: 12px; padding: 10px 14px;
  background: var(--sky-tint); border: 1px solid #CFE3F7; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.log-bar[hidden] { display: none; }
.log-bar .grow { flex: 1; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font-body); font-size: 13px; font-weight: 700; color: var(--hazard-deep); text-decoration: underline; }
.link-btn[hidden] { display: none; }
.lg-select, .lg-del { width: 46px; text-align: center; vertical-align: top; }
.lg-select input { width: 17px; height: 17px; margin-top: 2px; cursor: pointer; accent-color: var(--hazard); }
.lg-lock { display: inline-flex; margin-top: 2px; color: var(--steel-light); }
.log-table.readonly .lg-select, .log-table.readonly .lg-del { display: none; }
.log-table tbody tr.is-protected td { background: #FFFBF5; }
@media print { .log-bar, .lg-select, .lg-del { display: none !important; } }

/* ═══════════════════════════════════════════════════════════════════════════════
   Loads breakup · Summary controls · Documents · Payments
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Loads breakup (Data Entry + Edit dialog) */
.lp-section { margin-top: 22px; padding: 16px 18px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.lp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.lp-title strong { font-size: 14.5px; }
.lp-hint { margin: 4px 0 12px; }
.lp-total { font-size: 13px; font-weight: 700; padding: 3px 11px; border-radius: 99px; }
.lp-total:empty { display: none; }
.lp-total.ok   { background: var(--moss-tint);  color: var(--moss); }
.lp-total.warn { background: var(--hazard-tint); color: var(--hazard-deep); }
.lp-total.bad  { background: var(--brick-tint); color: var(--brick); }
.lp-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.lp-rows:empty { margin-bottom: 0; }
.lp-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 34px; gap: 8px; align-items: center; }
.lp-row input { background: #fff; }
.lp-del {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 5px; cursor: pointer;
  background: none; color: var(--steel-light); font-size: 14px; transition: background-color .15s, color .15s;
}
.lp-del:hover { background: var(--brick-tint); color: var(--brick); }
.lp-mini { margin-top: 3px; max-width: 220px; font-size: 11.5px; line-height: 1.35; color: var(--steel); white-space: normal; }
@media (max-width: 480px) { .lp-row { grid-template-columns: minmax(0, 1fr) 96px 34px; } }

/* Summary: period selector + custom dates */
.sum-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sum-controls select { font-size: 12.5px; padding: 7px 10px; width: 170px; }
.sum-custom { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.sum-custom[hidden] { display: none; }
.sum-custom label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--steel); }
.sum-custom input { width: 160px; padding: 7px 10px; font-size: 13px; }
.sum-range-text { margin: 0 0 14px; font-size: 12.5px; font-weight: 600; color: var(--steel); }

/* Documents */
.doc-file { padding: 9px; background: #fff; }
.doc-file::file-selector-button {
  margin-right: 12px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  background: var(--hazard-tint); color: var(--hazard-deep); font-family: var(--font-body); font-weight: 600;
}
.doc-file-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; padding: 9px 12px; background: var(--paper); border-radius: 6px; font-size: 13px; }
.doc-file-info[hidden] { display: none; }
.doc-size { color: var(--steel); font-size: 12.5px; white-space: nowrap; }
.doc-progress { margin: 4px 0 8px; }
.doc-progress[hidden] { display: none; }
.doc-bar { height: 8px; background: var(--paper); border-radius: 99px; overflow: hidden; }
.doc-bar span { display: block; height: 100%; width: 0; background: var(--hazard); transition: width .15s linear; }
.doc-progress small { display: block; margin-top: 5px; color: var(--steel); font-size: 12px; }
.doc-count { font-size: 12.5px; font-weight: 600; color: var(--steel); }
.doc-name-cell { white-space: normal; min-width: 240px; max-width: 420px; }
.doc-sub { font-size: 12px; color: var(--steel); overflow-wrap: anywhere; }
.doc-notes { margin-top: 3px; font-size: 12.5px; color: var(--mid, #475569); white-space: normal; }
.fmt-badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .3px; color: #fff; background: #5B6779; }
.fm-pdf { background: #C4392B; } .fm-word { background: #2B5FAA; } .fm-excel { background: #1D7A46; } .fm-ppt { background: #C2571A; }
.fm-img { background: #7B4FB5; } .fm-cad { background: #0F7B8A; } .fm-zip { background: #8A6D1F; } .fm-other { background: #5B6779; }

/* Payments */
.sub-tab small { font-weight: 500; opacity: .75; }
.pay-period { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 18px; margin-bottom: 16px; }
.pay-period .form-group { width: 240px; max-width: 100%; }
.pay-period-text { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--hazard-deep); }
.pay-head, .pay-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 150px 34px; gap: 8px; align-items: center; }
.pay-head { padding: 0 2px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--steel); }
.pay-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pay-row.has-error input { border-color: var(--brick); background: #FFF7F6; }
.pay-total { margin: 14px 0 4px; font-size: 14px; font-weight: 700; }
.pay-total:empty { display: none; }
.log-filters select[id^="pay-"] { width: 260px; }
.pay-footer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 700; text-align: right; }
.pay-footer:empty { display: none; }
.pay-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-edit-period { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--hazard-deep); }
@media (max-width: 720px) {
  .pay-head { display: none; }
  .pay-row { grid-template-columns: minmax(0, 1fr) 96px 34px; grid-template-areas: "name name del" "days amount amount"; padding: 10px; background: var(--paper); border-radius: 6px; }
  .pay-row .pr-name { grid-area: name; } .pay-row .pr-days { grid-area: days; } .pay-row .pr-amount { grid-area: amount; } .pay-row .lp-del { grid-area: del; }
}
@media print { .lp-section, .pay-rows, .doc-file { display: none !important; } }

/* ── Edit Entry Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  z-index: 500;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}
.modal-overlay.open { display: flex; }
.modal-overlay.open .modal-card { animation: modalIn .28s cubic-bezier(.2,.8,.2,1) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-card {
  background: var(--panel);
  border-radius: 6px;
  border-top: 5px solid var(--hazard);
  box-shadow: var(--shadow-lg);
  padding: 26px;
  width: 100%;
  max-width: 760px;
}

/* ── Print ───────────────────────────────────────────────────────────────────── */
@media print {
  body { background: #fff !important; background-image: none !important; }
  .app-top, .btn, .modal-overlay, .hazard-stripe { display: none !important; }
  main { padding: 0; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  thead th { background: #eee !important; color: #000 !important; }
}

/* ── Tablets / phones ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .form-grid, .modal-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-group.span-2 { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .app-top      { position: static; }          /* don't let a tall bar eat the phone screen */
  .site-header  { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .brand h1     { font-size: 17px; letter-spacing: .4px; }
  .brand p      { letter-spacing: 1.4px; }
  .header-right { width: 100%; margin-left: 0; justify-content: space-between; }
  .header-date  { display: none; }
  .tab          { padding: 13px 13px; }
  main          { padding-top: 18px; }
  .card         { padding: 18px; }
  .form-grid, .modal-card .form-grid { gap: 22px 12px; }
  .stat-val     { font-size: 30px; }
}
@media (max-width: 480px) {
  .form-grid, .modal-card .form-grid { grid-template-columns: 1fr; }
  .stats-grid  { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card        { padding: 16px; }
  .card-title  { font-size: 17px; }
  .modal-overlay { padding: 12px; }
  .modal-card    { padding: 18px; }
  .toast       { left: 14px; right: 14px; bottom: 16px; max-width: none; }
}

@media (max-width: 720px) {
  .log-filters select, .log-filters input[type="date"], .log-filters input[type="text"] { width: 100%; flex: 1 1 100%; }
  .tl-time { margin-left: 0; width: 100%; }
  .modal-overlay.modal-top { align-items: flex-start; padding-top: 24px; }
  .history-entry { font-size: 12.5px; }
}

/* Phones: each log line becomes a card, so nothing needs sideways swiping */
@media (max-width: 720px) {
  .log-table thead { display: none; }
  .log-table, .log-table tbody { display: block; }
  .log-table tbody tr:not(.empty-row) {
    display: grid; grid-template-columns: 1fr auto; gap: 7px 10px;
    padding: 14px 16px; border-bottom: 1px solid #EEF1F6;
  }
  .log-table tbody tr:not(.empty-row):last-child { border-bottom: none; }
  .log-table tbody tr:not(.empty-row) td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; max-width: none; }
  .log-table tbody tr:hover td { background: none; }
  .log-table tbody tr:not(.empty-row) { grid-template-columns: auto 1fr auto auto; }
  .log-table td:nth-child(1) { grid-column: 1;      grid-row: 1; align-self: center; }
  .log-table td:nth-child(2) { grid-column: 2;      grid-row: 1; align-self: center; }
  .log-table td:nth-child(4) { grid-column: 3;      grid-row: 1; justify-self: end; align-self: center; }
  .log-table td:nth-child(7) { grid-column: 4;      grid-row: 1; align-self: center; }
  .log-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .log-table td:nth-child(5) { grid-column: 1 / -1; grid-row: 3; }
  .log-table td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }
  /* Owner: no tick-box / delete cells, so the card is just: when · activity */
  .log-table.readonly tbody tr:not(.empty-row) { grid-template-columns: 1fr auto; }
  .log-table.readonly td:nth-child(2) { grid-column: 1; }
  .log-table.readonly td:nth-child(4) { grid-column: 2; }
  .lg-select, .lg-del { width: auto; }
  .card-header { position: relative; }       /* the download menu opens full-width under its own header */
}

@media (max-width: 1250px) { .rec-filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .rec-filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rec-filters { padding: 14px; } }
@media (max-width: 480px)  { .rec-filters-grid { grid-template-columns: 1fr; } }


/* ═══════════════════════════════════════════════════════════════════════════════
   Polish: clickable logo · footer · mobile menu · phone-friendly tables · 44 px touch targets
   ═══════════════════════════════════════════════════════════════════════════════ */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 2000; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 8px; font-weight: 700; }
.skip-link:focus { left: 8px; }

.brand-link { display: flex; align-items: center; gap: 14px; min-width: 0; color: inherit; text-decoration: none; border-radius: 6px; }
.brand-link:focus-visible, .login-logo-link:focus-visible { outline: 3px solid rgba(226,116,10,.5); outline-offset: 4px; }
.login-logo-link { display: block; color: inherit; border-radius: 50%; }

/* Footer (app, login, privacy, 404) */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 18px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); font-size: 12.5px; color: var(--steel); text-align: center;
}
.site-footer a { display: inline-block; color: var(--steel); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 14px 4px; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--hazard-deep); }
.site-footer [hidden] { display: none; }
.login-footer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; color: rgba(255,255,255,.9); background: linear-gradient(transparent, rgba(10,16,28,.55)); }
.login-footer a { color: #fff; }

/* Offline notice (shown whenever the phone loses its connection) */
.net-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); text-align: center; font-size: 13.5px; font-weight: 700; background: #1B2433; color: #fff; }
.net-banner[hidden] { display: none; }
.net-banner.back { background: #1D7A46; }

/* ── Mobile menu ────────────────────────────────────────────────────────────── */
.menu-btn { display: none; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-family: var(--font-body); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn:focus-visible, .mm-item:focus-visible, .mm-close:focus-visible { outline: 3px solid rgba(226,116,10,.5); outline-offset: 2px; }
.menu-btn .menu-current { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(16,24,40,.5); opacity: 0; transition: opacity .2s; }
.mobile-menu-overlay.open { opacity: 1; }
.mobile-menu-overlay[hidden], .mobile-menu[hidden] { display: none; }
.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 901; width: min(88vw, 340px); display: flex; flex-direction: column;
  background: #fff; box-shadow: -14px 0 40px rgba(16,24,40,.28); transform: translateX(100%); transition: transform .22s ease;
  padding-top: env(safe-area-inset-top);
}
.mobile-menu.open { transform: none; }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--line); }
.mm-user { font-size: 14px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.mm-user small { display: block; font-size: 12px; font-weight: 600; color: var(--steel); }
.mm-close { flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 20px; cursor: pointer; }
.mm-nav { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.mm-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 14px; border: 0; border-radius: 6px; background: none; color: var(--ink); font-family: var(--font-body); font-size: 15.5px; font-weight: 600; text-align: left; cursor: pointer; }
.mm-item svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--steel); }
.mm-item.active { background: var(--hazard-tint); color: var(--hazard-deep); }
.mm-item.active svg { color: var(--hazard); }
.mm-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 10px; }
.mm-foot .site-footer { padding: 6px 0 0; }
body.menu-open { overflow: hidden; }
@media (min-width: 961px) { .menu-btn, .mobile-menu, .mobile-menu-overlay { display: none !important; } }
@media (max-width: 960px) {
  .tabs { display: none; }                          /* the tab bar would need sideways swiping — the menu replaces it */
  .menu-btn { display: inline-flex; }
  .header-right { display: none; }                  /* date, user and logout live inside the menu */
  .app-top { position: sticky; }
  .site-header { flex-wrap: nowrap; gap: 10px; padding: 8px var(--gutter); }
  .brand-link { flex: 1 1 auto; gap: 10px; }
  .logo-box { width: 44px; height: 44px; }
  .brand h1 { font-size: 16px; letter-spacing: .3px; }
  .brand p { font-size: 9.5px; letter-spacing: 1.2px; margin-top: 2px; }
}
@media (max-width: 400px) { .brand p { display: none; } .brand h1 { font-size: 14.5px; } .menu-btn .menu-current { display: none; } }

/* ── Phones: every table becomes a stack of cards, so nothing is swiped sideways ─────────────────────── */
@media (max-width: 720px) {
  .table-wrap { overflow: visible; border: 0; background: none; border-radius: 0; }
  .table-wrap table:not(.log-table), .table-wrap table:not(.log-table) tbody, .table-wrap table:not(.log-table) tr, .table-wrap table:not(.log-table) td { display: block; width: 100%; }
  .table-wrap table:not(.log-table) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap table:not(.log-table) tbody tr:not(.empty-row) { margin: 0 0 12px; padding: 2px 14px 6px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
  .table-wrap table:not(.log-table) tbody tr:hover td { background: none; }
  .table-wrap table:not(.log-table) tbody td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; min-width: 0 !important; max-width: none !important;
    border-bottom: 1px solid #EEF1F6; white-space: normal; text-align: right; overflow-wrap: anywhere;
  }
  .table-wrap table:not(.log-table) tbody td::before { content: attr(data-label); flex: 0 0 34%; max-width: 40%; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--steel); }
  /* cells that only hold buttons sit together in one row at the bottom of the card, with no label */
  .table-wrap table:not(.log-table) tbody td[data-label=""] { display: inline-flex; width: auto; border-bottom: 0; padding: 10px 10px 4px 0; }
  .table-wrap table:not(.log-table) tbody td[data-label=""]::before { display: none; }
  .table-wrap table:not(.log-table) tbody td:last-child { border-bottom: 0; }
  .table-wrap table:not(.log-table) .empty-row td { display: block; text-align: center; padding: 28px 12px; }
  .table-wrap table:not(.log-table) .empty-row td::before { display: none; }
  .table-wrap table:not(.log-table) .empty-row { display: block; border: 1px dashed var(--line); border-radius: 6px; margin-bottom: 12px; }
  .doc-name-cell { min-width: 0; max-width: none; }
  .doc-name-cell > * { text-align: right; }
  .lp-mini { max-width: none; text-align: right; }
}

/* ── Touch targets: at least 44 px on phones and tablets ──────────────────────────────────────────────── */
@media (max-width: 960px), (pointer: coarse) {
  .btn, .btn-sm, .link-btn, .sub-tab, .photo-add, .hist-btn, .pin-toggle, .logout-btn { min-height: 44px; }
  .btn-sm { padding-left: 14px; padding-right: 14px; }
  .btn, .btn-sm { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .link-btn { padding: 10px 4px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { min-height: 44px; }
  .lg-check, #log-select-all { width: 24px; height: 24px; }
  .lg-select, .lg-del { min-width: 48px; }
  .lp-del { width: 44px; height: 44px; }
  .lp-row { grid-template-columns: minmax(0, 1fr) 120px 44px; }
  .pay-head, .pay-row { grid-template-columns: minmax(0, 1fr) 110px 140px 44px; }
  .export-pop button { min-height: 48px; }
  .pin-toggle { min-width: 44px; }
  .modal-card .btn-group .btn { flex: 1 1 auto; }
}
@media (max-width: 720px) {
  .pay-row { grid-template-columns: minmax(0, 1fr) 110px 44px; }
}
@media (max-width: 480px) { .lp-row { grid-template-columns: minmax(0, 1fr) 96px 44px; } }

/* Login: a lighter background picture on phones */
@media (max-width: 800px) { .login-bg-img { background-image: url('/img/login-bg-sm.jpg') !important; } }
.login-info { margin-top: 12px; font-size: 13px; font-weight: 600; text-align: center; color: #1D7A46; min-height: 0; }
.login-info:empty { display: none; }

/* A table's hidden labels must stay inside its own scroll box (otherwise they stretch the whole page on tablets) */
.table-wrap { position: relative; }
.skip-link { pointer-events: none; }
.skip-link:focus { pointer-events: auto; }
@media (max-width: 960px), (pointer: coarse) {
  .btn, .btn-sm { min-width: 44px; }          /* icon-only buttons (🗑, ✏️, ✕) are 44 px wide as well as tall */
}
@media (max-width: 960px), (pointer: coarse) {
  button, [role="tab"], .sub-tab { min-height: 44px; }
  .sub-tab { min-height: 46px; }
  .lg-check, #log-select-all { width: 28px; height: 28px; }
  .lg-select { min-width: 52px; }
}
@media (max-width: 960px), (pointer: coarse) {
  .lg-select input.lg-check, .lg-select #log-select-all, #log-select-all { width: 28px; height: 28px; }
}

/* Text on the sign-in page is never smaller than 12 px, and small brand text on phones uses the darker orange (readable contrast) */
.login-foot, .login-tagline, .login-field label { font-size: 12px; }
@media (max-width: 960px) { .brand h1 { color: var(--hazard-deep); } }

/* ═══ Purchases · View buttons ═══ */
.open-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pu-file { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.pu-file-name { font-weight: 600; overflow-wrap: anywhere; }
.pu-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pu-table th:nth-child(n+6):nth-child(-n+8) { text-align: right; }
input.pu-net { background: #F3F5F9; font-weight: 800; color: var(--ink); cursor: default; }
input.pu-net.is-bad { border-color: #B4372A; }
.pu-net-hint { min-height: 1.3em; }
.pu-net-hint.ok  { color: #1D7A46; font-weight: 600; }
.pu-net-hint.bad { color: #B4372A; font-weight: 600; }
.pu-footer { margin-top: 14px; font-size: 14px; color: var(--steel); }
.pu-footer strong { color: var(--ink); }
.pu-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pu-filters input[type="text"] { flex: 1 1 220px; min-width: 0; }
#pu-edit-overlay .modal-card { max-width: 720px; }

/* On phones the admin-only columns must stay hidden for everyone else (the card layout would otherwise show them) */
@media (max-width: 720px) {
  body:not(.is-admin) .table-wrap table:not(.log-table) tbody td.admin-only-col { display: none !important; }
  .open-btns { justify-content: flex-end; }
  .pu-file { align-items: flex-end; text-align: right; }
  .pu-filters > * { flex: 1 1 100%; }
}
.pu-table th, .pu-table td { padding-left: 9px; padding-right: 9px; }
.pu-table .pu-file-name { max-width: 170px; }
@media (max-width: 720px) {
  .pu-filters > input[type="date"] { flex: 1 1 calc(50% - 10px); }
  .pu-table .pu-file-name { max-width: none; }
}

/* ═══ Permissions: anything marked  perm-<permission>  is hidden from people who do not have that permission ═══ */
body:not(.can-entry-add) .perm-entry-add { display: none !important; }
body:not(.can-records-view) .perm-records-view { display: none !important; }
body:not(.can-records-export) .perm-records-export { display: none !important; }
body:not(.can-records-edit) .perm-records-edit { display: none !important; }
body:not(.can-records-delete) .perm-records-delete { display: none !important; }
body:not(.can-purchases-add) .perm-purchases-add { display: none !important; }
body:not(.can-purchases-view) .perm-purchases-view { display: none !important; }
body:not(.can-purchases-edit) .perm-purchases-edit { display: none !important; }
body:not(.can-summary-view) .perm-summary-view { display: none !important; }
body:not(.can-documents-view) .perm-documents-view { display: none !important; }
body:not(.can-documents-print) .perm-documents-print { display: none !important; }
body:not(.can-documents-upload) .perm-documents-upload { display: none !important; }
body:not(.can-documents-delete) .perm-documents-delete { display: none !important; }
body:not(.can-payments-add) .perm-payments-add { display: none !important; }
body:not(.can-payments-view) .perm-payments-view { display: none !important; }
body:not(.can-payments-edit) .perm-payments-edit { display: none !important; }
body:not(.can-inventory-manage) .perm-inventory-manage { display: none !important; }
body:not(.can-logs-view) .perm-logs-view { display: none !important; }
body:not(.can-logs-delete) .perm-logs-delete { display: none !important; }
body:not(.can-users-manage) .perm-users-manage { display: none !important; }
body:not(.can-permissions-manage) .perm-permissions-manage { display: none !important; }

/* Records: order selector and the totals under the table */
.rec-order { display: inline-flex; align-items: center; gap: 8px; margin-left: 14px; font-size: 13px; font-weight: 600; color: var(--steel); }
.rec-order select { min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; color: var(--ink); }
.records-totals { margin-top: 18px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.records-totals[hidden] { display: none; }
@media (max-width: 1280px) { .records-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .records-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .records-totals { grid-template-columns: 1fr; } .rec-order { margin-left: 0; width: 100%; justify-content: space-between; } }
@media print { .rec-order { display: none !important; } .records-totals { break-inside: avoid; grid-template-columns: repeat(5, 1fr); } .stat-card { border: 1px solid #ccc; } }

/* Nothing switched on for this person */
.center-card { text-align: center; padding: 40px 24px; }
.center-card h2 { margin-bottom: 10px; }

/* ═══ Permissions screen ═══ */
.perm-warning { margin: 14px 0; padding: 14px 16px; border-radius: 6px; background: #FFF1E0; color: #7A3D00; font-size: 14px; font-weight: 600; }
.perm-warning[hidden] { display: none; }
.perm-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 22px; margin-top: 16px; align-items: start; }
.perm-people { display: flex; flex-direction: column; gap: 8px; }
.perm-person { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; font-family: inherit; }
.perm-person:hover { border-color: var(--hazard); }
.perm-person.active { border-color: var(--hazard); background: var(--hazard-tint); box-shadow: 0 0 0 2px rgba(226,116,10,.18); }
.perm-person:focus-visible { outline: 3px solid rgba(226,116,10,.5); outline-offset: 2px; }
.perm-person-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.perm-person-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.perm-tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.perm-tag-extra { background: #E7F5EC; color: #1D7A46; }
.perm-tag-removed { background: #FBEAE7; color: #B4372A; }
.perm-tag-gray { background: #EEF1F6; color: var(--steel); }
.perm-editor { min-width: 0; }
.perm-empty { padding: 22px; border: 1px dashed var(--line); border-radius: 6px; color: var(--steel); text-align: center; }
.perm-editor-head { margin-bottom: 14px; }
.perm-editor-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 19px; margin-bottom: 6px; }
.perm-preview { padding: 10px 14px; border-radius: 6px; background: var(--paper); font-size: 14px; color: var(--ink); }
.perm-group { margin: 0 0 14px; padding: 4px 14px 8px; border: 1px solid var(--line); border-radius: 6px; }
.perm-group legend { padding: 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--hazard-deep); }
.perm-row { display: flex; align-items: flex-start; gap: 12px; min-height: 56px; padding: 10px 2px; border-bottom: 1px solid #EEF1F6; cursor: pointer; }
.perm-row:last-child { border-bottom: 0; }
.perm-row input[type="checkbox"] { flex-shrink: 0; width: 24px; height: 24px; margin-top: 2px; accent-color: var(--hazard); cursor: pointer; }
.perm-row.locked { opacity: .6; cursor: not-allowed; }
.perm-row.locked input { cursor: not-allowed; }
.perm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.perm-text strong { font-size: 14.5px; }
.perm-text small { font-size: 12.5px; color: var(--steel); line-height: 1.4; }
.perm-actions { margin-top: 10px; }
@media (max-width: 860px) { .perm-layout { grid-template-columns: 1fr; } .perm-people { flex-direction: row; flex-wrap: wrap; } .perm-person { width: auto; flex: 1 1 200px; } }
@media (max-width: 720px) { .perm-group { padding: 4px 10px 8px; } }
@media (max-width: 960px), (pointer: coarse) { .rec-order select { min-height: 44px; } }

/* Summary: the Site selector beside the period; the per-site table's site names are buttons */
.sum-controls #sum-site { min-width: 250px; max-width: 360px; }
.sum-controls select { min-height: 40px; }
#site-summary-body .link-btn { padding: 10px 0; text-align: left; color: var(--ink); background: none; border: 0; cursor: pointer; font: inherit; }
#site-summary-body .link-btn:hover strong, #site-summary-body .link-btn:focus-visible strong { color: var(--hazard-deep); text-decoration: underline; }
#sum-sites-card[hidden] { display: none; }
@media (max-width: 720px) { .sum-controls #sum-site { max-width: none; width: 100%; } }
@media (max-width: 960px), (pointer: coarse) { .sum-controls select { min-height: 44px; } }
.login-agree { margin: 14px 4px 0; font-size: 12.5px; line-height: 1.5; text-align: center; color: var(--steel); }
.login-agree a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 3px; font-weight: 700; color: var(--hazard-deep); text-decoration: underline; text-underline-offset: 3px; }

/* Mileage */
.mileage-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.records-note { margin: 10px 2px 0; }
.records-note[hidden] { display: none; }
#u-role[aria-invalid="true"], #f-site[aria-invalid="true"] { border-color: var(--danger, #C0392B); box-shadow: 0 0 0 3px rgba(192,57,43,.15); }

/* ── Loads breakup as a table: Sl No · Name · Material · Location · Loads · Rate · Amount ───────── */
.pg-section { margin-top: 22px; padding: 16px 18px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.lp-table { margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.lp-table .lp-thead, .lp-table .lp-row, .lp-table .lp-foot {
  display: grid; grid-template-columns: 52px minmax(120px, 1.5fr) minmax(100px, 1.1fr) minmax(100px, 1.2fr) 84px 100px 116px 40px; gap: 8px; align-items: center; padding: 8px 12px;
}
.lp-thead { background: #F8FAFC; border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--steel); }
.lp-table .lp-rows { display: block; margin: 0; }
.lp-table .lp-row { border-bottom: 1px solid var(--line); }
.lp-table .lp-row:last-child { border-bottom: 0; }
.lp-sl { text-align: center; font-weight: 700; color: var(--steel); }
.lp-f { display: block; margin: 0; min-width: 0; }
.lp-fl { display: none; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--steel); margin-bottom: 4px; }
.lp-table .lp-row input { width: 100%; min-width: 0; background: #fff; }
.lp-amount { display: block; text-align: right; padding-right: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-foot { background: #FFF3E6; border-top: 1.5px solid var(--hazard); font-weight: 800; }
.lp-foot[hidden] { display: none; }
.lp-foot-label { grid-column: 1 / 5; text-align: right; padding-right: 6px; }
.lp-foot-loads { grid-column: 5; padding-left: 12px; }
.lp-foot-amount { grid-column: 7; text-align: right; padding-right: 8px; font-variant-numeric: tabular-nums; }
@media (max-width: 960px), (pointer: coarse) {
  .lp-table .lp-thead { display: none; }
  .lp-table .lp-row { grid-template-columns: 1fr 1fr; padding: 14px 12px 12px; position: relative; row-gap: 10px; }
  .lp-sl { grid-column: 1 / -1; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding-right: 48px; }
  .lp-sl::before { content: 'Line '; }
  .lp-fl { display: block; }
  .lp-f-name { grid-column: 1 / -1; }
  .lp-f-amount { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; background: #F8FAFC; border-radius: 6px; padding: 8px 12px; }
  .lp-f-amount .lp-fl { margin: 0; }
  .lp-table .lp-del { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; }
  .lp-table .lp-foot { grid-template-columns: 1fr auto; }
  .lp-foot-label { grid-column: 1; text-align: left; } .lp-foot-loads, .lp-foot-amount { grid-column: 2; padding: 0; text-align: right; }
  .lp-foot-amount::before { content: '₹ '; }
  .lp-foot { row-gap: 4px; } .lp-foot-loads::before { content: 'Loads: '; font-weight: 600; color: var(--steel); }
}

/* ── Site Working Progress Images: adding (Data Entry) ───────────────────────────────────────── */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 12px; }
.pg-grid:empty { display: none; }
.pg-item { display: flex; flex-direction: column; gap: 6px; }
.pg-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #E9EDF3; border: 1px solid var(--line); }
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-item.is-busy .pg-thumb img { opacity: .55; }
.pg-x { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(27,36,51,.78); color: #fff; font-size: 15px; cursor: pointer; }
.pg-x:disabled { opacity: .5; cursor: default; }
.pg-cap { width: 100%; font-size: 13px; padding: 8px 10px; }
.pg-st { font-size: 12px; color: var(--steel); }
.pg-st.is-bad { color: var(--brick); font-weight: 700; }

/* ── Progress tab (Owner + Admin) ──────────────────────────────────────────────────────────────── */
.pgv-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 6px; }
.pgv-day { font-size: 16px; margin: 22px 0 10px; }
.pgv-day span { font-weight: 500; color: var(--steel); }
.pgv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.pgv-card { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.pgv-img { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: #EEF1F6; cursor: zoom-in; }
.pgv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pgv-missing { display: grid; place-items: center; height: 100%; color: var(--steel); font-size: 13px; }
.pgv-card figcaption { padding: 10px 12px; font-size: 13px; line-height: 1.45; flex: 1; overflow-wrap: anywhere; }
.pgv-del { margin: 0 12px 12px; }
@media (max-width: 720px) { .pgv-filters { grid-template-columns: 1fr; } .pgv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 960px), (pointer: coarse) { .pgv-del, .pg-cap, #pg-add { min-height: 44px; } .pg-x { width: 44px; height: 44px; } }

/* what a person may not use is hidden */
body:not(.can-progress-add) .perm-progress-add { display: none !important; }
body:not(.can-progress-view) .perm-progress-view { display: none !important; }
body:not(.can-progress-delete) .perm-progress-delete { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════════
   Payments ledger — Company · Outside Rental · Cumulative
   ═══════════════════════════════════════════════════════════════════════════════ */
body:not(.can-payments-add) .perm-payments-add { display: none !important; }
body:not(.can-payments-view) .perm-payments-view { display: none !important; }
body:not(.can-payments-edit) .perm-payments-edit { display: none !important; }

.pl-head { margin: 2px 2px 16px; }
.pl-title { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: .2px; color: var(--ink); }
.pl-sub { margin: 4px 0 0; color: var(--steel); font-size: 14px; }

/* who we are paying: a segmented control */
.pl-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; margin-bottom: 20px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 2px rgba(27,36,51,.04); }
.pl-seg-btn { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 18px; border: 0; border-radius: 6px; background: transparent; color: var(--steel); font: 700 14.5px var(--font-body); cursor: pointer; transition: background .15s, color .15s; }
.pl-seg-btn svg { width: 18px; height: 18px; flex: none; }
.pl-seg-btn:hover { background: var(--paper); color: var(--ink); }
.pl-seg-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(226,116,10,.35); }
.pl-seg-btn.active { background: var(--ink); color: #fff; box-shadow: 0 2px 6px rgba(27,36,51,.25); }

/* the three headline figures */
.pl-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.pl-stat { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 15px 22px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 2px rgba(27,36,51,.04); overflow: hidden; }
.pl-stat::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--steel-light); }
.pl-s-payable::before { background: var(--ink); } .pl-s-paid::before { background: var(--moss); }
.pl-s-bal.pl-s-due::before { background: var(--hazard); } .pl-s-bal.pl-s-settled::before { background: var(--moss); } .pl-s-bal.pl-s-over::before { background: var(--sky); }
.pl-lbl { font-size: 12px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--steel); }
.pl-val { font-family: var(--font-display); font-size: 31px; font-weight: 800; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pl-s-bal.pl-s-due .pl-val { color: var(--hazard-deep); } .pl-s-bal.pl-s-settled .pl-val { color: var(--moss); } .pl-s-bal.pl-s-over .pl-val { color: var(--sky); }
.pl-note { font-size: 12.5px; color: var(--steel-light); }

/* cards on this screen */
.pl-card { margin-bottom: 20px; padding: 20px 22px 22px; }
.pl-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pl-card-title { display: flex; gap: 14px; align-items: center; }
.pl-card-title h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--ink); }
.pl-card-title p { margin: 3px 0 0; font-size: 13px; color: var(--steel); max-width: 62ch; }
.pl-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 6px; background: var(--hazard-tint); color: var(--hazard-deep); }
.pl-ic svg { width: 20px; height: 20px; }
.pl-h4 { margin: 4px 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--steel); }

/* entering lines: a ledger grid */
.pl-grid { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; margin-bottom: 14px; }
.pl-grid .pl-thead, .pl-grid .pl-row, .pl-grid .pl-foot {
  display: grid; grid-template-columns: 52px minmax(130px, 1.3fr) minmax(110px, 1fr) minmax(130px, 1.4fr) 118px 118px 124px 40px; gap: 8px; align-items: center; padding: 8px 12px;
}
.pl-thead { background: #F8FAFC; border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--steel); }
.pl-thead .r, .pl-foot .r { text-align: right; }
.pl-grid .pl-row { border-bottom: 1px solid var(--line); }
.pl-grid .pl-row input { width: 100%; min-width: 0; background: #fff; }
.pl-f { display: block; margin: 0; min-width: 0; }
.pl-fl { display: none; font-size: 11.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--steel); margin-bottom: 4px; }
.pl-sl { text-align: center; font-weight: 700; color: var(--steel); }
.pl-balance { display: block; text-align: right; padding-right: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pl-rm { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--steel-light); font-size: 15px; cursor: pointer; }
.pl-rm:hover { background: var(--brick-tint); color: var(--brick); }
.pl-foot { background: #FFF3E6; border-top: 1.5px solid var(--hazard); font-weight: 800; font-variant-numeric: tabular-nums; }
.pl-foot-label { grid-column: 1 / 5; text-align: right; padding-right: 6px; }
.pl-foot .r { padding-right: 8px; }
.pl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pl-bal-due { color: var(--hazard-deep); font-weight: 800; } .pl-bal-settled { color: var(--moss); font-weight: 800; } .pl-bal-over { color: var(--sky); font-weight: 800; }

/* the saved ledger */
.pl-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.pl-toolbar input[type="search"] { flex: 1 1 260px; min-width: 0; }
.pl-toolbar select { flex: 0 0 190px; }
.pl-wrap { border: 1px solid var(--line); border-radius: 6px; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pl-table th { padding: 11px 14px; background: #F8FAFC; border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; text-align: left; color: var(--steel); white-space: nowrap; }
.pl-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pl-table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-table tbody tr:hover { background: #FBFCFE; }
.pl-desc-cell { max-width: 320px; color: var(--steel); overflow-wrap: anywhere; } .pl-none { color: var(--steel-light); }
.pl-chip { display: inline-block; margin-left: 9px; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .3px; vertical-align: middle; }
.pl-chip-due { background: var(--hazard-tint); color: var(--hazard-deep); } .pl-chip-settled { background: var(--moss-tint); color: var(--moss); } .pl-chip-over { background: var(--sky-tint); color: var(--sky); }
.pl-act { white-space: nowrap; text-align: right !important; }
.pl-danger { color: var(--brick); }
.pl-table tfoot td, .pl-table .pl-total td { background: #FFF3E6; border-top: 1.5px solid var(--hazard); font-weight: 800; }
.pl-table .pl-subtotal td { background: #FFF8F0; font-weight: 800; }
.pl-table .pl-sec th { padding: 12px 14px; background: #FDECD8; border-bottom: 1.5px solid var(--hazard); color: var(--hazard-deep); font-size: 12.5px; letter-spacing: .7px; }

/* cumulative: the three summary blocks */
.pl-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.pl-kind { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--steel-light); border-radius: 6px; box-shadow: 0 1px 2px rgba(27,36,51,.04); }
.pl-k-company { border-top-color: var(--ink); } .pl-k-outside { border-top-color: var(--hazard); } .pl-k-all { border-top-color: var(--moss); background: #FBFDFB; }
.pl-kind h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--ink); }
.pl-kind dl { margin: 0; display: grid; gap: 7px; }
.pl-kind dl > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pl-kind dt { font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--steel); }
.pl-kind dd { margin: 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-kind .pl-kind-bal { padding-top: 8px; border-top: 1px dashed var(--line); } .pl-kind .pl-kind-bal dd { font-size: 21px; font-weight: 800; }
.pl-kind .pl-kind-bal.pl-s-due dd { color: var(--hazard-deep); } .pl-kind .pl-kind-bal.pl-s-settled dd { color: var(--moss); } .pl-kind .pl-kind-bal.pl-s-over dd { color: var(--sky); }
.pl-kind p { margin: 10px 0 0; font-size: 12.5px; color: var(--steel-light); }
.pl-edit-balance { display: block; padding: 10px 12px; border-radius: 6px; background: #F8FAFC; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }

/* tablets and phones */
@media (max-width: 960px), (pointer: coarse) {
  .pl-cards, .pl-kinds { grid-template-columns: 1fr; gap: 12px; }
  .pl-val { font-size: 27px; }
  .pl-seg { display: flex; width: 100%; } .pl-seg-btn { flex: 1 1 100%; justify-content: center; }
  .pl-card { padding: 16px; }
  .pl-grid .pl-thead { display: none; }
  .pl-grid .pl-row { grid-template-columns: 1fr 1fr; padding: 14px 12px 12px; position: relative; row-gap: 10px; }
  .pl-sl { grid-column: 1 / -1; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding-right: 48px; } .pl-sl::before { content: 'Line '; }
  .pl-fl { display: block; }
  .pl-f-name, .pl-f-item, .pl-f-desc, .pl-f-bal { grid-column: 1 / -1; }
  .pl-f-bal { display: flex; align-items: center; justify-content: space-between; background: #F8FAFC; border-radius: 6px; padding: 8px 12px; } .pl-f-bal .pl-fl { margin: 0; }
  .pl-grid .pl-rm { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; }
  .pl-grid .pl-foot { grid-template-columns: 1fr auto; row-gap: 4px; } .pl-foot-label { grid-column: 1 / -1; text-align: left; }
  .pl-foot .r { grid-column: 2; } .pl-foot .r::before { content: attr(data-l); }
  .pl-actions .btn, .pl-toolbar select, .pl-toolbar input[type="search"] { min-height: 44px; } .pl-actions .btn { flex: 1 1 100%; }
  .pl-toolbar select { flex: 1 1 100%; }
}
@media (max-width: 720px) {
  .pl-table thead { display: none; }
  .pl-table, .pl-table tbody, .pl-table tfoot, .pl-table tr { display: block; width: 100%; }
  .pl-table tbody tr { margin: 0; padding: 12px 14px; border-bottom: 8px solid #F1F4F8; }
  .pl-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 5px 0; border: 0; text-align: right; }
  .pl-table td::before { content: attr(data-label); flex: none; font-size: 11.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--steel); text-align: left; }
  .pl-table td[data-label=""]::before { content: none; }
  .pl-table .pl-desc-cell { max-width: none; }
  .pl-table .pl-act { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; } .pl-table .pl-act::before { content: none; } .pl-act .btn { min-height: 44px; flex: 1; }
  .pl-table tr.pl-sec { padding: 0; border: 0; } .pl-table .pl-sec th { display: block; }
  .pl-table tfoot tr, .pl-table tr.pl-total, .pl-table tr.pl-subtotal { padding: 12px 14px; background: #FFF3E6; border-bottom: 0; }
  .pl-table tr.pl-subtotal { background: #FFF8F0; }
  .pl-table tfoot td, .pl-table .pl-total td, .pl-table .pl-subtotal td { background: none; border: 0; }
  .pl-table td[colspan] { justify-content: flex-start; font-weight: 800; }
  .pl-table .empty-row td { display: block; text-align: center; }
}

/* Payments: finishing touches */
.pl-toolbar input[type="search"], .pl-toolbar select { min-height: 44px; padding: 10px 14px; font-size: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pl-toolbar input[type="search"]:focus, .pl-toolbar select:focus { outline: none; border-color: var(--hazard); box-shadow: 0 0 0 3px rgba(226,116,10,.18); }
.pl-table td.r > span { white-space: nowrap !important; }
@media (max-width: 720px) {
  .pl-table td.r { flex-wrap: wrap; row-gap: 4px; }
  .pl-table td.r .pl-chip { margin-left: 0; }
  .pl-table td[data-label="Balance"] { align-items: center; }
}
.pl-table .pl-sec th { white-space: normal; overflow-wrap: anywhere; }
.pl-kind dd, .pl-val { overflow-wrap: anywhere; }
.pl-kind dl > div { flex-wrap: wrap; }
@media (max-width: 720px) {
  .pl-table tfoot td, .pl-table tr.pl-total td, .pl-table tr.pl-subtotal td { display: flex !important; justify-content: space-between; align-items: baseline; gap: 14px; padding: 5px 0; }
  .pl-table tfoot td[colspan], .pl-table tr.pl-total td[colspan], .pl-table tr.pl-subtotal td[colspan] { justify-content: flex-start; font-size: 14.5px; }
  .pl-table tfoot td[data-label=""]:empty, .pl-table tr td:empty { display: none !important; }
}

/* ── Payments: Date and Paid By columns, and the search filters ─────────────────────────────────── */
.pl-grid .pl-thead, .pl-grid .pl-row, .pl-grid .pl-foot {
  grid-template-columns: 46px 134px minmax(118px, 1.2fr) minmax(96px, 1fr) minmax(118px, 1.2fr) 104px 104px 108px minmax(100px, .9fr) 36px;
}
.pl-foot-label { grid-column: 1 / 6; }
.pl-grid .pl-row input[type="date"] { padding-left: 8px; padding-right: 6px; }
.pl-date-cell { white-space: nowrap; }
.pl-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 14px; align-items: end; margin-bottom: 16px; padding: 14px; background: #F8FAFC; border: 1px solid var(--line); border-radius: 6px; }
.pl-flt-search { grid-column: span 2; }
.pl-flt span { display: block; margin-bottom: 5px; font-size: 11.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--steel); }
.pl-flt input, .pl-flt select { width: 100%; min-height: 44px; padding: 10px 12px; font-size: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pl-flt input:focus, .pl-flt select:focus { outline: none; border-color: var(--hazard); box-shadow: 0 0 0 3px rgba(226,116,10,.18); }
.pl-flt-clear { min-height: 44px; }
@media (max-width: 720px) { .pl-flt-search { grid-column: 1 / -1; } .pl-filters { grid-template-columns: 1fr 1fr; } .pl-flt-clear { grid-column: 1 / -1; } }

/* the entry grid has nine fields now, so it becomes one card per line on anything narrower than a wide desktop */
@media (max-width: 1180px), (pointer: coarse) {
  .pl-grid .pl-thead { display: none; }
  .pl-grid .pl-row { grid-template-columns: 1fr 1fr; padding: 14px 12px 12px; position: relative; row-gap: 10px; }
  .pl-sl { grid-column: 1 / -1; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding-right: 48px; } .pl-sl::before { content: 'Line '; }
  .pl-fl { display: block; }
  .pl-f-item, .pl-f-desc, .pl-f-bal, .pl-f-by { grid-column: 1 / -1; }
  .pl-f-bal { display: flex; align-items: center; justify-content: space-between; background: #F8FAFC; border-radius: 6px; padding: 8px 12px; } .pl-f-bal .pl-fl { margin: 0; }
  .pl-grid .pl-rm { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; }
  .pl-grid .pl-foot { grid-template-columns: 1fr auto; row-gap: 4px; }
  .pl-foot-label { grid-column: 1 / -1; text-align: left; } .pl-foot .r { grid-column: 2; } .pl-foot .r::before { content: attr(data-l); }
  .pl-foot > span[aria-hidden] { display: none; }
  .pl-grid .pl-row input, .pl-grid .pl-row input[type="date"] { min-height: 44px; }
}

/* Payments ledger: ten columns have to fit, so the table is a little tighter and the status chip sits under the balance */
.pl-wrap { overflow-x: auto; }
.pl-table { font-size: 13.5px; }
.pl-table th { padding: 10px 10px; }
.pl-table td { padding: 11px 10px; }
.pl-desc-cell { max-width: 210px; }
.pl-table td.r .pl-chip { display: table; margin: 5px 0 0 auto; }
.pl-act .btn { padding-left: 11px; padding-right: 11px; }
.pl-filters { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
@media (max-width: 720px) {
  .pl-table td.r .pl-chip { display: inline-block; margin: 0; }
  .pl-filters { grid-template-columns: 1fr 1fr; }
}
.pl-flt { min-width: 0; }
.pl-flt input, .pl-flt select { min-width: 0; max-width: 100%; box-sizing: border-box; }
@media (max-width: 480px) { .pl-filters { grid-template-columns: 1fr; } }
@media (max-width: 1180px), (pointer: coarse) { .pl-f-date { grid-column: 1 / -1; } }

/* ═══════════════════════════════════════════════════════════════════════════════
   Renewals, the reminder bell, and the reminder settings
   ═══════════════════════════════════════════════════════════════════════════════ */
body:not(.can-renewals-add) .perm-renewals-add { display: none !important; }

/* the bell (header) */
.bell-wrap { position: relative; margin-left: 10px; flex-shrink: 0; }
.bell-wrap[hidden] { display: none; }
.bell-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s; }
.bell-btn svg { width: 22px; height: 22px; }
.bell-btn:hover { background: var(--paper); }
.bell-btn:focus-visible { outline: 3px solid rgba(226,116,10,.5); outline-offset: 2px; }
.bell-btn.has-unread { border-color: var(--hazard); color: var(--hazard-deep); background: var(--hazard-tint); }
.bell-btn.has-unread svg { animation: bell-ring 2.4s ease-in-out infinite; transform-origin: 50% 4px; }
@keyframes bell-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .bell-btn.has-unread svg { animation: none; } }
.bell-count { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--brick); color: #fff; font: 800 11.5px/20px var(--font-body); text-align: center; box-shadow: 0 0 0 2px #fff; }
.bell-count[hidden] { display: none; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 80; width: min(400px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 18px 48px rgba(27,36,51,.22); overflow: hidden; }
.bell-panel[hidden] { display: none; }
.bell-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #F8FAFC; }
.bell-head strong { display: block; font-family: var(--font-display); font-size: 17px; color: var(--ink); }
.bell-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--steel); }
.bell-list { overflow-y: auto; flex: 1; }
.bell-item { position: relative; display: flex; gap: 12px; width: 100%; padding: 13px 16px 13px 18px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.bell-item::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--steel-light); }
.bell-overdue::before { background: var(--brick); } .bell-today::before { background: var(--hazard-deep); } .bell-soon::before { background: var(--hazard); }
.bell-item:hover, .bell-item:focus-visible { background: #FBFCFE; outline: none; }
.bell-item.is-unread { background: #FFF9F2; }
.bell-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: transparent; border: 2px solid var(--line); }
.bell-item.is-unread .bell-dot { background: var(--hazard); border-color: var(--hazard); }
.bell-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bell-main strong { font-size: 15px; color: var(--ink); }
.bell-when { font-size: 13.5px; font-weight: 700; color: var(--hazard-deep); }
.bell-overdue .bell-when { color: var(--brick); }
.bell-desc { font-size: 13px; color: var(--steel); overflow-wrap: anywhere; }
.bell-main small { font-size: 12px; color: var(--steel-light); }
.bell-empty { margin: 0; padding: 30px 18px; text-align: center; color: var(--steel); }
.bell-foot { padding: 12px 16px 14px; border-top: 1px solid var(--line); background: #F8FAFC; }
.bell-foot p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--steel); }
.bell-foot .bell-device-note { margin: 8px 0 0; }
.bell-foot .btn { min-height: 44px; }
@media (max-width: 960px) {
  .bell-wrap { margin-left: auto; margin-right: 8px; }
  .bell-wrap + .menu-btn { margin-left: 0; }
  .bell-wrap { position: static; }
  .bell-panel { position: fixed; left: 10px; right: 10px; top: 68px; width: auto; max-height: calc(100vh - 84px); }
}

/* the Renewals screen */
.rn-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.rn-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 16px 18px 15px 22px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 2px rgba(27,36,51,.04); overflow: hidden; }
.rn-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--steel-light); }
.rn-c-overdue::before { background: var(--brick); } .rn-c-today::before { background: var(--hazard-deep); } .rn-c-soon::before { background: var(--hazard); } .rn-c-upcoming::before { background: var(--moss); }
.rn-num { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1.1; color: var(--ink); }
.rn-c-overdue .rn-num { color: var(--brick); } .rn-c-today .rn-num, .rn-c-soon .rn-num { color: var(--hazard-deep); }
.rn-note { margin: 0 2px 18px; padding: 11px 14px; border-radius: 6px; background: #FFF8F0; border: 1px solid #F5D3A8; color: #6B3A00; font-size: 13.5px; line-height: 1.5; }
.rn-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rn-wide { grid-column: 1 / -1; }
.rn-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.rn-chosen { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.rn-chosen li { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; background: #F8FAFC; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.rn-chosen-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rn-chosen small { color: var(--steel); }
.rn-filters { margin-bottom: 14px; }
.rn-table td.rn-docs { max-width: 280px; }
.rn-file { display: inline-flex; align-items: center; margin: 0 6px 6px 0; border: 1px solid var(--line); border-radius: 5px; background: #fff; max-width: 100%; }
.rn-file-btn { display: inline-flex; gap: 5px; align-items: center; min-height: 32px; padding: 4px 9px; border: 0; background: none; color: var(--ink); font: 600 12.5px var(--font-body); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.rn-file-btn:hover { color: var(--hazard-deep); text-decoration: underline; }
.rn-file-x { min-width: 32px; min-height: 32px; padding: 0 8px; border: 0; background: none; color: var(--steel-light); cursor: pointer; border-radius: 8px; }
.rn-file-x:hover { color: var(--brick); background: var(--brick-tint); }
.rn-adddoc { display: inline-flex; align-items: center; min-height: 32px; margin-bottom: 6px; padding: 4px 10px; border: 1px dashed var(--steel-light); border-radius: 5px; background: none; color: var(--steel); font: 700 12.5px var(--font-body); cursor: pointer; }
.rn-adddoc:hover { border-color: var(--hazard); color: var(--hazard-deep); }
.rn-chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; letter-spacing: .3px; }
.rn-chip-overdue { background: var(--brick-tint); color: var(--brick); } .rn-chip-today { background: #FFE2C2; color: var(--hazard-deep); } .rn-chip-soon { background: var(--hazard-tint); color: var(--hazard-deep); }
.rn-chip-upcoming { background: var(--moss-tint); color: var(--moss); } .rn-chip-renewed { background: var(--sky-tint); color: var(--sky); }
.rn-when { display: block; margin-top: 5px; font-size: 12.5px; color: var(--steel); white-space: nowrap; }
.rn-overdue td:first-child { box-shadow: inset 4px 0 0 var(--brick); } .rn-today td:first-child { box-shadow: inset 4px 0 0 var(--hazard-deep); } .rn-soon td:first-child { box-shadow: inset 4px 0 0 var(--hazard); }
@keyframes rn-flash { 0%, 100% { background: transparent; } 20%, 70% { background: #FFF1DB; } }
.rn-flash td { animation: rn-flash 3s ease-in-out; }
.rn-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.rn-quick .btn { min-height: 40px; }

/* the reminder settings (Permissions tab) */
.rs-card { margin-top: 20px; }
.rs-grid { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(240px, 1.2fr) minmax(240px, 1.2fr); gap: 18px 24px; align-items: end; margin: 16px 0 6px; }
.rs-field label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--steel); }
.rs-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-inline input[type="number"] { width: 92px; min-height: 44px; }
.rs-inline select { min-height: 44px; min-width: 96px; }
.rs-inline span { color: var(--steel); font-size: 14px; }
.rs-switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 600; }
.rs-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rs-track { position: relative; flex: none; width: 48px; height: 28px; border-radius: 99px; background: var(--steel-light); transition: background .15s; }
.rs-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.rs-switch input:checked + .rs-track { background: var(--moss); } .rs-switch input:checked + .rs-track::after { transform: translateX(20px); }
.rs-switch input:focus-visible + .rs-track { outline: 3px solid rgba(226,116,10,.5); outline-offset: 2px; }
.rs-preview { margin: 12px 0 4px; padding: 12px 14px; border-radius: 6px; background: #F8FAFC; border: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--ink); }
.rs-preview.is-bad { background: var(--brick-tint); border-color: var(--brick); color: var(--brick); }

@media (max-width: 1100px) { .rn-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rn-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rs-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .rn-cards { gap: 10px; } .rn-num { font-size: 28px; } .rn-form { grid-template-columns: 1fr; }
  .rn-pick .btn, .rn-quick .btn { min-height: 44px; } .rn-file-btn, .rn-file-x, .rn-adddoc { min-height: 44px; } .rn-file-x { min-width: 44px; }
  .rn-table td.rn-docs { max-width: none; display: block; text-align: left; } .rn-table td.rn-docs::before { display: block; margin-bottom: 6px; }
  .rn-when { display: inline; margin-left: 8px; } .rn-overdue td:first-child, .rn-today td:first-child, .rn-soon td:first-child { box-shadow: none; }
  .rn-overdue, .rn-today, .rn-soon { border-left: 5px solid var(--hazard); } .rn-overdue { border-left-color: var(--brick); }
  .rs-inline input[type="number"] { width: 100px; } .rs-card .btn-group .btn { flex: 1 1 100%; min-height: 44px; }
}
@media print { .bell-wrap { display: none !important; } }

/* twelve tabs: a little tighter on desktop so that they all fit on a normal laptop screen */
@media (min-width: 961px) {
  .tabs { gap: 2px; }
  .tab { padding: 13px 10px; gap: 6px; font-size: 13px; }
  .tab svg { width: 16px; height: 16px; }
}

/* Renewals table: cells wrap (a long description never spills over the next column) and the buttons stack */
.rn-table td { white-space: normal; vertical-align: top; }
.rn-table td.r { white-space: nowrap; }
.rn-table td.pl-desc-cell { min-width: 170px; max-width: 240px; overflow-wrap: anywhere; }
.rn-table td.rn-docs { min-width: 210px; max-width: 270px; }
.rn-table td.pl-act { min-width: 122px; width: 1%; text-align: left !important; }
.rn-table .pl-act .btn { display: block; width: 100%; margin: 0 0 6px; white-space: nowrap; text-align: center; }
.rn-table .pl-act .btn:last-child { margin-bottom: 0; }
.rn-table th.pl-act { text-align: left; }
.rn-table td.pl-date-cell { white-space: nowrap; }
@media (max-width: 720px) {
  .rn-table td.pl-desc-cell, .rn-table td.rn-docs { min-width: 0; max-width: none; }
  .rn-table td.pl-act { width: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .rn-table .pl-act .btn { width: auto; flex: 1 1 40%; margin: 0; }
}
.rs-inline select { width: auto; flex: 0 0 auto; }
.rs-inline input[type="number"] { flex: 0 0 auto; }

/* ═══════════════════════════════════════════════════════════════════════════════
   DESIGN LAYER — "site office"
   Flat, structured and calm: thin borders, small corners, no shadows or gradients, one accent colour.
   (This block only changes how things LOOK. Nothing here changes what the app does.)
   ═══════════════════════════════════════════════════════════════════════════════ */
:root {
  --ink: #1B2127; --steel: #566170; --steel-light: #8A94A2;
  --paper: #F2F3F5; --panel: #FFFFFF; --line: #DADFE5;
  --hazard: #E2740A; --hazard-deep: #A84F00; --hazard-tint: #FDF1E3; --hazard-mid: #F0C99B;
  --accent: #C05800; --accent-hover: #A04A00;
  --moss: #1E7A4C; --moss-tint: #E7F3EC; --brick: #B3261E; --brick-tint: #FBEAE8; --sky: #1F5FA8; --sky-tint: #E5EDF7;
  --radius: 6px; --shadow: none; --shadow-lg: 0 14px 36px rgba(17,24,32,.24);
  --font-body: 'IBM Plex Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --side-w: 248px; --bar-h: 60px; --side-bg: #1C2228;
}
body { background: var(--paper); background-image: none; font-size: 14px; line-height: 1.5; letter-spacing: 0; }
::selection { background: #F6D7B5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── cards ── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 20px 22px; margin-bottom: 16px; }
.card-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.card-title { font-family: var(--font-body); font-size: 15.5px; font-weight: 600; letter-spacing: 0; color: var(--ink); gap: 10px; }
.card-title .ic { width: auto; height: auto; padding: 0; background: none; border: 0; border-radius: 0; color: var(--steel); box-shadow: none; }
.card-title .ic svg { width: 18px; height: 18px; }
.pl-ic { width: auto; height: auto; background: none; color: var(--steel); }
.pl-ic svg { width: 18px; height: 18px; }
.pl-card, .rs-card { padding: 20px 22px; }
.pl-card-head { margin-bottom: 14px; padding-bottom: 12px; }
.pl-card-title { gap: 10px; align-items: flex-start; }
.pl-card-title h3 { font-family: var(--font-body); font-size: 15.5px; font-weight: 600; letter-spacing: 0; }
.pl-card-title p { font-size: 13px; }
.pl-title { font-family: var(--font-body); font-size: 22px; font-weight: 600; letter-spacing: -.2px; }
.pl-sub { font-size: 13.5px; }
.pl-head { margin-bottom: 14px; }
.form-hint, .form-group small { color: var(--steel); }

/* ── buttons ── */
.btn { border-radius: 5px; font-weight: 600; letter-spacing: 0; box-shadow: none; background-image: none; translate: none; }
.btn:active { translate: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: none; background-image: none; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: none; }
.btn-outline { background: #fff; border: 1px solid #C2C9D2; color: var(--ink); box-shadow: none; }
.btn-outline:hover:not(:disabled) { background: #F3F4F6; border-color: #97A1AE; color: var(--ink); }
.btn-danger { background: #fff; border: 1px solid #E0B4AF; color: var(--brick); box-shadow: none; }
.btn-danger:hover:not(:disabled) { background: var(--brick-tint); border-color: var(--brick); color: var(--brick); }
.btn-green { background: var(--moss); border-color: var(--moss); color: #fff; box-shadow: none; background-image: none; }
.btn .ico, .ico { width: 16px; height: 16px; flex: none; display: block; }
.btn:disabled, .btn[disabled] { opacity: .5; }
@media (pointer: fine) and (min-width: 961px) {
  .btn { min-height: 36px; padding: 7px 16px; font-size: 13.5px; }
  .btn-sm { min-height: 30px; padding: 4px 11px; font-size: 12.5px; }
}

/* ── forms ── */
input[type="text"], input[type="date"], input[type="number"], input[type="password"], input[type="search"], select, textarea {
  border: 1px solid #BFC7D1; border-radius: 5px; background: #fff; color: var(--ink); box-shadow: none; font-size: 14px;
}
@media (pointer: fine) and (min-width: 961px) { input[type="text"], input[type="date"], input[type="number"], input[type="password"], input[type="search"], select { padding: 8px 11px; min-height: 38px; } textarea { padding: 8px 11px; } }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(192,88,0,.16); background: #fff; }
input::placeholder, textarea::placeholder { color: #98A1AD; }
.form-group label, .pl-flt span, .rs-field label, .login-field label { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #3B4652; }
.form-error { font-size: 13px; }

/* ── tables ── */
.table-wrap { border-radius: var(--radius); }
table th, .pl-table th { background: #F3F4F6; color: #46515E; font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; border-bottom: 1px solid var(--line); }
table td, .pl-table td { border-bottom: 1px solid #E8EBEF; }
tbody tr:hover { background: #FAFAFB; }
.pl-wrap { border-radius: var(--radius); border-color: var(--line); }
.pl-table tfoot td, .pl-table .pl-total td { background: #F3F4F6; border-top: 1px solid #B9C1CB; }
.pl-table .pl-subtotal td { background: #F8F9FA; }
.pl-table .pl-sec th { background: #EEF0F3; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 12.5px; letter-spacing: 0; }

/* ── labels, badges and status chips: small, square-cornered ── */
.badge { border-radius: 3px; background: #ECEFF3; color: #46515E; font-size: 11px; font-weight: 600; letter-spacing: .3px; padding: 2px 7px; }
[class*="pill-"], .pl-chip, .rn-chip { border-radius: 3px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; border: 1px solid transparent; }
.pill-green, .pl-chip-settled, .rn-chip-upcoming { background: var(--moss-tint); color: var(--moss); border-color: #C5E2D1; }
.pill-red, .rn-chip-overdue { background: var(--brick-tint); color: var(--brick); border-color: #F0C5C1; }
.pill-orange, .pl-chip-due, .rn-chip-soon { background: var(--hazard-tint); color: var(--hazard-deep); border-color: #F2D3AE; }
.rn-chip-today { background: #FBE3C6; color: var(--hazard-deep); border-color: #EFC38D; }
.pill-sky, .pl-chip-over, .rn-chip-renewed { background: var(--sky-tint); color: var(--sky); border-color: #C6D7EC; }
.pill-gray, .pill-own, .pill-rental { background: #ECEFF3; color: #46515E; border-color: #DCE1E7; }

/* ── figures ── */
.stat-card, .pl-stat, .rn-card, .pl-kind { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.pl-stat::before, .rn-card::before { display: none; }
.pl-stat, .rn-card { padding: 14px 16px; }
.pl-kind { border-top: 1px solid var(--line); background: #fff; padding: 16px 18px; }
.pl-k-all { background: #FAFBFB; }
.pl-kind h3 { font-family: var(--font-body); font-size: 14.5px; font-weight: 600; }
.pl-lbl, .stat-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--steel); }
.pl-val, .rn-num, .stat-val { font-family: var(--font-body); font-weight: 600; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.pl-val { font-size: 26px; } .rn-num { font-size: 28px; }
.pl-kind dt { font-size: 12.5px; letter-spacing: 0; text-transform: none; }
.rn-note { border-radius: var(--radius); background: #FBF6EE; border: 1px solid #EBD9BF; color: #5C3A10; }

/* ── payments sub-tabs: underlined, not pills ── */
.pl-seg { display: flex; gap: 2px; padding: 0; margin-bottom: 18px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.pl-seg-btn { min-height: 42px; padding: 8px 16px; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--steel); font-size: 14px; font-weight: 600; }
.pl-seg-btn:hover { background: #ECEEF1; color: var(--ink); }
.pl-seg-btn.active { background: none; color: var(--ink); box-shadow: none; border-bottom-color: var(--accent); }
.pl-seg-btn svg { width: 17px; height: 17px; }

/* ── filter bars ── */
.pl-filters, .rn-filters { background: #F7F8F9; border: 1px solid var(--line); border-radius: var(--radius); }

/* ── pop-ups ── */
.modal-overlay { background: rgba(17,24,32,.55); backdrop-filter: none; }
.modal-card { border-radius: 8px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.toast { background: #1C2228; color: #fff; border: 0; border-left: 4px solid var(--moss); border-radius: 5px; box-shadow: 0 8px 24px rgba(17,24,32,.28); font-weight: 500; }
.toast.is-error { border-left-color: #E5534B; }
.bell-btn { border-radius: 5px; border-color: #C2C9D2; }
.bell-btn.has-unread { background: #fff; border-color: var(--accent); color: var(--accent); }
.bell-count { border-radius: 3px; min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; background: var(--brick); }
.bell-panel { border-radius: 8px; box-shadow: var(--shadow-lg); }
.bell-item::before { width: 4px; }
.rn-file { border-radius: 4px; } .rn-adddoc { border-radius: 4px; }
.rn-ext { display: inline-block; min-width: 30px; padding: 1px 4px; margin-right: 7px; border-radius: 3px; background: #ECEFF3; color: #46515E; font: 700 10.5px/1.5 var(--font-body); text-align: center; letter-spacing: .3px; }

/* ── the footer ── */
.site-footer { color: var(--steel-light); }
.site-footer a { color: var(--steel); }

/* ═══════════ desktop shell: dark sidebar + slim top bar ═══════════ */
@media (min-width: 1200px) {
  .app-top { position: sticky; top: 0; z-index: 200; background: #fff; box-shadow: none; border-bottom: 1px solid var(--line); }
  .site-header { height: var(--bar-h); padding: 0 22px 0 0; gap: 0; background: #fff; border: 0; align-items: center; }
  .brand-link { width: var(--side-w); height: var(--bar-h); flex: none; padding: 0 16px; margin-right: 24px; gap: 11px; background: var(--side-bg); align-items: center; }
  .logo-box { width: 38px; height: 38px; }
  .brand h1 { color: #fff; font-size: 14.5px; letter-spacing: .6px; font-weight: 700; line-height: 1.15; }
  .brand p { color: #97A1AE; font-size: 11.5px; letter-spacing: .1px; text-transform: none; margin-top: 2px; }
  .header-date { color: var(--steel); }
  .header-user { background: none; border: 0; padding: 0 4px; font-weight: 600; }
  .tabs { position: fixed; top: var(--bar-h); left: 0; bottom: 0; width: var(--side-w); z-index: 150; flex-direction: column; gap: 1px; padding: 12px 10px 24px; background: var(--side-bg); border: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3A444F transparent; }
  .tab { padding: 10px 12px; gap: 12px; border-radius: 5px; font-size: 14px; font-weight: 500; color: #B4BDC8; }
  .tab svg { width: 18px; height: 18px; color: #8793A1; }
  .tab:hover { background: rgba(255,255,255,.06); color: #fff; }
  .tab.active { background: rgba(255,255,255,.10); color: #fff; font-weight: 600; }
  .tab.active svg { color: var(--hazard); }
  .tab::after, .tab.active::after { left: 0; right: auto; top: 9px; bottom: 9px; width: 3px; height: auto; border-radius: 2px; background: var(--hazard); transform: scaleY(0); }
  .tab.active::after { transform: scaleY(1); }
  main { margin-left: var(--side-w); padding: 26px 36px 56px; }
  .app-footer { margin-left: var(--side-w); }
  .section { max-width: 1280px; }
}
/* laptops too narrow for the sidebar: a quiet top bar of tabs */
@media (min-width: 961px) and (max-width: 1199px) {
  .site-header { background: #fff; }
  .tabs { background: #fff; border-top: 1px solid var(--line); }
  .tab { color: var(--steel); font-weight: 500; } .tab.active { color: var(--ink); font-weight: 600; }
  .tab::after { height: 2px; background: var(--accent); }
  .tab.active svg { color: var(--accent); }
}
.brand h1 { font-family: var(--font-display); }

/* ═══════════ the phone ═══════════ */
@media (max-width: 960px) {
  .site-header { background: #fff; border-bottom: 1px solid var(--line); box-shadow: none; }
  .menu-btn { border-radius: 5px; border-color: #C2C9D2; background: #fff; }
  main { padding-top: 16px; }
  .card { padding: 16px; border-radius: var(--radius); }
  .pl-seg-btn { flex: 1 1 auto; justify-content: center; border-bottom-width: 2px; }
  .mm-item { border-radius: 5px; }
}

/* ═══════════ sign-in: a steady panel (no tilt, glare or floating dust) ═══════════ */
.login-dust, .login-glare { display: none !important; }
.login-bg-img { animation: none !important; transform: none !important; }
.login-bg { transform: none !important; }
.login-shade { background: linear-gradient(90deg, rgba(20,26,32,.82), rgba(20,26,32,.55)); }
.login-card { transform: none !important; border-radius: 8px; box-shadow: 0 18px 48px rgba(0,0,0,.35); border: 0; background: #fff; }
.login-card::before, .login-card::after { display: none !important; }
.login-coin { width: 76px; height: 76px; border-radius: 0; box-shadow: none; background: none; border: 0; }
.login-coin img { width: 76px; height: 76px; border-radius: 0; box-shadow: none; }
.login-card-body h2 { font-family: var(--font-display); font-size: 19px; letter-spacing: .6px; }
.login-tagline { text-transform: none; letter-spacing: .1px; font-size: 13px; }
.login-divider { display: none; }
.login-btn { border-radius: 5px; }

/* ── finishing ── */
.brand-link { border-radius: 0; }
body::before { background: var(--side-bg) !important; background-image: none !important; height: 3px; }
.login-logo { margin-bottom: 10px; }
.login-coin img { filter: none !important; box-shadow: none !important; border-radius: 50%; }
.login-tagline { margin-bottom: 20px; color: var(--steel); }
.login-field label { display: block; margin-bottom: 6px; text-align: left; }
.login-btn { background: var(--accent) !important; background-image: none !important; box-shadow: none !important; border: 1px solid var(--accent) !important; color: #fff !important; min-height: 44px; border-radius: 5px; }
.login-btn:hover:not(:disabled) { background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; }
.login-agree { line-height: 1.65; font-size: 12.5px; color: var(--steel); }
.login-info, .login-foot { color: var(--steel); }
.pin-wrap input { border-radius: 5px; letter-spacing: 3px; }

/* ── no gradients left: the top strip is one plain line; the sign-in button is flat ── */
.app-top::before { background: var(--side-bg) !important; background-image: none !important; height: 3px; }
.login-card .login-btn { background: var(--accent) !important; background-image: none !important; box-shadow: none !important; }
.login-card .login-btn::after { display: none !important; }
.hazard-stripe { background: none; border-top: 3px solid var(--hazard); }
.login-footer { background: none; }

/* ── phones: a renewal's documents stay readable (each file on its own line) ── */
@media (max-width: 720px) {
  .rn-table td.rn-docs { display: block !important; text-align: left; }
  .rn-table td.rn-docs::before { display: block; margin-bottom: 8px; }
  .rn-table td.rn-docs .rn-file { display: flex; width: 100%; margin: 0 0 8px; }
  .rn-table td.rn-docs .rn-file-btn { flex: 1 1 auto; min-width: 0; text-align: left; align-items: center; }
  .rn-table td.rn-docs .rn-adddoc { display: flex; width: 100%; justify-content: center; }
  .rn-ext { flex: none; margin-right: 8px; }
}
@media (max-width: 720px) {
  .pl-table td::before, .table-wrap td::before { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--steel); }
}
@media (max-width: 960px) {
  .pl-seg { flex-direction: column; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .pl-seg-btn { width: 100%; min-height: 46px; justify-content: flex-start; margin: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; padding: 10px 14px; }
  .pl-seg-btn:last-child { border-bottom: 0; }
  .pl-seg-btn.active { background: #F7F8F9; border-left-color: var(--accent); border-bottom-color: var(--line); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   COLOUR PASS — white dashboard, orange highlight (the logo's orange), red for Logout and Delete
   ═══════════════════════════════════════════════════════════════════════════════ */
:root { --red-solid: #C62828; --red-solid-hover: #A81F1F; --side-bg: #FFFFFF; --hover-tint: #FDEEDB; --active-tint: #FBE3C6; }
body { background: #FFFFFF; }
.app-top::before { background: var(--hazard) !important; height: 3px; }

/* the brand: orange name on white */
.brand h1 { color: var(--hazard) !important; }
.brand p { color: var(--steel) !important; }

/* logout and delete are red, as people expect */
.logout-btn, .mm-foot .btn-outline { background: var(--red-solid) !important; border-color: var(--red-solid) !important; color: #fff !important; }
.logout-btn:hover, .mm-foot .btn-outline:hover { background: var(--red-solid-hover) !important; border-color: var(--red-solid-hover) !important; color: #fff !important; }
.btn-danger, .pl-danger { background: var(--red-solid) !important; border: 1px solid var(--red-solid) !important; color: #fff !important; }
.btn-danger:hover:not(:disabled), .pl-danger:hover:not(:disabled) { background: var(--red-solid-hover) !important; border-color: var(--red-solid-hover) !important; color: #fff !important; }
.btn-danger .ico, .logout-btn svg { color: #fff; }

/* sidebar and menus: white, with an orange highlight under the pointer and on the open page */
@media (min-width: 1200px) {
  .brand-link { background: #fff; border-right: 1px solid var(--line); }
  .tabs { background: #fff; border-right: 1px solid var(--line); scrollbar-color: #D5DAE0 transparent; }
  .tab { color: #3B4652; }
  .tab svg { color: var(--steel); }
  .tab:hover { background: var(--hover-tint); color: var(--hazard-deep); }
  .tab:hover svg { color: var(--hazard); }
  .tab.active { background: var(--active-tint); color: #8A4000; font-weight: 600; }
  .tab.active svg { color: var(--hazard); }
}
@media (min-width: 961px) and (max-width: 1199px) {
  .tab:hover { background: var(--hover-tint); color: var(--hazard-deep); }
  .tab.active { color: #8A4000; background: var(--active-tint); }
  .tab::after { background: var(--hazard); }
}
.mm-item:hover { background: var(--hover-tint); color: var(--hazard-deep); }
.mm-item.active { background: var(--active-tint); color: #8A4000; }
.pl-seg-btn:hover { background: var(--hover-tint); color: var(--hazard-deep); }
.bell-item:hover, .bell-item:focus-visible { background: var(--hover-tint); }
tbody tr:hover { background: #FFF8EF; }

/* sign-in: the logo sits exactly in the middle */
.login-logo { width: 100px !important; height: 100px !important; margin: 0 auto 14px !important; display: block; }
.login-logo-link { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.login-coin { width: 100% !important; height: 100% !important; margin: 0 auto; display: flex; align-items: center; justify-content: center; filter: none !important; box-shadow: none !important; }
.login-coin img { width: 100% !important; height: 100% !important; object-fit: contain; display: block; margin: 0; }
@media (max-width: 600px) { .login-logo { width: 84px !important; height: 84px !important; } }
/* the optional panels inside the entry forms: white, with a thin border like everything else */
.lp-section, .pg-section, .pl-filters, .rn-filters { background: #fff; }
.lp-section, .pg-section { border: 1px solid var(--line); }
.tab:hover:not(.active) { background: var(--hover-tint); color: var(--hazard-deep); }
.tab:hover:not(.active) svg { color: var(--hazard); }
.login-logo { margin-top: 20px !important; }

/* ═══════════════════════════════════════════════════════════════════════════════
   Shell details (breadcrumb, person card), Home, and the Archive
   ═══════════════════════════════════════════════════════════════════════════════ */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.crumbs { display: none; align-items: center; gap: 8px; margin-right: auto; font-size: 14px; color: var(--steel); }
.crumbs strong { color: var(--ink); font-weight: 600; }
.crumb-root.is-here { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--steel-light); }
.crumb-sep[hidden] { display: none; }
.side-foot { display: none; }
@media (min-width: 1200px) {
  .crumbs { display: flex; }
  .header-right { margin-left: 0; }
  .header-right .logout-btn { display: none; }                           /* Logout lives in the sidebar, as in the reference */
  .side-foot { display: grid; gap: 10px; margin-top: auto; padding: 12px 2px 4px; border-top: 1px solid var(--line); background: #fff; position: sticky; bottom: 0; }
  .side-user { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 6px; background: #F6F7F8; }
  .avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--hazard); color: #fff; font: 700 16px var(--font-body); }
  .side-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .side-who strong { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-who small { font-size: 12.5px; color: var(--steel); }
  .side-logout { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; border: 1px solid var(--red-solid); border-radius: 5px; background: var(--red-solid); color: #fff; font: 600 14px var(--font-body); cursor: pointer; }
  .side-logout:hover { background: var(--red-solid-hover); border-color: var(--red-solid-hover); }
  .side-logout svg { width: 17px; height: 17px; }
}

/* Home */
.hm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 0 0 18px; }
.hm-head .pl-title { font-size: 24px; }
.hm-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.hm-range[hidden] { display: none; }
.hm-range .pl-flt { min-width: 150px; }
.hm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; margin-bottom: 18px; }
.hm-card { display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.hm-card:hover { border-color: var(--hazard); background: #FFFAF4; }
.hm-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--hazard-tint); color: var(--hazard); }
.hm-ic svg { width: 21px; height: 21px; }
.hm-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hm-title { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.hm-title small { font-size: 12.5px; font-weight: 500; color: var(--steel); margin-left: 4px; }
.hm-chips { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.hm-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--steel); }
.hm-n { display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 4px; background: #EEF0F2; color: var(--ink); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.hm-n-bad { background: var(--brick-tint); color: var(--brick); } .hm-n-warn { background: var(--hazard-tint); color: var(--hazard-deep); } .hm-n-good { background: var(--moss-tint); color: var(--moss); }
.hm-empty { margin: 0; padding: 18px; color: var(--steel); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.hm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hm-actions .btn { min-width: 170px; }

/* Archived */
.ar-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ar-chips:empty { display: none; }
.ar-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--steel); font: 600 13px var(--font-body); cursor: pointer; }
.ar-chip b { padding: 0 6px; border-radius: 3px; background: #EEF0F2; color: var(--ink); font-variant-numeric: tabular-nums; }
.ar-chip:hover { border-color: var(--hazard); color: var(--hazard-deep); background: var(--hover-tint); }
.ar-chip.is-on { border-color: var(--hazard); background: var(--active-tint); color: #8A4000; }
.ar-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 12px; }
.ar-all { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.ar-all input, .ar-chk input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.ar-count { margin-right: auto; font-size: 13px; color: var(--steel); }
.ar-chk { width: 40px; text-align: center !important; }
.ar-kind { display: inline-block; padding: 2px 8px; border-radius: 3px; background: #ECEFF3; color: #46515E; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ar-files, .ar-note { display: block; margin-top: 3px; font-size: 12px; color: var(--steel); }
.ar-table td.pl-act { white-space: normal; min-width: 150px; }
.ar-table .pl-act .btn { display: block; width: 100%; margin: 0 0 6px; white-space: nowrap; }
.ar-table .pl-act .btn:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .hm-cards { grid-template-columns: 1fr; gap: 12px; }
  .hm-range .pl-flt { flex: 1 1 140px; }
  .hm-actions .btn { flex: 1 1 100%; min-height: 44px; }
  .ar-table td.ar-chk { display: flex; justify-content: flex-start; } .ar-table td.ar-chk::before { content: 'Select'; }
  .ar-table td.pl-act { display: flex; flex-wrap: wrap; gap: 8px; justify-content: stretch; }
  .ar-table .pl-act .btn { flex: 1 1 100%; width: auto; min-height: 44px; margin: 0; }
  .ar-chip, .ar-all { min-height: 44px; }
}
/* Archived: the text wraps, so Restore / Delete permanently are always in view */
.ar-table th, .ar-table td { padding: 10px; white-space: normal; overflow-wrap: anywhere; }
.ar-table td:nth-child(2) { width: 118px; } .ar-table td:nth-child(3) { width: 104px; }
.ar-table td:nth-child(4) { min-width: 170px; max-width: 250px; } .ar-table td:nth-child(5), .ar-table td:nth-child(7) { max-width: 190px; }
.ar-table td.pl-act { width: 150px; }
.hm-cards { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); }
@media (max-width: 720px) { .ar-table td:nth-child(n) { width: auto; max-width: none; min-width: 0; } }
#confirm-overlay { z-index: 1100; }                                   /* the Yes / No question is always on top (even over the phone menu) */
#confirm-overlay { align-items: center; }
@media (pointer: coarse), (max-width: 960px) { #confirm-yes, #confirm-no { min-height: 46px; } }
/* sign-in footer: its links sit on the dark photo, so they are white (the grey of the normal footer was nearly invisible there) */
.login-footer.site-footer, .login-footer.site-footer span { color: rgba(255,255,255,.92); }
.login-footer.site-footer a { color: #fff; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.login-footer.site-footer a:hover { color: #FFD9A8; }
.hm-actions .hm-backup { margin-left: auto; }
.hm-backup-note { margin: 12px 2px 0; }
@media (max-width: 720px) { .hm-actions .hm-backup { margin-left: 0; } }

