* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, Arial, sans-serif;
  background: #f5f6fa;
  color: #1d1d1f;
}
a { text-decoration: none; color: inherit; }
table a { color: #0a84ff; font-weight: 600; }
table a:hover { text-decoration: underline; }

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

.sidebar {
  width: 220px;
  background: #1c1c1e;
  color: #f2f2f7;
  padding: 20px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.whoami { color: #98989d; font-size: 12px; margin-bottom: 18px; }
.nav-item {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  color: #98989d;
  font-size: 14px;
  margin-bottom: 3px;
  transition: background-color .12s ease, color .12s ease;
}
.nav-item:hover { background: #2c2c2e; color: #f2f2f7; }
.nav-item.active { background: #0a84ff; color: white; font-weight: 600; }
.nav-item.logout { margin-top: auto; background: #2c2c2e; color: #f2f2f7; text-align: center; }

.content { flex: 1; padding: 24px 30px; max-width: 1200px; }

h1.page-title { font-size: 26px; margin: 0 0 18px 0; }
h2.section-title { font-size: 16px; font-weight: 700; margin: 22px 0 10px 0; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash-error { background: #fde2e2; color: #c73a3f; }
.flash-success { background: #d9f5e6; color: #248a58; }

.cards-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }

.range-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.range-tab {
  padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: white; border: 1px solid #e3e5ea; color: #6b6b70;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.range-tab:hover { border-color: #0a84ff; color: #0a84ff; }
.range-tab.active { background: #0a84ff; border-color: #0a84ff; color: white; }

.chart-legend { display: flex; gap: 18px; font-size: 12px; color: #6b6b70; margin-bottom: 14px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 10px; }
.bar-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-chart-bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.bar-chart-bar { width: 40%; border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity .12s ease; }
.bar-chart-bar:hover { opacity: .8; }
.bar-chart-bar.sales { background: #0a84ff; }
.bar-chart-bar.repairs { background: #34c759; }
.bar-chart-label { font-size: 11px; color: #86868b; margin-top: 8px; white-space: nowrap; }

.hbar-chart { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: 140px 1fr 80px; align-items: center; gap: 10px; }
.hbar-label { font-size: 13px; color: #1d1d1f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: #eef0f4; border-radius: 5px; height: 16px; overflow: hidden; }
.hbar-fill { background: #ff9f0a; height: 100%; border-radius: 5px; min-width: 3px; }
.hbar-value { font-size: 13px; font-weight: 700; text-align: right; }
.stat-card {
  background: #ffffff;
  border: 1px solid #e3e5ea;
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 190px;
  flex: 1;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.stat-card .label { font-size: 11px; color: #86868b; text-transform: uppercase; letter-spacing: .02em; }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.stat-card a { display: block; }
.stat-card.clickable:hover {
  border-color: #0a84ff; cursor: pointer;
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(10,132,255,.15);
}
.status-open { color: #30a46c; }
.status-closed { color: #e5484d; }

.tiles-row { display: flex; gap: 16px; margin-bottom: 24px; justify-content: center; }
.tile {
  width: 320px; height: 170px; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: white; text-align: center; box-shadow: 0 3px 10px rgba(0,0,0,.12);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { transform: translateY(-3px) scale(1.015); box-shadow: 0 10px 24px rgba(0,0,0,.22); }
.tile:active { transform: translateY(0) scale(0.99); }
.tile .tile-icon {
  font-size: 30px; margin-bottom: 10px; line-height: 1; width: 100%;
  text-align: center; display: block;
}
.tile .tile-title { font-weight: 700; font-size: 17px; width: 100%; text-align: center; }
.tile .tile-sub { font-size: 12px; opacity: .9; margin-top: 3px; width: 100%; text-align: center; }
.tile-sale { background: linear-gradient(to bottom, #4facfe, #0060df); }
.tile-repair { background: linear-gradient(to bottom, #6ee7b7, #1f7a4d); }

.card {
  background: #ffffff;
  border: 1px solid #e3e5ea;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.two-col { display: flex; gap: 18px; align-items: flex-start; }
.two-col .col-left { flex: 0 0 320px; }
.two-col .col-right { flex: 1; min-width: 0; }

label { display: block; font-size: 13px; margin: 10px 0 4px 0; color: #1d1d1f; }
input[type=text], input[type=number], input[type=password], input[type=tel], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #d6d8dd; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: white;
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b8bac0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #0a84ff; border-color: #0a84ff; }

.btn {
  display: inline-block; border: none; border-radius: 8px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease, background-color .12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 4px 10px rgba(0,0,0,.14); }
.btn:active { transform: translateY(0); filter: brightness(0.96); box-shadow: none; }
.btn-primary { background: #0a84ff; color: white; }
.btn-success { background: #30a46c; color: white; }
.btn-secondary { background: #eceef1; color: #1d1d1f; }
.btn-danger { background: #e5484d; color: white; }
.btn-dark { background: #1c1c1e; color: white; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 8px 10px; color: #86868b; font-size: 11px; text-transform: uppercase;
     border-bottom: 1px solid #e3e5ea; }
td { padding: 9px 10px; border-bottom: 1px solid #f0f1f4; transition: background-color .1s ease; }
tr:hover td { background: #f8f9fb; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-queue { background: #fff4e0; color: #b45309; }
.badge-progress { background: #e0f0ff; color: #0a84ff; }
.badge-ready { background: #d9f5e6; color: #248a58; }
.badge-done { background: #e6e7ea; color: #55565a; }

.quick-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.quick-btns form { flex: 1; min-width: 140px; }

.summary-bar {
  background: #1c1c1e; color: white; border-radius: 12px; padding: 18px 26px;
  display: flex; gap: 40px; align-items: center; margin-top: 22px;
}
.summary-bar .block .label { color: #98989d; font-size: 11px; text-transform: uppercase; }
.summary-bar .block .value { font-size: 22px; font-weight: 700; margin-top: 4px; }

.daily-target-badge {
  background: #eef0f4; color: #6b6b70; font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: 20px; transition: background-color .2s ease, color .2s ease;
}
.daily-target-badge.hit { background: #d5f5db; color: #1c8a3e; }

.totals-box { margin-top: 14px; }

.payment-methods { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.payment-btn {
  flex: 1; min-width: 90px; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 8px; border: 2px solid #e3e5ea; border-radius: 10px;
  background: white; cursor: pointer; font-size: 12px; font-weight: 600; color: #1d1d1f;
  transition: border-color .12s ease, background-color .12s ease, transform .12s ease;
}
.payment-btn:hover { border-color: #b8bac0; transform: translateY(-1px); }
.payment-btn.active { border-color: #0a84ff; background: #eef6ff; color: #0a84ff; }
.payment-btn .payment-icon { font-size: 22px; line-height: 1; }
.zelle-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px; background: #6d1ed4; color: white;
  font-weight: 800; font-size: 15px; font-family: Georgia, serif;
}

.cash-calc { margin-top: 12px; padding: 12px; background: #f5f6fa; border-radius: 10px; }
.cash-calc-label { font-size: 12px; color: #86868b; margin-bottom: 8px; font-weight: 600; }
.cash-bills { display: flex; gap: 8px; }
.bill-btn {
  flex: 1; padding: 10px 6px; border: 2px solid #d8dae0; border-radius: 8px;
  background: white; cursor: pointer; font-weight: 700; font-size: 14px; color: #1d1d1f;
  transition: border-color .12s ease, background-color .12s ease;
}
.bill-btn:hover { border-color: #0a84ff; background: #eef6ff; }
.cash-change { margin-top: 10px; font-size: 14px; color: #1c8a3e; font-weight: 600; min-height: 20px; }
.cash-change.short { color: #c73a3f; }

.tax-toggle-row {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  padding: 10px 14px; background: #f5f6fa; border-radius: 10px;
}
.tax-toggle-label { font-size: 13px; font-weight: 600; color: #1d1d1f; flex: 1; }
.tax-toggle-state { font-size: 12px; font-weight: 700; color: #1c8a3e; min-width: 62px; }
.tax-toggle-state.off { color: #ff9500; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: #d8dae0;
  border-radius: 24px; transition: background-color .15s ease;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: white; border-radius: 50%; transition: transform .15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: #34c759; }
.switch input:checked + .slider::before { transform: translateX(18px); }
.totals-box .line { font-size: 14px; margin: 3px 0; }
.totals-box .total { font-size: 20px; font-weight: 800; color: #0a84ff; margin: 8px 0; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1c1c1e;
}
.login-box {
  background: white; border-radius: 16px; padding: 40px 36px; width: 320px; text-align: center;
}
.login-box h1 { font-size: 20px; margin-bottom: 4px; }
.login-box p { color: #86868b; font-size: 13px; margin-bottom: 20px; }

.pill { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #eceef1; }

.close-link { float: right; color: #86868b; font-size: 13px; }
.empty-note { color: #86868b; font-style: italic; padding: 14px 0; }

.receipt-box { max-width: 420px; margin: 0 auto; }
.receipt-box .row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.receipt-box hr { border: none; border-top: 1px dashed #ccc; margin: 10px 0; }

/* Printer slide-out animation, matching the desktop app's receipt window.
   Only the slot bar itself is a visible, fixed-size graphic. The area
   below it is an invisible clipping mask (no background/border of its
   own) - so nothing is "pre-drawn" as a picture; the paper genuinely
   looks like it's emerging from the slot into empty space, not sliding
   up from underneath an already-fully-rendered gray frame. */
.printer-wrap { max-width: 440px; margin: 0 auto; }
.printer-slot {
  height: 20px; background: #1c1c1e; border-radius: 10px 10px 0 0;
  position: relative; z-index: 2;
}
.printer-slot::after {
  content: ""; position: absolute; left: 40px; right: 40px; top: 50%;
  transform: translateY(-50%); height: 5px; background: #3a3a3c; border-radius: 3px;
}
.paper-clip { overflow: hidden; width: calc(100% - 56px); margin: 0 auto; }
.paper {
  position: relative; z-index: 1;
  background: white; border-radius: 0 0 3px 3px;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  padding: 26px 24px; animation: paper-slide 2.6s cubic-bezier(.22,.61,.36,1) both;
  animation-delay: .15s;
}
@keyframes paper-slide { from { transform: translateY(-100%); } to { transform: translateY(0); } }

.receipt-company { text-align: center; font-size: 20px; font-weight: 800; margin: 0; }
.receipt-address, .receipt-phone { text-align: center; font-size: 12px; color: #86868b; margin: 2px 0 0 0; }
.receipt-divider { border: none; border-top: 1px solid #e3e5ea; margin: 16px 0; }
.receipt-divider.thick { border-top: 2px solid #1c1c1e; margin: 12px 0 8px 0; }
.receipt-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.receipt-row.bold { font-weight: 700; font-size: 15px; }
.receipt-meta-row { display: flex; justify-content: space-between; font-size: 12px; }
.receipt-note { text-align: center; font-size: 12px; color: #86868b; font-style: italic; margin-top: 14px; }
.receipt-terms { font-size: 10px; color: #98989d; line-height: 1.5; margin: 10px 0 0 0; text-align: left; }
.receipt-thanks { text-align: center; font-size: 13px; font-style: italic; color: #0a84ff; margin-top: 16px; }
.receipt-cut { text-align: center; color: #d6d8dd; letter-spacing: 2px; margin-top: 18px; font-size: 12px; }
.receipt-actions { max-width: 440px; margin: 14px auto 0 auto; display: flex; gap: 8px; flex-wrap: wrap; }

@media print {
  @page { margin: 0; }
  body { margin: 1.3cm; background: white; }
  .sidebar, .receipt-actions, .flash, .printer-slot,
  .header-row form, .close-link, .no-print { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; max-width: none; }
  .paper-clip { overflow: visible; }
  .paper { box-shadow: none; animation: none; padding: 0; margin-top: 0; }
}
