/* ==================================================================
   LoadRun - styled to match her original program:
   Bootstrap 5, blue #0d6efd navbar, #f5f5f5 body, white rounded
   cards with shadow, blue card headings (#1c6dd0), bordered tables
   with dark heads, Bootstrap badges and buttons, system fonts.
   Dark mode rides on Bootstrap's data-bs-theme.
   ================================================================== */

body { background: #f5f5f5; }
[data-bs-theme="dark"] body { background: #1a1d21; }

.navbar-brand { font-weight: bold; }
.content { padding: 25px; }

.theme-toggle-nav {
  background: rgba(255,255,255,.15); border: none; border-radius: 8px;
  padding: 4px 9px; font-size: 14px; line-height: 1;
}
[data-bs-theme="light"] .icon-sun { display: none; }
[data-bs-theme="dark"] .icon-moon { display: none; }

/* ---------- Page headings ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 1.7rem; font-weight: 700; margin: 0; color: #1c6dd0; }
[data-bs-theme="dark"] h1 { color: #6ea8fe; }
.page-sub { color: var(--bs-secondary-color); font-size: .9rem; margin-top: 3px; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 12px; }

/* ---------- Cards (her white / rounded / shadow) ---------- */
.card {
  background: var(--bs-body-bg);
  border: none;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, .15);
  padding: 20px;
  display: block;
}
[data-bs-theme="dark"] .card { box-shadow: 0 0 10px rgba(0,0,0,.5); }
.card + .card { margin-top: 18px; }
.mt { margin-top: 18px; }

/* ---------- Dashboard stat cards (her exact style) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat {
  background: var(--bs-body-bg); border-radius: 10px; padding: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, .15);
}
.stat-label { color: #1c6dd0; font-size: 1.05rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
[data-bs-theme="dark"] .stat-label { color: #6ea8fe; }
.stat-value { font-size: 30px; font-weight: bold; margin-top: 10px; }
.stat-value.money { font-size: 24px; }
.stat-note { font-size: .8rem; color: var(--bs-secondary-color); margin-top: 2px; }
.stat.accent, .stat.good, .stat.bad { border: none; }
.stat.good .stat-value { color: #198754; }
.stat.bad .stat-value { color: #dc3545; }

/* ---------- Tables: bordered + hover, dark head like hers ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; vertical-align: middle; }
table.data th, table.data td { border: 1px solid var(--bs-border-color); padding: .5rem .65rem; }
table.data thead th {
  background: #212529; color: #fff; font-weight: 600;
  text-transform: none; letter-spacing: 0; font-size: .88rem; white-space: nowrap;
}
table.data tbody tr:hover td { background: var(--bs-tertiary-bg); }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { text-decoration: underline; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-no { font-weight: 600; }
.mono { font-family: inherit; }

/* ---------- Status badges (her Bootstrap badges) ---------- */
.chip {
  display: inline-block; padding: .35em .65em; border-radius: .375rem;
  font-size: .75rem; font-weight: 700; line-height: 1; white-space: nowrap;
}
.chip.WAITING_ACK              { background: #6c757d; color: #fff; }
.chip.WAITING_SETTLEMENT       { background: #0dcaf0; color: #000; }
.chip.WAITING_CUSTOMER_PAYMENT { background: #ffc107; color: #000; }
.chip.COMPLETED                { background: #198754; color: #fff; }
.chip.request                  { background: #0d6efd; color: #fff; }

/* ---------- Buttons (hers: green save, gray cancel, blue row action) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #6c757d; background: #6c757d; color: #fff;
  padding: .375rem .75rem; border-radius: .375rem;
  font: inherit; font-size: .92rem; font-weight: 400; cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #5c636a; border-color: #565e64; color: #fff; text-decoration: none; }
.btn.primary { background: #198754; border-color: #198754; }
.btn.primary:hover { background: #157347; border-color: #146c43; }
.btn.small { padding: .25rem .5rem; font-size: .82rem; }
.btn.small.primary { background: #0d6efd; border-color: #0d6efd; }
.btn.small.primary:hover { background: #0b5ed7; border-color: #0a58ca; }
.btn.blue { background: #0d6efd; border-color: #0d6efd; }
.btn.blue:hover { background: #0b5ed7; border-color: #0a58ca; }
.btn.success { background: #198754; border-color: #198754; }
.btn.success:hover { background: #157347; border-color: #146c43; }
.btn.danger { background: #dc3545; border-color: #dc3545; }
.btn.danger:hover { background: #bb2d3b; border-color: #b02a37; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Tabs as nav pills ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: .4rem .8rem; border-radius: .375rem; font-size: .88rem; color: #0d6efd; text-decoration: none; }
.tab:hover { background: var(--bs-tertiary-bg); text-decoration: none; }
.tab.active { background: #0d6efd; color: #fff; }
.tab .count { opacity: .75; margin-left: 4px; }

/* ---------- Forms (Bootstrap look) ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; }
.field label { display: block; font-size: .9rem; font-weight: 400; color: inherit; margin-bottom: .4rem; text-transform: none; letter-spacing: 0; }
.input,
input.form-control, select.form-select, textarea.form-control {
  width: 100%;
}
.input {
  padding: .375rem .75rem; border: 1px solid var(--bs-border-color);
  border-radius: .375rem; background: var(--bs-body-bg); color: var(--bs-body-color);
  font: inherit; font-size: .95rem;
}
.input:focus { border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 .25rem rgba(13,110,253,.25); }
select.input { appearance: auto; }
.check { width: 1.1em; height: 1.1em; accent-color: #0d6efd; }
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: .95rem; }
.field-error { color: #dc3545; font-size: .82rem; margin-top: 4px; }
.help { color: var(--bs-secondary-color); font-size: .82rem; margin-top: 4px; }
.form-section { border-top: 1px solid var(--bs-border-color); margin-top: 20px; padding-top: 16px; }
.form-section-title { font-size: 1.02rem; font-weight: 600; color: #0d6efd; margin-bottom: 12px; text-transform: none; letter-spacing: 0; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Inline messages inside forms ---------- */
.messages { margin-bottom: 16px; display: grid; gap: 8px; }
.msg { padding: .6rem 1rem; border-radius: .375rem; font-size: .92rem; border: 1px solid transparent; }
.msg.success { background: #d1e7dd; color: #0f5132; border-color: #badbcc; }
.msg.danger  { background: #f8d7da; color: #842029; border-color: #f5c2c7; }
.msg.info    { background: #cff4fc; color: #055160; border-color: #b6effb; }
[data-bs-theme="dark"] .msg.success { background: #0f5132; color: #d1e7dd; }
[data-bs-theme="dark"] .msg.danger  { background: #842029; color: #f8d7da; }
[data-bs-theme="dark"] .msg.info    { background: #055160; color: #cff4fc; }

/* ---------- Route: plain text arrow, like her "From -> To" ---------- */
.route { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.route .stop { font-weight: 500; }
.route .leg { width: auto; border: 0; }
.route .leg::after { content: "→"; position: static; border: 0; color: var(--bs-secondary-color); }

/* ---------- Misc ---------- */
.muted { color: var(--bs-secondary-color); }
.empty { text-align: center; color: var(--bs-secondary-color); padding: 30px 10px; }
.right { text-align: right; }
.inline-form { display: inline; }
.summary-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: .95rem; max-width: 340px; }
.summary-line strong { font-weight: 700; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- Auth pages (her centered card with shadow) ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 720px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; justify-content: center; }
.auth-brand .brand-mark {
  width: 42px; height: 42px; border-radius: 9px; background: #0d6efd; color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 17px;
}
.auth-brand-name { font-size: 1.35rem; font-weight: 700; }
.auth-brand-sub { font-size: .72rem; letter-spacing: 1.2px; text-transform: uppercase; color: var(--bs-secondary-color); }
.auth-foot { text-align: center; margin-top: 16px; font-size: .88rem; color: var(--bs-secondary-color); }
.theme-toggle { position: fixed; top: 16px; right: 16px; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.icon-moon, .icon-sun { font-size: 15px; }

/* My Profile + Google sign-in */
.field-hint { color: var(--bs-secondary-color); font-size: .8rem; margin-top: 4px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--bs-secondary-color); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--bs-border-color); }
