@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  --bg: #f0f4f8;
  --panel: #ffffff;
  --panel-2: #f7f9fb;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0d9488;
  --brand-light: #14b8a6;
  --brand-2: #0f2942;
  --accent: #3b82f6;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
  --shadow: 0 20px 50px rgba(15, 41, 66, .08), 0 4px 12px rgba(15, 41, 66, .04);
  --soft-shadow: 0 8px 24px rgba(15, 41, 66, .06);
  --glass: rgba(255, 255, 255, .72);
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar: 280px;
  --transition: .2s cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1524;
  --panel: #111d2e;
  --panel-2: #162236;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --line: #1e3048;
  --brand: #2dd4bf;
  --brand-light: #5eead4;
  --brand-2: #0a1628;
  --accent: #60a5fa;
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #fbbf24;
  --shadow: 0 20px 50px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .2);
  --soft-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  --glass: rgba(17, 29, 46, .78);
}

* { box-sizing: border-box; margin: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font: inherit;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

button {
  border: 0;
  cursor: pointer;
  transition: all var(--transition);
}

button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

button:active:not(:disabled) {
  transform: scale(.97);
}

.app-shell {
  min-height: 100vh;
}

/* ===================== LOGIN SCREEN ===================== */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, .22), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(217, 70, 239, .14), transparent 50%),
    linear-gradient(160deg, #2b0f54 0%, #4c1d95 45%, #1e1b4b 100%);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23ffffff' stroke-width='.3' opacity='.06'/%3E%3C/svg%3E");
  pointer-events: none;
}

.login-card {
  position: relative;
  width: min(480px, 100%);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(20px);
  color: #0f172a;
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 64px rgba(0, 0, 0, .2), 0 0 0 1px rgba(255, 255, 255, .1);
  animation: cardIn .5s cubic-bezier(.16, 1, .3, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-radius: var(--radius);
  font-weight: 900;
  font-size: 18px;
  margin-bottom: 20px;
  box-shadow: 0 12px 28px rgba(13, 148, 136, .3);
  letter-spacing: 1px;
}

.brand-button {
  border: 0;
  flex: 0 0 auto;
  margin-bottom: 0;
}

.top-brand {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.login-card p {
  margin: 0 0 24px;
  color: #64748b;
  font-size: 14px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.field span, .field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.login-card .field span { color: #475569; }

input, select, textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 11px 14px;
  outline: none;
  font-size: 14px;
  transition: all var(--transition);
}

.login-card input, .login-card select {
  background: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
}

.login-card input:hover, .login-card select:hover {
  border-color: #cbd5e1;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  border: 1.5px solid var(--line);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  letter-spacing: -.01em;
}

.btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--soft-shadow);
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), #0e7490);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff;
  box-shadow: 0 8px 24px rgba(13, 148, 136, .3);
  transform: translateY(-1px);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.btn.danger:hover:not(:disabled) {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 8px 20px rgba(239, 68, 68, .25);
}

.btn.full { width: 100%; min-height: 44px; font-size: 15px; }

.btn.success {
  background: var(--ok);
  color: #fff;
  border-color: transparent;
}

.btn.success:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(34, 197, 94, .25);
}

/* ===================== LAYOUT ===================== */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
  transition: grid-template-columns .3s cubic-bezier(.4, 0, .2, 1);
}

.layout.sidebar-hidden {
  grid-template-columns: 0 1fr;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #0f2942 0%, #0a1e33 50%, #081726 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  color: #e2e8f0;
  padding: 20px 16px;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
  z-index: 20;
}

.sidebar-hidden .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.side-head {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 16px;
}

.side-head .brand-mark {
  margin-bottom: 0;
}

.quick-tools-wrap {
  position: relative;
  flex: 0 0 auto;
}

.quick-tools {
  position: absolute;
  left: 0;
  top: 50px;
  z-index: 40;
  display: none;
  width: min(260px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius);
  background: #0f2942;
  color: #e2e8f0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
  backdrop-filter: blur(12px);
}

.quick-tools.show {
  display: grid;
  gap: 8px;
  animation: slideDown .2s cubic-bezier(.16, 1, .3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-tools strong {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--brand-light);
  letter-spacing: .06em;
}

.quick-tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.quick-tool:hover {
  background: rgba(255, 255, 255, .1);
}

.quick-tool input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.side-title strong {
  display: block;
  font-weight: 700;
  line-height: 1.2;
  font-size: 15px;
}

.side-title small {
  color: rgba(226, 232, 240, .55);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  background: transparent;
  color: rgba(226, 232, 240, .65);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13.5px;
  transition: all var(--transition);
}

.nav button:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.nav button.active {
  background: rgba(13, 148, 136, .15);
  color: #fff;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  flex: 0 0 auto;
  transition: all var(--transition);
}

.nav button.active .nav-icon {
  background: linear-gradient(135deg, var(--brand), #0e7490);
  box-shadow: 0 6px 16px rgba(13, 148, 136, .35);
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===================== MAIN AREA ===================== */
.main {
  min-width: 0;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--line);
}

.top-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  border: 1.5px solid var(--line);
  transition: all var(--transition);
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--soft-shadow);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===================== CONTENT ===================== */
.content {
  padding: 24px;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat, .panel, .customer-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--soft-shadow);
  transition: all var(--transition);
}

.stat:hover, .panel:hover {
  box-shadow: var(--shadow);
}

.stat {
  position: relative;
  padding: 20px;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: auto -30px -40px auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  transition: transform var(--transition);
}

.stat:hover::after {
  transform: scale(1.15);
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stat strong {
  display: block;
  font-size: 32px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -.03em;
}

.stat small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
  font-size: 12px;
}

.panel {
  padding: 20px;
}

.panel h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ===================== TOOLBAR ===================== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar input, .toolbar select {
  width: auto;
  min-width: 180px;
}

/* ===================== TABLE ===================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: var(--panel);
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: color-mix(in srgb, var(--brand) 4%, transparent);
}

tr:last-child td { border-bottom: 0; }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.badge.paid { color: #047857; background: #d1fae5; }
.badge.unpaid { color: #92400e; background: #fef3c7; }
.badge.overdue { color: #991b1b; background: #fee2e2; }
.badge.queued { color: #1e40af; background: #dbeafe; }
.badge.sent { color: #047857; background: #d1fae5; }
.badge.failed { color: #991b1b; background: #fee2e2; }
.badge.pending { color: #92400e; background: #fef3c7; }
.badge.completed { color: #047857; background: #d1fae5; }

[data-theme="dark"] .badge.paid { color: #86efac; background: rgba(22, 163, 74, .15); }
[data-theme="dark"] .badge.unpaid { color: #fde68a; background: rgba(217, 119, 6, .15); }
[data-theme="dark"] .badge.overdue { color: #fca5a5; background: rgba(220, 38, 38, .15); }
[data-theme="dark"] .badge.queued { color: #93c5fd; background: rgba(59, 130, 246, .15); }
[data-theme="dark"] .badge.sent { color: #86efac; background: rgba(22, 163, 74, .15); }
[data-theme="dark"] .badge.failed { color: #fca5a5; background: rgba(220, 38, 38, .15); }
[data-theme="dark"] .badge.pending { color: #fde68a; background: rgba(217, 119, 6, .15); }
[data-theme="dark"] .badge.completed { color: #86efac; background: rgba(22, 163, 74, .15); }

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

.mini {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

/* ===================== FORMS ===================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide { grid-column: 1 / -1; }

.two-col {
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
}

/* ===================== DASHBOARD ===================== */
.dashboard-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.clean-dashboard {
  margin-top: 16px;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 28px;
  color: #fff;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(13, 148, 136, .25), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(59, 130, 246, .15), transparent 50%),
    linear-gradient(135deg, #0f2942, #0a1e33);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(15, 41, 66, .2);
  overflow: hidden;
  position: relative;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23ffffff' stroke-width='.3' opacity='.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

.dashboard-hero > * {
  position: relative;
}

.dashboard-hero h3 {
  margin: 6px 0 8px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.dashboard-hero p {
  max-width: 640px;
  margin: 0;
  color: rgba(255, 255, 255, .7);
  line-height: 1.6;
  font-size: 14px;
}

.eyebrow {
  color: var(--brand-light);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .08em;
}

.hero-metric {
  min-width: 180px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
}

.hero-stack {
  display: grid;
  gap: 10px;
  min-width: 230px;
}

.hero-metric span {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, .6);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.hero-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.live-clock-card {
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .06);
}

.live-clock-card span {
  display: block;
  color: var(--brand-light);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .06em;
}

.live-clock-card strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  margin-bottom: 14px;
  color: #fff;
}

.metric-icon.navy { background: linear-gradient(135deg, #1e3a5f, #0f2942); }
.metric-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.metric-icon.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.metric-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.metric-icon.teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.metric-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.internal-no {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--brand-2);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  font-weight: 700;
  font-size: 12px;
}

[data-theme="dark"] .internal-no {
  color: var(--brand);
}

.revenue-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
}

/* ===================== CALCULATOR ===================== */
.calculator {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.calculator input {
  text-align: right;
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  background: var(--panel);
  letter-spacing: -.01em;
}

[data-theme="dark"] .calculator input {
  color: var(--brand);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.calc-grid .btn {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  font-weight: 700;
}

/* ===================== CHARTS ===================== */
.chart-row {
  display: grid;
  grid-template-columns: 86px 1fr 42px;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  font-size: 13px;
  font-weight: 700;
}

.chart-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
}

.chart-row i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

/* ===================== RECEIPT ===================== */
.receipt {
  background: #fff;
  color: #111;
  padding: 20px;
  border: 1px dashed #ccc;
  max-width: 420px;
  margin: 0 auto;
  font-family: "Courier New", monospace;
  border-radius: 8px;
}

.receipt h3, .receipt p {
  text-align: center;
  margin: 4px 0;
}

.receipt .line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px dashed #ddd;
  padding-top: 8px;
  margin-top: 8px;
}

/* ===================== PDF PREVIEW ===================== */
.pdf-preview {
  min-height: 560px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 24px;
  overflow: auto;
  border-radius: var(--radius);
}

.pdf-page {
  width: min(760px, 100%);
  min-height: 500px;
  margin: 0 auto;
  background: white;
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  padding: 36px;
  border-radius: 8px;
}

/* ===================== CARDS ===================== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.customer-card {
  padding: 18px;
  transition: all var(--transition);
}

.customer-card:hover {
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}

.customer-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.customer-card span {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.muted { color: var(--muted); }

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
}

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(80px);
  opacity: 0;
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 100;
  transition: all .3s cubic-bezier(.16, 1, .3, 1);
  max-width: min(480px, calc(100vw - 32px));
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===================== INSTALL BANNER ===================== */
.install-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--soft-shadow);
}

.install-banner.show { display: flex; }

.drawer-scrim {
  display: none;
}

/* ===================== INTEGRATION CARDS ===================== */
.integration-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--panel);
  transition: all var(--transition);
}

.integration-card:hover {
  box-shadow: var(--shadow);
}

.integration-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.integration-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
}

.integration-icon.beem {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.integration-icon.zenopay {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.integration-title {
  font-weight: 700;
  font-size: 15px;
}

.integration-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.sms-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.sms-stat {
  text-align: center;
  padding: 12px 8px;
  border-radius: 8px;
  background: var(--panel-2);
}

.sms-stat strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
}

.sms-stat small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

/* Payment method selector */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.payment-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  transition: all var(--transition);
  cursor: pointer;
}

.payment-method-btn:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 5%, var(--panel));
}

.payment-method-btn.active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--panel));
  color: var(--brand);
}

.payment-method-btn .method-icon {
  font-size: 22px;
}

/* Zenopay status */
.zenopay-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  margin-top: 12px;
}

.zenopay-status.waiting {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.zenopay-status.success {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #86efac;
}

.zenopay-status.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

[data-theme="dark"] .zenopay-status.waiting {
  background: rgba(217, 119, 6, .15);
  color: #fde68a;
  border-color: rgba(217, 119, 6, .3);
}

[data-theme="dark"] .zenopay-status.success {
  background: rgba(22, 163, 74, .15);
  color: #86efac;
  border-color: rgba(22, 163, 74, .3);
}

[data-theme="dark"] .zenopay-status.error {
  background: rgba(220, 38, 38, .15);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, .3);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

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

/* ===================== RESPONSIVE ===================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    height: 100vh;
    transform: translateX(-105%);
    opacity: 1;
    pointer-events: none;
  }
  .drawer-open .sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }
  .sidebar-hidden .sidebar { opacity: 1; }
  .drawer-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .drawer-open .drawer-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .stats, .cards, .two-col, .payment-methods { grid-template-columns: 1fr; }
  .sms-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  .content, .topbar { padding: 14px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .hero-stack, .hero-metric { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select { width: 100%; min-width: 0; }
  .toolbar, .toolbar .filters, .top-actions { width: 100%; }
  .btn { flex: 1 1 auto; }
  .sms-stats { grid-template-columns: 1fr; }
}

/* ===================== PRINT ===================== */
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .receipt {
    border: 0;
    box-shadow: none;
  }
  [data-print-size="58mm"] #printArea { width: 58mm; }
  [data-print-size="80mm"] #printArea { width: 80mm; }
  [data-print-size="A4"] #printArea { width: 210mm; }
}

/* Password toggle */
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap input {
  flex: 1;
  padding-right: 40px;
}
.pw-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
  display: flex;
  align-items: center;
}
.pw-toggle:hover {
  color: var(--brand);
}
.pw-toggle .icon {
  width: 18px;
  height: 18px;
}

/* User management */
.btn.mini {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}
.btn.mini .icon {
  width: 14px;
  height: 14px;
}
.btn.danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn.danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}
.badge.admin { background: linear-gradient(135deg, var(--brand), #0e7490); color: #fff; }
.badge.cashier { background: var(--accent); color: #fff; }
.badge.viewer { background: var(--muted); color: #fff; }

/* Forgot password link */
.btn-link {
  display: inline-block;
  text-align: center;
  width: 100%;
}
