/* ================================================================
   SerBiz — Main Stylesheet
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

/* ── light mode (default) ── */
:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #eff6ff;
  --accent:        #0ea5e9;
  --success:       #22c55e;
  --danger:        #ef4444;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --border:        #e2e8f0;
  --card-bg:       #ffffff;
  --bg:            #f1f5f9;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:     0 20px 60px rgba(0,0,0,.15), 0 8px 20px rgba(0,0,0,.08);
  --radius:        14px;
  --radius-sm:     8px;
  --transition:    .2s ease;
}

/* ── dark mode overrides ── */
[data-theme="dark"] {
  --primary:       #3b82f6;
  --primary-dark:  #2563eb;
  --primary-light: #1e3a5f;
  --accent:        #38bdf8;
  --text:          #f1f5f9;
  --text-muted:    #94a3b8;
  --text-light:    #64748b;
  --border:        #334155;
  --card-bg:       #1e293b;
  --bg:            #0f172a;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.4),  0 1px 2px rgba(0,0,0,.3);
  --shadow-md:     0 4px 16px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg:     0 20px 60px rgba(0,0,0,.6), 0 8px 20px rgba(0,0,0,.4);
}

[data-theme="dark"] .bg-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, #1e3a5f 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 110%, #0c2a3a 0%, transparent 55%),
    #0f172a;
}

[data-theme="dark"] .signin-card,
[data-theme="dark"] .pin-modal,
[data-theme="dark"] .welcome-card {
  border-color: rgba(255,255,255,.06);
}

[data-theme="dark"] .tab-group { background: #0f172a; }
[data-theme="dark"] .tab.active { background: #1e293b; }

[data-theme="dark"] .field-wrap input {
  background: #0f172a;
  color: var(--text);
}
[data-theme="dark"] .field-wrap input:focus { background: #1e293b; }
[data-theme="dark"] .field-wrap input.field-ok  { background: #052e16; }
[data-theme="dark"] .field-wrap input.field-error { background: #2d0a0a; }

[data-theme="dark"] .btn-google {
  background: #1e293b;
  border-color: #334155;
  color: var(--text);
}
[data-theme="dark"] .btn-google:hover { background: #263348; }

[data-theme="dark"] .demo-banner {
  background: #172554;
  border-color: #1d4ed8;
}
[data-theme="dark"] .demo-banner-top { color: #93c5fd; }
[data-theme="dark"] .demo-cred-row { color: #bfdbfe; }
[data-theme="dark"] .demo-cred-label { color: #3b82f6; }
[data-theme="dark"] .demo-cred-value {
  background: #1e3a5f;
  color: #93c5fd;
}

[data-theme="dark"] .numpad-key {
  background: #1e293b;
  border-color: #334155;
  color: var(--text);
}
[data-theme="dark"] .numpad-clear { background: #2d1515; border-color: #7f1d1d; }

[data-theme="dark"] .accounts-header,
[data-theme="dark"] .dash-header {
  background: rgba(15,23,42,.85);
}

[data-theme="dark"] .account-card {
  background: #1e293b;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

/* ── theme toggle button ── */
#theme-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), transform var(--transition), box-shadow var(--transition);
}
#theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.08);
}
#theme-toggle .material-icons-round { font-size: 22px; transition: transform .35s ease; }
#theme-toggle:active .material-icons-round { transform: rotate(25deg); }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── VIEWS ── */
.view {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
}
.view.active { display: flex; }

/* ── GRADIENT BG ── */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, #c7d9ff 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 110%, #bae6fd 0%, transparent 55%),
    #f1f5f9;
}

/* ================================================================
   SIGN-IN
   ================================================================ */
#view-signin {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.signin-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: 24px;
  padding: 48px 44px 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.8);
}

/* brand */
.brand { text-align: center; margin-bottom: 28px; }
.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
}
.brand-icon .material-icons-round { font-size: 30px; }
.brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
}
.brand-tagline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--text-light);
  margin-top: 4px;
  text-transform: uppercase;
}

.form-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-transform: uppercase;
}

/* tabs */
.tab-group {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.tab {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.tab.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* fields */
.field-wrap {
  position: relative;
  margin-bottom: 14px;
}
.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-light);
  pointer-events: none;
  transition: color var(--transition);
}
.field-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 44px 0 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
.field-wrap input:focus {
  border-color: var(--primary);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field-wrap input:focus + .field-icon,
.field-wrap:focus-within .field-icon { color: var(--primary); }
.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.toggle-pw:hover { color: var(--primary); }

/* flex row */
.flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.remember-me input[type=checkbox] {
  accent-color: var(--primary);
  width: 16px; height: 16px;
  cursor: pointer;
}
.forgot-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

/* buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.4);
}
.btn-primary:active { transform: translateY(0); opacity: 1; }
.btn-primary:disabled,
.btn-google:disabled {
  opacity: .72;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-loading {
  pointer-events: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btn-spin .8s linear infinite;
}

.btn-spinner-dark {
  border-color: rgba(148, 163, 184, .35);
  border-top-color: #0f172a;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-light);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn-google:hover {
  background: var(--bg);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-sm);
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.signup-hint {
  text-align: center;
  margin-top: 20px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.signup-hint a { color: var(--primary); font-weight: 600; text-decoration: none; }
.signup-hint a:hover { text-decoration: underline; }

/* hidden form (signup/signin toggle) */
.hidden-form { display: none; }

/* field error / success states */
.field-wrap input.field-error {
  border-color: var(--danger);
  background: #fff5f5;
}
.field-wrap input.field-error:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
  border-color: var(--danger);
}
.field-wrap input.field-ok {
  border-color: var(--success);
  background: #f0fdf4;
}
.field-wrap input.field-ok:focus {
  box-shadow: 0 0 0 3px rgba(34,197,94,.12);
  border-color: var(--success);
}

/* match icon inside confirm-password field */
.match-icon {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}
.match-icon.visible { opacity: 1; }
.match-icon.ok    { color: var(--success); }
.match-icon.error { color: var(--danger); }

/* match message below confirm field */
.match-msg {
  font-size: 12.5px;
  font-weight: 500;
  margin-top: -8px;
  margin-bottom: 10px;
  min-height: 18px;
  padding-left: 2px;
}
.match-msg.ok    { color: var(--success); }
.match-msg.error { color: var(--danger); }

/* demo banner */
.demo-banner {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.demo-banner-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.demo-banner-top .material-icons-round { font-size: 16px; }
.demo-banner-title { flex: 1; }
.demo-creds {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.demo-cred-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1e40af;
}
.demo-cred-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #60a5fa;
  width: 62px;
  flex-shrink: 0;
}
.demo-cred-value {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 13px;
  background: #dbeafe;
  padding: 2px 8px;
  border-radius: 4px;
  color: #1d4ed8;
  letter-spacing: .02em;
}
.demo-banner button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity var(--transition);
}
.demo-banner button:hover { opacity: .85; }


/* ================================================================
   ACCOUNT SELECTION
   ================================================================ */
#view-accounts {
  flex-direction: column;
  align-items: stretch;
}

.accounts-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.accounts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-sm {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}
.brand-sm .material-icons-round { font-size: 22px; }
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.store-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.accounts-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px 40px;
}
.accounts-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 8px;
}
.accounts-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 780px;
}

.account-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 20px 24px;
  background: var(--card-bg);
  border: 2px solid transparent;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  user-select: none;
}
.account-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 36px rgba(37,99,235,.14);
}
.account-card:active { transform: translateY(-2px); }

.card-avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.card-name {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}
.badge-admin {
  background: #fef3c7;
  color: #92400e;
}
.badge-staff {
  background: #e0f2fe;
  color: #075985;
}
.badge-manager {
  background: #ede9fe;
  color: #5b21b6;
}
.card-biz-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.4;
}


/* ================================================================
   PIN OVERLAY
   ================================================================ */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pin-overlay.hidden { display: none; }

.pin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(8px);
}

.pin-modal {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border-radius: 28px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp .25s cubic-bezier(.22,.68,0,1.2);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.pin-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border: none;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.pin-close:hover { background: var(--border); color: var(--text); }

.pin-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.pin-name {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}
.pin-role {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.pin-label {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 500;
}

/* dots */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}
.dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.15);
}
.dot.error {
  background: var(--danger);
  border-color: var(--danger);
}

.pin-error {
  font-size: 13px;
  color: var(--danger);
  font-weight: 500;
  min-height: 20px;
  margin-bottom: 14px;
}

/* numpad */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.numpad-key {
  height: 60px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  user-select: none;
}
.numpad-key:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.numpad-key:active { transform: scale(.94); }
.numpad-clear {
  background: #fff5f5;
  border-color: #fecaca;
  color: var(--danger);
}
.numpad-clear:hover {
  background: #fee2e2;
  border-color: var(--danger);
  color: var(--danger);
}
.numpad-ok {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.numpad-ok:hover {
  opacity: .9;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  color: #fff;
}

/* shake animation for wrong PIN */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}
.shake { animation: shake .4s ease; }


/* ================================================================
   DASHBOARDS (shared)
   ================================================================ */
#view-dashboard-admin,
#view-dashboard-manager,
#view-dashboard-staff {
  flex-direction: column;
  align-items: stretch;
}

.dashboard-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* header */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
[data-theme="dark"] .dash-header { background: rgba(15,23,42,.85); }

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.dash-username { font-size: 13.5px; font-weight: 700; color: var(--text); }
.dash-role-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* live clock in header */
.dash-live-clock {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  letter-spacing: .5px;
}

/* body */
.dash-body {
  flex: 1;
  padding: 32px 28px 40px;
  overflow-y: auto;
}

/* page title row */
.dash-page-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.dash-page-title h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--success);
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.3);
  border-radius: 20px;
  padding: 3px 10px;
  text-transform: uppercase;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.7); }
}

/* stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.stat-value.clocked-in  { color: var(--success); }
.stat-value.clocked-out { color: var(--text-muted); }

/* records table */
.records-table-wrap {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.records-table thead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.records-table th {
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: left;
  white-space: nowrap;
}
.records-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.records-table tbody tr:last-child td { border-bottom: none; }
.records-table tbody tr:hover { background: var(--bg); }

.employee-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rec-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.rec-name { font-weight: 600; }

.badge-role {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}
.status-pill.in  { background: rgba(34,197,94,.12);  color: #16a34a; border: 1px solid rgba(34,197,94,.3); }
.status-pill.out { background: rgba(100,116,139,.12); color: var(--text-muted); border: 1px solid var(--border); }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-pill.in  .dot { background: var(--success); }
.status-pill.out .dot { background: var(--text-light); }

.duration-cell { font-variant-numeric: tabular-nums; font-weight: 500; }
.time-cell     { font-variant-numeric: tabular-nums; color: var(--text-muted); }

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 32px !important;
  font-size: 14px;
}

/* ================================================================
   STAFF DASHBOARD (specific)
   ================================================================ */
.staff-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-top: 40px;
}

/* big clock */
.staff-clock-wrap {
  text-align: center;
}
.staff-clock {
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: var(--text);
  line-height: 1;
}
.staff-date {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: .3px;
}

/* action card */
.staff-action-card {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 32px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.staff-status-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-light);
  transition: background .3s;
}
.status-dot.clocked-in { background: var(--success); animation: pulse 1.4s ease infinite; }
.staff-status-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.staff-elapsed {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  min-height: 36px;
  letter-spacing: 1px;
}

.btn-timeinout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(34,197,94,.35);
  transition: opacity .2s, transform .2s, box-shadow .2s;
}
.btn-timeinout:hover {
  opacity: .9;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34,197,94,.4);
}
.btn-timeinout:active { transform: translateY(0); }
.btn-timeinout.timeout {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
  box-shadow: 0 4px 16px rgba(239,68,68,.35);
}
.btn-timeinout.timeout:hover { box-shadow: 0 8px 20px rgba(239,68,68,.4); }
.btn-timeinout .material-icons-round { font-size: 22px; }

.staff-last-action {
  font-size: 12.5px;
  color: var(--text-muted);
  min-height: 18px;
}

/* staff's own records table */
.staff-records-wrap {
  width: 100%;
  max-width: 560px;
}
.staff-records-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.staff-records-table { font-size: 13px; }
.staff-records-table th,
.staff-records-table td { padding: 10px 14px; }


/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 500px) {
  .signin-card { padding: 36px 24px 30px; }
  .accounts-grid { grid-template-columns: repeat(2, 1fr); }
  .pin-modal { padding: 28px 20px 24px; }
  .dash-body { padding: 20px 14px 32px; }
  .records-table th, .records-table td { padding: 10px 10px; }
}

@media (max-width: 360px) {
  .accounts-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .account-card { padding: 20px 12px 18px; }
  .card-avatar { width: 60px; height: 60px; font-size: 22px; }
}


/* ================================================================
   ADMIN DASHBOARD TABS
   ================================================================ */
.dash-tab-nav {
  display: flex;
  gap: 2px;
  padding: 10px 20px 0;
  background: var(--card-bg);
  border-bottom: 2px solid var(--border);
}
[data-theme="dark"] .dash-tab-nav { background: #1e293b; }

.dash-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 8px 8px 0 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.dash-tab .material-icons-round { font-size: 18px; }
.dash-tab:hover { color: var(--primary); background: var(--primary-light); }
.dash-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.dash-panel { display: none; }
.dash-panel.active { display: block; }

/* ================================================================
   ADMIN DASHBOARD (TIMEKEEP STYLE)
   ================================================================ */
#view-dashboard-admin .bg-gradient {
  background:
    radial-gradient(ellipse 70% 50% at 8% -8%, rgba(0, 153, 171, .12), transparent 60%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(33, 89, 161, .16), transparent 60%),
    #04070d;
}

#view-dashboard-admin .dashboard-container {
  overflow: hidden;
}

#view-dashboard-admin .tk-admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

#view-dashboard-admin .tk-admin-sidebar {
  border-right: 1px solid rgba(148, 163, 184, .16);
  background: linear-gradient(180deg, rgba(7, 11, 19, .98), rgba(4, 7, 13, .98));
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#view-dashboard-admin .tk-admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 29px;
  font-weight: 800;
  color: #14b8c7;
  padding: 4px 8px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

#view-dashboard-admin .tk-admin-brand .material-icons-round {
  font-size: 24px;
}

#view-dashboard-admin .tk-admin-tab-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
}

#view-dashboard-admin .tk-nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #475569;
  padding: 12px 12px 4px;
  user-select: none;
}

[data-theme="light"] #view-dashboard-admin .tk-nav-group-label {
  color: #94a3b8;
}

#view-dashboard-admin .tk-admin-tab-nav .dash-tab {
  width: 100%;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  justify-content: flex-start;
  padding: 10px 12px;
  color: #94a3b8;
}

#view-dashboard-admin .tk-admin-tab-nav .dash-tab:hover {
  color: #e2e8f0;
  background: rgba(15, 23, 42, .85);
  border-color: rgba(56, 189, 248, .28);
}

#view-dashboard-admin .tk-admin-tab-nav .dash-tab.active {
  color: #d1fae5;
  border-color: rgba(45, 212, 191, .5);
  border-bottom-color: rgba(45, 212, 191, .5);
  background: linear-gradient(90deg, rgba(14, 116, 144, .34), rgba(5, 46, 66, .4));
}

#view-dashboard-admin .tk-admin-sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(148, 163, 184, .12);
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#view-dashboard-admin .tk-lock-btn {
  background: rgba(15, 23, 42, .65);
  border: 1px solid rgba(148, 163, 184, .24);
}

#view-dashboard-admin .tk-admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(2, 6, 13, .9);
}

#view-dashboard-admin .tk-admin-topbar {
  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  padding: 20px 24px;
  flex-wrap: nowrap;
}

#view-dashboard-admin .tk-admin-title {
  font-size: 36px;
  line-height: 1.05;
  color: #f8fafc;
  letter-spacing: -.4px;
}

#view-dashboard-admin .tk-admin-subtitle {
  margin-top: 3px;
  font-size: 16px;
  color: #94a3b8;
}

#view-dashboard-admin .dash-live-clock {
  color: #94a3b8;
}

#view-dashboard-admin .tk-admin-body {
  padding: 18px 20px 28px;
}

#view-dashboard-admin .tk-admin-filter-bar {
  margin-bottom: 14px;
}

#view-dashboard-admin .biz-select,
#view-dashboard-admin .emp-search,
#view-dashboard-admin .btn-secondary {
  background: #0b1320;
  border-color: #223247;
  color: #cbd5e1;
}

#view-dashboard-admin .tk-status-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

#view-dashboard-admin .tk-status-card {
  border: 1px solid #1f2937;
  border-radius: 10px;
  background: #0b111c;
  overflow: hidden;
  min-height: 170px;
}

#view-dashboard-admin .tk-status-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}

#view-dashboard-admin .tk-status-card.notyetin .tk-status-card-head {
  background: linear-gradient(90deg, rgba(124, 45, 18, .35), rgba(69, 26, 3, .35));
}

#view-dashboard-admin .tk-status-card.clockedin .tk-status-card-head {
  background: linear-gradient(90deg, rgba(6, 78, 59, .42), rgba(6, 95, 70, .3));
}

#view-dashboard-admin .tk-status-card.onbreak .tk-status-card-head {
  background: linear-gradient(90deg, rgba(30, 64, 175, .35), rgba(30, 41, 59, .35));
}

#view-dashboard-admin .tk-status-card.clockedout .tk-status-card-head {
  background: linear-gradient(90deg, rgba(30, 41, 59, .32), rgba(2, 6, 23, .45));
}

#view-dashboard-admin .tk-status-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
}

#view-dashboard-admin .tk-status-count {
  min-width: 24px;
  height: 20px;
  border-radius: 999px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #e2e8f0;
  background: rgba(2, 6, 23, .55);
  border: 1px solid rgba(148, 163, 184, .2);
}

#view-dashboard-admin .tk-status-card-body {
  padding: 12px;
}

#view-dashboard-admin .tk-status-empty {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #8da1b8;
  font-size: 14px;
}

#view-dashboard-admin .tk-status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#view-dashboard-admin .tk-status-person {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 8px;
  background: rgba(15, 23, 42, .52);
  padding: 6px 8px;
}

#view-dashboard-admin .tk-status-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
}

#view-dashboard-admin .tk-status-name {
  color: #dbe6f3;
  font-size: 12px;
  font-weight: 600;
}

#view-dashboard-admin .tk-admin-refresh-note {
  color: #7f93ab;
  text-align: center;
  font-size: 13px;
  margin-bottom: 14px;
}

#view-dashboard-admin .tk-admin-records-table-wrap {
  border-color: #1f2937;
  background: #0a111a;
}

#view-dashboard-admin .records-table thead {
  background: #101827;
  border-bottom-color: #1f2937;
}

#view-dashboard-admin .records-table tbody tr:hover {
  background: #0f172a;
}

/* Light-mode overrides for Timekeep-style admin dashboard */
[data-theme="light"] #view-dashboard-admin .bg-gradient {
  background:
    radial-gradient(ellipse 70% 50% at 8% -8%, rgba(14, 116, 144, .10), transparent 60%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(37, 99, 235, .08), transparent 60%),
    #f5f8fc;
}

[data-theme="light"] #view-dashboard-admin .tk-admin-sidebar {
  background: linear-gradient(180deg, #f8fbff, #f0f6fd);
  border-right-color: rgba(148, 163, 184, .35);
}

[data-theme="light"] #view-dashboard-admin .tk-admin-brand {
  color: #0e7490;
  border-bottom-color: rgba(148, 163, 184, .32);
}

[data-theme="light"] #view-dashboard-admin .tk-admin-tab-nav .dash-tab {
  color: #334155;
}

[data-theme="light"] #view-dashboard-admin .tk-admin-tab-nav .dash-tab:hover {
  color: #0f172a;
  background: #eaf2fb;
  border-color: rgba(14, 116, 144, .25);
}

[data-theme="light"] #view-dashboard-admin .tk-admin-tab-nav .dash-tab.active {
  color: #0f172a;
  border-color: rgba(14, 116, 144, .45);
  border-bottom-color: rgba(14, 116, 144, .45);
  background: linear-gradient(90deg, rgba(45, 212, 191, .22), rgba(59, 130, 246, .18));
}

[data-theme="light"] #view-dashboard-admin .tk-admin-sidebar-footer {
  border-top-color: rgba(148, 163, 184, .3);
}

[data-theme="light"] #view-dashboard-admin .tk-lock-btn {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] #view-dashboard-admin .tk-admin-main {
  background: rgba(255, 255, 255, .62);
}

[data-theme="light"] #view-dashboard-admin .tk-admin-topbar {
  border-bottom-color: rgba(148, 163, 184, .35);
}

[data-theme="light"] #view-dashboard-admin .tk-admin-title {
  color: #0f172a;
}

[data-theme="light"] #view-dashboard-admin .tk-admin-subtitle,
[data-theme="light"] #view-dashboard-admin .dash-live-clock,
[data-theme="light"] #view-dashboard-admin .tk-admin-refresh-note {
  color: #64748b;
}

[data-theme="light"] #view-dashboard-admin .biz-select,
[data-theme="light"] #view-dashboard-admin .emp-search,
[data-theme="light"] #view-dashboard-admin .btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] #view-dashboard-admin .tk-status-card {
  background: #ffffff;
  border-color: #dbe4ef;
}

[data-theme="light"] #view-dashboard-admin .tk-status-card-head {
  border-bottom-color: rgba(148, 163, 184, .28);
}

[data-theme="light"] #view-dashboard-admin .tk-status-card h3,
[data-theme="light"] #view-dashboard-admin .tk-status-name {
  color: #0f172a;
}

[data-theme="light"] #view-dashboard-admin .tk-status-count {
  color: #0f172a;
  background: rgba(148, 163, 184, .14);
  border-color: rgba(148, 163, 184, .35);
}

[data-theme="light"] #view-dashboard-admin .tk-status-empty {
  color: #64748b;
}

[data-theme="light"] #view-dashboard-admin .tk-status-person {
  background: #f8fbff;
  border-color: #dbe4ef;
}

[data-theme="light"] #view-dashboard-admin .tk-admin-records-table-wrap {
  background: #ffffff;
  border-color: #dbe4ef;
}

[data-theme="light"] #view-dashboard-admin .records-table thead {
  background: #f8fafc;
  border-bottom-color: #dbe4ef;
}

[data-theme="light"] #view-dashboard-admin .records-table tbody tr:hover {
  background: #f8fafc;
}

@media (max-width: 980px) {
  #view-dashboard-admin .tk-admin-layout {
    grid-template-columns: 1fr;
  }

  #view-dashboard-admin .tk-admin-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
    gap: 12px;
  }

  #view-dashboard-admin .tk-admin-tab-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  #view-dashboard-admin .tk-admin-tab-nav .dash-tab {
    width: auto;
  }

  #view-dashboard-admin .tk-admin-sidebar-footer {
    margin-top: 0;
  }

  #view-dashboard-admin .tk-status-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 620px) {
  #view-dashboard-admin .tk-admin-topbar {
    padding: 16px 14px;
    flex-wrap: wrap;
  }

  #view-dashboard-admin .tk-admin-title {
    font-size: 30px;
  }

  #view-dashboard-admin .tk-admin-body {
    padding: 14px;
  }

  #view-dashboard-admin .tk-status-grid {
    grid-template-columns: 1fr;
  }
}


/* ================================================================
   EMPLOYEE TOOLBAR
   ================================================================ */
.emp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.emp-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.emp-search {
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  width: 200px;
  outline: none;
  transition: border-color var(--transition);
}
.emp-search:focus { border-color: var(--primary); }
[data-theme="dark"] .emp-search { background: #0f172a; }

.btn-add-emp {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37,99,235,.3);
  transition: opacity var(--transition), transform var(--transition);
}
.btn-add-emp:hover { opacity: .9; transform: translateY(-1px); }
.btn-add-emp .material-icons-round { font-size: 18px; }

.btn-emp-edit, .btn-emp-del {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  transition: var(--transition);
}
.btn-emp-edit:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-emp-del:hover  { border-color: var(--danger);  color: var(--danger);  background: #fff5f5; }
[data-theme="dark"] .btn-emp-del:hover { background: #2d0a0a; }
.btn-emp-edit .material-icons-round,
.btn-emp-del  .material-icons-round { font-size: 15px; }

.comp-summary {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.sched-summary {
  font-size: 12px;
  color: var(--text-muted);
}
.sched-day {
  display: inline-block;
  width: 24px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 0;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-light);
  border: 1px solid var(--border);
  margin: 1px;
}
.sched-day.on { background: var(--primary); color: #fff; border-color: var(--primary); }


/* ================================================================
   EMPLOYEE MODAL
   ================================================================ */
.emp-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.emp-modal.hidden { display: none; }

.emp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(8px);
}

.emp-modal-box {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border-radius: 24px;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s cubic-bezier(.22,.68,0,1.2);
  overflow: hidden;
}

.emp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  flex-shrink: 0;
}
.emp-modal-header h3 {
  font-size: 18px;
  font-weight: 800;
}

.emp-modal-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.emp-mtab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 6px 6px 0 0;
  transition: color var(--transition), border-color var(--transition);
}
.emp-mtab .material-icons-round { font-size: 16px; }
.emp-mtab:hover { color: var(--primary); }
.emp-mtab.active { color: var(--primary); border-bottom-color: var(--primary); }

.emp-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.emp-mtab-panel { display: none; }
.emp-mtab-panel.active { display: block; }

.emp-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-secondary {
  height: 42px;
  padding: 0 22px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.emp-modal-footer .btn-primary { height: 42px; width: auto; }


/* ================================================================
   FORM COMPONENTS (modal)
   ================================================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input,
.form-group select {
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select { background: #0f172a; }
.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.form-section-divider {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin: 20px 0 14px;
}


/* ── Color swatches ── */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.color-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform .15s, border-color .15s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--primary); }

/* ── Avatar preview ── */
.emp-avatar-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.preview-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}
.emp-avatar-preview span { font-size: 14px; font-weight: 600; color: var(--text); }


/* ── Schedule grid ── */
.schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schedule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  transition: border-color var(--transition), background var(--transition);
}


/* ================================================================
   SETUP WIZARD
   ================================================================ */
#view-setup {
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.setup-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
}
.setup-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 44px 48px 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.8);
}
[data-theme="dark"] .setup-card {
  border-color: rgba(255,255,255,.06);
  background: #1e293b;
}
.setup-brand { text-align: center; margin-bottom: 32px; }

.setup-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 36px;
}
.stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.stepper-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: var(--bg);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}
.stepper-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text-light);
  text-transform: uppercase;
  transition: color var(--transition);
}
.stepper-item.active .stepper-circle { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.stepper-item.active .stepper-label  { color: var(--primary); }
.stepper-item.completed .stepper-circle { background: var(--success); border-color: var(--success); color: #fff; }
.stepper-item.completed .stepper-label  { color: var(--success); }
.stepper-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 40px;
  margin-bottom: 20px;
}

.setup-panel { display: none; }
.setup-panel.active { display: block; }
.setup-title { font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 8px; }
.setup-desc  { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.setup-actions { margin-top: 28px; }
.setup-actions-row { display: flex; gap: 10px; justify-content: flex-end; }
.btn-primary-inline { width: auto !important; padding: 0 28px; }

/* Template grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}
@media (max-width: 500px) { .template-grid { grid-template-columns: repeat(2, 1fr); } }
.template-grid-sm { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }

.tpl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px 14px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-align: center;
  user-select: none;
}
[data-theme="dark"] .tpl-card { background: #0f172a; }
.tpl-card:hover { border-color: var(--primary); background: var(--primary-light); transform: translateY(-2px); }
.tpl-card.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 4px 16px rgba(37,99,235,.18); }
[data-theme="dark"] .tpl-card.selected { background: #1e3a5f; }
.tpl-icon  { font-size: 32px; transition: transform .2s; }
.tpl-card:hover .tpl-icon, .tpl-card.selected .tpl-icon { transform: scale(1.15); }
.tpl-label { font-size: 12px; font-weight: 700; color: var(--text); }
.tpl-check { position: absolute; top: 8px; right: 8px; font-size: 18px; color: var(--primary); opacity: 0; transition: opacity .15s; }
.tpl-card.selected .tpl-check { opacity: 1; }

.setup-biz-block {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--bg);
}
[data-theme="dark"] .setup-biz-block { background: #0f172a; }
.setup-biz-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 14.5px; }
.setup-branch-list { display: flex; flex-direction: column; gap: 8px; }
.setup-branch-row  { display: flex; align-items: center; gap: 8px; }
.setup-branch-row input {
  flex: 1; height: 38px; padding: 0 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card-bg); color: var(--text); font-family: inherit; font-size: 13.5px; outline: none;
  transition: border-color var(--transition);
}
[data-theme="dark"] .setup-branch-row input { background: #1e293b; }
.setup-branch-row input:focus { border-color: var(--primary); }

.setup-done-wrap  { text-align: center; margin-bottom: 24px; }
.setup-done-icon  {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #fef08a, #fbbf24);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; box-shadow: 0 8px 24px rgba(251,191,36,.35);
}
.setup-done-icon .material-icons-round { font-size: 38px; color: #78350f; }
.setup-done-list { text-align: left; display: inline-block; margin-top: 16px; min-width: 280px; }
.setup-done-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); margin-bottom: 10px;
}
[data-theme="dark"] .setup-done-item { background: #0f172a; }
.setup-done-item strong { font-size: 14px; font-weight: 700; display: block; }
.setup-done-branches { font-size: 12px; color: var(--text-muted); margin-top: 2px; }


/* ================================================================
   BIZ / BRANCH BAR
   ================================================================ */
.biz-branch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .biz-branch-bar { background: rgba(15,23,42,.78); }

.biz-select {
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  min-width: 160px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--transition);
}
[data-theme="dark"] .biz-select { background-color: #1e293b; }
.biz-select:focus { border-color: var(--primary); }

.card-biz-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
.admin-filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.biz-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 20px;
}


/* ================================================================
   BUSINESS CARDS (Businesses tab)
   ================================================================ */
.biz-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.biz-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.biz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.biz-card-header {
  position: relative;
  padding: 24px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}
.biz-card-icon { font-size: 40px; color: #fff; }
.biz-card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.biz-card-actions .btn-icon {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.3);
  color: #fff;
}
.biz-card-actions .btn-icon:hover { background: rgba(255,255,255,.35); border-color: rgba(255,255,255,.6); color: #fff; }
.biz-card-body  { padding: 16px 18px 18px; }
.biz-card-name  { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.biz-card-type  { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 12px; }
.biz-card-branches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.branch-chip {
  font-size: 11.5px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
}
.biz-card-stats { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-muted); font-weight: 500; }


/* ================================================================
   MANAGER ACCESS SECTION
   ================================================================ */
.manager-access-section {
  margin-top: 8px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg);
}
[data-theme="dark"] .manager-access-section { background: #0f172a; }
.mgr-access-block { margin-bottom: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--card-bg); }
.mgr-access-biz { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin-bottom: 10px; cursor: pointer; }
.mgr-access-biz input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.mgr-branch-list { display: flex; flex-direction: column; gap: 6px; padding-left: 24px; }
.mgr-branch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.mgr-branch-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }


/* ================================================================
   BUSINESS MODAL BRANCH ROWS
   ================================================================ */
.biz-branch-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.biz-branch-row .biz-branch-name {
  flex: 1; height: 38px; padding: 0 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 13.5px; outline: none;
  transition: border-color var(--transition);
}
[data-theme="dark"] .biz-branch-row .biz-branch-name { background: #0f172a; }
.biz-branch-row .biz-branch-name:focus { border-color: var(--primary); }
.btn-full-w { width: 100%; justify-content: center; display: flex; align-items: center; gap: 6px; }


/* ================================================================
   POS VIEW
   ================================================================ */

/* Shell */
#view-pos { overflow: hidden; background: var(--bg); }

.pos-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────── */
.pos-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 62px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  z-index: 10;
}

.pos-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}
.pos-brand-icon { font-size: 28px; }
.pos-biz-name   { font-size: 15px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; }
.pos-branch-name { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }

.pos-clock-center {
  flex: 1;
  text-align: center;
}
.pos-time    { font-size: 20px; font-weight: 800; letter-spacing: -.5px; font-family: 'SF Mono', 'Consolas', monospace; }
.pos-date-sm { font-size: 11.5px; color: var(--text-muted); margin-top: -1px; }

.pos-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pos-staff-info { display: flex; align-items: center; gap: 8px; }
.pos-staff-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.pos-staff-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.pos-staff-role { font-size: 11px; color: var(--text-muted); }

.btn-pos-timeout {
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 36px;
  background: #fef2f2; color: #dc2626;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-pos-timeout:hover { background: #fee2e2; border-color: #f87171; }
[data-theme="dark"] .btn-pos-timeout { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .btn-pos-timeout:hover { background: #7f1d1d; }

/* ── Main (two column) ───────────────────────────────────────────── */
.pos-main {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  overflow: hidden;
}
@media (max-width: 860px) {
  /* Sidebar becomes a fixed overlay that slides in from the left */
  .pos-sidebar {
    position: fixed !important;
    left: 0; top: 0; bottom: 0;
    z-index: 300;
    width: 220px !important;
    padding: 12px 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    transform: translateX(-100%);
    transition: transform .22s ease, box-shadow .22s ease !important;
    box-shadow: none;
  }
  .pos-sidebar:not(.pos-sidebar-closed) {
    transform: translateX(0);
    box-shadow: 4px 0 28px rgba(0,0,0,.28);
  }
  /* Main area takes full width — no sidebar column */
  .pos-main { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .pos-panel-order { display: none; }
  .pos-panel-queue { display: none; }
  .pos-main.pos-mtab-order .pos-panel-order { display: flex; }
  .pos-main.pos-mtab-order .pos-panel-queue { display: none; }
  .pos-main.pos-mtab-queue .pos-panel-order { display: none; }
  .pos-main.pos-mtab-queue .pos-panel-queue { display: flex; }
  /* Header: compact layout so all buttons stay reachable */
  .pos-header {
    padding: 0 10px;
    gap: 8px;
  }
  .pos-branch-name { display: none; }
  .pos-staff-name, .pos-staff-role { display: none; }
  .btn-pos-timeout > span:last-child { display: none; }
  .btn-pos-timeout { padding: 0 10px; }
  .pos-clock-center { flex: 0 1 auto; }
}
/* Sidebar backdrop (mobile overlay) */
.pos-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  /* z-index is relative to #view-pos's stacking context;
     must be below the sidebar (300) but above the panel content */
  z-index: 10;
  cursor: pointer;
}
.pos-sidebar-backdrop.visible { display: block; }

/* ── Mobile tab switcher (hidden on desktop) ────────────────────── */
.pos-mobile-tabs {
  display: none;
}
@media (max-width: 860px) {
  .pos-mobile-tabs {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    padding: 10px 14px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
  }
  .pos-mtab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
  }
  .pos-mtab .material-icons-round { font-size: 18px; }
  .pos-mtab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
  }
  .pos-mtab-badge {
    background: #fff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .pos-mtab:not(.active) .pos-mtab-badge {
    background: var(--primary);
    color: #fff;
  }
}

/* ── Generic panel ───────────────────────────────────────────────── */
.pos-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
.pos-panel-order {
  border-right: 1px solid var(--border);
  background: var(--card-bg);
  padding: 16px 18px 20px;
  gap: 0;
}
[data-theme="dark"] .pos-panel-order { background: #1e293b; }

.pos-panel-queue {
  background: var(--bg);
  padding: 16px 16px 0;
}

.pos-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 14px;
  flex-shrink: 0;
}
.pos-panel-head .material-icons-round { font-size: 20px; color: var(--primary); }
.pos-order-num {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
}
.queue-badge {
  margin-left: auto;
  min-width: 22px; height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}

/* ── Form sections (left panel) ─────────────────────────────────── */
.pos-form-section {
  margin-bottom: 14px;
}
.pos-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.pos-field:last-child { margin-bottom: 0; }
.pos-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
  display: block;
}
.pos-optional { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; }

.pos-field input,
.pos-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color var(--transition);
}
[data-theme="dark"] .pos-field input,
[data-theme="dark"] .pos-field textarea { background: #0f172a; }
.pos-field input:focus,
.pos-field textarea:focus { border-color: var(--primary); }
.pos-field textarea { resize: vertical; min-height: 56px; }
.input-shake { animation: shake .4s ease; }

/* ── Service cards ───────────────────────────────────────────────── */
.pos-services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pos-svc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  text-align: center;
  user-select: none;
  transition: border-color var(--transition), background var(--transition), transform .15s;
}
[data-theme="dark"] .pos-svc-card { background: #0f172a; }
.pos-svc-card:hover  { border-color: var(--primary); transform: translateY(-1px); }
.pos-svc-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 2px 10px rgba(37,99,235,.15);
}
[data-theme="dark"] .pos-svc-card.selected { background: #1e3a5f; }
.pos-svc-icon  { font-size: 22px; }
.pos-svc-label { font-size: 10.5px; font-weight: 700; line-height: 1.2; color: var(--text); }
.pos-svc-price { font-size: 10px; font-weight: 600; }
.pos-svc-check {
  position: absolute; top: 5px; right: 5px;
  font-size: 14px; color: var(--primary);
  opacity: 0; transition: opacity .15s;
}
.pos-svc-card.selected .pos-svc-check { opacity: 1; }

/* ── Qty row ─────────────────────────────────────────────────────── */
.pos-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), background var(--transition);
}
[data-theme="dark"] .qty-btn { background: #0f172a; }
.qty-btn:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.pos-qty-row input[type=number] {
  width: 80px; height: 36px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 15px; font-weight: 700;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
[data-theme="dark"] .pos-qty-row input { background: #0f172a; }
.pos-qty-row input:focus { border-color: var(--primary); }
.pos-qty-row input::-webkit-inner-spin-button,
.pos-qty-row input::-webkit-outer-spin-button { opacity: 1; }

/* ── Price preview ───────────────────────────────────────────────── */
.pos-price-preview {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg);
  margin-bottom: 14px;
}
[data-theme="dark"] .pos-price-preview { background: #0f172a; }
.pos-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.pos-price-row:last-child { margin-bottom: 0; }
.pos-price-total { font-size: 17px; font-weight: 800; color: var(--text); padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; }
.pos-svc-name-lbl { font-weight: 600; color: var(--text); }
.pos-rate-hint { font-size: 11.5px; }
.pos-svc-subtotal-row { font-size: 12.5px; color: var(--text-muted); padding-left: 4px; }
.pos-svc-subtotal-lbl { font-style: italic; }

/* ── Add to Queue button ─────────────────────────────────────────── */
.btn-add-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition), transform .15s;
}
.btn-add-order:hover:not(:disabled) { background: var(--primary-dark, #1d4ed8); transform: translateY(-1px); }
.btn-add-order:disabled { opacity: .45; cursor: not-allowed; }

/* ── Queue tabs ──────────────────────────────────────────────────── */
.pos-queue-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.pos-qtab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.pos-qtab:hover  { border-color: var(--primary); color: var(--primary); }
.pos-qtab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Order queue list ────────────────────────────────────────────── */
.pos-queue-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.pos-queue-empty {
  margin: auto;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.pos-queue-empty .material-icons-round { font-size: 48px; opacity: .3; display: block; margin-bottom: 8px; }
.pos-queue-empty p { font-size: 13.5px; line-height: 1.6; }

/* ── Order card ──────────────────────────────────────────────────── */
.pos-order-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--card-bg);
  transition: border-color var(--transition);
  flex-shrink: 0;
}
[data-theme="dark"] .pos-order-card { background: #1e293b; }
.poc-pending    { border-left: 4px solid #f59e0b; }
.poc-processing { border-left: 4px solid #2563eb; }
.poc-done       { border-left: 4px solid #059669; opacity: .8; }

.poc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.poc-num      { font-size: 11.5px; font-weight: 800; color: var(--text-muted); }
.poc-customer { font-size: 13.5px; font-weight: 700; flex: 1; }
.poc-status   { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.poc-status-pending    { background: #fef3c7; color: #92400e; }
.poc-status-processing { background: #dbeafe; color: #1e40af; }
.poc-status-done       { background: #d1fae5; color: #065f46; }
[data-theme="dark"] .poc-status-pending    { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .poc-status-processing { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .poc-status-done       { background: #052e16; color: #6ee7b7; }

.poc-mid {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 6px;
}
.poc-svc-icon { font-size: 16px; }
.poc-svc-name { flex: 1; font-weight: 600; }
.poc-qty      { color: var(--text-muted); font-size: 12px; }
.poc-price    { font-size: 14px; font-weight: 800; margin-left: auto; }

.poc-notes {
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  margin-bottom: 4px;
}

.poc-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.poc-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.poc-btn .material-icons-round { font-size: 14px; }
.poc-btn-progress { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.poc-btn-progress:hover { background: #dbeafe; }
.poc-btn-done     { border-color: #059669; color: #065f46; background: #ecfdf5; }
.poc-btn-done:hover { background: #d1fae5; }
.poc-btn-delete   { border-color: transparent; color: var(--text-muted); background: transparent; margin-left: auto; }
.poc-btn-delete:hover { color: #dc2626; background: #fef2f2; border-color: #fca5a5; }
[data-theme="dark"] .poc-btn-progress { background: #1e3a5f; }
[data-theme="dark"] .poc-btn-done     { background: #052e16; }

.poc-done-stamp {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  color: #059669;
}
.poc-done-stamp .material-icons-round { font-size: 14px; }

.poc-btn-notify { border-color: #0891b2; color: #0e7490; background: #ecfeff; }
.poc-btn-notify:hover { background: #cffafe; }
[data-theme="dark"] .poc-btn-notify { background: #083344; border-color: #0e7490; color: #67e8f9; }
[data-theme="dark"] .poc-btn-notify:hover { background: #164e63; }

/* ── SMS Toast ───────────────────────────────────────────────────── */
.sms-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 380px;
  padding: 14px 16px;
  background: #0f172a;
  color: #f1f5f9;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(16px) scale(.97);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
[data-theme="light"] .sms-toast { background: #1e293b; }
.sms-toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.sms-toast-icon {
  font-size: 22px;
  color: #38bdf8;
  flex-shrink: 0;
  margin-top: 1px;
}
.sms-toast-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.sms-toast-body strong { font-size: 13.5px; font-weight: 800; color: #38bdf8; }
.sms-toast-body em     { font-style: normal; font-weight: 700; }
.sms-toast-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color .15s;
}
.sms-toast-close:hover { color: #f1f5f9; }
.sms-toast-close .material-icons-round { font-size: 17px; }

/* ── Shift footer ────────────────────────────────────────────────── */
.pos-shift-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  border-top: 1.5px solid var(--border);
  padding: 12px 0 14px;
  margin-top: 8px;
  background: var(--bg);
  position: sticky;
  bottom: 0;
}
.pos-shift-stat { text-align: center; }
.shift-val { display: block; font-size: 18px; font-weight: 800; }
.shift-lbl { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

/* ── Placeholder (no-template) ───────────────────────────────────── */
.pos-placeholder-wrap {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 40px;
  gap: 10px;
}
.pos-placeholder-icon { font-size: 64px; opacity: .3; }
.pos-placeholder-hint { font-size: 13px; color: var(--text-muted); }
.pos-placeholder-hint code { background: var(--bg); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.pos-placeholder-actions { display: flex; gap: 10px; margin-top: 12px; }


/* ================================================================
   POS SIDEBAR + SCREEN SWITCHER
   ================================================================ */

/* pos-wrap already sets flex-direction column — we need a new row layer below the header */
.pos-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.pos-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  transition: width .22s ease, padding .22s ease;
  overflow: hidden;
}
[data-theme="dark"] .pos-sidebar { background: #1e293b; }

.pos-sidebar.pos-sidebar-closed {
  width: 0;
  padding: 0;
}

.pos-body.pos-sidebar-hidden .pos-sidebar { width: 0; padding: 0; }

.pos-sbnav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px;
}

.pos-sbnav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  width: 100%;
  text-align: left;
}
.pos-sbnav-item .material-icons-round { font-size: 20px; flex-shrink: 0; }
.pos-sbnav-item:hover  { background: var(--bg); color: var(--text); }
.pos-sbnav-item.active { background: var(--primary-light); color: var(--primary); }
[data-theme="dark"] .pos-sbnav-item.active { background: #1e3a5f; }

.pos-sbnav-label { overflow: hidden; }

/* ── Screens container ──────────────────────────────────────────── */
.pos-screens {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.pos-screen {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
  height: 100%;
}
.pos-screen.active { display: flex; }

/* pos-main lives inside .pos-screen now — keep existing styles working */
.pos-screen > .pos-main { flex: 1; overflow: hidden; }

/* Sidebar toggle btn (already styled as .btn-icon — just needs spacing) */
.pos-sidebar-toggle { flex-shrink: 0; }


/* ================================================================
   INVENTORY SCREEN
   ================================================================ */

.inv-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 24px 0;
  gap: 12px;
}

/* ── Toolbar ─────────────────────────────────────────────────────── */
.inv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}
.inv-toolbar-left { display: flex; align-items: center; gap: 10px; }
.inv-title-icon   { font-size: 26px; color: var(--primary); }
.inv-title        { font-size: 20px; font-weight: 800; margin: 0; }

.inv-toolbar-right { display: flex; align-items: center; gap: 10px; }

.inv-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.inv-search-icon {
  position: absolute;
  left: 10px;
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.inv-search-wrap input {
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  width: 220px;
  transition: border-color var(--transition);
}
[data-theme="dark"] .inv-search-wrap input { background: #0f172a; }
.inv-search-wrap input:focus { border-color: var(--primary); }

.inv-add-btn { width: auto; padding: 0 18px; height: 38px; display: flex; align-items: center; gap: 6px; font-size: 13.5px; }

/* ── Low Stock Banner ────────────────────────────────────────────── */
.inv-low-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1.5px solid #fbbf24;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
[data-theme="dark"] .inv-low-banner { background: #451a03; border-color: #92400e; color: #fcd34d; }
.inv-low-banner .material-icons-round { font-size: 20px; color: #f59e0b; flex-shrink: 0; }

/* ── Table ───────────────────────────────────────────────────────── */
.inv-table-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 16px;
}
.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.inv-table thead th {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
[data-theme="dark"] .inv-table thead th { background: #1e293b; }
.inv-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.inv-table tbody tr:last-child { border-bottom: none; }
.inv-table tbody tr:hover { background: var(--bg); }
.inv-table tbody td { padding: 10px 14px; vertical-align: middle; }

.inv-row-low { background: #fffbeb !important; }
[data-theme="dark"] .inv-row-low { background: #1c1406 !important; }

.inv-item-name     { font-weight: 700; }
.inv-item-sku      { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.inv-item-notes-row { font-size: 11.5px; color: var(--text-muted); font-style: italic; margin-top: 2px; }

.inv-cat-chip {
  font-size: 11px; font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.inv-qty-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inv-qty-val { font-weight: 800; min-width: 28px; text-align: center; }
.inv-qty-low .inv-qty-val { color: #dc2626; }
.inv-qty-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.inv-qty-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.inv-actions-cell { text-align: right; white-space: nowrap; }
.inv-actions-cell .poc-btn { padding: 4px 8px; }
.inv-actions-cell .poc-btn .material-icons-round { font-size: 16px; }

/* ── Inventory Modal ─────────────────────────────────────────────── */
.inv-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.inv-modal.hidden { display: none; }

.inv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
}

.inv-modal-box {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border-radius: 20px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}
[data-theme="dark"] .inv-modal-box { background: #1e293b; }

.inv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.inv-modal-header h3 { font-size: 16px; font-weight: 800; margin: 0; }

.inv-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inv-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) { .inv-form-row { grid-template-columns: 1fr; } }

.inv-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

/* ── Inventory Type Tabs ─────────────────────────────────────────── */
.inv-type-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}
.inv-type-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--transition), border-color var(--transition);
}
.inv-type-tab .material-icons-round { font-size: 18px; }
.inv-type-tab:hover { color: var(--text); }
.inv-type-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Inventory modal — type radios ───────────────────────────────── */
.form-group-full { grid-column: 1 / -1; }
.inv-type-radios {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.inv-radio-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
.inv-radio-opt input { display: none; }
.inv-radio-opt .material-icons-round { font-size: 18px; color: var(--text-muted); }
.inv-radio-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
[data-theme="dark"] .inv-radio-opt:has(input:checked) { background: #1e3a5f; }
.inv-radio-opt:has(input:checked) .material-icons-round { color: var(--primary); }

/* ── POS — Punch item search ─────────────────────────────────────── */
.pos-punch-search-wrap {
  position: relative;
}
.pos-punch-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.pos-punch-search-wrap input {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color var(--transition);
}
[data-theme="dark"] .pos-punch-search-wrap input { background: #0f172a; }
.pos-punch-search-wrap input:focus { border-color: var(--primary); }

.pos-punch-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 220px;
  overflow-y: auto;
}
[data-theme="dark"] .pos-punch-dropdown { background: #1e293b; }
.pos-punch-dropdown.hidden { display: none; }

.pos-punch-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background var(--transition);
}
.pos-punch-result:hover { background: var(--primary-light); }
[data-theme="dark"] .pos-punch-result:hover { background: #1e3a5f; }
.pos-punch-result-name { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text); }
.pos-punch-result-qty  { font-size: 12px; color: var(--text-muted); }
.pos-punch-result-price { font-size: 13px; font-weight: 700; color: var(--text); }

/* ── Punch type badges ───────────────────────────────────────────── */
.pos-punch-result-type,
.pos-punch-item-type {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
}
.punch-type-product { background: #dbeafe; color: #1d4ed8; }
.punch-type-supply  { background: #dcfce7; color: #15803d; }
[data-theme="dark"] .punch-type-product { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .punch-type-supply  { background: #14532d; color: #86efac; }

/* ── Punched items list (in POS form) ───────────────────────────── */
.pos-punch-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pos-punch-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
[data-theme="dark"] .pos-punch-item { background: #0f172a; }
.pos-punch-item-name  { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); min-width: 80px; }
.pos-punch-item-qty-row { display: flex; align-items: center; gap: 4px; }
.pos-punch-item-price { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 60px; text-align: right; }
.pos-punch-remove { padding: 2px 4px !important; min-width: unset; }

/* ── Punched items on order card ────────────────────────────────── */
.poc-punched-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 0 2px;
}
.poc-punched-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.poc-punch-product { background: #dbeafe; color: #1d4ed8; }
.poc-punch-supply  { background: #dcfce7; color: #15803d; }
[data-theme="dark"] .poc-punch-product { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .poc-punch-supply  { background: #14532d; color: #86efac; }

/* ── Browse / Add Items button ───────────────────────────────────── */
.btn-add-items {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 9px 14px;
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-add-items:hover { background: #bfdbfe; }
[data-theme="dark"] .btn-add-items { background: #1e3a5f; }
[data-theme="dark"] .btn-add-items:hover { background: #1e40af44; }
.btn-add-items .material-icons-round { font-size: 20px; }

/* ── Item Picker Modal ───────────────────────────────────────────── */
.item-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-picker-modal.hidden { display: none; }

.item-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}

.item-picker-box {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: min(680px, 96vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
[data-theme="dark"] .item-picker-box { background: #1e293b; }

.item-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.item-picker-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
}
.item-picker-title .material-icons-round { font-size: 22px; }
.item-picker-title h3 { font-size: 16px; font-weight: 800; color: var(--text); margin: 0; }

.item-picker-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px 0;
  flex-shrink: 0;
}

.item-picker-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
[data-theme="dark"] .item-picker-search-wrap { background: #0f172a; }
.item-picker-search-wrap:focus-within { border-color: var(--primary); }
.item-picker-search-wrap .material-icons-round { font-size: 18px; color: var(--text-muted); flex-shrink: 0; }
.item-picker-search-wrap input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
}

.item-picker-filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.item-picker-tab {
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.item-picker-tab:hover { border-color: var(--primary); color: var(--primary); }
.item-picker-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Grid ── */
.item-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px 20px;
  overflow-y: auto;
  flex: 1;
}

.item-picker-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 10px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: default;
}
[data-theme="dark"] .item-picker-card { background: #0f172a; }
.item-picker-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,.12); }
.item-picker-card-oos { opacity: .45; pointer-events: none; }

.ipc-type-badge { display: inline-flex; align-self: flex-start; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.ipc-name  { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; }
.ipc-cat   { font-size: 11px; color: var(--text-light); }
.ipc-price { font-size: 14px; font-weight: 800; color: var(--primary); }
.ipc-stock { font-size: 11px; color: var(--text-muted); }
.ipc-stock-low { color: #ef4444; font-weight: 700; }

.ipc-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.btn-ipc-add {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  justify-content: center;
  padding: 6px 0;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-ipc-add:hover { background: #1d4ed8; }
.btn-ipc-add .material-icons-round { font-size: 15px; }
.btn-ipc-add.disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.ipc-qty-val { font-size: 14px; font-weight: 800; min-width: 22px; text-align: center; }

.item-picker-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 0;
  color: var(--text-muted);
}
.item-picker-empty .material-icons-round { font-size: 36px; }

.item-picker-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.item-picker-footer .btn-primary { width: auto; padding: 0 24px; }


[data-theme="dark"] .schedule-row { background: #0f172a; }
.schedule-row.active { border-color: var(--primary); background: var(--primary-light); }
[data-theme="dark"] .schedule-row.active { background: #1e3a5f; }
.schedule-row .form-toggle { flex: 1; min-width: 100px; font-size: 13px; font-weight: 700; color: var(--text); }
.schedule-day-label { font-size: 13px; font-weight: 700; color: var(--text); }
.schedule-row input[type="time"] {
  width: 120px;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
[data-theme="dark"] .schedule-row input[type="time"] { background: #1e293b; }
.schedule-row input[type="time"]:focus { border-color: var(--primary); }
.schedule-row input[type="time"]:disabled { opacity: .35; cursor: not-allowed; }


/* ── Compensation type cards ── */
.comp-type-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 480px) { .comp-type-group { grid-template-columns: 1fr; } }

.comp-type-opt { cursor: pointer; }
.comp-type-opt input { display: none; }
.comp-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  background: var(--bg);
}
[data-theme="dark"] .comp-type-card { background: #0f172a; }
.comp-type-card .material-icons-round { font-size: 24px; color: var(--text-muted); }
.comp-type-card strong { font-size: 13px; color: var(--text); }
.comp-type-card small  { font-size: 11px; color: var(--text-light); }
.comp-type-opt input:checked + .comp-type-card {
  border-color: var(--primary);
  background: var(--primary-light);
}
[data-theme="dark"] .comp-type-opt input:checked + .comp-type-card { background: #1e3a5f; }
.comp-type-opt input:checked + .comp-type-card .material-icons-round { color: var(--primary); }

.comp-fields { display: none; }
.comp-fields.visible { display: block; }
.comp-optional-fields { display: none; }
.comp-optional-fields.visible { display: block; }
.comp-optional-fields.hidden { display: none !important; }

/* ── Toggle switch ── */
.form-toggle-row {
  margin-bottom: 10px;
}
.form-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.form-toggle input { display: none; }
.toggle-knob {
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background .2s;
}
.toggle-knob::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.form-toggle input:checked ~ .toggle-knob { background: var(--primary); }
.form-toggle input:checked ~ .toggle-knob::after { transform: translateX(18px); }

/* ── Pay preview box ── */
.pay-preview {
  margin-top: 18px;
  padding: 16px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  min-height: 56px;
}
.pay-preview strong { color: var(--text); }
.pay-preview .pay-amount { font-size: 20px; font-weight: 800; color: var(--success); }

/* ══════════════════════════════════════════════════════════════════
   PAID / UNPAID BADGE  (POS order cards)
══════════════════════════════════════════════════════════════════ */
.poc-paid-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.poc-paid-badge .material-icons-round { font-size: 13px; }
.poc-paid   { background: #dcfce7; color: #15803d; }
.poc-unpaid { background: #fef9c3; color: #854d0e; }
[data-theme="dark"] .poc-paid   { background: #14532d; color: #86efac; }
[data-theme="dark"] .poc-unpaid { background: #451a03; color: #fde68a; }

/* Pay/Unpaid action buttons */
.poc-btn-pay {
  background: #059669 !important;
  color: #fff !important;
  border-color: #059669 !important;
}
.poc-btn-pay:hover { background: #047857 !important; }
.poc-btn-unpay {
  background: transparent !important;
  color: var(--text-muted) !important;
  border: 1.5px solid var(--border) !important;
  font-size: 12px !important;
}
.poc-btn-unpay:hover { color: var(--text) !important; border-color: var(--text-muted) !important; }

/* ══════════════════════════════════════════════════════════════════
   PAYMENT METHOD MODAL
══════════════════════════════════════════════════════════════════ */
.pay-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pay-modal.hidden { display: none; }

.pay-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
}
.pay-modal-box {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  width: min(420px, 92vw);
  padding: 0;
  overflow: hidden;
}
.pay-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1.5px solid var(--border);
}
.pay-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.pay-modal-hint {
  margin: 12px 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.pay-method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 20px 20px;
}
.pay-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
}
.pay-method-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.pay-method-icon { font-size: 28px; }
.pay-method-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
/* Pay detail section (step 2) */
.pay-detail-section {
  padding: 0 20px 20px;
}
.pay-detail-section.hidden { display: none; }
.pay-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0 14px;
}
.pay-detail-back .material-icons-round { font-size: 16px; }
.pay-detail-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.pay-detail-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  outline: none;
  transition: border-color .15s;
  margin-bottom: 10px;
}
.pay-detail-input:focus { border-color: var(--primary); }
.pay-change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 14px;
}
[data-theme="dark"] .pay-change-row { background: #052e16; border-color: #166534; }
.pay-change-label { font-size: 13px; font-weight: 700; color: #15803d; }
[data-theme="dark"] .pay-change-label { color: #4ade80; }
.pay-change-amount { font-size: 22px; font-weight: 800; color: #15803d; }
[data-theme="dark"] .pay-change-amount { color: #4ade80; }
.pay-insufficient {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
}
[data-theme="dark"] .pay-insufficient { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
.pay-insufficient.hidden { display: none; }
.pay-ref-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: -4px 0 14px;
}
.pay-confirm-btn {
  width: 100%;
  height: 46px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pay-confirm-btn:disabled { opacity: .4; cursor: not-allowed; }
.pay-modal-footer {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
  border-top: 1.5px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════════
   DAILY REPORT SCREEN
══════════════════════════════════════════════════════════════════ */
#posscreen-report {
  overflow-y: auto;
}
.report-layout {
  padding: 28px 32px;
  max-width: 860px;
  margin: 0 auto;
}
.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.report-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}
.report-title .material-icons-round { font-size: 28px; color: var(--primary); }
.report-date {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* Summary cards row */
.report-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.report-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border-top: 3px solid var(--rc, var(--primary));
}
.report-card-icon {
  font-size: 22px;
  color: var(--rc, var(--primary));
  margin-bottom: 4px;
}
.report-card-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.report-card-lbl {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* Report sections */
.report-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.report-section {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.report-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg);
}
.report-section-title .material-icons-round { font-size: 18px; color: var(--primary); }
.report-rows { padding: 4px 0; }
.report-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.report-row:last-child { border-bottom: none; }
.report-row-icon { font-size: 18px; color: var(--text-muted); flex-shrink: 0; }
.report-row-name { flex: 1; font-weight: 600; color: var(--text); }
.report-row-sub  { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.report-row-amt  { font-weight: 700; color: var(--text); white-space: nowrap; min-width: 72px; text-align: right; }
.report-empty {
  padding: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════════
   BIZ MODAL — Payment Methods checkboxes
══════════════════════════════════════════════════════════════════ */
.biz-pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 8px 0 4px;
}
.biz-pay-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.biz-pay-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════
   CUSTOMER DATABASE SCREEN
══════════════════════════════════════════════════════════════════ */
#posscreen-customers { overflow-y: auto; }

.cust-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 24px;
  gap: 16px;
  box-sizing: border-box;
}
.cust-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.cust-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cust-title-icon {
  font-size: 26px;
  color: var(--primary);
}
.cust-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}
.cust-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cust-table-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Customer table cells */
.cust-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cust-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .04em;
}
.cust-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
}
.cust-email {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.cust-notes-cell {
  max-width: 260px;
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cust-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.cust-load-btn {
  font-size: 12px !important;
  padding: 5px 10px !important;
  white-space: nowrap;
}
.cust-required {
  color: var(--danger, #dc2626);
  font-weight: 700;
}
.text-muted { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════════
   CUSTOMER PICKER MINI-MODAL  (opens from POS New Order form)
══════════════════════════════════════════════════════════════════ */
.cust-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cust-picker-modal.hidden { display: none; }

.cust-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.cust-picker-box {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  width: min(480px, 94vw);
  max-height: min(560px, 88vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cust-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.cust-picker-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}
.cust-picker-title .material-icons-round { font-size: 20px; color: var(--primary); }
.cust-picker-title h3 { margin: 0; font-size: 15px; }

.cust-picker-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}

/* List */
.cust-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.cust-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: default;
  transition: background .12s;
}
.cust-picker-row:hover { background: var(--bg); }
.cust-picker-avatar {
  width: 38px;
  height: 38px;
  font-size: 13px;
  flex-shrink: 0;
}
.cust-picker-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cust-picker-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cust-picker-phone {
  font-size: 12px;
  color: var(--text-muted);
}
.cust-picker-notes {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}
.cust-picker-select {
  flex-shrink: 0;
  font-size: 12px !important;
  padding: 5px 12px !important;
}
.cust-picker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
}
.cust-picker-empty .material-icons-round { font-size: 36px; opacity: .5; }
.cust-picker-empty p { margin: 0; font-size: 13px; line-height: 1.5; }

/* ── Browse button in POS customer name label row ────────────────── */
.pos-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.pos-field-label-row .pos-field-label { margin-bottom: 0; }
.cust-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border: 1.5px solid var(--primary);
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.cust-picker-trigger:hover { background: #bfdbfe; }
[data-theme="dark"] .cust-picker-trigger { background: #1e3a5f; }
[data-theme="dark"] .cust-picker-trigger:hover { background: #1e40af55; }
.cust-picker-trigger .material-icons-round { font-size: 14px; }

/* Flash animation when customer is loaded into form */
@keyframes field-flash {
  0%   { background: #bbf7d0; }
  100% { background: transparent; }
}
.field-flash { animation: field-flash .8s ease-out; }

/* ── Customer Name Autocomplete Dropdown ─────────────────────────── */
.cust-suggest-dropdown {
  position: absolute;
  z-index: 200;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
}
[data-theme="dark"] .cust-suggest-dropdown {
  background: #1e293b;
  border-color: #334155;
}
.cust-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .15s;
}
.cust-suggest-item:hover { background: #eff6ff; }
[data-theme="dark"] .cust-suggest-item:hover { background: #1e3a5f; }
.cust-suggest-name { font-weight: 500; font-size: .875rem; color: var(--text); }
.cust-suggest-phone { font-size: .75rem; color: #64748b; white-space: nowrap; }
[data-theme="dark"] .cust-suggest-phone { color: #94a3b8; }
/* Make the name input's container a positioning anchor */
#pos-customer-name {
  position: relative;
}
.pos-field:has(#pos-customer-name) {
  position: relative;
}

/* ------------------------------------------------------------------
   PROFIT & LOSS MODAL + REPORT
------------------------------------------------------------------ */

/* Overlay shell (reuses same structure as pay-modal) */
.pl-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pl-modal.hidden { display: none; }

.pl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.52);
}

.pl-modal-box {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  width: min(560px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pl-preview-box {
  width: min(680px, 96vw);
}

/* Header */
.pl-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.pl-modal-header h3 { font-size: 17px; font-weight: 800; margin: 0; }
.pl-modal-sub { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }

/* Period row */
.pl-period-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.pl-field-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  white-space: nowrap;
}
#pl-period-input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
}
#pl-period-input:focus { border-color: var(--primary); }

/* Scrollable body */
.pl-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Section headers */
.pl-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 8px 0 4px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 4px;
  margin-top: 12px;
}
.pl-section-header:first-child { margin-top: 0; }
.pl-section-header .material-icons-round { font-size: 16px; }
.pl-color-revenue { color: #059669; }
.pl-color-cogs    { color: #d97706; }
.pl-color-opex    { color: #7c3aed; }

/* Entry rows */
.pl-entries-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.pl-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pl-entry-label {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}
.pl-entry-label:focus { border-color: var(--primary); }
.pl-entry-amount {
  width: 120px;
  flex-shrink: 0;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-align: right;
  outline: none;
}
.pl-entry-amount:focus { border-color: var(--primary); }
.pl-entry-del {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.pl-entry-del:hover { background: #fef2f2; color: #dc2626; }
[data-theme="dark"] .pl-entry-del:hover { background: #450a0a; color: #fca5a5; }
.pl-entry-del .material-icons-round { font-size: 17px; }

/* Add line button */
.pl-add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color var(--transition), color var(--transition);
}
.pl-add-row-btn:hover { border-color: var(--primary); color: var(--primary); }
.pl-add-row-btn .material-icons-round { font-size: 15px; }

/* Modal footer */
.pl-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1.5px solid var(--border);
  flex-shrink: 0;
}

/* -- P&L Print Preview ----------------------------------- */
.pl-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

.pl-doc-header {
  text-align: center;
  margin-bottom: 28px;
}
.pl-doc-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .5px;
}
.pl-doc-period {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.pl-doc-section-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 20px 0 6px;
  padding-bottom: 5px;
  border-bottom: 1.5px solid var(--border);
}

.pl-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 0;
  font-size: 14px;
}
.pl-row-label {
  white-space: nowrap;
  padding-left: 12px;
}
.pl-row-dots {
  flex: 1;
  border-bottom: 1px dotted var(--border);
  margin: 0 6px 3px;
}
.pl-row-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}

.pl-row-subtotal {
  font-weight: 700;
  margin-top: 4px;
}
.pl-row-subtotal .pl-row-label { padding-left: 0; }

.pl-row-total {
  font-size: 15px;
  font-weight: 800;
  margin: 12px 0 4px;
  padding: 8px 0;
  border-top: 2px solid var(--text);
}
.pl-row-total .pl-row-dots { border-bottom-color: var(--text); }

.pl-row-net { margin-top: 4px; }
.pl-row-net .pl-row-value  { font-size: 17px; }
.pl-row-profit .pl-row-value { color: #059669; }
.pl-row-loss   .pl-row-value { color: #dc2626; }
[data-theme="dark"] .pl-row-profit .pl-row-value { color: #4ade80; }
[data-theme="dark"] .pl-row-loss   .pl-row-value { color: #fca5a5; }

/* P&L Auto-generated block */
.pl-auto-block { background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.pl-auto-header { display: flex; align-items: center; gap: 6px; padding: 7px 12px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1.5px solid var(--border); }
.pl-auto-header .material-icons-round { font-size: 14px; }
.pl-auto-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.pl-auto-row:last-child { border-bottom: none; }
.pl-auto-row-name { flex: 1; color: var(--text); }
.pl-auto-row-val  { font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-auto-empty-note { display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--text-muted); font-size: 12.5px; }
.pl-auto-empty-note .material-icons-round { font-size: 15px; }
.pl-manual-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 6px 0 4px; margin-top: 4px; }

/* P&L context row (Admin — Business / Branch selector) */
.pl-ctx-row { display: flex; gap: 12px; padding: 8px 20px; background: var(--bg); border-bottom: 1.5px solid var(--border); }
.pl-ctx-field { display: flex; align-items: center; gap: 8px; flex: 1; }
.pl-ctx-field .pl-field-label { white-space: nowrap; }
.pl-ctx-field .biz-select { flex: 1; }

/* Recurring templates block */
.pl-recurring-block { margin-bottom: 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.pl-recurring-header { display: flex; align-items: center; gap: 6px; padding: 7px 12px; background: color-mix(in srgb, #7c3aed 10%, transparent); color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1.5px solid var(--border); }
.pl-recurring-header .material-icons-round { font-size: 14px; color: #7c3aed; }
.pl-recurring-hint { font-weight: 400; font-size: 10px; margin-left: auto; opacity: .7; }
.pl-recurring-row { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.pl-recurring-row:last-of-type { border-bottom: none; }
.pl-recurring-row-name { flex: 1; color: var(--text); }
.pl-recurring-row-amt  { font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-recurring-tag { font-size: 10px; font-weight: 400; color: var(--text-muted); margin-left: 2px; }
.pl-rec-edit, .pl-rec-del { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 2px; border-radius: 4px; display: flex; }
.pl-rec-edit:hover { color: var(--primary); }
.pl-rec-del:hover  { color: #dc2626; }
.pl-rec-edit .material-icons-round, .pl-rec-del .material-icons-round { font-size: 15px; }
.pl-recurring-form { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--bg); }
.pl-recurring-form .pl-entry-label  { flex: 2; }
.pl-recurring-form .pl-entry-amount { flex: 1; }
.pl-add-recurring-btn { display: flex; align-items: center; gap: 4px; margin: 0; padding: 7px 12px; background: none; border: none; border-top: 1px solid var(--border); color: #7c3aed; font-size: 13px; font-weight: 600; cursor: pointer; width: 100%; }
.pl-add-recurring-btn:hover { background: color-mix(in srgb, #7c3aed 8%, transparent); }
.pl-add-recurring-btn .material-icons-round { font-size: 16px; }

/* P&L preview context sub-label */
.pl-doc-context { font-size: 12px; color: #888; margin-top: 2px; }

/* ================================================================
   BRANCH MANAGEMENT PANEL
   ================================================================ */
.branches-panel-wrap { padding: 24px; }
.branches-panel-hint {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0 20px;
}
.branches-panel-hint .material-icons-round { font-size: 16px; color: var(--primary); flex-shrink: 0; margin-top: 1px; }
.branches-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 60px 24px; color: var(--text-muted); text-align: center;
}
.branches-empty .material-icons-round { font-size: 48px; opacity: .35; }
.branches-empty p { margin: 0; font-size: 14px; }

.branch-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* Branch card */
.branch-card {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.branch-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1.5px solid var(--border);
  background: var(--bg);
}
.branch-card-icon { font-size: 22px; flex-shrink: 0; }
.branch-card-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.branch-card-biz  { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* Expense section */
.branch-exp-section { padding: 12px 16px 0; }
.bexp-section-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 8px;
}
.bexp-section-label .material-icons-round { font-size: 14px; }

.bexp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bexp-row td { padding: 7px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; transition: opacity .15s; }
.bexp-row:last-child td { border-bottom: none; }
.bexp-name    { flex: 1; color: var(--text); }
.bexp-amt     { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; padding-right: 8px !important; }
.bexp-tag     { font-size: 10px; font-weight: 400; color: var(--text-muted); margin-left: 2px; }
.bexp-actions { white-space: nowrap; text-align: right; }
.bexp-empty   { color: var(--text-muted); font-size: 13px; padding: 10px 4px; text-align: center; }

.btn-bexp-edit, .btn-bexp-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 3px; border-radius: 4px; display: inline-flex;
}
.btn-bexp-edit:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.btn-bexp-del:hover  { color: #dc2626;         background: #fee2e216; }
.btn-bexp-edit .material-icons-round,
.btn-bexp-del  .material-icons-round { font-size: 15px; }

/* Inline form */
.bexp-form {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 0; border-top: 1px dashed var(--border);
  margin-top: 4px;
}
.bexp-form.hidden { display: none; }
.bexp-form-label  { flex: 2; }
.bexp-form-amount { flex: 1; max-width: 110px; }
.bexp-form .btn-primary { padding: 7px 10px; }

/* Footer */
.bexp-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 12px; gap: 8px;
  border-top: 1px solid var(--border); margin-top: 6px;
}
.bexp-add-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: 13px; font-weight: 600; padding: 4px 0;
}
.bexp-add-btn:hover { text-decoration: underline; }
.bexp-add-btn .material-icons-round { font-size: 16px; }
.bexp-total { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.bexp-total strong { color: var(--text); }
