/* ═══════════════════════════════════════════════════════
   Energy Action — Expense Management
   Theme: Business Central-inspired (Segoe UI · MS Blue)
   ═══════════════════════════════════════════════════════ */

:root {
  /* Core palette */
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #1b2333;
  --muted: #5e6b82;
  --line: #dde1ea;

  /* Microsoft / BC blue */
  --accent: #0078d4;
  --accent-dark: #106ebe;
  --accent-light: #deecf9;
  --accent-ink: #ffffff;

  /* Status */
  --ok: #107c10;
  --danger: #d13438;

  /* Sidebar */
  --sidebar-bg: #1a2940;
  --sidebar-width: 228px;

  /* Geometry */
  --radius: 4px;
  --radius-lg: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 16px rgba(0, 0, 0, .04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, .12);
}

/* ── Reset ──────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

/* ── App Shell ──────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .15);
  border-radius: 4px;
}

/* Brand / logo */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: -.5px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Navigation */
.side-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-section-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  color: rgba(255, 255, 255, .35);
  padding: 12px 10px 4px;
  text-transform: uppercase;
  user-select: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  color: rgba(255, 255, 255, .72);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
  transition: background .14s, color .14s;
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .09);
  color: rgba(255, 255, 255, .95);
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.nav-item.active:hover {
  background: var(--accent-dark);
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 1.75;
  opacity: .85;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.mileage-shell {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 640px;
  border: 1px solid #d7dbe4;
  background: #f9fafb;
  box-shadow: var(--shadow);
}

.mileage-panel {
  width: 366px;
  background: #f5f5f5;
  border-right: 1px solid #d7dbe4;
  display: flex;
  flex-direction: column;
}

.mileage-shell-compact {
  min-height: 420px;
  height: 420px;
}

.mileage-shell-compact .mileage-map-wrap,
.mileage-shell-compact #re-mileage-map {
  min-height: 420px;
}

.mileage-panel-header {
  padding: 18px 18px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #2f3d4d;
  border-bottom: 1px solid #d8dbe2;
}

.waypoint-fields {
  position: relative;
  padding: 16px 44px 16px 16px;
  border-bottom: 1px solid #d8dbe2;
}

.waypoint-rows {
  display: flex;
  flex-direction: column;
}

.waypoint-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #d7dbe4;
  border-radius: 4px;
  padding: 0 10px;
}

.waypoint-field-connector {
  width: 1px;
  height: 10px;
  margin-left: 15px;
  border-left: 2px dotted #b7bec9;
}

.waypoint-field-icon {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.waypoint-field-icon-start {
  border: 2px solid #5e6b82;
  background: transparent;
}

.waypoint-field-icon-end {
  border: 2px solid #d13438;
  background: #d13438;
}

.waypoint-field-icon-stop {
  border: 2px solid #2d6be8;
  background: #2d6be8;
}

.waypoint-field-remove-btn {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #8b94a3;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.waypoint-field-remove-btn:hover {
  background: #f0f2f5;
  color: var(--danger);
}

.waypoint-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.waypoint-add-btn,
.waypoint-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
}

.waypoint-add-btn {
  color: var(--accent);
}

.waypoint-clear-btn {
  color: var(--danger);
}

.waypoint-add-btn:hover,
.waypoint-clear-btn:hover {
  text-decoration: underline;
}

.waypoint-field-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 12.5px;
  color: #1d2b3a;
  padding: 9px 0;
  background: transparent;
}

.waypoint-field-input::placeholder {
  color: #8b94a3;
}

.waypoint-field-distance {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #1a1d29;
  white-space: nowrap;
}

.waypoint-field-personal {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 600;
  color: #5e6b82;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.waypoint-field-personal input[type="checkbox"] {
  width: 11px;
  height: 11px;
  accent-color: var(--accent);
  cursor: pointer;
}

.waypoint-swap-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #d7dbe4;
  background: #fff;
  color: #5e6b82;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.waypoint-swap-btn:hover {
  background: #f0f2f5;
  color: var(--accent);
}

.mileage-footer {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #d8dbe2;
  background: #f0f2f5;
}

.mileage-total-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px 12px;
  text-transform: uppercase;
}

.mileage-total-row+.mileage-total-row {
  border-left: 1px solid #d8dbe2;
}

.mileage-total-label {
  font-size: 11px;
  color: #4d5f77;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.mileage-total-value {
  font-size: 18px;
  color: #0f6cbd;
  font-weight: 700;
  line-height: 1.1;
}

.mileage-map {
  position: relative;
  flex: 1;
  min-height: 600px;
  background:
    linear-gradient(135deg, rgba(156, 203, 214, 0.15), rgba(167, 210, 216, 0.08)),
    linear-gradient(white 0, rgba(255, 255, 255, 0.15) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 0 1px, transparent 1px),
    linear-gradient(180deg, #a4d0d9 0%, #98c8d1 38%, #cfe9ec 38%, #d8e7e5 100%);
  background-size: auto, auto, 32px 32px, 32px 32px, auto;
  overflow: hidden;
}

.mileage-map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 600px;
}

#mileage-map {
  width: 100%;
  height: 100%;
  min-height: 600px;
  background: #d9e8ea;
}

.mileage-map-wrap .leaflet-container {
  font-family: inherit;
  z-index: 1;
}

.mileage-pin {
  display: block;
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.mileage-pin-selected {
  outline: 3px solid #111;
  outline-offset: 2px;
}

.mileage-pin-letter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
}

.mileage-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 28%, rgba(114, 172, 143, 0.7) 0%, rgba(114, 172, 143, 0.7) 9%, transparent 10%),
    radial-gradient(circle at 60% 34%, rgba(130, 180, 124, 0.8) 0%, rgba(130, 180, 124, 0.8) 9%, transparent 10%),
    radial-gradient(circle at 72% 15%, rgba(132, 183, 124, 0.55) 0%, rgba(132, 183, 124, 0.55) 7%, transparent 8%),
    linear-gradient(115deg, transparent 0 57%, rgba(255, 255, 255, 0.18) 57% 58%, transparent 58%);
  opacity: 0.9;
}

.map-header-badge {
  position: absolute;
  left: 22px;
  top: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(102, 108, 126, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  color: #1d2b3a;
  font-weight: 700;
  font-size: 18px;
  padding: 8px 14px;
  border-radius: 3px;
  z-index: 2;
}

.map-route {
  position: absolute;
  background: linear-gradient(90deg, rgba(60, 126, 232, 0.85), rgba(32, 104, 214, 1));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
  height: 4px;
  border-radius: 999px;
  transform-origin: left center;
  z-index: 1;
}

.map-route-main {
  left: 34%;
  top: 41%;
  width: 40%;
  transform: rotate(13deg);
}

.map-route-alt {
  left: 46%;
  top: 57%;
  width: 33%;
  transform: rotate(19deg);
}

.map-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  z-index: 2;
}

.map-pin-start {
  left: 38%;
  top: 38%;
  background: #ee4851;
}

.map-pin-end {
  left: 66%;
  top: 65%;
  background: #ee4851;
}

.map-label {
  position: absolute;
  z-index: 2;
  font-size: 12px;
  color: rgba(37, 49, 66, 0.8);
  font-weight: 600;
}

.map-label-east {
  right: 22%;
  top: 27%;
}

.map-label-west {
  left: 24%;
  top: 58%;
}

.map-google {
  position: absolute;
  right: 16px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(35, 42, 52, 0.8);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(94, 107, 130, 0.15);
  padding: 4px 8px;
  border-radius: 12px;
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, .08);
  margin: 8px 10px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 8px 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.nav-upgrade {
  color: rgba(255, 255, 255, .55);
}

.nav-upgrade:hover {
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .9);
}

/* ══════════════════════════════════════════════════════
   MAIN AREA
   ══════════════════════════════════════════════════════ */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  height: 50px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* User chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-settings-btn {
  width: 32px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fc;
  color: #2f3d55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-settings-btn:hover {
  background: #eef3fa;
  border-color: #cfd8e6;
}

.user-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 10px;
  display: none;
  z-index: 20;
}

.user-chip:hover .user-popover,
.user-chip:focus-within .user-popover {
  display: block;
}

.user-popover .user-meta {
  margin-bottom: 8px;
}

.user-popover .btn {
  width: 100%;
  justify-content: center;
}

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

.user-email {
  color: var(--muted);
  font-size: 11px;
}

/* Content area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.content-area.claims-compact {
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
}

.content-area.dashboard-compact {
  min-height: 0;
  overflow: hidden;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

#view-dashboard {
  align-items: flex-start;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-top: 14px;
}

#view-dashboard .cue-group {
  width: 100%;
  margin-left: 0;
  margin-bottom: 0;
}

#view-dashboard .dashboard-claims {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.dashboard-claims .card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.dashboard-claims .bc-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dashboard-claims .bc-table thead th,
#view-claims .bc-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7fb;
}

#view-claims {
  flex: 1;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

#view-claims>.card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

#view-claims .bc-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ══════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════ */
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 7px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .14s, border-color .14s, opacity .14s;
  line-height: 1.4;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  background: #edf2f8;
  border-color: #c8d0de;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-ms {
  background: #ffffff;
  border: 1px solid #d0d5dd;
  color: var(--ink);
  padding: 10px 20px;
  font-size: 14px;
  border-radius: var(--radius);
}

.btn-ms:hover {
  background: #f5f7fa;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.full {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════
   LOGIN VIEW
   ══════════════════════════════════════════════════════ */
.login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.login-logo-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 600;
}

.login-card p {
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.6;
}

.dev-note {
  font-size: 12px;
  color: var(--danger);
  margin-top: 14px;
}

/* ══════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* Two-column grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
  align-items: start;
}

.grid,
.card,
.form,
.form label,
.row,
.items,
.items-body,
.item-row {
  min-width: 0;
}

.form input,
.form select,
.form textarea {
  min-width: 0;
}

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

/* ══════════════════════════════════════════════════════
   DROPZONE
   ══════════════════════════════════════════════════════ */
.dropzone {
  display: block;
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  background: #f9fafc;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, background .15s;
  margin-bottom: 12px;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--accent);
  background: #e8f3fb;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}

.dz-icon {
  color: var(--accent);
  opacity: .7;
}

.dz-text {
  font-size: 13.5px;
  color: var(--ink);
}

.dz-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.preview-img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: #0f1520;
}

.preview-file {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--ink);
}

.receipt-attach-strip {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.receipt-attach-strip input.receipt-clickable {
  color: var(--accent);
  cursor: pointer !important;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .receipt-attach-strip {
    grid-template-columns: 1fr;
  }
}

.scan-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.confidence {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ok);
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

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

/* ══════════════════════════════════════════════════════
   FORM
   ══════════════════════════════════════════════════════ */
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.field-label-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label-action .btn {
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.2;
}

.form input,
.form select,
.form textarea {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .14s, box-shadow .14s;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, .14);
}

.record-date-field {
  position: relative;
  display: block;
  width: 100%;
}

.record-date-field #re-date-display {
  width: 100%;
  padding-right: 40px;
}

.record-date-field #re-date {
  position: absolute;
  right: 1px;
  top: 1px;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.record-date-field #re-date-button {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 34px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 4px 4px 0;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}

.record-date-field #re-date-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.items {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fafbfd;
}

.items-head {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 6px;
}

.items-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-row {
  display: grid;
  gap: 6px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 2px;
}

.item-row-basic {
  grid-template-columns: 1fr 60px 90px;
}

.item-row-fcy {
  grid-template-columns: 1fr 60px 90px 100px;
}

.item-row input {
  padding: 5px 8px;
}

.item-row-selected {
  border-color: #d0d5dd;
  background: #f8fafc;
}

.items-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.items-cols {
  display: grid;
  gap: 6px;
  margin: 0 2px 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.items-cols-basic {
  grid-template-columns: 1fr 60px 90px;
}

.record-expense-items {
  padding: 0;
  background: transparent;
}

.record-expense-items .items-head {
  padding: 10px 10px 6px;
  margin: 0;
}

.record-expense-items .items-actions {
  gap: 0;
  margin: 0;
  padding: 0 8px;
  min-height: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.record-expense-items .items-actions .btn {
  border: 0;
  border-radius: 0;
  padding: 6px 10px;
}

.record-expense-items .items-actions .btn+.btn {
  border-left: 1px solid var(--line);
}

.record-expense-items .items-cols {
  margin: 0;
  padding: 7px 10px;
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
}

.record-expense-items .items-body {
  gap: 0;
}

.record-expense-items .item-row {
  border: 0;
  border-radius: 0;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
}

.record-expense-items .item-row:last-child {
  border-bottom: 0;
}

.record-expense-items .item-row input {
  border-color: transparent;
  background: transparent;
  padding: 5px 4px;
}

.record-expense-items .item-row input:focus {
  border-color: var(--accent);
  background: #fff;
}

.record-expense-items .item-row-selected {
  background: #e8f3fb;
}

.items-cols-fcy {
  grid-template-columns: 1fr 60px 90px 100px;
}

.record-expense-items.fcy-hidden .items-cols-fcy,
.record-expense-items.fcy-hidden .item-row-fcy {
  grid-template-columns: 1fr 60px 90px;
}

.record-expense-items.fcy-hidden .items-cols-fcy span:last-child,
.record-expense-items.fcy-hidden .item-row-fcy .it-fcy {
  display: none;
}

.items-cols span {
  padding: 0 8px;
}

.muted {
  color: var(--muted);
}

/* ══════════════════════════════════════════════════════
   EXPENSE LIST
   ══════════════════════════════════════════════════════ */
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.list-head h2 {
  margin: 0;
}

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

.expense-item {
  display: grid;
  grid-template-columns: 42px 1fr auto auto 20px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .14s, background .14s, box-shadow .14s;
  background: var(--card);
}

.expense-item:hover {
  border-color: var(--accent);
  background: #f0f6fd;
  box-shadow: 0 1px 6px rgba(0, 120, 212, .1);
}

.expense-del {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius);
  opacity: .4;
  transition: opacity .14s, background .14s;
  color: var(--danger);
}

.expense-del:hover {
  opacity: 1;
  background: #fde8e8;
}

.expense-chevron {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.expense-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #eef2f8;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  border: 1px solid var(--line);
}

.expense-main .m-merchant {
  font-weight: 600;
  font-size: 13.5px;
}

.expense-main .m-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.expense-amount {
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}

/* Status badges — BC style */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 2px;
  vertical-align: middle;
  letter-spacing: .01em;
}

.badge-open {
  background: #dce8f9;
  color: #004c8c;
}

.badge-approved {
  background: #dff6dd;
  color: #0b6a0b;
}

.badge-returned {
  background: #fde7e9;
  color: #a4262c;
}

.badge-cancelled {
  background: #e5e7eb;
  color: #4b5563;
}

.badge-submitted,
.badge-pending-approval {
  background: #fef3c7;
  color: #92400e;
}

.badge.claim-list-status {
  background: transparent;
  color: #000;
}

/* ══════════════════════════════════════════════════════
   DATA CUES (Business Central Role Center style)
   ══════════════════════════════════════════════════════ */
.cue-group {
  margin-bottom: 28px;
}

.cue-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  padding-left: 2px;
}

.cue-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cue-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  width: 156px;
  min-height: 88px;
  padding: 14px 16px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  transition: box-shadow 80ms, border-top-color 80ms;
}

.cue-tile:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, .13);
  border-top-color: var(--accent);
}

.cue-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cue-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 8px;
}

.cue-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

/* Coloured accent tops */
.cue-tile.cue-blue {
  border-top-color: #0078d4;
}

.cue-tile.cue-blue .cue-value {
  color: #0078d4;
}

.cue-tile.cue-green {
  border-top-color: #107c10;
}

.cue-tile.cue-green .cue-value {
  color: #107c10;
}

.cue-tile.cue-red {
  border-top-color: #d13438;
}

.cue-tile.cue-red .cue-value {
  color: #d13438;
}

.cue-tile.cue-amber {
  border-top-color: #b7600a;
}

.cue-tile.cue-amber .cue-value {
  color: #b7600a;
}

/* ══════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  z-index: 100;
  max-width: 90vw;
  white-space: nowrap;
}

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

.toast.ok {
  background: var(--ok);
}

/* ══════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 80;
  overflow-y: auto;
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .22);
  width: 100%;
  max-width: 760px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  border-radius: var(--radius);
  transition: color .14s, background .14s;
}

.modal-close:hover {
  color: var(--ink);
  background: #edf2f8;
}

.modal-body {
  padding: 20px;
}

/* ── Expense document (BC FastTab style) ─────────────── */
.doc-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.doc-status-row .badge {
  font-size: 11px;
  padding: 3px 10px;
}

.doc-status-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.doc-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.doc-merchant {
  font-size: 18px;
  font-weight: 700;
}

.doc-docno {
  font-size: 11px;
  color: var(--muted);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfd;
}

.doc-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-field .k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
}

.doc-field .v {
  font-weight: 600;
  font-size: 13.5px;
}

.doc-field-right {
  align-items: flex-end;
  text-align: right;
}

.doc-field-input-num {
  max-width: 160px;
  text-align: right;
  font-weight: 700;
}

.doc-field-input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  box-sizing: border-box;
  margin-top: 2px;
}

.doc-field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, .15);
}

.doc-field-input.field-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(209, 52, 56, .15);
}

.claim-date-field {
  position: relative;
}

.claim-date-field .doc-field-input {
  padding-right: 36px;
}

.claim-date-field:focus-within .doc-field-input {
  border-color: var(--primary);
}

.claim-date-field:has(.field-invalid) .doc-field-input {
  border-color: var(--danger);
}

.claim-date-picker {
  position: absolute;
  right: 0;
  top: 2px;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.claim-date-button {
  position: absolute;
  right: 1px;
  top: 3px;
  bottom: 1px;
  width: 32px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 4px 4px 0;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
}

.claim-date-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(209, 52, 56, .15);
}

.doc-field-input-half {
  width: calc(50% - 12px);
  min-width: 280px;
}

textarea.doc-field-input {
  resize: vertical;
  min-height: 52px;
}

/* Lines table */
.doc-lines {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.doc-lines th,
.doc-lines td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.doc-lines th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 700;
  background: #f7f9fb;
}

.doc-lines td.num,
.doc-lines th.num {
  text-align: right;
  white-space: nowrap;
}

.claim-expense-account-no {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  margin-bottom: 2px;
}

.doc-lines tbody tr:hover {
  background: #f0f6fd;
}

.doc-lines .no-lines td {
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.claim-expenses-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.claim-expenses-scroll .doc-lines {
  min-width: 1160px;
}

/* Totals */
.doc-totals {
  margin-top: 14px;
  margin-left: auto;
  width: 240px;
}

.doc-totals .row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.doc-totals .row.grand {
  border-top: 2px solid var(--ink);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 700;
  font-size: 15px;
}

/* Receipt block */
.doc-receipt {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.doc-receipt h3 {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
}

.doc-receipt img {
  max-width: 100%;
  max-height: 340px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.doc-receipt a {
  font-size: 13px;
}

.doc-loading {
  color: var(--muted);
  padding: 20px 0;
  text-align: center;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ── */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.hamburger-btn:hover {
  background: #edf2f8;
}

/* ── Sidebar overlay backdrop ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 199;
}

.sidebar-overlay.visible {
  display: block;
}

/* ── Tablet: icon-only sidebar ── */
@media (max-width: 768px) {
  .sidebar {
    width: 54px;
  }

  .sidebar-logo-text,
  .nav-section-label,
  .nav-item>span:not(.nav-icon) {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 10px;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 14px 10px;
  }
}

/* ── Mobile: overlay drawer sidebar ── */
@media (max-width: 640px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: calc(-1 * var(--sidebar-width));
    width: var(--sidebar-width) !important;
    z-index: 200;
    transition: left 0.22s ease;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  /* Restore full sidebar labels & layout when open */
  .sidebar.mobile-open .sidebar-logo-text,
  .sidebar.mobile-open .nav-section-label,
  .sidebar.mobile-open .nav-item>span:not(.nav-icon) {
    display: initial;
  }

  .sidebar.mobile-open .nav-item {
    justify-content: flex-start;
    padding: 8px 10px;
  }

  .sidebar.mobile-open .sidebar-brand {
    justify-content: flex-start;
    padding: 18px 14px 16px;
  }

  /* Cue tiles: fill row on small screens */
  .cue-tile {
    flex: 1 1 130px;
  }

  /* Expense item: drop amount column on very small screens */
  .expense-item {
    grid-template-columns: 38px 1fr auto 20px;
  }

  /* Modal: reduce padding */
  .modal-overlay {
    padding: 12px 8px;
    align-items: flex-start;
  }

  .modal-body {
    padding: 14px;
  }

  .modal-head {
    padding: 12px 14px;
  }

  /* BC command bar: wrap filters below commands */
  .bc-sales-commandbar {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 10px;
  }

  .bc-sales-spacer {
    display: none;
  }

  .bc-sales-filters {
    width: 100%;
    margin-left: 0;
    padding: 4px 0 2px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .bc-sales-filters .filter-select,
  .bc-sales-filters .filter-input {
    flex: 1 1 120px;
    min-width: 0;
  }
}

/* ── Small mobile: 2-column proportional layout ── */
@media (max-width: 540px) {
  .content-area {
    padding: 14px;
  }

  .topbar {
    padding: 0 14px;
  }

  /* Keep 2 equal columns on mobile */
  .row {
    grid-template-columns: 1fr 1fr;
  }

  .row-3 {
    grid-template-columns: 1fr 1fr;
  }

  /* Item row: keep inline but tighter */
  .item-row {
    grid-template-columns: 1fr 60px 80px 28px;
    font-size: 12px;
  }

  /* Doc fields: 2 proportional columns */
  .doc-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* Totals: full width */
  .doc-totals {
    width: 100%;
  }

  /* Page title smaller */
  .page-title {
    font-size: 16px;
  }

  /* Login card: tighter padding */
  .login-card {
    padding: 28px 20px;
  }
}

/* ══════════════════════════════════════════════════════
   EXPENSE CLAIM — Page Header & Filter Bar
   ══════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.page-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.filter-select,
.filter-input {
  font-family: inherit;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
  height: 30px;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, .12);
}

.filter-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* BC Sales Invoice-style shell for Expense Claims */
.bc-sales-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bc-sales-viewline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
}

.bc-sales-caption {
  font-size: 22px;
  font-weight: 600;
  color: #1f2940;
  line-height: 1;
}

.bc-sales-select-wrap {
  position: relative;
}

.bc-sales-select {
  font-family: inherit;
  font-size: 20px;
  font-weight: 500;
  color: var(--accent);
  border: none;
  background: transparent;
  padding: 0 20px 0 0;
  cursor: pointer;
  appearance: none;
}

.bc-sales-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-52%);
  font-size: 11px;
  color: #44536b;
  pointer-events: none;
}

.bc-sales-select:focus {
  outline: none;
}

.bc-mini-icon-btn {
  width: 26px;
  height: 24px;
  border: 1px solid transparent;
  background: transparent;
  color: #4f5f79;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bc-mini-icon-btn:hover {
  background: #edf3fb;
  border-color: #d7e1ef;
  color: #294c7d;
}

.bc-sales-commandbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.bc-sales-spacer {
  flex: 1 1 auto;
  min-width: 10px;
}

.bc-sales-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 8px;
}

.bc-sales-filters .filter-select,
.bc-sales-filters .filter-input {
  height: 28px;
  min-width: 130px;
  padding: 4px 8px;
}

.bc-sales-filters .btn {
  height: 28px;
  padding: 4px 10px;
}

.bc-sales-cmd {
  border: 1px solid transparent;
  background: transparent;
  color: #1f2d43;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.bc-sales-cmd:hover {
  background: #edf3fb;
  border-color: #d7e1ef;
  color: #114782;
}

.bc-sales-cmd.primary {
  color: #005a9e;
  font-weight: 600;
}

.bc-sales-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.bc-sales-cmd:disabled {
  opacity: .45;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.claim-doc-commandbar {
  margin: 0;
  overflow: visible;
}

.bc-sales-dropdown {
  position: relative;
  display: inline-flex;
}

.bc-sales-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  min-width: 170px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}

.bc-sales-dropdown-menu[hidden] {
  display: none !important;
}

.bc-sales-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #1f2d43;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.bc-sales-dropdown-item svg {
  flex-shrink: 0;
  color: #005a9e;
}

.bc-sales-dropdown-item:hover {
  background: #edf3fb;
  color: #005a9e;
}

.claim-doc-commandbar .bc-sales-cmd-danger {
  color: #a4262c;
  font-weight: 600;
}

.claim-doc-commandbar .bc-sales-cmd-danger:hover {
  background: #fde7e9;
  border-color: #f3c7cc;
  color: #8f1d22;
}

.claim-doc-commandbar .bc-sales-cmd-dark {
  color: #1f2d43;
  font-weight: 600;
}

.claim-doc-commandbar .bc-sales-cmd-dark:hover {
  background: #eaedf2;
  border-color: #cdd4df;
  color: #000;
}

@media (max-width: 900px) {

  .bc-sales-caption,
  .bc-sales-select {
    font-size: 18px;
  }

  .bc-sales-filters {
    width: 100%;
    margin-left: 0;
    padding-top: 6px;
    padding-left: 0;
    justify-content: flex-start;
  }

  .doc-field-input-half {
    width: 100%;
    min-width: 0;
  }
}

/* ══════════════════════════════════════════════════════
   BC-STYLE TABLE (Expense Claim List)
   ══════════════════════════════════════════════════════ */

/* Ledger breadcrumb bar */
.bc-ledger-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fb;
}

.bc-ledger-link {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}

.bc-ledger-link:hover {
  text-decoration: underline;
}

.bc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bc-table thead tr {
  background: #f4f7fb;
}

.bc-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  border-bottom: 2px solid var(--line);
  cursor: pointer;
  user-select: none;
  position: relative;
}

.bc-table th:hover {
  color: var(--accent);
  background: #edf4fc;
}

.sort-icon {
  font-size: 10px;
  opacity: .5;
  margin-left: 4px;
}

.bc-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
}

.bc-table-row {
  cursor: pointer;
  transition: background .1s;
}

.bc-table-row:hover {
  background: #f0f6fd;
}

.bc-table-row.selected {
  background: #e9f3ff;
}

.bc-table-row:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.bc-table-row:last-child td {
  border-bottom: none;
}

.bc-link {
  color: var(--accent);
  font-weight: 600;
}

.bc-table-empty td {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
  font-size: 13px;
}

/* Credit card transaction lookup modal: keep Amount + Action visible in default view */
#cc-lookup-table {
  table-layout: fixed;
}

#cc-lookup-table .col-cc-no {
  width: 160px;
}

#cc-lookup-table .col-cc-account {
  width: 120px;
}

#cc-lookup-table .col-cc-date {
  width: 105px;
}

#cc-lookup-table .col-cc-desc {
  width: 240px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#cc-lookup-table .col-cc-amount {
  width: 110px;
}

#cc-lookup-table .col-cc-action {
  width: 92px;
}

/* ══════════════════════════════════════════════════════
   CLAIM CARD MODAL
   ══════════════════════════════════════════════════════ */
.claim-card-modal {
  max-width: 860px;
}

.claim-card-modal .modal-body {
  padding: 0 20px 20px;
}

.claim-card-modal .doc-grid {
  margin-top: 0;
}

.ea-line-input {
  width: 100%;
  max-width: 140px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  text-align: right;
}

.ea-add-user-card {
  margin: -4px 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.ea-add-user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ea-add-user-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ea-add-user-company-field {
  grid-column: 1;
  grid-row: 3;
}

.ea-allocation-summary-field {
  grid-column: 2;
}

.ea-add-user-email-field {
  grid-column: 1;
  grid-row: 1;
}

.ea-add-user-amount-field {
  grid-column: 2;
  grid-row: 1;
}

.ea-add-user-name-field {
  grid-column: 1;
  grid-row: 2;
}

.ea-allocation-total-field {
  grid-column: 2;
  grid-row: 2;
}

.ea-allocation-per-person-field {
  grid-column: 2;
  grid-row: 3;
}

.ea-add-user-grid .doc-field-input {
  color: #000;
}

.ea-add-user-grid .doc-field-input[readonly] {
  color: var(--muted);
}

.ea-add-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .ea-add-user-grid {
    grid-template-columns: 1fr;
  }
}

.section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}