/* ============================================================================
   KỆ TIMESHEET — Owner portal shared styles (D1)
   ----------------------------------------------------------------------------
   Loaded by every owner page (multi-page model). Layout = fixed left sidebar +
   scrolling main. All colours come from base.css design tokens, so the portal
   follows the Light (owner default) / Dark toggle automatically.
   ============================================================================ */

/* ---- Shell: sidebar + main -------------------------------------------------*/
.shell { display: flex; min-height: 100vh; }

.side {
  width: 240px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border-default);
  display: flex; flex-direction: column;
  padding: var(--space-5) var(--space-3);
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: var(--space-2);
  font-weight: 700; font-size: var(--text-lg);
  padding: 0 var(--space-2) var(--space-5);
}
.side-brand .ti { color: var(--accent); font-size: 22px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: var(--text-base);
  font-weight: var(--weight-medium); cursor: pointer;
  text-decoration: none; border: none; background: none; width: 100%;
  text-align: left; font-family: inherit;
}
.nav-item .ti { font-size: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-badge {
  margin-left: auto; background: var(--amber-warning); color: #fff;
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-badge.is-hidden { display: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }

/* ---- Main ------------------------------------------------------------------*/
.main { flex: 1; padding: var(--space-6) var(--space-8); max-width: 1100px; }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--space-6); gap: var(--space-4);
}
.topbar h1 { font-size: var(--text-2xl); margin: 0; }
.topbar .sub { color: var(--text-muted); font-size: var(--text-sm); margin-top: 2px; }
.owner-chip {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); color: var(--text-secondary); flex-shrink: 0;
}
.owner-avatar {
  width: 34px; height: 34px; border-radius: var(--radius-pill);
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--weight-medium);
}

/* ---- Section heading -------------------------------------------------------*/
.sec-head {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: var(--weight-medium);
  margin: var(--space-6) 0 var(--space-3);
}

/* ---- Cards (generic) -------------------------------------------------------*/
.card {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-5);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-4);
}
.card-head h3 { font-size: var(--text-lg); margin: 0; }

/* ---- Dashboard: needs-attention cards --------------------------------------*/
.attn-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.attn-card {
  display: flex; align-items: center; gap: var(--space-4);
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5);
  cursor: pointer; text-decoration: none; color: inherit;
}
.attn-card:hover { border-color: var(--border-strong); }
.attn-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.attn-icon.amber  { background: color-mix(in srgb, var(--amber-warning) 16%, transparent); color: var(--amber-warning); }
.attn-icon.purple { background: var(--accent-soft); color: var(--accent); }
.attn-num { font-size: var(--text-2xl); font-weight: 700; line-height: 1; }
.attn-label { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 3px; }
.attn-card .ti-chevron-right { margin-left: auto; color: var(--text-muted); }

/* ---- Dashboard: working-now list -------------------------------------------*/
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--space-4); align-items: start; }
.work-list { display: flex; flex-direction: column; gap: var(--space-3); }
.work-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-default);
}
.work-row:last-child { border-bottom: none; padding-bottom: 0; }
.emp-avatar {
  width: 38px; height: 38px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--weight-medium); flex-shrink: 0;
}
.work-name { font-weight: var(--weight-medium); }
.work-since { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }
.work-elapsed {
  margin-left: auto; font-variant-numeric: tabular-nums;
  font-weight: var(--weight-medium); color: var(--green-ok);
}
.work-empty { color: var(--text-muted); font-size: var(--text-sm); padding: var(--space-4) 0; text-align: center; }

.badge-live {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); color: var(--green-ok); font-weight: var(--weight-medium);
}
.badge-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-ok); }

/* ---- Dashboard: stat cards -------------------------------------------------*/
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.stat {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-5);
}
.stat-num { font-size: var(--text-3xl); font-weight: 700; line-height: 1; }
.stat-label { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-2); }
.stat-sub { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.stat-divider { border: none; border-top: 1px solid var(--border-default); margin: var(--space-4) 0; }

.disclaimer { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-6); text-align: center; }

/* ---- States ----------------------------------------------------------------*/
.is-hidden { display: none !important; }
.dash-loading, .dash-error { text-align: center; padding: 48px 20px; color: var(--text-secondary); font-size: var(--text-base); }
.dash-error { color: var(--red-critical); }

/* ---- Auth pages (login) — centered card, no sidebar -----------------------*/
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-xl); padding: var(--space-8);
}
.auth-brand {
  display: flex; align-items: center; gap: var(--space-2);
  font-weight: 700; font-size: var(--text-xl); justify-content: center;
  margin-bottom: var(--space-2);
}
.auth-brand .ti { color: var(--accent); font-size: 24px; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: var(--text-sm); margin-bottom: var(--space-6); }
.auth-field { margin-bottom: var(--space-4); }
.auth-field label { display: block; font-size: var(--text-sm); font-weight: var(--weight-medium); margin-bottom: var(--space-2); }
.auth-error { color: var(--red-critical); font-size: var(--text-sm); min-height: 18px; margin-bottom: var(--space-3); }
.auth-foot { text-align: center; font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-5); }
.auth-foot a { color: var(--accent); text-decoration: none; }

/* ---- Approvals (D3): tabs + request cards ---------------------------------*/
.tabs {
  display: flex; gap: var(--space-1);
  border-bottom: 1px solid var(--border-default); margin-bottom: var(--space-5);
}
.tab {
  padding: var(--space-3) var(--space-4); cursor: pointer;
  font-weight: var(--weight-medium); color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: inherit; font-size: var(--text-base);
  display: flex; align-items: center; gap: var(--space-2);
}
.tab:hover { color: var(--text-primary); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count {
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--text-xs); min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
}

.req-list { display: flex; flex-direction: column; gap: var(--space-4); }
.req-card {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-5);
}
.req-card.is-busy { opacity: .6; pointer-events: none; }
.req-top { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.req-emp { display: flex; align-items: center; gap: var(--space-3); }
.req-name { font-weight: var(--weight-medium); }
.req-when { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }
.req-type {
  margin-left: auto; font-size: var(--text-xs); font-weight: var(--weight-medium);
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--bg-hover); color: var(--text-secondary);
}
.req-type.edit { background: color-mix(in srgb, var(--info-blue) 14%, transparent); color: var(--info-blue); }
.req-type.missing { background: color-mix(in srgb, var(--amber-warning) 16%, transparent); color: var(--amber-warning); }
.req-type.vacation, .req-type.personal, .req-type.sick, .req-type.other {
  background: var(--accent-soft); color: var(--accent);
}

.req-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-5);
  background: var(--bg-page); border-radius: var(--radius-md);
  padding: var(--space-4); margin-bottom: var(--space-4);
}
.req-field .k { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 2px; }
.req-field .v { font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.req-field .v.muted { font-weight: 400; color: var(--text-secondary); }
.req-field .v.accent { color: var(--accent); }
.req-field.full { grid-column: 1 / -1; }

.req-adjust { background: var(--bg-default); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); border: 1px dashed var(--border-default); }
.req-adjust-label { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: var(--space-3); display: flex; align-items: center; gap: 6px; }
.req-adjust-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.req-adjust-row .form-field label { font-size: var(--text-sm); }
.req-note { margin-bottom: var(--space-3); }
.req-note label {
  display: block; font-size: var(--text-sm); font-weight: var(--weight-medium);
  margin-bottom: var(--space-2);
}
.req-actions { display: flex; gap: var(--space-3); justify-content: flex-end; align-items: center; }
.req-msg { margin-right: auto; font-size: var(--text-sm); }
.req-msg.err { color: var(--red-critical); }

.req-empty { text-align: center; padding: var(--space-12) var(--space-4); color: var(--text-muted); }
.req-empty .ti { font-size: 40px; display: block; margin-bottom: var(--space-3); opacity: .5; }

/* ---- Time entries (D4): review toolbar + employee groups -------------------*/
.te-toolbar {
  display: flex; align-items: center; gap: var(--space-3);
  flex-wrap: wrap; margin-bottom: var(--space-5);
}
.week-nav { display: flex; align-items: center; gap: var(--space-2); }
.week-nav button {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  border: 1px solid var(--border-default); background: var(--bg-card);
  color: var(--text-secondary); cursor: pointer; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.week-nav button:hover { background: var(--bg-hover); color: var(--text-primary); }
.week-nav button.btn-text { width: auto; padding: 0 var(--space-3); font-size: var(--text-sm); }
.week-label { font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; min-width: 150px; text-align: center; }
.te-filter { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.te-filter select {
  font-family: inherit; font-size: var(--text-sm); padding: 7px 10px;
  border-radius: var(--radius-md); border: 1px solid var(--border-default);
  background: var(--bg-card); color: var(--text-primary);
}
.te-total { font-size: var(--text-sm); color: var(--text-secondary); }
.te-total b { color: var(--text-primary); font-variant-numeric: tabular-nums; }

.emp-group {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); margin-bottom: var(--space-4); overflow: hidden;
}
.emp-group-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
}
.emp-group-head .emp-name { font-weight: var(--weight-medium); }
.emp-group-head .emp-role { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }
.emp-subtotal { margin-left: auto; text-align: right; }
.emp-subtotal .v { font-size: var(--text-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.emp-subtotal .k { font-size: var(--text-xs); color: var(--text-muted); }
.emp-print {
  margin-left: var(--space-4); display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  padding: 8px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border-default); background: var(--bg-card);
  color: var(--text-secondary); cursor: pointer; font-family: inherit;
}
.emp-print:hover { background: var(--bg-hover); color: var(--accent); }

.te-row {
  display: grid; grid-template-columns: 150px 1fr 90px 130px;
  align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-default); font-size: var(--text-sm);
}
.te-row:last-child { border-bottom: none; }
.te-date { font-weight: var(--weight-medium); }
.te-times { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.te-dur { font-variant-numeric: tabular-nums; font-weight: var(--weight-medium); text-align: right; }
.te-flags { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.te-flag {
  font-size: 11px; font-weight: var(--weight-medium);
  padding: 2px 8px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 4px;
}
.te-flag.edited { background: color-mix(in srgb, var(--info-blue) 14%, transparent); color: var(--info-blue); }
.te-flag.open   { background: color-mix(in srgb, var(--green-ok) 16%, transparent); color: var(--green-ok); }
.te-flag.auto   { background: color-mix(in srgb, var(--amber-warning) 16%, transparent); color: var(--amber-warning); }

/* ---- Printable "Timesheet Summary" slip (browser Print -> PDF) -------------*/
.print-area { display: none; }   /* off-screen; shown only by @media print below */
.print-sheet {
  max-width: 620px; margin: 0 auto;
  background: #fff; color: #2C2C2A;
  padding: 32px 36px; font-family: 'DM Sans', sans-serif;
}
.ps-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #2C2C2A; padding-bottom: 14px; }
.ps-biz { font-size: 18px; font-weight: 700; }
.ps-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #6b6b69; margin-top: 2px; }
.ps-meta { text-align: right; font-size: 12px; color: #6b6b69; line-height: 1.5; }
.ps-emp { margin: 16px 0 4px; font-size: 15px; font-weight: 700; }
.ps-period { font-size: 13px; color: #6b6b69; margin-bottom: 14px; }
table.ps-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ps-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #6b6b69; padding: 6px 8px; border-bottom: 1px solid #ddd; }
table.ps-table th.num, table.ps-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.ps-table td { padding: 8px; border-bottom: 1px solid #eee; }
table.ps-table tr.total td { border-top: 2px solid #2C2C2A; border-bottom: none; font-weight: 700; padding-top: 10px; }
.ps-note { font-size: 11px; color: #6b6b69; margin-top: 6px; }
.ps-edit-note { font-size: 12px; background: #f4f7fb; border-left: 3px solid #4A90E2; padding: 8px 10px; margin-top: 14px; color: #2C2C2A; }
.ps-ack { display: flex; gap: 30px; margin-top: 28px; font-size: 12px; color: #6b6b69; }
.ps-ack .line { flex: 1; border-top: 1px solid #999; padding-top: 5px; }
.ps-disclaim { font-size: 10.5px; color: #8a8a88; margin-top: 22px; text-align: center; }

@media print {
  .shell { display: none !important; }
  .print-area { display: block !important; }
  .print-sheet { max-width: none; padding: 0; }

  /* Tips print: show preview table only */
  .tips-print-show { display: block !important; }
  .tips-print-hide { display: none !important; }
}

/* ---- Responsive: collapse sidebar to a top strip on narrow screens ---------*/
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: var(--space-1);
    padding: var(--space-2) var(--space-3); overflow-x: auto;
  }
  .side-brand { display: none; }
  .nav { flex-direction: row; }
  .nav-item span:not(.nav-badge) { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .main { padding: var(--space-5); }
  .attn-row, .grid-2, .stat-row { grid-template-columns: 1fr; }
  .req-body { grid-template-columns: 1fr; }
  .te-filter { margin-left: 0; width: 100%; }
  .te-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .te-row .te-times { grid-column: 1 / -1; order: 3; }
  .emp-print span { display: inline; }
}

/* ============================================================================
   D2 — EMPLOYEES (list + Add/Edit modal + Reset PIN)
   ============================================================================ */
.staff-toolbar {
  display: flex; align-items: center; gap: var(--space-3);
  flex-wrap: wrap; margin-bottom: var(--space-5);
}
.staff-seg {
  display: inline-flex; border: 1px solid var(--border-default);
  border-radius: var(--radius-md); overflow: hidden; background: var(--bg-card);
}
.staff-seg button {
  font-family: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium);
  padding: 7px 14px; border: none; background: transparent; color: var(--text-secondary);
  cursor: pointer;
}
.staff-seg button.is-active { background: var(--accent); color: #fff; }
.staff-count { font-size: var(--text-sm); color: var(--text-muted); }
.staff-toolbar .staff-add { margin-left: auto; }

.staff-list { display: flex; flex-direction: column; gap: var(--space-3); }
.staff-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: var(--space-4); padding: var(--space-4) var(--space-5);
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
.staff-card.is-inactive { opacity: .62; }
.staff-avatar {
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: var(--weight-medium); font-size: var(--text-base);
}
.staff-name { font-weight: var(--weight-medium); color: var(--text-primary); }
.staff-name .badge { margin-left: var(--space-2); vertical-align: middle; }
.staff-meta { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.staff-meta b { color: var(--text-secondary); font-weight: var(--weight-medium); }
.staff-actions { display: flex; gap: var(--space-2); }
.staff-actions button {
  font-family: inherit; font-size: var(--text-sm); padding: 6px 12px;
  border-radius: var(--radius-md); border: 1px solid var(--border-default);
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.staff-actions button:hover { background: var(--bg-hover); color: var(--text-primary); }
.staff-actions button.danger:hover { color: var(--red-critical); border-color: var(--red-critical); }
.staff-actions button:disabled { opacity: .5; cursor: not-allowed; }

.staff-empty {
  text-align: center; color: var(--text-muted); padding: var(--space-8) var(--space-4);
}
.staff-empty i { display: block; font-size: 34px; margin-bottom: var(--space-3); opacity: .6; }

/* Add/Edit + Reset PIN modal helpers */
.pin-input {
  letter-spacing: .5em; text-align: center; font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.modal-msg { font-size: var(--text-sm); color: var(--red-critical); min-height: 1em; margin-right: auto; }

@media (max-width: 720px) {
  .staff-card { grid-template-columns: auto 1fr; }
  .staff-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
}

/* ============================================================================
   D5 — EDIT SHIFT (per-row edit button + edit modal helpers)
   ============================================================================ */
.te-edit {
  font-family: inherit; font-size: var(--text-sm); padding: 4px 10px;
  border-radius: var(--radius-md); border: 1px solid var(--border-default);
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.te-edit:hover { background: var(--bg-hover); color: var(--text-primary); }
.open-hint {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  font-size: var(--text-sm); color: var(--text-muted);
}

/* ============================================================================
   E — TIPS (tip pool entry / history / settings)
   ============================================================================ */

/* ---- Page header + toggle ------------------------------------------------*/
.tips-page-header {
  display: flex; align-items: center; justify-content: flex-end;
  margin-bottom: var(--space-5);
}
.tips-toggle-row { display: flex; align-items: center; gap: var(--space-3); }
.tips-toggle-label { font-size: var(--text-sm); color: var(--text-secondary); }
.tips-toggle-wrap  { display: flex; align-items: center; gap: var(--space-2); }
.tips-toggle {
  position: relative; width: 44px; height: 24px;
  border-radius: var(--radius-pill); background: var(--border-default);
  cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.tips-toggle.tips-toggle-on { background: var(--accent); }
.tips-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform .2s;
}
.tips-toggle.tips-toggle-on::after { transform: translateX(20px); }
.tips-toggle-text { font-size: var(--text-sm); font-weight: var(--weight-medium); }

/* ---- Disabled state ------------------------------------------------------*/
.tips-disabled {
  text-align: center; padding: var(--space-12) var(--space-4);
  color: var(--text-muted);
}
.tips-disabled .ti { font-size: 48px; display: block; margin-bottom: var(--space-4); opacity: .5; }
.tips-disabled h3  { font-size: var(--text-lg); color: var(--text-secondary); margin-bottom: var(--space-2); }

/* ---- Tabs ----------------------------------------------------------------*/
.tips-tabs {
  display: flex; border-bottom: 2px solid var(--border-default);
  margin-bottom: var(--space-6);
}
.tips-tab {
  padding: var(--space-3) var(--space-5); font-size: var(--text-base);
  font-weight: var(--weight-medium); color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: inherit; background: none; border-top: none; border-left: none; border-right: none;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.tips-tab:hover:not(.is-active) { color: var(--text-primary); }
.tips-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tips-panel { }

/* ---- Distributed banner --------------------------------------------------*/
.tips-distributed-banner {
  display: flex; align-items: center; gap: var(--space-3);
  background: color-mix(in srgb, var(--green-ok) 10%, transparent);
  border: 1px solid var(--green-ok); border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5);
}
.tips-distributed-banner .ti { font-size: 20px; color: var(--green-ok); }
.tips-distributed-banner strong { font-size: var(--text-sm); }
.tips-distributed-banner span  { font-size: var(--text-xs); color: var(--text-secondary); }
.btn-ghost-sm {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  border: 1px solid var(--border-default); color: var(--text-secondary);
  font-family: inherit; cursor: pointer; background: var(--bg-card);
}
.btn-ghost-sm:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ---- Meta row (date + method badge) -------------------------------------*/
.tips-meta-row {
  display: flex; align-items: center; gap: var(--space-4);
  margin-bottom: var(--space-5); flex-wrap: wrap;
}
.tips-date-wrap { display: flex; align-items: center; gap: var(--space-2); }
.tips-date-wrap label { font-size: var(--text-sm); color: var(--text-secondary); }
.tips-date-input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  font-size: var(--text-sm); background: var(--bg-card); font-family: inherit;
  color: var(--text-primary);
}
.tips-method-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
}
.tips-badge-pct    { background: var(--accent-soft); color: var(--accent); }
.tips-badge-time   { background: color-mix(in srgb, var(--info-blue) 14%, transparent); color: var(--info-blue); }
.tips-badge-hybrid { background: color-mix(in srgb, var(--accent-teal) 14%, transparent); color: var(--accent-teal); }
.tips-method-link  { font-size: var(--text-xs); color: var(--text-muted); }

/* ---- Cash + CC inputs ---------------------------------------------------*/
.tips-amounts-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5);
  margin-bottom: var(--space-4);
}
.tips-amount-card {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-5);
}
.tips-amount-label {
  font-size: var(--text-sm); color: var(--text-secondary);
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.tips-amount-input-wrap { position: relative; }
.tips-amount-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: var(--text-xl); font-weight: var(--weight-medium); color: var(--text-secondary);
}
.tips-amount-input {
  width: 100%; padding: var(--space-3) var(--space-3) var(--space-3) 26px;
  font-size: var(--text-2xl); font-weight: 700; color: var(--text-primary);
  border: 2px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--bg-page); font-family: inherit; outline: none;
  transition: border-color .15s;
}
.tips-amount-input:focus { border-color: var(--accent); }
.tips-amount-sub { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }

/* ---- Total row ----------------------------------------------------------*/
.tips-total-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--accent-soft); border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5);
}
.tips-total-label  { font-size: var(--text-sm); color: var(--accent); font-weight: var(--weight-medium); }
.tips-total-amount { font-size: var(--text-2xl); font-weight: 700; color: var(--accent); }

/* ---- Notes --------------------------------------------------------------*/
.tips-notes-wrap { margin-bottom: var(--space-5); }
.tips-notes-label {
  display: block; font-size: var(--text-sm); color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.tips-optional { color: var(--text-muted); }
.tips-notes-input {
  width: 100%; padding: var(--space-3);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-family: inherit; background: var(--bg-card);
  color: var(--text-primary); resize: none; outline: none; transition: border-color .15s;
}
.tips-notes-input:focus { border-color: var(--accent); }

/* ---- Preview section ----------------------------------------------------*/
.tips-preview-section { margin-top: var(--space-2); }
.tips-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-3);
}
.tips-preview-title { font-size: var(--text-base); font-weight: var(--weight-medium); }
.tips-preview-note  { font-size: var(--text-xs); color: var(--text-muted); }
.tips-table-wrap {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); overflow: hidden;
}
.tips-preview-table { width: 100%; border-collapse: collapse; }
.tips-preview-table th {
  text-align: left; font-size: var(--text-xs); color: var(--text-secondary);
  font-weight: var(--weight-medium); padding: var(--space-3);
  border-bottom: 1px solid var(--border-default); background: var(--bg-page);
}
.tips-preview-table td {
  padding: var(--space-3); font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-default);
}
.tips-preview-table tr:last-child td { border-bottom: none; }
.tips-preview-empty {
  text-align: center; padding: var(--space-6) !important;
  color: var(--text-muted); font-size: var(--text-sm);
}

/* ---- Employee cell ------------------------------------------------------*/
.tips-emp-cell { display: flex; align-items: center; gap: var(--space-2); }
.tips-emp-dot  {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: 700; color: #fff; flex-shrink: 0;
}

/* ---- Bar chart ----------------------------------------------------------*/
.tips-bar-wrap { display: flex; align-items: center; gap: var(--space-2); }
.tips-bar-bg   { flex: 1; height: 6px; background: var(--border-default); border-radius: 3px; }
.tips-bar-fill { height: 6px; border-radius: 3px; background: var(--accent); }
.tips-bar-pct  { font-size: var(--text-xs); color: var(--text-muted); width: 38px; text-align: right; }

/* ---- Include checkbox ---------------------------------------------------*/
.tips-include-chk { display: flex; justify-content: center; cursor: pointer; }
.tips-include-chk input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ---- Percentage input (preview) ----------------------------------------*/
.tips-pct-input-wrap { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.tips-config-input {
  width: 72px; padding: var(--space-1) var(--space-2); text-align: right;
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-family: inherit; background: var(--bg-page);
  color: var(--text-primary);
}
.tips-config-input:focus { outline: none; border-color: var(--accent); }

/* ---- Pct sum row --------------------------------------------------------*/
.tips-pct-sum {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); padding: var(--space-2) var(--space-3);
}
.tips-pct-sum.ok  { color: var(--green-ok); }
.tips-pct-sum.err { color: var(--red-critical); }

/* ---- Rounding note ------------------------------------------------------*/
.tips-auto-row {
  padding: var(--space-1) var(--space-3) var(--space-2);
}
.tips-rounding-note {
  font-size: var(--text-xs); color: var(--text-muted);
  padding: var(--space-2) var(--space-3); min-height: 24px;
}

/* ---- Empty state (no employees) ----------------------------------------*/
.tips-empty-state {
  text-align: center; padding: var(--space-8) var(--space-4);
  color: var(--text-muted); background: var(--bg-card);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
}
.tips-empty-state .ti { font-size: 36px; display: block; margin-bottom: var(--space-3); opacity: .5; }

/* ---- Action row ---------------------------------------------------------*/
.tips-action-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); margin-top: var(--space-5); padding-top: var(--space-5);
  border-top: 1px solid var(--border-default); flex-wrap: wrap;
}
.tips-action-btns { display: flex; gap: var(--space-3); flex-shrink: 0; }
.tips-disclaimer {
  font-size: var(--text-xs); color: var(--text-muted); max-width: 480px;
  line-height: 1.5;
}

/* ---- History table -------------------------------------------------------*/
.tips-history-table { width: 100%; border-collapse: collapse; }
.tips-history-table th {
  text-align: left; font-size: var(--text-xs); color: var(--text-secondary);
  font-weight: var(--weight-medium); padding: var(--space-3);
  border-bottom: 2px solid var(--border-default); white-space: nowrap;
  background: var(--bg-page);
}
.tips-history-table td {
  padding: var(--space-3); font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-default);
}
.tips-history-table tr:hover td { background: var(--bg-hover); cursor: pointer; }
.tips-history-table tr:last-child td { border-bottom: none; }
.tips-status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-medium);
}
.tips-status-pill.done  { background: color-mix(in srgb, var(--green-ok) 14%, transparent); color: #1a7a4a; }
.tips-status-pill.draft { background: color-mix(in srgb, var(--amber-warning) 14%, transparent); color: #856404; }
.tips-history-foot { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-3); text-align: right; }

/* ---- History modal body -------------------------------------------------*/
.tips-modal-meta {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  background: var(--bg-page); border-radius: var(--radius-md);
  padding: var(--space-4); margin-bottom: var(--space-2);
  font-size: var(--text-sm); color: var(--text-secondary);
}
.tips-modal-meta span { display: flex; flex-direction: column; gap: 2px; }

/* ---- Settings tab --------------------------------------------------------*/
.tips-settings-section { margin-bottom: var(--space-7); }
.tips-settings-title {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: var(--weight-medium); margin-bottom: var(--space-3);
}
.tips-settings-note { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: var(--space-4); }

/* Method cards */
.tips-method-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-4); }
.tips-method-card {
  border: 2px solid var(--border-default); border-radius: var(--radius-lg);
  padding: var(--space-5); cursor: pointer; position: relative;
  transition: border-color .15s, background .15s;
}
.tips-method-card:hover   { border-color: var(--accent); background: var(--accent-soft); }
.tips-method-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.tips-method-check {
  position: absolute; top: var(--space-3); right: var(--space-3);
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: none; align-items: center; justify-content: center; font-size: 11px;
}
.tips-method-card.selected .tips-method-check { display: flex; }
.tips-mc-icon { font-size: 22px; margin-bottom: var(--space-2); }
.tips-mc-icon.percentage { color: var(--accent); }
.tips-mc-icon.time-based { color: var(--info-blue); }
.tips-mc-icon.hybrid      { color: var(--accent-teal); }
.tips-mc-title { font-size: var(--text-base); font-weight: var(--weight-medium); margin-bottom: 4px; }
.tips-mc-desc  { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.5; }

/* Rounding */
.tips-rounding-options { display: flex; gap: var(--space-3); }
.tips-radio-card {
  flex: 1; border: 1px solid var(--border-default); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); cursor: pointer;
  display: flex; align-items: flex-start; gap: var(--space-3);
  transition: border-color .15s;
}
.tips-radio-card input[type=radio] { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.tips-radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tips-rc-label { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.tips-rc-sub   { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }

/* Employee config table */
.tips-emp-config-table { width: 100%; border-collapse: collapse; }
.tips-emp-config-table th {
  text-align: left; font-size: var(--text-xs); color: var(--text-secondary);
  font-weight: var(--weight-medium); padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-default); background: var(--bg-page);
}
.tips-emp-config-table td { padding: var(--space-3); border-bottom: 1px solid var(--border-default); font-size: var(--text-sm); }
.tips-emp-config-table tr:last-child td { border-bottom: none; }

/* Save row */
.tips-save-row {
  display: flex; align-items: center; justify-content: flex-end;
  gap: var(--space-4); margin-top: var(--space-2);
}
.tips-settings-msg { font-size: var(--text-sm); }
.tips-settings-msg.ok  { color: var(--green-ok); }
.tips-settings-msg.err { color: var(--red-critical); }

/* ============================================================================
   F — SCHEDULE
   ============================================================================ */

/* Week nav */
.sched-week-nav {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-4); flex-wrap: wrap;
}
.sched-week-label {
  font-size: var(--text-sm); font-weight: 600; min-width: 180px; text-align: center;
}
.sched-week-actions { margin-left: auto; display: flex; gap: var(--space-2); }

/* Grid */
.sched-grid-scroll { overflow-x: auto; }
.sched-grid {
  width: 100%; border-collapse: collapse; min-width: 700px;
  font-size: var(--text-sm);
}
.sched-emp-col  { width: 140px; min-width: 120px; }
.sched-day-col  { min-width: 110px; text-align: center; }
.sched-grid thead th {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle); border-bottom: 1px solid var(--border-default);
  font-weight: 600; font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-secondary);
}
.sched-grid thead th.is-today { color: var(--accent); }
.sched-grid tbody tr { border-bottom: 1px solid var(--border-default); }
.sched-grid tbody tr:last-child { border-bottom: none; }

/* Employee name cell */
.sched-emp-name {
  padding: var(--space-2) var(--space-3);
  display: flex; align-items: center; gap: var(--space-2);
  font-weight: 500; white-space: nowrap; vertical-align: top;
}
.sched-emp-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: 700; flex-shrink: 0;
}

/* Day cell */
.sched-cell {
  padding: var(--space-1) var(--space-2); vertical-align: top;
  border-left: 1px solid var(--border-default); min-height: 56px;
}
.sched-cell.is-today { background: var(--accent-faint, rgba(124,58,237,.04)); }

/* Shift chip */
.sched-shift {
  background: var(--accent); color: #fff;
  border-radius: var(--radius-sm); padding: 2px 6px;
  margin-bottom: 3px; cursor: grab;
  display: flex; align-items: flex-start; gap: 4px; flex-wrap: wrap;
  font-size: 11px; line-height: 1.4; user-select: none;
  touch-action: none; /* required for Pointer Events on touch */
  transition: opacity .15s, box-shadow .15s;
}
.sched-shift:hover { opacity: .88; box-shadow: 0 2px 6px rgba(124,58,237,.35); }
.sched-shift.is-noshow { background: var(--red-critical, #CF2C2C); }
.sched-shift.is-dragging { opacity: .35; cursor: grabbing; }
.sched-shift-time { font-weight: 600; white-space: nowrap; }
.sched-shift-note { color: rgba(255,255,255,.8); font-size: 10px; width: 100%; }
.sched-noshow-badge { margin-left: auto; }

/* Drag-over highlight on day cells */
.sched-cell.drag-over {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* Drag ghost */
#schedDragGhost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(124,58,237,.45);
  transform: rotate(2deg) scale(1.05);
  white-space: nowrap;
  display: none;
}

/* Add cell (+) */
.sched-add-cell {
  width: 100%; min-height: 28px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; font-size: 13px;
  border: none; background: transparent;
  transition: background .12s, color .12s;
}
.sched-add-cell:hover { background: var(--accent); color: #fff; }

/* No-show legend */
.sched-noshow-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 2px; background: var(--red-critical, #CF2C2C); margin-right: 3px;
}
.sched-legend {
  font-size: var(--text-xs); color: var(--text-muted);
  margin-top: var(--space-3); text-align: right;
}

/* Modal form helpers */
.form-row-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.form-field label { display: block; font-size: var(--text-xs); font-weight: 600;
  color: var(--text-secondary); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.sched-modal-actions {
  display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-5);
}

/* Templates tab */
.sched-tmpl-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: var(--space-4); gap: var(--space-3);
}
.sched-tmpl-note { font-size: var(--text-sm); color: var(--text-secondary); max-width: 480px; }
.sched-tmpl-list { display: flex; flex-direction: column; gap: var(--space-2); }
.sched-tmpl-card {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}
.sched-tmpl-name { font-weight: 600; flex: 1; }
.sched-tmpl-time { font-size: var(--text-sm); color: var(--text-secondary); }
.btn-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-default); background: transparent;
  color: var(--text-secondary); cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-danger-outline {
  border-color: var(--red-critical, #CF2C2C); color: var(--red-critical, #CF2C2C);
  background: transparent;
}
.btn-danger-outline:hover { background: var(--red-critical, #CF2C2C); color: #fff; }

/* ============================================================================
   Settings (I)
   ============================================================================ */
.sett-section { margin-bottom: var(--space-7); }

.sett-section-head {
  display: flex; align-items: flex-start; gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.sett-section-head > .ti {
  font-size: 20px; color: var(--accent); margin-top: 2px; flex-shrink: 0;
}
.sett-section-title { font-size: var(--text-lg); font-weight: 700; }
.sett-section-sub   { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }

.sett-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 680px;
}

.sett-hint {
  font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px;
}

.sett-save-row {
  display: flex; align-items: center; gap: var(--space-3);
  margin-top: var(--space-5); padding-top: var(--space-4);
  border-top: 1px solid var(--border-default);
}

.sett-saved {
  font-size: var(--text-sm); color: var(--green-ok, #16A34A);
  display: flex; align-items: center; gap: 4px;
}
.sett-saved.is-hidden { display: none; }

/* Toggle switch */
.sett-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
}
.sett-toggle-label { font-weight: var(--weight-medium); font-size: var(--text-sm); }

.sett-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.sett-toggle input { opacity: 0; width: 0; height: 0; }
.sett-toggle-track {
  position: absolute; inset: 0;
  background: var(--border-default);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background .2s;
}
.sett-toggle-track::after {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.sett-toggle input:checked + .sett-toggle-track { background: var(--accent); }
.sett-toggle input:checked + .sett-toggle-track::after { transform: translateX(18px); }

.sett-emp-url-row {
  display: flex; gap: var(--space-2); align-items: center;
}
.sett-emp-url-row .form-input {
  flex: 1; font-family: monospace; font-size: var(--text-sm);
  color: var(--text-secondary); cursor: text;
}

/* ============================================================================
   Notification bell (H)
   ============================================================================ */
.notif-bell-wrap {
  position: relative;
}
.notif-bell-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
  transition: background .15s, color .15s;
}
.notif-bell-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: var(--red-critical, #CF2C2C);
  color: #fff; font-size: 10px; font-weight: 700;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; pointer-events: none;
}
.notif-badge.is-hidden { display: none; }

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 200;
  overflow: hidden;
}
.notif-dropdown.is-hidden { display: none; }

.notif-item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  font-size: var(--text-sm); line-height: 1.4;
}
.notif-item .ti { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.notif-item.is-overdue { color: var(--red-critical, #CF2C2C); background: color-mix(in srgb, var(--red-critical, #CF2C2C) 6%, transparent); text-decoration: none; }
.notif-item.is-missed  { color: var(--amber-warning, #D97706); background: color-mix(in srgb, var(--amber-warning, #D97706) 6%, transparent); text-decoration: none; }
.notif-item:hover { filter: brightness(.95); }
.notif-chevron { margin-left: auto; font-size: 14px; opacity: .6; flex-shrink: 0; }

.notif-empty {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-4); font-size: var(--text-sm);
  color: var(--text-secondary);
}
.notif-empty .ti { color: var(--green-ok, #16A34A); font-size: 16px; }

.notif-footer {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs); color: var(--text-muted);
  text-align: center;
}

/* ============================================================================
   Reports (G)
   ============================================================================ */

/* Filter bar */
.rpt-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--space-3); margin-bottom: var(--space-5);
}
.rpt-presets { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.rpt-preset.is-active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.rpt-range {
  display: flex; align-items: center; gap: var(--space-2);
  margin-left: auto;
}
.rpt-date-input { width: 140px; }
.rpt-range-sep { color: var(--text-muted); font-size: var(--text-sm); }

/* Summary cards */
.rpt-summary-row {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.rpt-summary-card {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5);
  min-width: 140px;
}
.rpt-summary-name { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 4px; }
.rpt-summary-val  { font-size: var(--text-2xl); font-weight: 700; line-height: 1; }
.rpt-summary-label { font-size: var(--text-xs); color: var(--text-muted); margin-top: 3px; }

/* Export row */
.rpt-export-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-3); gap: var(--space-3);
}
.rpt-disclaimer {
  font-size: var(--text-xs); color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}
.rpt-disclaimer .ti { font-size: 13px; }

/* Table */
.rpt-table-wrap { overflow-x: auto; }
.rpt-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-card); border-radius: var(--radius-lg);
  overflow: hidden; font-size: var(--text-sm);
  border: 1px solid var(--border-default);
}
.rpt-table thead th {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-default);
  font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-secondary); text-align: left;
}
.rpt-table thead th.rpt-num { text-align: right; }
.rpt-table tbody tr { border-bottom: 1px solid var(--border-default); }
.rpt-table tbody tr:last-child { border-bottom: none; }
.rpt-table tbody tr:hover { background: var(--bg-hover); }
.rpt-table td { padding: var(--space-3) var(--space-4); color: var(--text-primary); }
.rpt-table td.rpt-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rpt-table td.rpt-method { text-transform: capitalize; color: var(--text-secondary); font-size: var(--text-xs); }

/* ---- Bulk assign modal ---- */
.bulk-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: background .15s;
}
.bulk-check-row:hover { background: var(--bg-hover); }
.bulk-check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: #7c3aed; flex-shrink: 0; margin: 0 8px 0 0; }
.bulk-select-all-row { font-weight: 600; border-bottom: 1px solid var(--border); border-radius: 0; }
.bulk-emp-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-1) 0;
}
.form-error { font-size: var(--text-sm); color: var(--danger, #ef4444); margin-top: var(--space-2); }

/* ---- Bulk assign — day pills ---- */
.bulk-days-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.bulk-day-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  color: var(--text-secondary);
}
.bulk-day-pill input { display: none; }
.bulk-day-pill.is-checked {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

/* ---- Timeline tab ---- */
.tl-wrap {
  overflow-x: auto;
  padding-bottom: var(--space-4);
}
.tl-ruler {
  display: flex;
  margin-left: 140px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.tl-hour {
  min-width: 64px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 4px;
  flex-shrink: 0;
}
.tl-rows { display: flex; flex-direction: column; gap: 0; }
.tl-row {
  display: flex;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
}
.tl-row:last-child { border-bottom: none; }
.tl-emp-label {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}
.tl-emp-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tl-track {
  flex: 1;
  position: relative;
  height: 36px;
  display: flex;
}
.tl-track-col {
  min-width: 64px;
  flex-shrink: 0;
  border-left: 1px dashed var(--border);
  height: 100%;
}
.tl-bar {
  position: absolute;
  height: 28px;
  top: 4px;
  background: #7c3aed;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(124,58,237,.25);
  transition: opacity .15s;
}
.tl-bar:hover { opacity: .85; }
.tl-no-shift {
  position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================================
   J — COMMISSION
   ============================================================================ */

/* ---- Locked screen --------------------------------------------------------*/
.comm-locked {
  max-width: 440px; margin: 60px auto; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-xl); padding: var(--space-8);
}
.comm-locked-icon {
  width: 64px; height: 64px; border-radius: var(--radius-lg);
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: var(--space-4);
}
.comm-locked h2 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.comm-locked-sub { color: var(--text-secondary); font-size: var(--text-sm); margin-bottom: var(--space-5); }
.comm-locked-features {
  list-style: none; padding: 0; margin: 0 0 var(--space-6);
  text-align: left;
}
.comm-locked-features li {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); color: var(--text-secondary);
  padding: var(--space-2) 0;
}
.comm-locked-features li .ti { color: var(--accent); font-size: 16px; }
.comm-locked-cta { width: 100%; justify-content: center; }

/* ---- Week nav row ---------------------------------------------------------*/
.comm-week-nav {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-2);
}
.comm-log-actions { display: flex; align-items: center; gap: var(--space-2); }

/* ---- Source chip ----------------------------------------------------------*/
.comm-source-chip {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-medium);
}
.comm-source-chip.pos    { background: color-mix(in srgb, var(--amber-warning) 16%, transparent); color: #856404; }
.comm-source-chip.manual { background: var(--bg-hover); color: var(--text-secondary); }

/* ---- Period / mode pills --------------------------------------------------*/
.comm-period-pills {
  display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2);
}
.comm-period-pill {
  display: inline-flex; align-items: center;
  padding: 6px 16px; border-radius: 999px;
  border: 1.5px solid var(--border-default);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  cursor: pointer; background: transparent; color: var(--text-secondary);
  font-family: inherit; transition: all .15s; user-select: none;
}
.comm-period-pill:hover { border-color: var(--accent); color: var(--accent); }
.comm-period-pill.is-active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* ---- Mode helper text -----------------------------------------------------*/
.comm-mode-helpers { margin-top: var(--space-3); }
.comm-mode-helper {
  font-size: var(--text-sm); color: var(--text-secondary);
  background: var(--bg-page); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); line-height: 1.5;
}

/* ---- Tiers table ----------------------------------------------------------*/
.comm-tiers-table { width: 100%; border-collapse: collapse; }
.comm-tiers-table th {
  text-align: left; font-size: var(--text-xs); color: var(--text-secondary);
  font-weight: var(--weight-medium); padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-default); background: var(--bg-page);
}
.comm-tiers-table td {
  padding: var(--space-3); border-bottom: 1px solid var(--border-default);
  font-size: var(--text-sm);
}
.comm-tiers-table tr:last-child td { border-bottom: none; }

/* ---- Report controls ------------------------------------------------------*/
.comm-report-controls { margin-bottom: var(--space-2); }
.comm-report-period-label {
  font-size: var(--text-xs); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: var(--space-4); font-weight: var(--weight-medium);
}
.comm-report-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

/* ---- Report card ----------------------------------------------------------*/
.comm-report-card {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-5); overflow: hidden;
}
.comm-report-card-head {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4); padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}
.comm-report-lines { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
.comm-report-line {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-sm); color: var(--text-secondary);
}
.comm-report-total {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: var(--text-base);
  padding-top: var(--space-3); border-top: 2px solid var(--border-default);
  margin-top: var(--space-2);
}
.comm-report-disclaimer {
  font-size: var(--text-xs); color: var(--text-muted);
  margin-top: var(--space-3); line-height: 1.4;
}

/* ---- Print: show only report cards ----------------------------------------*/
@media print {
  /* This rule piggybacks on the existing @media print in owner.css which
     hides .shell. We additionally show the report cards full-width. */
  #commContent .comm-report-controls,
  #commContent .tips-tabs { display: none !important; }
  #commContent .comm-report-cards { grid-template-columns: 1fr 1fr; }
  #commContent .comm-report-card { break-inside: avoid; }
  .comm-period-pills, .comm-log-actions { display: none !important; }
}

/* ── Employee search box ─────────────────────────────────────────────────── */
.emp-search-wrap {
  position: relative;
  margin-bottom: var(--space-4);
}
.emp-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.emp-search-input {
  padding-left: 36px !important;
}
