    /* ── Reset & base ─────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      /* Colors (existing — kept untouched) */
      --bg:        var(--tg-theme-bg-color,            #ffffff);
      --text:      var(--tg-theme-text-color,          #1c1c1e);
      --hint:      var(--tg-theme-hint-color,          #8e8e93);
      --link:      var(--tg-theme-link-color,          #007aff);
      --btn:       var(--tg-theme-button-color,        #007aff);
      --btn-text:  var(--tg-theme-button-text-color,   #ffffff);
      --sec-bg:    var(--tg-theme-secondary-bg-color,  #f2f2f7);
      --border:    rgba(60, 60, 67, 0.13);
      --red:    #ff3b30;
      --orange: #ff9500;
      --green:  #34c759;
      --blue:   #007aff;

      /* Brand accent — used for borders, fills, link tint. Resolves to the
         Telegram button colour inside the WebView, falls back to system blue
         outside Telegram so the same tokens work in a regular browser. */
      --accent:       var(--tg-theme-button-color, #007aff);

      /* Soft tinted accents for hover / pressed / badge backgrounds.
         Reused everywhere we mix in colour without changing the brand. */
      --accent-soft:  rgba(0,122,255,.10);
      --red-soft:     rgba(255,59,48,.10);
      --orange-soft:  rgba(255,149,0,.12);
      --green-soft:   rgba(52,199,89,.12);

      /* Spacing — 4 px scale. Replaces ad-hoc 5/7/9/11/13 px values throughout. */
      --space-0: 0;
      --space-1: 4px;
      --space-2: 8px;
      --space-3: 12px;
      --space-4: 16px;
      --space-5: 20px;
      --space-6: 24px;
      --space-8: 32px;
      --space-10: 40px;

      /* Radii (existing aliases preserved + named scale) */
      --radius-sm: 8px;
      --radius:    12px;
      --r-xs:      6px;
      --r-sm:      8px;
      --r-md:      12px;
      --r-lg:      16px;
      --r-pill:    999px;

      /* Typography scale */
      --text-xs:   11px;
      --text-sm:   12px;
      --text-base: 13px;
      --text-md:   14px;
      --text-lg:   15px;
      --text-xl:   17px;
      --text-2xl:  20px;
      --text-3xl:  24px;
      --text-4xl:  28px;

      /* Elevation — three steps. --card-shadow alias kept for legacy callers. */
      --shadow-sm:   0 1px 2px rgba(0,0,0,.05);
      --shadow-md:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
      --shadow-lg:   0 6px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
      --shadow-focus:0 0 0 3px rgba(0,122,255,.25);
      --card-shadow: var(--shadow-md);

      /* Motion */
      --transition-fast: 120ms ease;
      --transition-base: 160ms ease;

      /* Layout */
      --container-max:    760px;
      --container-max-lg: 960px;
    }

    @media (prefers-color-scheme: dark) {
      :root {
        --bg:      var(--tg-theme-bg-color,           #1c1c1e);
        --text:    var(--tg-theme-text-color,         #ffffff);
        --hint:    var(--tg-theme-hint-color,         #8e8e93);
        --link:    var(--tg-theme-link-color,         #0a84ff);
        --btn:     var(--tg-theme-button-color,       #0a84ff);
        --btn-text:var(--tg-theme-button-text-color,  #ffffff);
        --sec-bg:  var(--tg-theme-secondary-bg-color, #2c2c2e);
        --border:  rgba(255,255,255,.10);
        --blue:    #0a84ff;

        /* Same accent token in dark mode — pulls Telegram theme first,
           falls back to the brighter system blue outside Telegram. */
        --accent:       var(--tg-theme-button-color, #0a84ff);

        /* Tinted accents are brighter on dark — same logic, bumped alpha */
        --accent-soft:  rgba(10,132,255,.20);
        --red-soft:     rgba(255,69,58,.18);
        --orange-soft:  rgba(255,159,10,.20);
        --green-soft:   rgba(48,209,88,.18);

        --shadow-sm:   0 1px 2px rgba(0,0,0,.30);
        --shadow-md:   0 1px 3px rgba(0,0,0,.30), 0 1px 2px rgba(0,0,0,.20);
        --shadow-lg:   0 6px 16px rgba(0,0,0,.40), 0 2px 6px rgba(0,0,0,.20);
        --shadow-focus:0 0 0 3px rgba(10,132,255,.35);
        --card-shadow: var(--shadow-md);
      }
    }

    html { font-size: 16px; }

    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      background: var(--sec-bg);
      color: var(--text);
      min-height: 100dvh;
      padding-bottom: 90px;
      -webkit-font-smoothing: antialiased;
    }

    /* Desktop layout — center the mobile-first column on wide screens.
       Bottom sheets / overlays use position: fixed and are unaffected. */
    @media (min-width: 768px) {
      body {
        max-width: 760px;
        margin: 0 auto;
        background: var(--bg);
        box-shadow: 0 0 0 1px var(--border);
      }
    }
    @media (min-width: 1280px) {
      body { max-width: 960px; }
    }

    /* Browser-only back button (Telegram WebView uses the system BackButton).
       Visible only when the script unhides it via the BackButton mock. */
    #webBackButton {
      position: fixed;
      top: 12px;
      left: 12px;
      z-index: 1000;
      background: var(--bg);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 8px 14px 8px 10px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
      -webkit-tap-highlight-color: transparent;
    }
    #webBackButton:hover  { background: var(--sec-bg); }
    #webBackButton:active { transform: scale(.97); }
    #webBackButton[hidden] { display: none; }

    /* ── Home screen ─────────────────────────────────────────── */
    .home-header {
      padding: var(--space-5) var(--space-4) var(--space-4);
      background: var(--bg);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: var(--space-3);
    }
    .home-header-left { flex: 1; min-width: 0; }
    .home-header h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.5px; }
    .home-header p  { font-size: var(--text-base); color: var(--hint); margin-top: var(--space-1); }

    .home-date {
      flex-shrink: 0;
      text-align: right;
      padding-top: 2px;
    }
    .home-date-day   { font-size: 30px; font-weight: 700; line-height: 1; color: var(--btn); }
    .home-date-month { font-size: 11px; color: var(--hint); text-transform: uppercase;
                       letter-spacing: .5px; margin-top: 2px; }
    .home-date-dow   { font-size: 11px; color: var(--hint); margin-top: 1px; }

    /* ── Module buttons (compact) ────────────────────────────── */
    .home-modules {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
      gap: 8px;
      padding: 14px 12px 0;
    }
    .home-module-btn {
      background: var(--bg);
      border-radius: var(--r-sm);
      border: 1.5px solid var(--border);
      border-top-width: 3px;
      padding: var(--space-3) var(--space-2);
      text-align: center;
      cursor: pointer;
      transition: transform var(--transition-fast),
                  box-shadow var(--transition-fast),
                  border-color var(--transition-fast);
      box-shadow: var(--shadow-md);
    }
    .home-module-btn:hover  { box-shadow: var(--shadow-lg); }
    .home-module-btn:active { transform: scale(.94); box-shadow: none; }
    .home-module-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
    .home-module-btn[data-module="reporting"] { border-top-color: #007aff; }
    .home-module-btn[data-module="dcc"]       { border-top-color: #5856d6; }
    .home-module-btn[data-module="shifts"]    { border-top-color: #34c759; }
    .home-module-btn[data-module="ncr"]       { border-top-color: #ff3b30; }
    .home-module-btn[data-module="heat"]      { border-top-color: #ff9500; }
    .home-module-icon { font-size: 22px; display: block; line-height: 1; }
    .home-module-name {
      display: block; font-size: 11px; font-weight: 600;
      color: var(--hint); margin-top: 5px; letter-spacing: -0.1px;
    }

    /* ── Dashboard sections ──────────────────────────────────── */
    .dash-section { padding: var(--space-4) var(--space-3) 0; }
    .dash-section-title {
      font-size: var(--text-xs); font-weight: 700; text-transform: uppercase;
      letter-spacing: .6px; color: var(--hint); margin-bottom: var(--space-2);
    }
    .dash-ncr-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
      gap: 8px;
    }
    .dash-ncr-card {
      background: var(--bg);
      border-radius: var(--r-sm);
      border: 1.5px solid var(--border);
      box-shadow: var(--shadow-sm);
      padding: var(--space-3);
      transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
    }
    .dash-ncr-card:hover { box-shadow: var(--shadow-md); border-color: rgba(60, 60, 67, 0.22); }
    .dash-ncr-source {
      font-size: var(--text-base); font-weight: 700; margin-bottom: var(--space-1);
      letter-spacing: -0.2px;
    }
    .dash-ncr-row {
      display: flex; justify-content: space-between; align-items: baseline;
      font-size: var(--text-sm); color: var(--hint); margin-top: var(--space-1);
    }
    .dash-ncr-val { font-weight: 700; color: var(--text); }
    .dash-ncr-val.red    { color: var(--red); }
    .dash-ncr-val.orange { color: var(--orange); }
    .dash-ncr-skeleton { opacity: .4; }
    @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
    .dash-ncr-skeleton { animation: pulse 1.2s ease-in-out infinite; }

    /* ── Shifts dashboard ────────────────────────────────────── */
    .dash-shifts-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .dash-shifts-card {
      background: var(--bg);
      border-radius: var(--r-sm);
      border: 1.5px solid var(--border);
      box-shadow: var(--shadow-sm);
      padding: var(--space-3);
      transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
    }
    .dash-shifts-card:hover { box-shadow: var(--shadow-md); border-color: rgba(60, 60, 67, 0.22); }
    .dash-shifts-site {
      font-size: 11px; font-weight: 700; text-transform: uppercase;
      letter-spacing: .5px; color: var(--btn); margin-bottom: 6px;
    }
    .dash-shifts-name {
      font-size: 12px; color: var(--text); line-height: 1.7;
    }
    .dash-shifts-office {
      grid-column: 1 / -1;
      background: var(--bg);
      border-radius: var(--radius-sm);
      border: 1.5px solid var(--border);
      box-shadow: var(--card-shadow);
      font-size: 12px; color: var(--hint);
      padding: 10px 12px;
    }
    .dash-shifts-empty {
      grid-column: 1 / -1;
      font-size: 12px; color: var(--hint);
      padding: 4px 0;
    }
    .dash-shifts-loading { animation: pulse 1.2s ease-in-out infinite; }

    /* ── Page header ──────────────────────────────────────────── */
    .page-header {
      background: var(--bg);
      border-bottom: 1px solid var(--border);
      padding: var(--space-4) var(--space-4) var(--space-3);
      position: sticky;
      top: 0;
      z-index: 10;
    }
    .page-header h1 { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.3px; }
    .page-header p  { font-size: var(--text-sm); color: var(--hint); margin-top: var(--space-1); }

    .tab-bar { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
    /* ── Buttons — design-token-driven base (Stage 2) ─────────────
       New code should use `.btn` + modifiers. Legacy class names
       (.tab-btn, .opt, .submit-btn, …) keep their styling but now
       read from the same tokens, so paddings/radii/fonts line up
       across the app. */
    .btn {
      display: inline-flex; align-items: center; justify-content: center;
      gap: var(--space-2);
      padding: var(--space-3) var(--space-4);
      border-radius: var(--r-sm);
      border: 1.5px solid transparent;
      background: var(--sec-bg);
      color: var(--text);
      font-family: inherit;
      font-size: var(--text-md); font-weight: 600;
      line-height: 1.15;
      cursor: pointer;
      user-select: none; -webkit-tap-highlight-color: transparent;
      transition: background-color var(--transition-fast),
                  border-color    var(--transition-fast),
                  color           var(--transition-fast),
                  transform       var(--transition-fast),
                  opacity         var(--transition-fast),
                  box-shadow      var(--transition-fast);
    }
    .btn:focus-visible        { outline: none; box-shadow: var(--shadow-focus); }
    .btn:active:not([disabled]){ transform: scale(.97); }
    .btn[disabled]            { opacity: .55; cursor: not-allowed; }

    .btn--primary {
      background: var(--btn); color: var(--btn-text); border-color: var(--btn);
    }
    .btn--primary:hover:not([disabled])  { filter: brightness(.95); }
    .btn--ghost {
      background: transparent; color: var(--btn); border-color: var(--btn);
    }
    .btn--ghost:hover:not([disabled])    { background: var(--accent-soft); }
    .btn--danger {
      background: transparent; color: var(--red); border-color: var(--red);
    }
    .btn--danger:hover:not([disabled])   { background: var(--red-soft); }
    .btn--icon {
      padding: var(--space-2);
      background: transparent; border: none;
      font-size: var(--text-xl); color: var(--hint);
    }
    .btn--icon:hover:not([disabled])     { background: var(--sec-bg); color: var(--text); }

    .btn--sm { padding: var(--space-2) var(--space-3); font-size: var(--text-base); }
    .btn--md { padding: var(--space-3) var(--space-4); font-size: var(--text-md); }
    .btn--lg { padding: var(--space-4) var(--space-5); font-size: var(--text-lg); }
    .btn--block { width: 100%; }

    /* ── Legacy class aliases ──────────────────────────────────── */
    .tab-btn {
      flex: 1;
      padding: var(--space-2) var(--space-3);
      border-radius: var(--r-sm);
      border: 1.5px solid var(--border);
      background: var(--sec-bg); color: var(--hint);
      font-size: var(--text-base); font-weight: 600;
      cursor: pointer;
      transition: background-color var(--transition-fast),
                  color            var(--transition-fast),
                  border-color     var(--transition-fast);
      text-align: center;
    }
    .tab-btn:hover:not(.active) { color: var(--text); }
    .tab-btn:focus-visible      { outline: none; box-shadow: var(--shadow-focus); }
    .tab-btn.active             { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }

    /* ── Cards ────────────────────────────────────────────────── */
    .card {
      background: var(--bg);
      border-radius: var(--r-md);
      box-shadow: var(--shadow-md);
      margin: var(--space-3) var(--space-3) 0;
      overflow: hidden;
    }
    .card-title {
      font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.5px; color: var(--hint);
      padding: var(--space-4) var(--space-4) var(--space-1);
    }

    /* ── Form fields ──────────────────────────────────────────── */
    .field { padding: 0 var(--space-4); margin-bottom: var(--space-1); }
    .field:last-child { padding-bottom: var(--space-4); }

    label {
      display: block;
      font-size: var(--text-sm); font-weight: 500;
      color: var(--hint);
      margin-bottom: var(--space-1); margin-top: var(--space-3);
    }

    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="date"], textarea, select {
      width: 100%; background: var(--sec-bg);
      border: 1.5px solid var(--border); border-radius: var(--r-sm);
      color: var(--text);
      font-size: var(--text-lg); font-family: inherit;
      padding: var(--space-3); outline: none;
      transition: border-color var(--transition-fast),
                  box-shadow   var(--transition-fast),
                  background-color var(--transition-fast);
      appearance: none; -webkit-appearance: none;
    }
    input[type="email"]:focus, input[type="password"]:focus,
    input[type="number"]:focus { border-color: var(--accent); }
    input[type="date"] {
      color-scheme: light dark;
      line-height: normal;
      height: 44px;
      display: flex;
      align-items: center;
      padding-top: 0;
      padding-bottom: 0;
    }
    input:hover:not(:focus):not(.invalid),
    textarea:hover:not(:focus):not(.invalid),
    select:hover:not(:focus):not(.invalid) { border-color: var(--hint); }
    input:focus, textarea:focus, select:focus {
      border-color: var(--btn);
      box-shadow: var(--shadow-focus);
    }
    input.invalid, textarea.invalid, select.invalid {
      border-color: var(--red) !important; background: var(--red-soft);
    }
    textarea { resize: vertical; min-height: 72px; line-height: 1.45; }

    .select-wrap { position: relative; }
    .select-wrap::after {
      content: ''; pointer-events: none; position: absolute;
      right: 12px; top: 50%; transform: translateY(-50%);
      width: 0; height: 0;
      border-left: 5px solid transparent; border-right: 5px solid transparent;
      border-top: 6px solid var(--hint);
    }

    .site-other-wrap { display: none; margin-top: 8px; }
    .site-other-wrap.visible { display: block; }

    /* ── Button groups ────────────────────────────────────────── */
    .btn-group { display: flex; gap: var(--space-2); flex-wrap: wrap; }
    .btn-group--wrap .opt { flex: 1 1 calc(33% - var(--space-2)); min-width: 80px; }
    .btn-group--wrap3 {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2);
    }
    .btn-group--wrap3 .opt { flex: none; font-size: var(--text-sm); padding: var(--space-2) var(--space-1); text-align: center; white-space: nowrap; }
    .btn-group .opt {
      flex: 1; min-width: 0; text-align: center;
      padding: var(--space-2) var(--space-3);
      border-radius: var(--r-sm); border: 1.5px solid var(--border);
      background: var(--sec-bg); color: var(--text);
      font-size: var(--text-base); font-weight: 600; cursor: pointer;
      transition: background-color var(--transition-fast),
                  color            var(--transition-fast),
                  border-color     var(--transition-fast),
                  transform        var(--transition-fast);
      white-space: nowrap;
      user-select: none; -webkit-user-select: none;
    }
    .btn-group .opt:hover:not(.active) { border-color: var(--hint); }
    .btn-group .opt:focus-visible      { outline: none; box-shadow: var(--shadow-focus); }
    .btn-group .opt:active             { transform: scale(.97); }

    .opt.active { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }
    .opt[data-val="GREEN"].active  { background: var(--green);  color: #fff; border-color: var(--green); }
    .opt[data-val="AMBER"].active  { background: var(--orange); color: #fff; border-color: var(--orange); }
    .opt[data-val="RED"].active    { background: var(--red);    color: #fff; border-color: var(--red); }
    .opt[data-val="Y"].active      { background: var(--green);  color: #fff; border-color: var(--green); }
    .opt[data-val="N"].active      { background: var(--hint);   color: #fff; border-color: var(--hint); }
    .opt[data-val="WITNESS"].active    { background: var(--blue);   color: #fff; border-color: var(--blue); }
    .opt[data-val="HOLD"].active       { background: var(--red);    color: #fff; border-color: var(--red); }
    .opt[data-val="REVIEW"].active     { background: var(--hint);   color: #fff; border-color: var(--hint); }
    .opt[data-val="SURVEILLANCE"].active { background: var(--orange); color: #fff; border-color: var(--orange); }
    .opt[data-val="MONITOR"].active    { background: #5856d6;       color: #fff; border-color: #5856d6; }
    .opt[data-val="OK"].active         { background: var(--green);  color: #fff; border-color: var(--green); }
    .opt[data-val="NOK"].active        { background: var(--red);    color: #fff; border-color: var(--red); }
    .opt[data-val="CONDITIONAL"].active{ background: var(--orange); color: #fff; border-color: var(--orange); }
    .opt[data-val="IN_PROGRESS"].active{ background: var(--blue);   color: #fff; border-color: var(--blue); }
    .opt[data-val="IN_PROCESS"].active { background: var(--blue);   color: #fff; border-color: var(--blue); }
    .opt[data-val="PENDING"].active    { background: var(--hint);   color: #fff; border-color: var(--hint); }
    .opt[data-val="LOW"].active        { background: var(--green);  color: #fff; border-color: var(--green); }
    .opt[data-val="MEDIUM"].active     { background: var(--orange); color: #fff; border-color: var(--orange); }
    .opt[data-val="HIGH"].active       { background: var(--red);    color: #fff; border-color: var(--red); }
    .opt[data-val="all"].active        { background: var(--blue);   color: #fff; border-color: var(--blue); }
    .opt[data-val="site"].active       { background: var(--orange); color: #fff; border-color: var(--orange); }
    .opt[data-val="item"].active       { background: #5856d6;       color: #fff; border-color: #5856d6; }
    .btn-group.invalid .opt:not(.active) { border-color: var(--red); background: rgba(255,59,48,.06); }

    /* ── Entry blocks ─────────────────────────────────────────── */
    .entries-section { margin-top: 12px; }
    .entry-card {
      background: var(--bg);
      border-radius: var(--r-md);
      box-shadow: var(--shadow-md);
      margin: 0 var(--space-3) var(--space-3);
      overflow: hidden;
      border: 1.5px solid var(--border);
      transition: border-color var(--transition-base),
                  box-shadow   var(--transition-fast);
    }
    .entry-card:hover { box-shadow: var(--shadow-lg); }
    .entry-card.open  { border-color: var(--btn); }
    .entry-header {
      display: flex; align-items: center; padding: 14px 14px 14px 16px;
      cursor: pointer; gap: 10px; user-select: none; -webkit-user-select: none;
    }
    .entry-chevron {
      width: 22px; height: 22px; display: flex; align-items: center;
      justify-content: center; flex-shrink: 0; color: var(--hint); transition: transform .2s;
    }
    .entry-card.open .entry-chevron { transform: rotate(90deg); }
    .entry-chevron svg { display: block; }
    .entry-label { flex: 1; min-width: 0; }
    .entry-label .entry-num { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--hint); }
    .entry-label .entry-summary { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .entry-result-badge {
      font-size: var(--text-xs); font-weight: 700;
      padding: var(--space-1) var(--space-2);
      border-radius: var(--r-pill);
      flex-shrink: 0; display: none;
    }
    .entry-result-badge.OK         { background: var(--green-soft);  color: var(--green);  display: block; }
    .entry-result-badge.NOK        { background: var(--red-soft);    color: var(--red);    display: block; }
    .entry-result-badge.CONDITIONAL{ background: var(--orange-soft); color: var(--orange); display: block; }
    .entry-result-badge.IN_PROGRESS{ background: var(--accent-soft); color: var(--blue);   display: block; }
    .entry-result-badge.IN_PROCESS { background: var(--accent-soft); color: var(--blue);   display: block; }
    .entry-result-badge.HOLD       { background: var(--red-soft);    color: var(--red);    display: block; }
    .entry-result-badge.PENDING    { background: var(--sec-bg);      color: var(--hint);   display: block; }
    .entry-delete-btn {
      width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
      border-radius: 50%; background: rgba(255,59,48,.12); color: var(--red);
      cursor: pointer; flex-shrink: 0; border: none; font-size: 18px; line-height: 1; transition: background .15s;
    }
    .entry-delete-btn:active { background: rgba(255,59,48,.25); }
    .entry-body { display: none; border-top: 1px solid var(--border); padding-bottom: 14px; }
    .entry-card.open .entry-body { display: block; }
    .field-divider { height: 1px; background: var(--border); margin: 12px 16px 0; }

    /* ── Buttons ──────────────────────────────────────────────── */
    .add-entry-btn {
      display: flex; align-items: center; justify-content: center;
      gap: var(--space-2);
      margin: 0 var(--space-3) var(--space-3);
      padding: var(--space-3);
      border-radius: var(--r-md);
      border: 2px dashed var(--btn);
      background: transparent;
      color: var(--btn);
      font-size: var(--text-lg); font-weight: 600;
      cursor: pointer;
      width: calc(100% - var(--space-6));
      transition: background-color var(--transition-fast);
    }
    .add-entry-btn:hover  { background: var(--accent-soft); }
    .add-entry-btn:active { background: var(--accent-soft); transform: scale(.99); }
    .add-entry-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

    .sticky-footer {
      position: fixed; bottom: 0; left: 0; right: 0;
      padding: var(--space-3) var(--space-4) max(var(--space-3), env(safe-area-inset-bottom));
      background: var(--bg); border-top: 1px solid var(--border); z-index: 20;
    }
    .submit-btn {
      width: 100%;
      padding: var(--space-4) var(--space-5);
      border-radius: var(--r-md); border: none;
      background: var(--btn); color: var(--btn-text);
      font-size: var(--text-lg); font-weight: 600;
      cursor: pointer;
      transition: filter var(--transition-fast),
                  transform var(--transition-fast),
                  opacity var(--transition-fast),
                  box-shadow var(--transition-fast);
      letter-spacing: -0.2px;
    }
    .submit-btn:hover:not(:disabled)  { filter: brightness(.95); }
    .submit-btn:active:not(:disabled) { transform: scale(.98); }
    .submit-btn:focus-visible          { outline: none; box-shadow: var(--shadow-focus); }
    .submit-btn:disabled               { opacity: .5; cursor: not-allowed; transform: none; }

    /* ── Photos ───────────────────────────────────────────────── */
    .photo-add-btn {
      display: inline-flex; align-items: center;
      gap: var(--space-1);
      padding: var(--space-2) var(--space-3);
      border-radius: var(--r-sm); border: 1.5px dashed var(--border);
      cursor: pointer; color: var(--link);
      font-size: var(--text-base); font-weight: 600;
      background: var(--sec-bg);
      transition: background-color var(--transition-fast), border-color var(--transition-fast);
    }
    .photo-add-btn:hover  { background: var(--bg); border-color: var(--link); }
    .photo-add-btn:active { background: var(--border); }
    .photo-add-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
    .photo-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
    .photo-thumb-wrap { position: relative; width: 72px; height: 72px; }
    .photo-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); border: 1.5px solid var(--border); }
    .photo-remove-btn {
      position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
      border-radius: 50%; background: var(--red); color: #fff; border: none;
      font-size: 11px; line-height: 18px; text-align: center; cursor: pointer; padding: 0;
    }

    /* ── Reports panel ────────────────────────────────────────── */
    #reportsPanel { display: none; }
    .report-hint { font-size: 13px; color: var(--hint); padding: 12px 16px 0; line-height: 1.5; }
    .date-range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 0 16px; }
    .date-range-grid label { margin-top: 12px; }
    .conditional-field { display: none; }
    .conditional-field.visible { display: block; }

    /* ── Misc ─────────────────────────────────────────────────── */
    .section-spacer { height: 12px; }

    /* Recent reports list */
    .recent-report-card {
      background: var(--bg);
      border-radius: var(--r-sm);
      border: 1.5px solid var(--border);
      box-shadow: var(--shadow-sm);
      margin: 0 var(--space-3) var(--space-2);
      padding: var(--space-3) var(--space-4);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-3);
      transition: box-shadow var(--transition-fast),
                  border-color var(--transition-fast),
                  transform   var(--transition-fast);
    }
    .recent-report-card:hover  { box-shadow: var(--shadow-md); border-color: rgba(60,60,67,.22); }
    .recent-report-card:active { transform: scale(.98); }
    .recent-report-left { flex: 1; min-width: 0; }
    .recent-report-date { font-size: 13px; font-weight: 700; }
    .recent-report-site { font-size: 12px; color: var(--hint); margin-top: 2px; }
    .recent-report-right { text-align: right; flex-shrink: 0; }
    .recent-report-count { font-size: 11px; color: var(--hint); }
    .recent-report-status {
      font-size: var(--text-xs); font-weight: 700; text-transform: uppercase;
      letter-spacing: .4px;
      padding: var(--space-1) var(--space-2);
      border-radius: var(--r-pill);
      margin-top: var(--space-1); display: inline-block;
    }
    .recent-report-status.pass  { background: var(--green-soft); color: var(--green); }
    .recent-report-status.fail  { background: var(--red-soft);   color: var(--red); }
    .recent-report-status.other { background: var(--sec-bg);     color: var(--hint); }
    .recent-report-arrow { color: var(--hint); font-size: 18px; margin-left: 4px; }
    .report-delete-btn {
      width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
      border-radius: 50%; background: transparent; color: var(--hint);
      cursor: pointer; flex-shrink: 0; border: none; font-size: 15px; line-height: 1;
      transition: background .15s, color .15s; margin-left: 2px;
    }
    .report-delete-btn:active { background: rgba(255,59,48,.18); color: var(--red); }
    /* ── Report entry detail sheet ──────────────────────────── */
    #reportEntryOverlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,.45); z-index: 1100; align-items: flex-end;
    }
    #reportEntryOverlay.open { display: flex; }
    #reportEntrySheet {
      background: var(--bg); border-radius: 18px 18px 0 0;
      width: 100%; max-height: 82vh; display: flex; flex-direction: column;
      overflow: hidden;
    }
    .re-sheet-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 10px auto 0; flex-shrink: 0; }
    .re-sheet-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 8px; flex-shrink: 0; }
    .re-sheet-title { font-size: 15px; font-weight: 700; }
    .re-sheet-close { background: none; border: none; font-size: 20px; color: var(--hint); cursor: pointer; padding: 4px 8px; }
    #reportEntryList { overflow-y: auto; flex: 1; padding: 0 0 16px; }
    .re-entry-row {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 11px 16px; border-bottom: 1px solid var(--border);
    }
    .re-entry-row:last-child { border-bottom: none; }
    .re-entry-info { flex: 1; min-width: 0; }
    .re-entry-op { font-size: 14px; font-weight: 600; color: var(--text); }
    .re-entry-meta { font-size: 12px; color: var(--hint); margin-top: 2px; }
    .re-entry-result { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px; flex-shrink: 0; margin-top: 2px; }
    .re-entry-result.ok     { background: rgba(52,199,89,.15); color: #28a745; }
    .re-entry-result.nok    { background: rgba(255,59,48,.15);  color: var(--red); }
    .re-entry-result.inproc { background: rgba(255,149,0,.15);  color: #c87800; }
    .re-entry-del,
    .re-entry-edit,
    .re-entry-recreate { background: none; border: none; color: var(--hint); font-size: 18px; cursor: pointer; padding: 4px; flex-shrink: 0; }
    .re-entry-del:active      { color: var(--red); }
    .re-entry-edit:active     { color: var(--link); }
    .re-entry-recreate:active { color: #c87800; }
    .edit-banner {
      background: rgba(255,149,0,.12); color: #c87800;
      border: 1px solid rgba(255,149,0,.3); border-radius: 8px;
      padding: 10px 12px; margin: 8px 0 12px; font-size: 13px; line-height: 1.4;
    }
    .edit-banner strong { color: #a35e00; }
    input[readonly], select:disabled { opacity: .65; cursor: not-allowed; }
    .re-sheet-actions { display: flex; gap: 8px; padding: 12px 16px 16px; flex-shrink: 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
    .re-sheet-pdf-btn {
      flex: 1 1 calc(33% - var(--space-2)); min-width: 90px;
      padding: var(--space-3) var(--space-2);
      background: var(--btn); color: var(--btn-text); border: none;
      border-radius: var(--r-sm);
      font-size: var(--text-base); font-weight: 600; cursor: pointer;
      transition: filter var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
    }
    .re-sheet-pdf-btn:hover:not([disabled])  { filter: brightness(.95); }
    .re-sheet-pdf-btn:active:not([disabled]) { transform: scale(.97); }
    .re-sheet-pdf-btn:focus-visible          { outline: none; box-shadow: var(--shadow-focus); }
    .re-sheet-pdf-btn[disabled]              { opacity: .55; cursor: not-allowed; }

    .re-sheet-delall-btn {
      padding: var(--space-3) var(--space-4);
      background: transparent; border: 1.5px solid var(--red); color: var(--red);
      border-radius: var(--r-sm);
      font-size: var(--text-base); font-weight: 600; cursor: pointer;
      flex: 0 0 auto;
      transition: background-color var(--transition-fast);
    }
    .re-sheet-delall-btn:hover  { background: var(--red-soft); }
    .re-sheet-delall-btn:active { background: var(--red-soft); transform: scale(.97); }
    .re-sheet-delall-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

    /* PDF preview overlay — full-screen, browser only */
    #pdfPreviewOverlay {
      display: none;
      position: fixed; inset: 0; z-index: 1100;
      background: rgba(0,0,0,.65);
      align-items: stretch; justify-content: center;
    }
    #pdfPreviewOverlay.open { display: flex; }
    #pdfPreviewSheet {
      flex: 1; display: flex; flex-direction: column;
      background: var(--bg); max-width: 1100px; margin: 0 auto;
    }
    .pdf-preview-topbar {
      display: flex; align-items: center; gap: 8px;
      padding: 10px 12px; border-bottom: 1px solid var(--border);
      background: var(--bg);
    }
    .pdf-preview-title { flex: 1; font-size: 15px; font-weight: 600; }
    .pdf-preview-action {
      width: 38px; height: 38px; border-radius: 8px;
      background: var(--sec-bg); border: none; cursor: pointer;
      font-size: 18px; color: var(--text);
    }
    .pdf-preview-action:active { background: var(--border); }
    #pdfPreviewFrame {
      flex: 1; width: 100%; border: 0; background: var(--sec-bg);
    }
    /* Compact variant of submit-btn for the 3-PDF-buttons row in the Reports tab footer */
    .pdf-mini-btn { font-size: 12px !important; padding: 11px 6px !important; }
    .pdf-mini-btn[disabled] { opacity: .55; cursor: not-allowed; }

    .entry-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 0 16px; }
    .entry-fields-grid label { margin-top: 12px; }
    @media (max-width: 360px) { .btn-group .opt { font-size: 11px; padding: 8px 4px; } }

    /* ── Heat Input module ───────────────────────────────────── */
    .hi-result-row {
      display: flex; justify-content: space-between; align-items: baseline;
      padding: 6px 0; border-bottom: 1px solid var(--border);
      font-size: 14px;
    }
    .hi-result-row:last-child { border-bottom: none; }
    .hi-result-label { color: var(--hint); flex: 1; padding-right: 8px; }
    .hi-result-value { font-weight: 600; color: var(--text); white-space: nowrap; }
    .hi-result-main {
      margin-top: 12px; padding: 14px 16px; background: var(--btn);
      border-radius: var(--radius); text-align: center;
    }
    .hi-result-main-label { font-size: 12px; color: rgba(255,255,255,.75); font-weight: 500; }
    .hi-result-main-value { font-size: 32px; font-weight: 700; color: #fff; line-height: 1.15; }
    .hi-result-main-unit  { font-size: 13px; color: rgba(255,255,255,.75); }

    /* ── Toast notification ──────────────────────────────────── */
    .toast {
      position: fixed; bottom: 90px; left: 50%;
      transform: translateX(-50%) translateY(20px);
      background: var(--text); color: var(--bg);
      padding: var(--space-3) var(--space-5);
      border-radius: var(--r-pill);
      font-size: var(--text-md); font-weight: 500;
      z-index: 100; opacity: 0;
      transition: opacity var(--transition-base), transform var(--transition-base);
      pointer-events: none; white-space: nowrap; max-width: 90vw;
      text-overflow: ellipsis; overflow: hidden;
      box-shadow: var(--shadow-lg);
    }
    .toast.toast--show  { opacity: 1; transform: translateX(-50%) translateY(0); }
    .toast.toast--error { background: var(--red); color: #fff; }
    .toast.toast--success { background: var(--green); color: #fff; }

    /* ── Admin module ───────────────────────────────────────── */
    .home-module-btn[data-module="admin"] { border-top-color: #ff9500; }

    .admin-section-title {
      font-size: var(--text-xs); font-weight: 700; text-transform: uppercase;
      letter-spacing: .6px; color: var(--hint);
      padding: var(--space-4) var(--space-4) var(--space-1);
    }

    .admin-user-card {
      background: var(--bg);
      border-radius: var(--r-md);
      box-shadow: var(--shadow-sm);
      border: 1.5px solid var(--border);
      margin: 0 var(--space-3) var(--space-2);
      padding: var(--space-3) var(--space-4);
      display: flex; align-items: center; gap: var(--space-3);
      transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
    }
    .admin-user-card:hover { box-shadow: var(--shadow-md); border-color: rgba(60,60,67,.22); }
    .admin-user-avatar {
      width: 38px; height: 38px; border-radius: 50%;
      background: var(--sec-bg); display: flex; align-items: center;
      justify-content: center; font-size: 16px; flex-shrink: 0;
    }
    .admin-user-info { flex: 1; min-width: 0; }
    .admin-user-name { font-size: 15px; font-weight: 600; }
    .admin-user-sub  { font-size: 12px; color: var(--hint); margin-top: 1px; }
    .admin-user-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

    .role-badge {
      display: inline-block;
      font-size: var(--text-xs); font-weight: 600;
      padding: var(--space-1) var(--space-2);
      border-radius: var(--r-pill);
      text-transform: uppercase; letter-spacing: .3px;
    }
    .role-badge.admin   { background: var(--orange-soft); color: var(--orange); }
    .role-badge.editor  { background: var(--green-soft);  color: var(--green); }
    .role-badge.viewer  { background: var(--sec-bg);      color: var(--hint); }
    .role-badge.pending { background: var(--red-soft);    color: var(--red); }

    .admin-icon-btn {
      background: transparent; border: none;
      padding: var(--space-1) var(--space-2);
      font-size: var(--text-xl); cursor: pointer;
      border-radius: var(--r-sm);
      transition: background-color var(--transition-fast);
    }
    .admin-icon-btn:hover  { background: var(--sec-bg); }
    .admin-icon-btn:active { background: var(--border); }
    .admin-icon-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

    .admin-team-select {
      font-size: 12px; padding: 4px 6px; border-radius: 8px;
      border: 1px solid var(--divider); background: var(--sec-bg);
      color: var(--text); cursor: pointer; max-width: 90px;
    }

    /* Team picker popup */
    #teamPickerOverlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,.45); z-index: 9999;
      align-items: flex-end; justify-content: center;
    }
    #teamPickerOverlay.open { display: flex; }
    #teamPickerSheet {
      background: var(--bg); border-radius: 14px 14px 0 0;
      padding: 16px 16px 32px; width: 100%; max-width: 480px;
    }
    #teamPickerSheet h3 {
      margin: 0 0 4px; font-size: 15px; font-weight: 600;
    }
    #teamPickerSheet .tps-sub {
      font-size: 12px; color: var(--hint); margin-bottom: 14px;
    }
    .team-pick-btn {
      display: flex; align-items: center; gap: 10px;
      width: 100%; padding: 12px 14px; margin-bottom: 8px;
      background: var(--sec-bg); border: none; border-radius: var(--radius);
      font-size: 15px; font-weight: 500; color: var(--text); cursor: pointer;
      text-align: left;
    }
    .team-pick-btn.active { border: 2px solid var(--accent); }
    .team-pick-btn:last-of-type { margin-bottom: 0; }
    #teamPickerCancel {
      margin-top: 12px; width: 100%; padding: 12px;
      background: none; border: none; font-size: 15px;
      color: var(--hint); cursor: pointer;
    }

    .admin-emp-card {
      background: var(--bg);
      border-radius: var(--r-md);
      box-shadow: var(--shadow-sm);
      border: 1.5px solid var(--border);
      margin: 0 var(--space-3) var(--space-2);
      padding: var(--space-3) var(--space-4);
      display: flex; align-items: center; gap: var(--space-3);
      transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
    }
    .admin-emp-card:hover { box-shadow: var(--shadow-md); border-color: rgba(60,60,67,.22); }
    .admin-emp-name { flex: 1; font-size: 15px; font-weight: 500; }
    .admin-emp-inactive { opacity: .45; }

    .admin-add-bar {
      background: var(--bg); border-radius: var(--radius);
      box-shadow: var(--card-shadow); margin: 0 12px 12px;
      padding: 10px 12px; display: flex; gap: 8px;
    }
    .admin-add-bar input {
      flex: 1; font-size: 14px; border: none; background: var(--sec-bg);
      border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text);
      outline: none;
    }
    .admin-add-bar button {
      background: var(--btn); color: var(--btn-text);
      border: none; border-radius: var(--radius-sm);
      padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
    }

    .admin-empty {
      text-align: center; color: var(--hint);
      padding: 32px 16px; font-size: 14px;
    }

    /* ── Placeholder (coming soon) ───────────────────────────── */
    .placeholder {
      display: flex; flex-direction: column; align-items: center;
      justify-content: center; min-height: 50dvh; padding: 40px 24px; text-align: center;
    }
    .placeholder .ph-icon { font-size: 48px; margin-bottom: 16px; }
    .placeholder h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
    .placeholder p  { font-size: 14px; color: var(--hint); line-height: 1.5; }

    /* ── NCR module ──────────────────────────────────────────── */
    .ncr-stats-row {
      display: flex; gap: 0; background: var(--bg);
      border-radius: var(--radius); box-shadow: var(--card-shadow);
      margin: 0 12px 10px; overflow: hidden;
    }
    .ncr-stat {
      flex: 1; text-align: center; padding: 14px 4px;
      border-right: 1px solid var(--border);
    }
    .ncr-stat:last-child { border-right: none; }
    .ncr-stat-num  { font-size: 26px; font-weight: 800; line-height: 1; }
    .ncr-stat-num.open  { color: var(--red); }
    .ncr-stat-num.close { color: var(--green); }
    .ncr-stat-num.hold  { color: var(--orange); }
    .ncr-stat-label {
      font-size: 10px; color: var(--hint); margin-top: 3px;
      text-transform: uppercase; letter-spacing: .4px;
    }

    .ncr-open-section {
      background: var(--bg); border-radius: var(--radius);
      box-shadow: var(--card-shadow); margin: 0 12px 10px; overflow: hidden;
    }
    .ncr-open-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 16px; cursor: pointer; user-select: none;
    }
    .ncr-open-header span { font-size: 13px; font-weight: 700; }
    .ncr-open-header .badge {
      font-size: 11px; font-weight: 700; padding: 2px 8px;
      border-radius: 10px; background: rgba(255,59,48,.15); color: var(--red);
    }
    .ncr-open-header .chevron { color: var(--hint); transition: transform .2s; font-size: 12px; }
    .ncr-open-section.open .ncr-open-header .chevron { transform: rotate(90deg); }
    .ncr-open-body { display: none; border-top: 1px solid var(--border); }
    .ncr-open-section.open .ncr-open-body { display: block; }
    .ncr-item {
      padding: 9px 16px; border-bottom: 1px solid var(--border);
      font-size: 12px; font-family: monospace; word-break: break-all;
    }
    .ncr-item:last-child { border-bottom: none; }
    .ncr-item.hold { color: var(--orange); font-weight: 600; }
    .ncr-fetched {
      font-size: 11px; color: var(--hint); text-align: center;
      padding: 8px 16px 4px;
    }

    /* ── Shifts module ───────────────────────────────────────── */
    .shifts-group {
      background: var(--bg); border-radius: var(--radius);
      box-shadow: var(--card-shadow); margin: 0 12px 10px; overflow: hidden;
    }
    .shifts-group-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 16px; cursor: pointer; user-select: none;
    }
    .shifts-group-title { display: flex; align-items: center; gap: 8px; }
    .shifts-group-name  { font-size: 13px; font-weight: 700; }
    .shifts-group-code  {
      font-size: 11px; font-weight: 700; width: 22px; height: 22px;
      border-radius: 50%; display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; color: #fff;
    }
    .shifts-group-count {
      font-size: 11px; font-weight: 700; padding: 2px 8px;
      border-radius: 10px; background: var(--sec-bg); color: var(--hint);
    }
    .shifts-group-count.has-people { background: rgba(0,122,255,.15); color: var(--btn); }
    .shifts-chevron { color: var(--hint); transition: transform .2s; font-size: 12px; }
    .shifts-group.open .shifts-chevron { transform: rotate(90deg); }
    .shifts-group-body { display: none; border-top: 1px solid var(--border); }
    .shifts-group.open .shifts-group-body { display: block; }
    .shifts-employee-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 9px 16px; border-bottom: 1px solid var(--border);
      font-size: 13px;
    }
    .shifts-employee-row:last-child { border-bottom: none; }
    .shifts-emp-name   { font-weight: 600; }
    .shifts-emp-period { color: var(--hint); font-size: 12px; }
    .shifts-empty      { padding: 12px 16px; font-size: 13px; color: var(--hint); }

    /* Onshore status buttons */
    .osh-status-btn {
      padding: 12px 6px; border-radius: var(--radius);
      border: 1.5px solid var(--divider); background: var(--sec-bg);
      font-size: 13px; font-weight: 600; color: var(--text);
      cursor: pointer; transition: background .15s, border-color .15s, color .15s;
      text-align: center; line-height: 1.3;
    }
    .osh-status-btn.active {
      border-color: #007aff; background: #007aff; color: #fff;
    }
    .osh-status-btn:active {
      opacity: .85;
    }

    /* Admin team picker inside Shifts */
    #shiftsTeamPicker { display:none; padding: 12px 12px 0; }
    .shifts-team-tabs { display:flex; gap:8px; }
    .shifts-team-tab {
      flex:1; padding:10px 8px; border-radius:var(--radius);
      border: 2px solid var(--divider); background: var(--sec-bg);
      font-size:14px; font-weight:600; color:var(--hint); cursor:pointer;
      transition: all .15s;
    }
    .shifts-team-tab.active {
      border-color: var(--accent); background: var(--accent);
      color: #fff;
    }

    /* Admin team picker inside Reporting */
    #reportingTeamPicker { display:none; padding: 12px 12px 0; }
    .reporting-team-tabs { display:flex; gap:8px; }
    .reporting-team-tab {
      flex:1; padding:10px 8px; border-radius:var(--radius);
      border: 2px solid var(--border); background: var(--sec-bg);
      font-size:14px; font-weight:600; color:var(--hint); cursor:pointer;
      transition: all .15s;
    }
    .reporting-team-tab.active {
      border-color: var(--btn); background: var(--btn);
      color: #fff;
    }

    .shifts-travel-section {
      background: rgba(88,86,214,.08); border-left: 3px solid #5856d6;
    }
    .shifts-travel-row {
      padding: 9px 16px; border-bottom: 1px solid var(--border);
      font-size: 12px; color: var(--text);
    }
    .shifts-travel-row:last-child { border-bottom: none; }
    .shifts-travel-row b { color: #5856d6; }

    .shifts-days-table {
      background: var(--bg); border-radius: var(--radius);
      box-shadow: var(--card-shadow); margin: 0 12px 10px; overflow: hidden;
    }
    .shifts-days-row {
      display: flex; align-items: center; padding: 10px 16px;
      border-bottom: 1px solid var(--border); gap: 10px;
    }
    .shifts-days-row:last-child { border-bottom: none; }
    .shifts-days-name { flex: 1; font-size: 13px; font-weight: 600; }
    .shifts-days-count { font-size: 16px; font-weight: 800; min-width: 36px; text-align: right; }
    .shifts-days-diff {
      font-size: 12px; font-weight: 600; min-width: 46px; text-align: right;
    }
    .shifts-days-diff.pos { color: var(--green); }
    .shifts-days-diff.neg { color: var(--red); }

    .shifts-site-opt {
      padding: 9px 4px; border-radius: var(--radius-sm);
      border: 1.5px solid var(--border); background: var(--sec-bg);
      color: var(--text); font-size: 11px; font-weight: 600;
      cursor: pointer; text-align: center; white-space: nowrap;
      transition: all .15s; user-select: none;
    }
    .shifts-site-opt.active { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }
    .shifts-site-opt.office.active { background: var(--hint); border-color: var(--hint); color:#fff; }
    .shifts-site-opt.vacation.active { background: var(--orange); border-color: var(--orange); color:#fff; }

    .shifts-travel-toggle {
      flex: 1; padding: 11px 8px;
      border-radius: var(--radius-sm);
      border: 1.5px solid var(--border);
      background: var(--sec-bg); color: var(--hint);
      font-size: 13px; font-weight: 600; cursor: pointer;
      transition: all .15s; text-align: center;
    }
    .shifts-travel-toggle.active {
      background: #5856d6; border-color: #5856d6; color: #fff;
    }

    /* Site group color dots */
    .sc-1  { background: #007aff; }
    .sc-2  { background: #ff9500; }
    .sc-3  { background: #34c759; }
    .sc-4  { background: #ff3b30; }
    .sc-5  { background: #af52de; }
    .sc-6  { background: #00c7be; }
    .sc-7  { background: #ff2d55; }
    .sc-8  { background: #a2845e; }
    .sc-9  { background: var(--hint); }
    .sc-0  { background: var(--hint); }

    /* ── DCC module ──────────────────────────────────────────── */
    .dcc-result-card {
      background: var(--bg);
      border-radius: var(--r-md);
      box-shadow: var(--shadow-md);
      margin: 0 var(--space-3) var(--space-3);
      overflow: hidden;
      border: 1.5px solid var(--border);
      transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
    }
    .dcc-result-card:hover { box-shadow: var(--shadow-lg); }
    .dcc-result-card.sent { border-left: 4px solid var(--green); }
    .dcc-result-card.pending { border-left: 4px solid var(--orange); }
    .dcc-result-header {
      display: flex; align-items: flex-start;
      justify-content: space-between; padding: 12px 14px 8px;
      gap: 10px;
    }
    .dcc-doc-no {
      font-size: 14px; font-weight: 700; color: var(--text);
      line-height: 1.3; flex: 1; min-width: 0; word-break: break-all;
    }
    .dcc-doc-rev {
      font-size: 11px; font-weight: 600; padding: 2px 7px;
      border-radius: 10px; background: var(--sec-bg);
      color: var(--hint); flex-shrink: 0; white-space: nowrap;
    }
    .dcc-doc-name {
      font-size: 12px; color: var(--hint); padding: 0 14px 8px;
      line-height: 1.4; word-break: break-word;
    }
    .dcc-meta {
      display: flex; flex-wrap: wrap; gap: 6px;
      padding: 0 14px 10px;
    }
    .dcc-tag {
      font-size: 11px; background: var(--sec-bg);
      border-radius: 6px; padding: 3px 8px; color: var(--hint); white-space: nowrap;
    }
    .dcc-tag b { color: var(--text); font-weight: 600; }
    .dcc-status-badge {
      font-size: 11px; font-weight: 700; padding: 3px 9px;
      border-radius: 10px; white-space: nowrap;
    }
    .dcc-status-badge.sent    { background: rgba(52,199,89,.15); color: #28a745; }
    .dcc-status-badge.pending { background: rgba(255,149,0,.15); color: #c87800; }
    .dcc-result-card { cursor: pointer; transition: background .12s; }
    .dcc-result-card:active { background: var(--sec-bg); }
    .dcc-link-btn {
      margin: 0 var(--space-4) var(--space-3);
      padding: var(--space-2) var(--space-4);
      border-radius: var(--r-sm); border: 1.5px solid var(--btn);
      background: transparent; color: var(--btn);
      font-size: var(--text-base); font-weight: 600; cursor: pointer;
      width: calc(100% - var(--space-8)); text-align: center;
      transition: background-color var(--transition-fast);
    }
    .dcc-link-btn:hover:not(:disabled)  { background: var(--accent-soft); }
    .dcc-link-btn:active:not(:disabled) { background: var(--accent-soft); transform: scale(.99); }
    .dcc-link-btn:focus-visible          { outline: none; box-shadow: var(--shadow-focus); }
    .dcc-link-btn:disabled               { opacity: .5; cursor: not-allowed; }

    /* ── DCC Document detail sheet ─────────────────────────── */
    #dccDocOverlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,.5); z-index: 9000;
      align-items: flex-end; justify-content: center;
    }
    #dccDocOverlay.open { display: flex; }
    #dccDocSheet {
      background: var(--bg); border-radius: 18px 18px 0 0;
      width: 100%; max-width: 480px;
      max-height: 88vh; overflow-y: auto;
      padding: 0 0 36px;
    }
    .dcc-sheet-handle {
      width: 36px; height: 4px; border-radius: 2px;
      background: var(--border); margin: 10px auto 0;
    }
    .dcc-sheet-topbar {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 16px 10px;
    }
    .dcc-sheet-title {
      font-size: 13px; font-weight: 700; color: var(--hint);
      text-transform: uppercase; letter-spacing: .04em;
    }
    .dcc-sheet-close {
      width: 28px; height: 28px; border-radius: 50%;
      background: var(--sec-bg); border: none; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 14px; color: var(--hint); flex-shrink: 0;
    }
    .dcc-sheet-docno {
      font-size: 18px; font-weight: 800; color: var(--text);
      padding: 0 16px 4px; word-break: break-all; line-height: 1.3;
    }
    .dcc-sheet-rev {
      display: inline-block; font-size: 12px; font-weight: 600;
      padding: 2px 9px; border-radius: 10px;
      background: var(--sec-bg); color: var(--hint);
      margin: 0 16px 8px;
    }
    .dcc-sheet-status {
      display: inline-block; font-size: 12px; font-weight: 700;
      padding: 3px 11px; border-radius: 10px; margin: 0 16px 12px;
    }
    .dcc-sheet-status.sent    { background: rgba(52,199,89,.15); color: #28a745; }
    .dcc-sheet-status.pending { background: rgba(255,149,0,.15);  color: #c87800; }
    .dcc-sheet-docname {
      font-size: 14px; color: var(--text); font-weight: 500;
      padding: 0 16px 16px; line-height: 1.5; word-break: break-word;
    }
    .dcc-sheet-divider {
      height: 1px; background: var(--border); margin: 0 16px 14px;
    }
    .dcc-sheet-section-label {
      font-size: 11px; font-weight: 700; color: var(--hint);
      text-transform: uppercase; letter-spacing: .06em;
      padding: 0 16px 8px;
    }
    .dcc-sheet-row {
      display: flex; align-items: baseline; justify-content: space-between;
      padding: 5px 16px; gap: 12px;
    }
    .dcc-sheet-row-label {
      font-size: 12px; color: var(--hint); flex-shrink: 0; min-width: 110px;
    }
    .dcc-sheet-row-value {
      font-size: 13px; font-weight: 600; color: var(--text);
      text-align: right; word-break: break-all;
    }
    .dcc-sheet-row-value.muted { color: var(--hint); font-weight: 400; }
    .dcc-sheet-action {
      margin: 18px 16px 0; padding: 12px;
      border-radius: var(--radius); border: 1.5px solid var(--btn);
      background: transparent; color: var(--btn);
      font-size: 14px; font-weight: 600; cursor: pointer;
      width: calc(100% - 32px); text-align: center;
      transition: background .15s; display: block;
    }
    .dcc-sheet-action:active  { background: rgba(0,122,255,.07); }
    .dcc-sheet-action:disabled { opacity: .5; cursor: not-allowed; }

    .dcc-analyze-summary {
      background: var(--bg); border-radius: var(--radius);
      box-shadow: var(--card-shadow); margin: 0 12px 10px;
      padding: 16px; display: flex; gap: 12px; align-items: center;
    }
    .dcc-stat-block { text-align: center; flex: 1; }
    .dcc-stat-num {
      font-size: 28px; font-weight: 800; line-height: 1;
    }
    .dcc-stat-num.overdue { color: var(--red); }
    .dcc-stat-num.ok      { color: var(--green); }
    .dcc-stat-label { font-size: 11px; color: var(--hint); margin-top: 3px; text-transform: uppercase; letter-spacing: .4px; }
    .dcc-stat-divider { width: 1px; height: 40px; background: var(--border); flex-shrink: 0; }

    .dcc-list-section {
      background: var(--bg); border-radius: var(--radius);
      box-shadow: var(--card-shadow); margin: 0 12px 10px; overflow: hidden;
    }
    .dcc-list-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 16px; cursor: pointer; user-select: none;
    }
    .dcc-list-header span { font-size: 13px; font-weight: 700; }
    .dcc-list-header .badge {
      font-size: 11px; font-weight: 700; padding: 2px 8px;
      border-radius: 10px; background: var(--sec-bg); color: var(--hint);
    }
    .dcc-list-header .badge.red { background: rgba(255,59,48,.15); color: var(--red); }
    .dcc-list-header .chevron { color: var(--hint); transition: transform .2s; font-size: 12px; }
    .dcc-list-section.open .dcc-list-header .chevron { transform: rotate(90deg); }
    .dcc-list-body { display: none; border-top: 1px solid var(--border); }
    .dcc-list-section.open .dcc-list-body { display: block; }
    .dcc-list-item {
      padding: 10px 16px; border-bottom: 1px solid var(--border);
      font-size: 12px; color: var(--text); line-height: 1.5; word-break: break-word;
    }
    .dcc-list-item:last-child { border-bottom: none; }
    .dcc-empty { padding: 16px; font-size: 13px; color: var(--hint); text-align: center; }

    /* ── DCC Transfer stats ────────────────────────────────── */
    .tr-period-bar {
      display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
    }
    .tr-period-btn {
      flex: 1; min-width: 56px;
      padding: var(--space-2) var(--space-3); border-radius: var(--r-sm);
      border: 1.5px solid var(--border);
      background: var(--sec-bg); color: var(--hint);
      font-size: var(--text-base); font-weight: 600; cursor: pointer;
      transition: background-color var(--transition-fast),
                  color            var(--transition-fast),
                  border-color     var(--transition-fast);
    }
    .tr-period-btn:hover:not(.active) { color: var(--text); border-color: var(--hint); }
    .tr-period-btn:focus-visible      { outline: none; box-shadow: var(--shadow-focus); }
    .tr-period-btn.active {
      border-color: var(--accent); background: rgba(0,122,255,.12);
      color: var(--accent);
    }
    .tr-registry-card {
      background: var(--bg);
      border-radius: var(--r-md);
      border: 1.5px solid var(--border);
      box-shadow: var(--shadow-sm);
      margin-bottom: var(--space-3); overflow: hidden;
      transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
    }
    .tr-registry-card:hover { box-shadow: var(--shadow-md); border-color: rgba(60,60,67,.22); }
    .tr-registry-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 14px; cursor: pointer;
      user-select: none;
    }
    .tr-registry-header:active { background: var(--sec-bg); }
    .tr-reg-name {
      font-size: 16px; font-weight: 700; letter-spacing: .3px;
    }
    .tr-reg-chevron { color: var(--hint); transition: transform .2s; font-size: 12px; }
    .tr-registry-card.open .tr-reg-chevron { transform: rotate(90deg); }
    .tr-direction-block { display: none; border-top: 1px solid var(--border); }
    .tr-registry-card.open .tr-direction-block { display: block; }
    .tr-dir-label {
      padding: 8px 14px 4px;
      font-size: 11px; font-weight: 700; color: var(--hint);
      text-transform: uppercase; letter-spacing: .6px;
    }
    .tr-counters {
      display: flex; gap: 0; padding: 0 14px 10px;
    }
    .tr-count-item { flex: 1; text-align: center; }
    .tr-count-num { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
    .tr-count-num.accent { color: var(--accent); }
    .tr-count-label { font-size: 10px; color: var(--hint); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
    .tr-count-div { width: 1px; background: var(--border); align-self: stretch; margin: 0 4px; }
    .tr-trs-list { border-top: 1px solid var(--border); }
    .tr-trs-row {
      padding: 9px 14px; border-bottom: 1px solid var(--border);
      cursor: pointer;
    }
    .tr-trs-row:last-child { border-bottom: none; }
    .tr-trs-row:active { background: var(--sec-bg); }
    .tr-trs-no { font-size: 13px; font-weight: 600; color: var(--text); }
    .tr-trs-meta { font-size: 11px; color: var(--hint); margin-top: 2px; }
    .tr-trs-docs { display: none; padding: 4px 14px 10px 28px; background: var(--sec-bg); }
    .tr-trs-row.open + .tr-trs-docs { display: block; }
    .tr-doc-row {
      font-size: 12px; color: var(--text); padding: 4px 0;
      border-bottom: 1px solid var(--border);
    }
    .tr-doc-row:last-child { border-bottom: none; }
    .tr-doc-no { font-weight: 600; }
    .tr-doc-meta { color: var(--hint); font-size: 11px; margin-top: 1px; }
    .tr-doc-link { color: var(--accent); text-decoration: none; font-size: 11px; }
    .tr-sync-info {
      font-size: 12px; color: var(--hint); text-align: center;
      padding: 6px 0 14px;
    }
    .tr-refresh-btn {
      display: inline-flex; align-items: center; gap: 4px;
      background: none; border: 1.5px solid var(--border);
      border-radius: 20px; padding: 6px 14px;
      font-size: 12px; color: var(--hint); cursor: pointer;
      transition: all .15s; margin-top: 8px;
    }
    .tr-refresh-btn:active { background: var(--sec-bg); }
    .tr-empty { padding: 32px 16px; font-size: 13px; color: var(--hint); text-align: center; }

    .dcc-loading {
      display: flex; align-items: center; justify-content: center;
      gap: 10px; padding: 32px 16px; color: var(--hint); font-size: 14px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .dcc-spinner {
      width: 20px; height: 20px; border: 2px solid var(--border);
      border-top-color: var(--btn); border-radius: 50%;
      animation: spin .7s linear infinite; flex-shrink: 0;
    }

/* ══════════════════════════════════════════════════════════════
   ANALYTICS TAB
   ══════════════════════════════════════════════════════════════ */
.analytics-range { display: flex; gap: 10px; }
.analytics-range-row { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.analytics-range-row label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--hint);
}
.analytics-range-row input {
  padding: 8px 10px; font-size: 14px; color: var(--text);
  background: var(--sec-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
}
.analytics-presets { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.analytics-preset {
  flex: 1; min-width: 56px; padding: 8px 10px; font-size: 13px;
  font-weight: 600; color: var(--hint);
  background: var(--sec-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
}
.analytics-preset:active { background: var(--border); }
.analytics-preset-active { color: #fff; background: var(--btn); border-color: var(--btn); }
#analytics-apply { color: var(--accent); border-color: var(--accent); background: transparent; }

.kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 12px 12px 0;
}
.kpi-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--hint); margin-bottom: 4px;
}
.kpi-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; }
.kpi-sub { font-size: 11px; color: var(--hint); margin-top: 4px; }

.analytics-card { margin: 12px 12px 0; padding: 14px 16px; }
.analytics-card-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--hint); margin-bottom: 10px;
}
.analytics-empty { color: var(--hint); font-size: 13px; padding: 8px 0; }
.analytics-loading { padding: 32px 16px; text-align: center; color: var(--hint); font-size: 14px; }
.analytics-error { padding: 16px; color: var(--red, #d92020); font-size: 13px; }

.analytics-bar-list { display: flex; flex-direction: column; gap: 8px; }
.analytics-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 30%) 1fr auto auto;
  gap: 8px; align-items: center; font-size: 12px;
}
.analytics-bar-name { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-bar-track {
  height: 8px; background: var(--sec-bg);
  border-radius: 4px; overflow: hidden;
}
.analytics-bar-fill {
  height: 100%; background: var(--accent);
  border-radius: 4px; transition: width .3s ease;
}
.analytics-bar-num { color: var(--hint); font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.analytics-bar-rate { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 48px; text-align: right; }
.analytics-bar-rate.good { color: #15803d; }
.analytics-bar-rate.warn { color: #c2780a; }
.analytics-bar-rate.bad  { color: #d92020; }

.trend-svg { display: block; width: 100%; height: 80px; }
.trend-bar-pass { fill: #4ade80; }
.trend-bar-fail { fill: #f5a3a3; }
.trend-legend {
  display: flex; gap: 14px; margin-top: 6px;
  font-size: 11px; color: var(--hint);
}
.trend-legend-pass, .trend-legend-fail {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  vertical-align: -1px; margin-right: 4px;
}
.trend-legend-pass { background: #4ade80; }
.trend-legend-fail { background: #f5a3a3; }


/* ══════════════════════════════════════════════════════════════
   DASHBOARD · ANALYTICS (compact KPI strip on home screen)
   ══════════════════════════════════════════════════════════════ */
.dash-analytics-section { cursor: pointer; }
.dash-analytics-section:active { opacity: .8; }
.dash-section-sub {
  font-weight: 500; text-transform: none; letter-spacing: 0;
  font-size: 11px; color: var(--hint); margin-left: 6px;
}
.dash-analytics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 0 12px;
}
.dash-an-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-sm);
}
.dash-an-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--hint);
}
.dash-an-value {
  font-size: 17px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.dash-an-value.good { color: #15803d; }
.dash-an-value.warn { color: #c2780a; }
.dash-an-value.bad  { color: #d92020; }

/* Per-supplier dashboard rows (used by offshore) */
.dash-an-row {
  display: grid;
  grid-template-columns: 56px 1fr 1fr 1fr 1fr;
  gap: 4px;
  padding: 7px 12px;
  align-items: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.dash-an-row:first-child { border-top: none; }
.dash-an-row:nth-child(2) { border-top: none; }   /* skip the header→first-data border */
.dash-an-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--hint);
  font-weight: 700;
  background: transparent;
  padding-bottom: 4px;
}
.dash-an-header > div:not(:first-child) { text-align: right; }
.dash-an-name { font-size: 12px; font-weight: 700; color: var(--text); }
.dash-an-cell { text-align: right; font-weight: 600; color: var(--text); }
.dash-an-cell.good { color: #15803d; }
.dash-an-cell.warn { color: #c2780a; }
.dash-an-cell.bad  { color: #d92020; }

/* Container: aggregate (onshore) keeps 4-col grid; per-supplier (offshore)
   is a vertical list of dash-an-row. They both live in .dash-analytics-grid
   so we relax the grid rule when child .dash-an-row is present. */
.dash-analytics-grid:has(.dash-an-row) {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  margin: 0 12px;
  padding: 0;
}
.dash-an-error { padding: 12px; font-size: 13px; color: var(--hint); text-align: center; }

/* Profile page */
.profile-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--hint);
  line-height: 1.4;
}
.profile-hint--success { color: #15803d; }
.profile-hint--error   { color: #d92020; }
