/* Geek Fix POS - black, white and blue */
:root {
  --blue: #1663e6;
  --blue-dark: #0f4fbf;
  --blue-soft: #eaf1fe;
  --ink: #0d1117;
  --ink-2: #161b22;
  --text: #1f2328;
  --muted: #6b7280;
  --line: #e4e7ec;
  --bg: #f5f7fa;
  --white: #ffffff;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 12px;
  --sidebar: 248px;
  --bs-primary: var(--blue);
  --bs-primary-rgb: 22, 99, 230;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-border-radius: 10px;
}

body { background: var(--bg); font-size: 15px; }
* { transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); background: var(--ink); color: #c9d1d9;
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--blue); display: grid; place-items: center; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6e7681; padding: 16px 10px 6px; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px;
  color: #c9d1d9; text-decoration: none; font-size: 14.5px;
}
.sidebar .nav-link i { font-size: 17px; width: 18px; text-align: center; }
.sidebar .nav-link:hover { background: var(--ink-2); color: #fff; }
.sidebar .nav-link.active { background: var(--blue); color: #fff; }
.sidebar .nav-link.disabled { opacity: .45; cursor: default; }
.sidebar .nav-link em { margin-left: auto; font-style: normal; font-size: 10px; border: 1px solid #30363d; border-radius: 20px; padding: 1px 7px; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid #21262d; font-size: 14px; }
.sidebar-foot a { color: #c9d1d9; font-size: 18px; }
.sidebar-foot a:hover { color: #fff; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--white);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000;
}
.page-title { font-size: 20px; font-weight: 700; margin: 0; color: var(--ink); }
.content { padding: 24px 28px 48px; max-width: 1400px; }

.backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1030; }
  .main { margin-left: 0; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
}

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: var(--white); border-bottom: 1px solid var(--line); padding: 14px 18px; font-weight: 600; border-radius: var(--radius) var(--radius) 0 0 !important; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }

.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; height: 100%; }
.stat .label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 24px; font-weight: 700; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.dark { background: var(--ink); border-color: var(--ink); }
.stat.dark .label, .stat.dark .sub { color: #9ca3af; }
.stat.dark .value { color: #fff; }
.stat.blue { background: var(--blue); border-color: var(--blue); }
.stat.blue .label, .stat.blue .sub { color: #dbe7ff; }
.stat.blue .value { color: #fff; }

.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }

/* ---------- Forms & buttons ---------- */
.form-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.form-control, .form-select { border-radius: 10px; padding: 9px 12px; border-color: #d0d5dd; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,99,230,.15); }
.input-group-text { border-radius: 10px; background: #f9fafb; border-color: #d0d5dd; }

.btn { border-radius: 10px; padding: 8px 16px; font-weight: 500; }
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover, .btn-primary:focus { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-outline-primary { color: var(--blue); border-color: #c9d8f8; }
.btn-outline-primary:hover, .btn-check:checked + .btn-outline-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-light { background: #fff; border-color: var(--line); }
.btn-light:hover { background: #f3f4f6; border-color: #d0d5dd; }
.btn-icon { padding: 6px 10px; border: 1px solid var(--line); background: #fff; }
.btn-sm { padding: 5px 10px; border-radius: 8px; }
.btn-lg { padding: 12px 20px; }
.pay-group .btn { padding: 9px 6px; font-size: 14px; }

/* ---------- Tables ---------- */
.table { margin: 0; --bs-table-bg: transparent; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #f9fafb; border-bottom: 1px solid var(--line); padding: 10px 14px; white-space: nowrap; }
.table td { padding: 11px 14px; vertical-align: middle; border-color: var(--line); }
.table tbody tr:hover { background: #fafbfc; }
.table tfoot td { font-weight: 700; background: #f9fafb; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 32px !important; }

.badge-soft { background: var(--blue-soft); color: var(--blue); font-weight: 600; border-radius: 20px; padding: 4px 10px; font-size: 12px; }
.badge-dark { background: var(--ink); color: #fff; font-weight: 600; border-radius: 20px; padding: 4px 10px; font-size: 12px; }
.green-label { color: var(--green) !important; }
.red-label { color: var(--red) !important; }
.badge-red {background: #fde8e8; color: var(--red); font-weight: 600; border-radius: 20px; padding: 4px 10px; font-size: 12px; }

/* ---------- Repair wizard ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step-pill { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 30px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.step-pill .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #f1f3f5; font-size: 12px; font-weight: 700; }
.step-pill.active { border-color: var(--blue); color: var(--blue); }
.step-pill.active .n { background: var(--blue); color: #fff; }
.step-pill.done .n { background: var(--ink); color: #fff; }
.step { display: none; animation: fadeIn .2s ease; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row .btn-group .btn { padding: 4px 10px; font-size: 13px; }
.btn-check:checked + .btn-ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn-check:checked + .btn-bad { background: var(--red); border-color: var(--red); color: #fff; }
.btn-check:checked + .btn-na { background: #6b7280; border-color: #6b7280; color: #fff; }
.pattern-grid { display: grid; grid-template-columns: repeat(3, 44px); gap: 10px; }
.pattern-grid button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #d0d5dd; background: #fff; font-weight: 700; color: var(--muted); }
.pattern-grid button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.sig-wrap { border: 2px dashed #c9d8f8; border-radius: 12px; background: #fbfcff; }
.sig-wrap canvas { width: 100%; height: 240px; display: block; touch-action: none; }
.review dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.review dd { margin-bottom: 12px; }
.cust-hit { cursor: pointer; }
.cust-hit:hover { background: var(--blue-soft); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.code-box { font-family: ui-monospace, Consolas, monospace; font-size: 20px; letter-spacing: .15em; }
.badge-warn {background: #fff4e5; color: #b45309; font-weight: 600; border-radius: 20px; padding: 4px 10px; font-size: 12px; }
.qty-pill { display: inline-block; min-width: 38px; text-align: center; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-variant-numeric: tabular-nums; }
.qty-pill.low { background: #fff4e5; color: #b45309; }
.qty-pill.out { background: #fde8e8; color: var(--red); }
.dropdown-menu { border-radius: 10px; border-color: var(--line); box-shadow: 0 8px 24px rgba(16,24,40,.08); padding: 6px; }
.dropdown-item { border-radius: 7px; padding: 7px 12px; font-size: 14px; }
.dropdown-item:active { background: var(--blue); }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.badge-grey {background: #f1f3f5; color: #495057; font-weight: 600; border-radius: 20px; padding: 4px 10px; font-size: 12px; }

/* Date bar */
.datebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.datebar input { width: auto; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 32px; }

/* Modal */
.modal-content { border-radius: 14px; border: 0; }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-footer { border-top: 1px solid var(--line); }

.nav-tabs .nav-link { border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--blue); font-weight: 600; }

.alert { border-radius: 10px; }
