/* ============================================================
   DSkin Cashup — Styles
   ============================================================ */

:root {
  --primary: #C4922A;
  --primary-dark: #8B6508;
  --primary-light: #fdf3e3;
  --accent: #ec407a;
  --success: #43a047;
  --warning: #fb8c00;
  --danger: #e53935;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #faf6f1;
  --card: #ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SCREEN SYSTEM
   ============================================================ */

.screen {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  background: var(--bg);
  animation: fadeIn 0.2s ease;
}

.screen.active { display: block; }

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

/* ============================================================
   HOME SCREEN
   ============================================================ */

.home-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 32px;
}

.logo-area {
  text-align: center;
  margin-bottom: 40px;
}

.logo-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.logo-img {
  width: 80px;
  height: auto;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.app-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.app-sub {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 15px;
}

.branch-grid {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.branch-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.branch-card:hover, .branch-card:active {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(196,146,42,0.2);
  transform: translateY(-1px);
}

.branch-card-left { display: flex; align-items: center; gap: 14px; }

.branch-icon {
  width: 44px; height: 44px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.branch-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.branch-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.branch-arrow {
  font-size: 20px;
  color: var(--primary);
  opacity: 0.6;
}

.branch-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.home-footer {
  margin-top: auto;
  padding-top: 40px;
  text-align: center;
}

/* ============================================================
   PIN SCREEN
   ============================================================ */

.pin-screen-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 40px;
}

.back-btn {
  align-self: flex-start;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 8px 4px 0;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.pin-branch-badge {
  margin-top: 20px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 16px;
  padding: 8px 20px;
  border-radius: 100px;
}

.pin-label {
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 15px;
}

.pin-dots-wrap {
  margin: 24px 0;
}

.pin-dots {
  display: flex;
  gap: 18px;
}

.pin-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: transparent;
  transition: all 0.15s ease;
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
}

.pin-dot.error {
  background: var(--danger);
  border-color: var(--danger);
}

.pin-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
  text-align: center;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 12px;
  margin: 8px 0 20px;
}

.num-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.num-btn:active { transform: scale(0.93); background: var(--primary-light); }

.num-clear { background: #fff3f3; color: var(--danger); font-size: 18px; }
.num-del { background: var(--primary-light); color: var(--primary-dark); font-size: 18px; }

.forgot-pin-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   SHARED SCREEN HEADER
   ============================================================ */

.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.screen-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.screen-date {
  font-size: 12px;
  color: var(--text-muted);
}

.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   DASHBOARD SCREEN
   ============================================================ */

.dashboard-wrap {
  padding: 20px 16px 80px;
  max-width: 600px;
  margin: 0 auto;
}

.date-badge {
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.cashup-status-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-info { display: flex; align-items: center; gap: 12px; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; }
.status-dot.pending { background: var(--warning); }
.status-dot.done { background: var(--success); }
.status-dot.none { background: var(--border); }

.status-label { font-weight: 600; font-size: 15px; }
.status-sub { font-size: 12px; color: var(--text-muted); }

/* stats-row kept for backwards compat */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.primary-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.primary-btn:hover { background: var(--primary-dark); }
.primary-btn:active { transform: scale(0.98); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.primary-btn.full-width {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  margin-top: 16px;
  border-radius: var(--radius);
}

.secondary-btn {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.secondary-btn:hover { border-color: var(--primary); color: var(--primary); }

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.link-btn:hover { text-decoration: underline; }

.danger-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

/* ============================================================
   CASHUP FORM SCREEN
   ============================================================ */

.view-only-banner {
  background: var(--primary-light);
  border-bottom: 1px solid #e9c97a;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  text-align: center;
}

.cashup-form-wrap {
  padding: 16px 16px 100px;
  max-width: 700px;
  margin: 0 auto;
}

.section-card {
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

.section-icon { font-size: 18px; }
.section-title { flex: 1; font-weight: 700; font-size: 15px; color: var(--text); }
.section-total { font-weight: 700; color: var(--primary-dark); font-size: 15px; }

/* Entry rows table */
.entries-table-wrap { overflow-x: auto; }

.entries-head {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 80px 1.2fr 32px;
  gap: 6px;
  padding: 8px 12px;
  background: #f9fafb;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  min-width: 560px;
}

.entry-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 80px 1.2fr 32px;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  min-width: 560px;
}

.entry-row:last-child { border-bottom: none; }

.entry-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: white;
  transition: border-color 0.15s;
  min-width: 0;
}

.entry-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196,146,42,0.15);
}

.entry-cell-amount {
  display: flex;
  align-items: center;
  gap: 2px;
}

.currency-prefix {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.entry-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  font-size: 13px;
  color: var(--text);
  background: white;
  cursor: pointer;
}

.entry-select:focus { outline: none; border-color: var(--primary); }

.del-row-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.del-row-btn:hover { color: var(--danger); background: #fff3f3; }

.add-row-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  text-align: center;
  border-top: 1px solid var(--border);
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.add-row-btn:hover { background: var(--primary-light); }

/* Expense rows */
.expense-row {
  display: grid;
  grid-template-columns: 1fr 120px 32px;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.expense-row:last-child { border-bottom: none; }

/* Summary grid */
.summary-grid { padding: 4px 0; }

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.summary-row:last-child { border-bottom: none; }

.summary-row label {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  min-width: 160px;
}

.summary-auto label { font-size: 14px; color: var(--text-muted); }
.summary-highlight { background: #fdf3e3; }
.summary-highlight label { font-weight: 600; color: var(--primary-dark); }

.summary-closing {
  background: var(--primary-light);
}

.summary-closing label {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

.summary-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: right;
  min-width: 100px;
}

.summary-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.summary-input {
  width: 120px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  color: var(--text);
  background: white;
}

.summary-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196,146,42,0.15);
}

/* Submit section */
.submit-section { padding: 0 4px; }

.submit-btn {
  background: var(--success);
  font-size: 17px;
  padding: 18px;
}

.submit-btn:hover { background: #388e3c; }

.submit-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============================================================
   ADMIN SCREEN
   ============================================================ */

.admin-wrap { padding: 20px 16px 80px; max-width: 600px; margin: 0 auto; }

.admin-login-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  margin-top: 20px;
}

.admin-icon { font-size: 48px; margin-bottom: 16px; }

.admin-login-card h2 { font-size: 22px; margin-bottom: 8px; }

.admin-login-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.text-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 12px;
  font-family: var(--font);
}

.text-input:focus { outline: none; border-color: var(--primary); }

.admin-msg { font-size: 13px; margin-top: 12px; color: var(--text-muted); }
.admin-msg.success { color: var(--success); }
.admin-msg.error { color: var(--danger); }

.admin-welcome {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.role-badge {
  background: var(--primary);
  color: white;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.role-badge.accountant { background: var(--accent); }

.admin-branch-row {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.admin-branch-row:last-child { border-bottom: none; }

.admin-branch-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}

.admin-branch-pin {
  font-size: 13px;
  color: var(--text-muted);
  font-family: monospace;
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 4px;
}

.icon-text-btn {
  background: none;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-text-btn:hover { background: var(--primary-light); }

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 { font-size: 18px; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

.modal-btns { display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end; }

/* ============================================================
   TOAST
   ============================================================ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a2e;
  color: white;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
}

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

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ============================================================
   AUTOCOMPLETE DROPDOWN
   ============================================================ */

.autocomplete-dropdown {
  position: fixed;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-height: 180px;
  overflow-y: auto;
  min-width: 160px;
}

.autocomplete-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--primary-light); color: var(--primary-dark); }

/* ============================================================
   VIEW MODE (read-only cashup)
   ============================================================ */

.view-mode .entry-input,
.view-mode .entry-select,
.view-mode .summary-input {
  background: var(--bg);
  color: var(--text-muted);
  pointer-events: none;
}

.view-mode .del-row-btn,
.view-mode .add-row-btn,
.view-mode #btn-add-expense,
.view-mode .submit-section {
  display: none;
}

/* ============================================================
   STATS GRID (replaces stats-row)
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* ============================================================
   RESPONSIVE — DESKTOP (≥ 768px)
   ============================================================ */

@media (min-width: 768px) {

  /* Home screen */
  .home-wrap {
    padding: 64px 40px 48px;
  }

  .logo-img { width: 96px; }
  .app-title { font-size: 32px; }

  .branch-grid {
    max-width: 700px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .branch-card { padding: 24px 28px; }

  /* PIN screen */
  .pin-screen-wrap { max-width: 440px; margin: 0 auto; padding: 40px 20px; }

  /* Dashboard */
  .dashboard-wrap {
    max-width: 960px;
    padding: 28px 32px 80px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .stat-card { padding: 20px; }
  .stat-value { font-size: 22px; }

  .cashup-status-card { padding: 22px 24px; }

  /* Dashboard actions row */
  .dash-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
    align-items: stretch;
  }

  .dash-actions-row .primary-btn.full-width {
    margin-top: 0;
    height: 100%;
    border-radius: var(--radius);
    font-size: 17px;
  }

  .dash-actions-row .section-card {
    margin-top: 0;
  }

  /* Admin override panel */
  #admin-date-override-panel .section-card { margin-top: 0; }

  /* Cashup form — 2-column layout */
  .cashup-form-wrap {
    max-width: 1100px;
    padding: 24px 32px 80px;
    display: grid;
    grid-template-columns: 1fr 360px;
    grid-template-rows: auto auto auto;
    gap: 16px;
    align-items: start;
  }

  /* Sales entries — left column */
  .cashup-form-wrap > .section-card:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }

  /* Summary — right column, spans rows */
  .cashup-form-wrap > .section-card:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / 4;
    margin-bottom: 0;
    position: sticky;
    top: 64px;
  }

  /* Expenses — left column */
  .cashup-form-wrap > .section-card:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0;
  }

  /* Submit — left column below expenses */
  .cashup-form-wrap > .submit-section {
    grid-column: 1;
    grid-row: 3;
  }

  /* Entry table — full width, no horizontal scroll */
  .entries-head,
  .entry-row {
    min-width: unset;
  }

  /* Summary sticky sidebar */
  .summary-input { width: 140px; }

  /* Admin panel */
  .admin-wrap {
    max-width: 800px;
    padding: 28px 32px 80px;
  }

  /* Screen header */
  .screen-header { padding: 16px 24px; }
  .screen-title { font-size: 18px; }

}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 600px)
   ============================================================ */

@media (max-width: 600px) {

  /* Home */
  .home-wrap { padding: 40px 16px 32px; }
  .app-title { font-size: 24px; }
  .logo-img { width: 70px; }

  /* Pin */
  .numpad { grid-template-columns: repeat(3, 68px); }
  .num-btn { width: 68px; height: 68px; font-size: 20px; }

  /* Dashboard */
  .dashboard-wrap { padding: 16px 14px 80px; }
  .stat-value { font-size: 17px; }
  .stat-card { padding: 14px; }

  /* Cashup form */
  .cashup-form-wrap { padding: 12px 12px 100px; }

  /* Entry rows — card layout (no horizontal scroll) */
  .entries-table-wrap { overflow-x: visible; }

  .entries-head { display: none; }

  .entry-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: unset;
    gap: 8px;
    padding: 12px;
    border-bottom: none;
    margin: 0 0 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }

  .entry-row:last-child { margin-bottom: 0; }

  /* Product — full width */
  .entry-row > div:nth-child(1) { grid-column: 1 / -1; }
  /* Name — full width */
  .entry-row > div:nth-child(2) { grid-column: 1 / -1; }
  /* Amount — left */
  .entry-row > div:nth-child(3) { grid-column: 1; }
  /* Type — right */
  .entry-row > div:nth-child(4) { grid-column: 2; }
  /* Staff — left */
  .entry-row > div:nth-child(5) { grid-column: 1; }
  /* Delete — right, aligned end */
  .entry-row > div:nth-child(6) {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .entry-input { font-size: 14px; padding: 9px 10px; }
  .entry-select { font-size: 14px; padding: 9px 6px; }

  /* Expense rows */
  .expense-row {
    grid-template-columns: 1fr 100px 32px;
    gap: 6px;
  }

  /* Summary */
  .summary-row label { min-width: 130px; font-size: 13px; }
  .summary-input { width: 100px; }

  /* Buttons */
  .primary-btn.full-width { font-size: 15px; padding: 15px; }
  .submit-btn { font-size: 16px; padding: 16px; }

  /* Admin wrap */
  .admin-wrap { padding: 16px 14px 80px; }
  .admin-branch-row { flex-wrap: wrap; gap: 8px; }

  /* Modals */
  .modal-card { padding: 24px 18px; }
}

/* ============================================================
   DASHBOARD ACTIONS — shared layout helper
   ============================================================ */

.dash-actions-row {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-actions-row .primary-btn.full-width { margin-top: 0; }
.dash-actions-row .section-card { margin-top: 0; }

/* ============================================================
   LOADING SPINNER
   ============================================================ */

.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text { color: var(--text-muted); font-size: 14px; }

/* ============================================================
   DATE OVERRIDE NOTICE (admin)
   ============================================================ */

.date-override-bar {
  background: var(--warning);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
