/* ============================================================
   Longhorn Doors & Trim — Global Styles (Light Theme)
   ============================================================ */

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

body {
  background: #f4f4f4;
  color: #1a1a1a;
  font-family: 'IBM Plex Mono', monospace;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

input[type=number] {
  -moz-appearance: textfield;
}

select option {
  background: #fff;
  color: #1a1a1a;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f4f4f4; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* ── Layout ── */
#app-shell {
  min-height: 100vh;
  background: #f4f4f4;
  color: #1a1a1a;
}

/* ── Nav ── */
#app-nav {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.nav-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 4px;
  color: #2196F3;
  margin-right: 20px;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #888;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 0 14px;
  height: 60px;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s;
}

.nav-tab:hover { color: #1a1a1a; }
.nav-tab.active {
  color: #1a1a1a;
  border-bottom-color: #2196F3;
}

.nav-count {
  margin-left: 4px;
  background: #eee;
  color: #888;
  font-size: 9px;
  padding: 1px 5px;
}

.nav-spacer { flex: 1; min-width: 8px; }

#global-search {
  width: 200px;
  padding: 7px 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  color: #1a1a1a;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  outline: none;
  flex-shrink: 0;
}
#global-search:focus { border-color: #2196F3; }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2196F3;
  color: #fff;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
  display: none;
  font-family: 'IBM Plex Mono', monospace;
}
#toast.warn { background: #555; }
#toast.show { display: block; }

/* ── Confirm overlay ── */
#confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}
#confirm-overlay.show { display: flex; }
.confirm-box {
  background: #fff;
  border: 2px solid #2196F3;
  padding: 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
}
.confirm-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: #2196F3;
  margin-bottom: 12px;
}
.confirm-msg {
  font-size: 12px;
  color: #555;
  margin-bottom: 24px;
  line-height: 1.7;
}
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ── Reusable card/section ── */
.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 3px;
  color: #2196F3;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 14px;
  padding-bottom: 6px;
}
.field-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #666;
  display: block;
  margin-bottom: 4px;
}

/* ── Inputs ── */
.inp {
  width: 100%;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #ddd;
  color: #1a1a1a;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  outline: none;
}
.inp:focus { border-color: #2196F3; }
textarea.inp { resize: vertical; }

/* ── Buttons ── */
.btn {
  padding: 9px 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
}
.btn-blue   { background: #2196F3; color: #fff; }
.btn-dark   { background: #efefef; color: #1a1a1a; border: 1px solid #ddd; }
.btn-green  { background: #e8f5e9; color: #388e3c; border: 1px solid #c8e6c9; }
.btn-red    { background: #ffebee; color: #d32f2f; border: 1px solid #ffcdd2; }
.btn-outline { background: transparent; color: #666; border: 1px solid #ddd; }

/* ── Sub-tabs ── */
.sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
}
.sub-tab {
  padding: 10px 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.5px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  cursor: pointer;
  color: #888;
  text-transform: uppercase;
}
.sub-tab.active { color: #1a1a1a; border-bottom-color: #2196F3; }

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }

@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ── List row ── */
.list-row {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* ── Page wrapper ── */
.page { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.page-wide { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }

/* ── Page heading row ── */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 4px;
  color: #2196F3;
}

/* ── Stat cards ── */
.stat-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
}
.stat-sub { font-size: 10px; color: #777; margin-top: 4px; }

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  width: 560px;
  max-height: 560px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
}
.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: #2196F3;
  margin-bottom: 12px;
}

/* ── Tag/badge ── */
.badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 7px;
}
.badge-paid   { background: #e8f5e9; color: #388e3c; border: 1px solid #c8e6c9; }
.badge-unpaid { background: #ffebee; color: #d32f2f; border: 1px solid #ffcdd2; }
.badge-muted  { background: #eee; color: #666; }
.badge-blue   { background: #e3f2fd; color: #1565C0; }
.badge-purple { background: #f3e5f5; color: #7b1fa2; }
.badge-green  { background: #e8f5e9; color: #388e3c; }
.badge-orange { background: #fff3e0; color: #e65100; }

/* ── Items table ── */
.items-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.items-table th {
  padding: 8px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #666;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  background: #f5f5f5;
}
.items-table td { padding: 4px; color: #1a1a1a; }
.items-table tr:nth-child(even) td { background: #fafafa; }
.items-table tr:nth-child(odd)  td { background: #fff; }

/* ── Calendar ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 2px;
}
.cal-cell {
  min-height: 80px;
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 4px;
  cursor: pointer;
}
.cal-cell.empty { background: transparent; border: none; cursor: default; }
.cal-cell.today { border-color: #2196F3; }
.cal-day-num { font-size: 10px; color: #888; margin-bottom: 2px; }
.cal-day-num.today-num { color: #2196F3; font-weight: 700; }
.cal-event {
  font-size: 8px;
  color: #fff;
  padding: 2px 4px;
  margin-bottom: 2px;
  border-radius: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

/* ── Low-stock alert ── */
.low-stock-bar {
  background: #fff3e0;
  border: 1px solid #e65100;
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Totals box ── */
.totals-box {
  border: 1px solid #e0e0e0;
  min-width: 260px;
  background: #fff;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 12px;
  border-bottom: 1px solid #e0e0e0;
  color: #666;
}
.totals-row span:last-child { color: #1a1a1a; }
.totals-total {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 16px;
  font-weight: 700;
  background: #2196F3;
  color: #fff;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px;
  color: #aaa;
}
.empty-state-big {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px;
  color: #e0e0e0;
}

/* ── Door/product variant builder ── */
.variant-block {
  border: 1px solid #2196F3;
  padding: 14px;
  margin-bottom: 14px;
  background: #f0f7ff;
}
.size-block {
  margin-left: 16px;
  margin-bottom: 10px;
  border: 1px solid #e0e0e0;
  padding: 10px;
  background: #fafafa;
}

/* ── Check/payment type switcher ── */
.pay-type-bar {
  display: flex;
  gap: 0;
  border: 1px solid #ddd;
  margin-bottom: 20px;
}
.pay-type-btn {
  flex: 1;
  padding: 12px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  background: #f5f5f5;
  color: #888;
}
.pay-type-btn.active-check  { background: #2196F3; color: #fff; }
.pay-type-btn.active-ach    { background: #9c27b0; color: #fff; }
.pay-type-btn.active-zelle  { background: #e91e63; color: #fff; }

/* ── Leads kanban ── */
.leads-section { margin-bottom: 18px; }
.leads-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* ── Reports rows ── */
.report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}
.report-net {
  display: flex;
  justify-content: space-between;
  padding: 12px 10px;
  margin: 0;
}

/* ── Product picker modal ── */
.prod-type-bar {
  display: flex;
  gap: 0;
  border: 1px solid #ddd;
  margin-bottom: 12px;
}
.prod-type-btn {
  flex: 1;
  padding: 10px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  background: #f5f5f5;
  color: #888;
}
.prod-type-btn.active { background: #2196F3; color: #fff; }

.picker-item {
  padding: 12px;
  border: 1px solid #e0e0e0;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
}
.picker-item:hover { border-color: #2196F3; background: #f0f7ff; }

/* ── Inventory qty controls ── */
.qty-control {
  display: flex;
  gap: 6px;
  align-items: center;
}
.qty-btn {
  background: #f0f0f0;
  border: 1px solid #ddd;
  color: #1a1a1a;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  padding: 4px 10px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.qty-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  min-width: 40px;
  text-align: center;
}

/* ── Line items del btn ── */
.del-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #c0392b;
  font-size: 22px;
  line-height: 1;
}

/* ── util ── */
.gold { color: #d4a843; }
.blue { color: #2196F3; }
.green { color: #4caf50; }
.red-c { color: #e53935; }
.muted { color: #777; }
.mono { font-family: 'Bebas Neue', sans-serif; }
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mt8 { margin-top: 8px; }
.mb8 { margin-bottom: 8px; }
.mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }
.mb20 { margin-bottom: 20px; }

/* ── Scrollable list inside modal ── */
.modal-list { overflow-y: auto; flex: 1; }
