/* RepairBill v2 — View-Specific Styles */

/* ─── Dashboard ─── */

.dash-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1200px;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.dash-actions {
  display: flex;
  gap: 10px;
}

.dash-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dash-chart-wrap {
  position: relative;
  height: 220px;
}

/* Dashboard invoice rows */
.dash-invoice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-dim);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.dash-invoice-row:last-child { border-bottom: none; }
.dash-invoice-row:hover { background: var(--surface2); }

.dash-inv-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dash-inv-num {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
}

.dash-inv-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-inv-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dash-inv-amount {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 600;
}

/* Dashboard walk-in rows */
.dash-walkin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-dim);
}
.dash-walkin-row:last-child { border-bottom: none; }

.dash-wk-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-wk-name {
  font-size: 13px;
  font-weight: 600;
}

.dash-wk-device {
  font-size: 12px;
  color: var(--text-3);
}

.dash-wk-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Invoice Editor ─── */

.invoice-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.invoice-form {
  width: 520px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 20px;
  border-right: 1px solid var(--border);
}

.invoice-preview-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ─── Walk-in Board ─── */

.walkin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.wk-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 200px;
}

.wk-col-head {
  padding: 12px 16px;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wk-waiting .wk-col-head { background: var(--info-bg); color: var(--info); }
.wk-inprog .wk-col-head { background: var(--warn-bg); color: var(--warn); }
.wk-ready .wk-col-head { background: var(--success-bg); color: var(--success); }
.wk-collected .wk-col-head { background: var(--surface2); color: var(--text-3); }

.wk-col-head .cnt {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
}

.wk-cards { padding: 10px; }

.wk-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color var(--dur) var(--ease);
}
.wk-card:hover { border-color: var(--border-lit); }

/* ─── History List ─── */

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.history-item:hover {
  border-color: var(--border-lit);
  background: var(--surface2);
}

/* ─── Settings ─── */

.settings-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  max-width: 900px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: var(--r);
  font-family: 'Satoshi', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--dur) var(--ease);
}
.settings-nav-btn:hover { background: var(--surface2); color: var(--text); }
.settings-nav-btn.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

.settings-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}

/* ─── History ─── */

.hist-page {
  max-width: 1000px;
}

.hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hist-header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hist-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.hist-count {
  font-size: 12px;
  color: var(--text-3);
}

.hist-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hist-search { flex: 1; min-width: 200px; max-width: 320px; }

.hist-status-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-count {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 2px;
}

.hist-list { display: flex; flex-direction: column; gap: 6px; }

.hist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.hist-item:hover {
  border-color: var(--border-lit);
  background: var(--surface2);
}

.hist-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.hist-item-num {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 80px;
}

.hist-item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hist-item-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-item-device {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-item-mid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  flex-shrink: 0;
}

.hist-item-date { font-size: 12px; color: var(--text-2); }
.hist-item-ago { font-size: 11px; color: var(--text-3); }

.hist-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hist-item-amount {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  min-width: 80px;
  text-align: right;
}

.hist-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.hist-item:hover .hist-item-actions { opacity: 1; }

/* ─── Responsive ─── */

@media (max-width: 1024px) {
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-columns { grid-template-columns: 1fr; }
  .walkin-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .invoice-layout { flex-direction: column; }
  .invoice-form { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 768px) {
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .dash-actions { flex-wrap: wrap; }
  .dash-actions .btn { flex: 1; min-width: 120px; }
  .walkin-grid { grid-template-columns: 1fr; }
  .invoice-form { padding: 16px; }
  .hist-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hist-filters { flex-direction: column; }
  .hist-search { max-width: 100%; }
  .hist-status-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .hist-item-mid { display: none; }
  .hist-item-actions { opacity: 1; }
  .hist-item { padding: 10px 12px; gap: 10px; }
}

@media (max-width: 480px) {
  .dash-kpis { grid-template-columns: 1fr; }
}
