:root {
  --brand-navy: #001533;
  --brand-navy-light: #002855;
  --brand-navy-dark: #000a1a;
  --brand-orange: #ff6600;
  --brand-orange-light: #ff8533;
  --brand-orange-dark: #e55a00;
  --primary: var(--brand-navy);
  --primary-light: var(--brand-navy-light);
  --primary-dark: var(--brand-navy-dark);
  --primary-glow: rgba(0, 21, 51, 0.22);
  --bg: #f4f6f9;
  --surface: #fff;
  --muted: #5a6578;
  --border: rgba(0, 21, 51, 0.1);
  --sidebar: var(--brand-navy);
  --sidebar-text: #dce4f0;
  --accent: #eef2f8;
  --danger: #b42318;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px rgba(15, 36, 31, 0.07);
  --shadow-lg: 0 24px 64px rgba(15, 36, 31, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: #1a2e28;
  -webkit-font-smoothing: antialiased;
}
.layout { display: flex; min-height: 100vh; }
.layout-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.layout-app .main { flex: 1; }
.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: linear-gradient(90deg, var(--sidebar) 0%, var(--brand-navy-dark) 100%);
  color: var(--sidebar-text);
  flex-wrap: wrap;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 10, 26, 0.18);
}
.app-header-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
  margin-right: 8px;
}
.app-header-brand:hover { opacity: 0.92; }
.app-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.app-brand { font-size: 1.35rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.layout-app.admin-user .main-nav { display: none; }
.layout-app.admin-user .app-header {
  flex-wrap: nowrap;
  padding: 12px 24px;
}
.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
}
.main-nav a {
  color: inherit;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.main-nav a.active,
.main-nav a:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.main-nav a.nav-external {
  opacity: 0.85;
  margin-left: auto;
}
.main-nav a.nav-external:hover {
  opacity: 1;
}
.layout-app.admin-user .main-nav a.nav-external {
  display: none;
}
.app-footer {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--brand-navy-dark);
  color: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 24px;
}
.app-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  justify-content: space-between;
}
.app-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.app-footer-brand:hover { opacity: 0.92; }
.app-footer-logo {
  border-radius: 8px;
  object-fit: cover;
}
.app-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.app-footer-nav a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.app-footer-nav a:hover { color: #fff; }
.app-footer-copy {
  margin: 0;
  font-size: 0.82rem;
  width: 100%;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 720px) {
  .app-footer-copy {
    width: auto;
    padding-top: 0;
    border-top: none;
    margin-left: auto;
  }
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.user-badge-header {
  font-size: 0.85rem;
  opacity: 0.9;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-header-logout {
  color: var(--primary-dark);
  background: #fff;
  border: 2px solid #fff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.btn-header-logout:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-dark);
}
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--brand-navy-dark) 100%);
  color: var(--sidebar-text);
  padding: 20px 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.brand { font-size: 1.25rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.brand-sub { font-size: 0.8rem; opacity: 0.75; margin-bottom: 28px; }
.nav { display: grid; gap: 6px; }
.nav button,
.nav a {
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  display: block;
}
.nav button.active, .nav button:hover,
.nav a.active, .nav a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.main { flex: 1; min-width: 0; padding: 20px 24px; overflow: auto; width: 100%; }
.platform-page,
.kiosk-form-page,
.client-fiche-page {
  width: 100%;
  max-width: none;
}
.form-new { box-shadow: 0 0 0 2px rgba(27,107,90,.18); }
.form-section h3 { margin: 0 0 8px; color: var(--primary-dark); font-size: 1rem; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.kiosk-meta { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.logo-upload-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { max-width: 180px; max-height: 80px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; }
.logo-preview.logo-preview-pending { border-style: dashed; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 21, 51, 0.12); }
.brand-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.brand-color-row input[type="color"] {
  width: 52px;
  height: 44px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}
.brand-color-row input[type="text"] {
  width: 7.5rem;
  font-family: ui-monospace, monospace;
}
.brand-color-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.brand-color-sample { font-size: 0.85rem; color: var(--muted); }
.brand-color-sample-btn { pointer-events: none; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.topbar-intro h1 {
  margin: 0;
  font-size: 1.45rem;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}
.topbar-intro {
  flex: 1;
  min-width: 0;
}
.topbar-intro .kiosk-live-status {
  margin: 12px 0 0;
  max-width: 720px;
}
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters input.date-eu {
  width: 9.5rem;
  font-variant-numeric: tabular-nums;
}
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
input, select, textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: #fff;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(0, 21, 51, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 21, 51, 0.1);
}
.row > div input,
.row > div select,
.row > div textarea { width: 100%; }
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 44px; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  padding: 6px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle:hover { color: var(--primary-dark); background: var(--accent); }
.password-toggle svg { width: 20px; height: 20px; fill: currentColor; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.visible .icon-eye { display: none; }
.password-toggle.visible .icon-eye-off { display: block; }
textarea { min-height: 72px; resize: vertical; width: 100%; }
.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-light) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 102, 0, 0.28);
}
.btn-primary:hover {
  box-shadow: 0 10px 28px rgba(0, 21, 51, 0.28);
}
.btn-block { width: 100%; display: block; }
.btn-ghost { background: var(--accent); color: #1a2e28; }
.btn-ghost:hover { background: #dceee8; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--primary-dark); }
.btn-outline:hover { border-color: rgba(0, 21, 51, 0.35); background: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #912018; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 61, 52, 0.45);
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 48px rgba(18, 61, 52, 0.18);
}
.modal-staff-edit {
  width: min(100%, 480px);
}
.modal-staff-edit label { margin-top: 10px; }
.modal-staff-edit input,
.modal-staff-edit select { width: 100%; }
.modal h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--primary-dark);
}
.modal-message {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}
.card-kpi .value { font-size: 1.75rem; font-weight: 700; color: var(--primary-dark); }
.card-kpi .label { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.card-clickable { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.card-clickable:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(27,107,90,.12); }
.card-action { margin-top: 10px; font-size: 0.82rem; font-weight: 600; color: var(--primary); }
.dash-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.dash-kiosk-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.dash-kiosk-row:last-child { border-bottom: 0; }
.user-badge {
  font-size: 0.82rem;
  padding: 8px 10px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.btn-logout {
  margin-top: auto;
  width: 100%;
  color: var(--sidebar-text);
  border-color: rgba(255,255,255,0.25);
  background: transparent;
}
.hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 10px; }
.field-hint { color: var(--muted); font-size: 0.78rem; margin: 2px 0 6px; line-height: 1.35; }
.receipt-preview {
  margin: 10px 0 16px;
  padding: 14px;
  border-radius: 12px;
  background: #1a1a1a;
  color: #f5f5f5;
  font-family: "Courier New", monospace;
}
.receipt-preview-title { font-size: 0.75rem; color: #aaa; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.receipt-preview-empty { color: #888; font-size: 0.85rem; }
.receipt-line { margin-bottom: 8px; }
.receipt-line-meta { font-size: 0.72rem; color: #aaa; margin-bottom: 2px; font-family: "Segoe UI", system-ui, sans-serif; }
.receipt-line.overflow .receipt-line-meta { color: #ffb4a9; }
.receipt-line-text { margin: 0; font-size: 0.85rem; white-space: pre; overflow: hidden; }
.receipt-warn { color: #ffb4a9; font-size: 0.78rem; margin-bottom: 8px; font-family: "Segoe UI", system-ui, sans-serif; }
#receiptHeaderText { min-height: 160px; font-family: "Courier New", monospace; line-height: 1.45; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.panel-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head-row h2 { margin: 0; }
.panel-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel h2 { margin: 0 0 14px; font-size: 1.1rem; color: var(--primary-dark); }
.monitor-actions { margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
}
.table-wrap table { min-width: 560px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: #fafcfb; }
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #eef8f4; }
.msg.error { background: #fef2f2; color: var(--danger); }
.view { display: none; }
.view.active { display: block; }

/* ── Auth (login / reset) ── */
.auth-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 80% 10%, rgba(255, 102, 0, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 45% 35% at 10% 90%, rgba(0, 21, 51, 0.08) 0%, transparent 50%),
    linear-gradient(165deg, #eef2f8 0%, var(--bg) 45%, #f0f3f8 100%);
  z-index: 0;
}

.auth-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: min(920px, 100%);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-layout--narrow {
  grid-template-columns: 1fr;
  width: min(440px, 100%);
}

.auth-aside {
  padding: 40px 36px;
  background: linear-gradient(160deg, var(--sidebar) 0%, var(--brand-navy-dark) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.auth-brand-mark,
.auth-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.auth-brand-mark {
  background: linear-gradient(135deg, var(--brand-navy-light) 0%, var(--brand-navy) 100%);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.auth-aside-title {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.auth-aside-lead {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 28px;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0 0 auto;
  display: grid;
  gap: 12px;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.88);
}

.auth-feature-icon {
  color: #6ee7b7;
  font-size: 0.65rem;
}

.auth-back-link {
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s;
}

.auth-back-link:hover { color: #fff; }

.auth-card {
  margin: 0;
  border: none;
  border-radius: 0;
  padding: 40px 36px;
  box-shadow: none;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card-head {
  margin-bottom: 24px;
}

.auth-card-head h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.auth-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-card label {
  font-size: 0.82rem;
  margin-top: 14px;
}

.auth-card label:first-of-type {
  margin-top: 0;
}

.auth-actions {
  margin-top: 20px;
}

.auth-actions--row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-actions--row .btn { flex: 1; min-width: 120px; }

.auth-api-warn {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #912018;
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-api-warn a { color: #b42318; font-weight: 700; }

.login-wrap { max-width: 440px; margin: 80px auto; padding: 0 20px; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.sale-row { cursor: pointer; }
.client-row { cursor: pointer; }
.client-row.active td { background: #d8ebe4; }
.client-archived-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}
.client-archived-banner p { margin: 0 0 10px; font-size: 0.9rem; }
.table-muted { color: var(--muted); font-size: 0.85rem; }
.client-id-preview {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.9rem;
}
.modal-message.credentials {
  font-family: "Segoe UI", system-ui, sans-serif;
  white-space: pre-line;
}
.modal-message.credentials strong { color: var(--primary-dark); }
.sale-row:hover td { background: var(--accent); }
.sale-row.active td { background: #d8ebe4; }
.sale-detail {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafcfb;
}
.sale-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.sale-lines-table {
  width: 100%;
  margin-top: 12px;
}
.sale-receipt {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  white-space: pre-wrap;
}
.monitoring-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.kiosk-form-page { width: 100%; max-width: none; }
.label-optional { color: var(--muted); font-weight: normal; font-size: 0.9em; }
#kioskNewSection select { max-width: 100%; }
.kiosk-list-empty { margin-top: 12px; }
.cards-compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cards-compact .card-kpi { padding: 14px 16px; }
.cards-compact .card-kpi .value { font-size: 1.5rem; }
.cards-compact .card-kpi .label { font-size: 0.78rem; }
.settings-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.settings-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-link:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.settings-link-title {
  font-weight: 600;
  color: var(--primary);
}
.settings-link-desc {
  font-size: 0.85rem;
  color: var(--muted);
}
.monitor-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.monitor-card-main {
  flex: 1;
  min-width: 0;
}
.monitor-card-aside {
  flex-shrink: 0;
  padding-left: 12px;
  text-align: right;
  align-self: center;
}
.monitor-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.monitor-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(27,107,90,0.15);
}
.monitor-config-hint {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
}
.client-kiosks-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.personnel-section { margin-bottom: 4px; }
.personnel-list-head { margin-bottom: 6px; }
.staff-count-badge { font-size: 0.82rem; }
.staff-list-empty {
  padding: 20px 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fafcfb;
  text-align: center;
  color: var(--muted);
}
.staff-list-empty strong { display: block; color: var(--primary-dark); margin-bottom: 6px; font-size: 1rem; }
.client-account-panel {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.client-login-id { margin: 8px 0 12px; }
.client-account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  color: #1e40af;
  font-size: 0.9rem;
}
.client-kiosk-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.client-kiosk-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.pill-alert { background: #fef3c7; color: #92400e; }
.pill-status-online { background: #dcfce7; color: #166534; }
.pill-status-warning { background: #fef3c7; color: #92400e; }
.pill-status-offline { background: #fee2e2; color: #991b1b; }
.pill-status-unknown { background: #f1f5f9; color: #475569; }
.monitor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.monitor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.monitor-online .monitor-dot { background: #16a34a; }
.monitor-warning .monitor-dot { background: #d97706; }
.monitor-offline .monitor-dot { background: #dc2626; }
.monitor-status { font-size: 0.9rem; margin-bottom: 4px; }
.monitor-meta { font-size: 0.82rem; color: var(--muted); }
.monitor-meta.muted { margin-top: 2px; }
.monitor-warn { font-size: 0.82rem; color: #b45309; margin-top: 6px; }
.monitor-alerts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.monitor-alert-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.monitor-alert-pill.monitor-alert-critical {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
.monitor-alert-pill.monitor-alert-info {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.monitor-alert-critical { color: #b91c1c; font-weight: 500; }
.monitor-alert-warn { color: #b45309; }
.monitor-alert-info { color: #0369a1; }
.monitor-has-alert { border-color: #fcd34d; background: #fffbeb; }
.kiosk-live-status {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fafcfb;
}
.kiosk-live-status strong { display: block; margin-bottom: 6px; color: var(--primary-dark); }
.kiosk-live-status p { margin: 0 0 6px; font-size: 0.92rem; }
.kiosk-live-status .monitor-alerts-row { margin-top: 8px; }
.kiosk-live-ok { border-color: #bbf7d0; background: #f0fdf4; }
.kiosk-live-warn { border-color: #fcd34d; background: #fffbeb; }
.kiosk-live-critical { border-color: #fecaca; background: #fef2f2; }
.kiosk-live-unknown { border-color: #e2e8f0; background: #f8fafc; }
.kiosk-live-ok-msg { color: #166534; margin-top: 4px !important; }
.monitor-sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; }
.form-kiosk-id-row { margin: 0 0 18px; }
.form-kiosk-id-row .hint { margin: 6px 0 0; }
.monitor-api {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.monitor-api-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.monitor-api-value {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  flex: 1;
  min-width: 0;
  word-break: break-all;
}
.btn-sm { padding: 6px 10px; font-size: 0.82rem; }
.install-panel {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.install-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.install-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.install-id-simple label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.install-id-hint {
  margin: 6px 0 10px;
}
.install-id-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.install-id-row input {
  flex: 1;
  min-width: 200px;
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.95rem;
}
.install-id-row input.install-id-dirty {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 21, 51, 0.12);
}
.install-id-row .btn {
  flex-shrink: 0;
  align-self: stretch;
}
.install-save-btn {
  margin-top: 4px;
}
.install-save-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.install-id-msg {
  margin-top: 10px;
}
.install-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.admin-advanced {
  margin-top: 12px;
  font-size: 0.9rem;
}
.admin-advanced summary { cursor: pointer; color: var(--muted); }
.monitor-unknown .monitor-dot { background: #94a3b8; }
.pill-company { background: #e0e7ff; color: #3730a3; }
.dash-alerts { margin-bottom: 16px; }
.alerts-banner {
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
}
.alerts-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
  font-size: 0.9rem;
}
.alerts-has-issues {
  background: #fff7ed;
  border-color: #fed7aa;
}
.alerts-summary {
  font-weight: 600;
  color: #9a3412;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.alert-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
}
.alert-item.alert-critical { border-left: 3px solid #dc2626; }
.alert-item.alert-warn { border-left: 3px solid #d97706; }
.alert-item.alert-info { border-left: 3px solid #0284c7; }
.alert-kiosk { font-weight: 500; }
.alert-text { color: var(--muted); text-align: right; }
.monitor-pill-online { background: #dcfce7; color: #166534; }
.monitor-pill-warning { background: #fef3c7; color: #92400e; }
.monitor-pill-offline { background: #fee2e2; color: #991b1b; }
.monitor-pill-unknown { background: #f1f5f9; color: #475569; }
.staff-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.staff-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.staff-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.staff-row.inactive { opacity: 0.65; }
.staff-row-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.staff-item { display: flex; flex-direction: column; gap: 8px; }
.staff-add-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
@media (max-width: 1320px) {
  .app-header { padding: 10px 16px; gap: 10px; }
  .main-nav a { padding: 8px 12px; font-size: 0.9rem; }
  .user-badge-header { max-width: 140px; font-size: 0.78rem; }
}
@media (max-width: 720px) {
  .app-header { flex-direction: column; align-items: stretch; }
  .app-header-brand { flex-direction: row; align-items: baseline; gap: 8px; }
  .main-nav { order: 3; width: 100%; }
  .app-header-right {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .topbar h1 { font-size: 1.35rem; }
  .main { padding: 12px 14px; }
  .app-footer { padding: 16px; }
  .app-footer-inner { flex-direction: column; align-items: flex-start; }
  .app-footer-copy { text-align: left; width: 100%; }
  .panel { padding: 16px; border-radius: 12px; }
  .panel-head-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .panel-head-actions { width: 100%; }
  .panel-head-actions .btn { flex: 1; }
  .cards-compact { grid-template-columns: 1fr; }
  .settings-links { grid-template-columns: 1fr; }
  .monitoring-grid { gap: 10px; }
  .monitor-card {
    flex-direction: column;
    align-items: stretch;
  }
  .monitor-card-aside {
    padding-left: 0;
    padding-top: 8px;
    text-align: left;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }
  .staff-row { flex-direction: column; align-items: stretch; }
  .staff-row-actions { width: 100%; }
  .staff-row-actions .btn { flex: 1; }
  .install-id-row { flex-direction: column; }
  .install-id-row input { min-width: 0; width: 100%; }
  .topbar { flex-direction: column; align-items: stretch; gap: 16px; }
  .filters { flex-direction: column; align-items: stretch; width: 100%; }
  .filters > div { width: 100%; }
  .btn { min-height: 44px; }
  .client-kiosk-row { flex-direction: column; align-items: stretch; }
  .sale-detail-header { flex-direction: column; align-items: stretch; }
}
@media (max-width: 1320px) {
  .main { padding: 16px 18px; }
}
@media (max-width: 900px) {
  .row { grid-template-columns: 1fr; }
  .auth-layout {
    grid-template-columns: 1fr;
    width: min(480px, 100%);
  }
  .auth-aside {
    padding: 28px 24px 24px;
  }
  .auth-aside-title { font-size: 1.25rem; }
  .auth-aside-lead { margin-bottom: 16px; font-size: 0.88rem; }
  .auth-features { gap: 8px; margin-bottom: 8px; }
  .auth-card { padding: 28px 24px 32px; }
  .auth-screen { padding: 20px 16px; align-items: flex-start; padding-top: 32px; }
}
@media (max-width: 480px) {
  .auth-brand { margin-bottom: 20px; }
  .auth-features { display: none; }
  .auth-back-link { margin-top: 12px; }
}
