/* Redmine Equipment Booking - plugin styles
   Deliberately small: layout and state only, colours come from these tokens so
   the plugin blends into whatever Redmine theme is active. */

:root {
  --eqb-tool: #1f4e79;
  --eqb-truck: #b06a00;
  --eqb-ok: #1c6e48;
  --eqb-ko: #9e2b2b;
  --eqb-line: #d8dee6;
  --eqb-surface: #ffffff;
  --eqb-surface-2: #f5f7fa;
  --eqb-ink-2: #5a6675;
  --eqb-radius: 8px;
}

/* ============================ reservation panel ========================= */

fieldset.eqb-panel {
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  padding: 8px 14px 14px;
  margin: 12px 0;
  background: var(--eqb-surface);
}
fieldset.eqb-panel > legend {
  font-weight: bold;
  padding: 0 6px;
}

.eqb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  background: var(--eqb-surface-2);
  position: relative;
}
.eqb-row.eqb-locked { opacity: .75; }
.eqb-row .eqb-cell { display: flex; flex-direction: column; min-width: 0; }
.eqb-row .eqb-cell-resource { flex: 1 1 220px; }
.eqb-row .eqb-cell-km input.eqb-km { width: 110px; min-height: 34px; font-size: 14px; box-sizing: border-box; }
.eqb-row .eqb-cell-feedback { flex: 1 1 240px; }
.eqb-row .eqb-cell-actions { margin-left: auto; }

.eqb-label {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--eqb-ink-2);
  margin-bottom: 3px;
}

.eqb-row select.eqb-resource,
.eqb-row input.eqb-datetime {
  min-height: 34px;
  font-size: 14px;
  max-width: 100%;
}
.eqb-row select.eqb-resource { width: 100%; }

.eqb-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  white-space: nowrap;
}
.eqb-badge-tool  { background: var(--eqb-tool); }
.eqb-badge-truck { background: var(--eqb-truck); }

/* searchable tool / truck list */
select.eqb-combo-native { display: none !important; }
.eqb-combo { position: relative; width: 100%; }
.eqb-combo-btn {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 6px 30px 6px 10px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235a6675' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eqb-combo-btn.eqb-combo-empty { color: var(--eqb-ink-2); }
.eqb-combo-btn:focus { outline: none; border-color: var(--eqb-tool); box-shadow: 0 0 0 2px rgba(31, 78, 121, .15); }
.eqb-combo-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14);
}
.eqb-combo-panel[hidden] { display: none; }
input.eqb-combo-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid var(--eqb-line);
  border-radius: 6px;
  font-size: 16px; /* 16px: no zoom-in on iPhone */
}
.eqb-combo-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.eqb-combo-list li { padding: 8px 10px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.eqb-combo-list li.active { background: #e5eef7; }
.eqb-combo-list li.selected { font-weight: bold; }
.eqb-combo-list li mark { background: #fff1a8; color: inherit; padding: 0; }
.eqb-combo-list li.eqb-combo-none { color: var(--eqb-ink-2); cursor: default; font-style: italic; }

.eqb-feedback { font-size: 13px; font-weight: bold; }
.eqb-feedback.ok { color: var(--eqb-ok); }
.eqb-feedback.ko { color: var(--eqb-ko); }
.eqb-feedback.loading { color: var(--eqb-ink-2); font-weight: normal; }
.eqb-cost { font-size: 12px; color: var(--eqb-ink-2); }

.eqb-remove {
  display: inline-block;
  min-width: 40px;
  min-height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 20px;
  text-decoration: none;
  color: var(--eqb-ko);
  border-radius: var(--eqb-radius);
}
.eqb-remove:hover { background: rgba(158, 43, 43, .1); }

.eqb-actions { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.eqb-hint { font-size: 12px; color: var(--eqb-ink-2); }

/* 30-day availability ribbon */
.eqb-ribbon {
  flex: 1 0 100%;
  display: flex;
  gap: 2px;
  margin-top: 2px;
}
.eqb-ribbon-day {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 2px;
  background: #dfe4ea;
}
.eqb-ribbon-day.busy { background: var(--eqb-ko); }
.eqb-ribbon-day.month-start { box-shadow: inset 1px 0 0 var(--eqb-ink-2); }

/* recap on the issue page */
.eqb-show { margin-top: 12px; }
.eqb-show h4 { margin: 0 0 6px; }
.eqb-show-table td, .eqb-show-table th { vertical-align: middle; }

/* quick reservation on the issue page */
.eqb-reserve { margin-top: 10px; }
.eqb-reserve-title { margin: 0 0 6px; }
.eqb-kind-switch { display: flex; gap: 4px; }
.eqb-kind-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  background: var(--eqb-surface);
  font-size: 13px;
  cursor: pointer;
}
.eqb-kind-option:has(input:checked) { color: #fff; }
.eqb-kind-tool:has(input:checked)  { background: var(--eqb-tool);  border-color: var(--eqb-tool); }
.eqb-kind-truck:has(input:checked) { background: var(--eqb-truck); border-color: var(--eqb-truck); }
.eqb-kind-option:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.eqb-quick .eqb-submit { min-height: 34px; padding: 0 18px; font-weight: bold; }
.eqb-num { text-align: right; font-variant-numeric: tabular-nums; }
.eqb-strong { font-weight: bold; }
.eqb-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.eqb-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid var(--eqb-line);
  background: var(--eqb-surface-2);
}
.eqb-tag-locked { border-color: var(--eqb-truck); color: var(--eqb-truck); }
.eqb-tag-cancelled { text-decoration: line-through; }

/* ================================ calendar ============================== */

.eqb-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.eqb-toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.eqb-toolbar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
input.eqb-search {
  width: 300px;
  max-width: 100%;
  min-height: 32px;
  box-sizing: border-box;
  padding: 4px 10px 4px 30px;
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  font-size: 13px;
  background: var(--eqb-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a6675' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 10px center;
}
input.eqb-search:focus { outline: none; border-color: var(--eqb-tool); box-shadow: 0 0 0 2px rgba(31, 78, 121, .15); }
.eqb-pl-row mark, .eqb-event mark { background: #fff1a8; color: inherit; padding: 0; }

.eqb-tabs { display: flex; gap: 4px; }
.eqb-tab, .eqb-view {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  text-decoration: none;
  font-size: 13px;
  background: var(--eqb-surface);
}
.eqb-tab:hover, .eqb-view:hover, .eqb-scale:hover { text-decoration: none; }
.eqb-tab.selected, .eqb-view.selected {
  background: var(--eqb-tool);
  border-color: var(--eqb-tool);
  color: #fff;
}
.eqb-viewswitch { display: flex; gap: 4px; }
.eqb-nav { display: flex; align-items: center; gap: 10px; }
.eqb-nav a { text-decoration: none; padding: 4px 8px; }
.eqb-month-label { font-weight: bold; min-width: 10em; text-align: center; text-transform: capitalize; }

.eqb-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 14px; }
.eqb-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

.eqb-calendar.loading { opacity: .5; }

.eqb-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--eqb-line);
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  overflow: hidden;
}
/* Redmine's layout sets overflow on #wrapper / #content, which stops sticky
   elements from following the page scroll. On the equipment calendar pages
   only, let them overflow (flow-root keeps the floats contained). */
body.controller-equipment_bookings #wrapper,
body.controller-equipment_bookings #content { overflow: visible; display: flow-root; }
/* #content is a flex item of #main: without this it would grow to the width
   of a wide chart instead of letting the chart scroll inside its own box */
body.controller-equipment_bookings #content { min-width: 0; }

/* day names: a separate row that stays at the top while the month scrolls */
.eqb-grid-headrow {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 0;
  border-radius: var(--eqb-radius) var(--eqb-radius) 0 0;
}
.eqb-grid-days { border-radius: 0 0 var(--eqb-radius) var(--eqb-radius); }
.eqb-grid-head {
  background: var(--eqb-surface-2);
  padding: 6px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
  color: var(--eqb-ink-2);
}
.eqb-day {
  background: var(--eqb-surface);
  min-height: 92px;
  padding: 4px;
}
.eqb-day.outside { background: var(--eqb-surface-2); }
.eqb-day.today { box-shadow: inset 0 0 0 2px var(--eqb-tool); }
.eqb-daynum { font-size: 12px; color: var(--eqb-ink-2); display: block; text-align: right; }
.eqb-event {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 4px;
  margin-top: 2px;
  border-left: 4px solid var(--eqb-tool);
  background: var(--eqb-surface-2);
  border-radius: 3px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eqb-event:hover { filter: brightness(.96); }

/* planner */
.eqb-scale-switch { display: flex; gap: 4px; }
.eqb-scale {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  text-decoration: none;
  font-size: 13px;
  background: var(--eqb-surface);
}
.eqb-scale.selected { background: var(--eqb-ink-2); border-color: var(--eqb-ink-2); color: #fff; }
.eqb-months { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

.eqb-planner {
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  background: var(--eqb-surface);
  overflow: hidden;
}
/* The chart scrolls inside its own box (both ways) so that the date header
   stays at the top and the names on the left while scrolling. */
.eqb-pl-scroll {
  overflow: auto;
  max-height: calc(100vh - 190px);
  min-height: 320px;
  overscroll-behavior: contain;
}
.eqb-pl-row.eqb-pl-header { position: sticky; top: 0; z-index: 5; }
.eqb-pl-header .eqb-pl-name { z-index: 6; } /* top-left corner above both */
.eqb-pl-inner { position: relative; }
.eqb-pl-body { position: relative; }

.eqb-pl-row { display: flex; position: relative; border-bottom: 1px solid var(--eqb-line); }
.eqb-pl-row:last-child { border-bottom: 0; }
.eqb-pl-name {
  flex: 0 0 var(--eqb-name-w, 280px);
  width: var(--eqb-name-w, 280px);
  box-sizing: border-box;
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: var(--eqb-surface);
  border-right: 1px solid var(--eqb-line);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}
.eqb-pl-track { position: relative; flex: 0 0 auto; }

/* header */
.eqb-pl-header .eqb-pl-name {
  background: var(--eqb-surface-2);
  justify-content: space-between;
  font-weight: bold;
  height: 52px;
}
.eqb-pl-toggle-all { font-size: 11px; font-weight: normal; }
.eqb-pl-header .eqb-pl-track { height: 52px; background: var(--eqb-surface-2); }
.eqb-pl-hrow { position: absolute; left: 0; right: 0; top: 22px; height: 30px; }
.eqb-pl-hrow-top { top: 0; height: 22px; border-bottom: 1px solid var(--eqb-line); }
.eqb-pl-hcell {
  position: absolute;
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  border-right: 1px solid var(--eqb-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1.15;
  color: var(--eqb-ink-2);
  overflow: hidden;
  white-space: nowrap;
  text-transform: capitalize;
}
.eqb-pl-hrow-top .eqb-pl-hcell { font-weight: bold; color: inherit; }
.eqb-pl-hcell small { font-size: 9px; text-transform: uppercase; }
.eqb-pl-hcell.weekend { background: #e9edf2; }
.eqb-pl-hcell.today { background: var(--eqb-ko); color: #fff; font-weight: bold; }

/* background grid */
.eqb-pl-grid { position: absolute; top: 0; bottom: 0; z-index: 0; pointer-events: none; }
.eqb-pl-gcol { position: absolute; top: 0; bottom: 0; box-sizing: border-box; border-right: 1px solid #eef1f5; }
.eqb-pl-gcol.weekend { background: rgba(90, 102, 117, .07); }
.eqb-pl-today { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--eqb-ko); z-index: 2; }

/* groups */
.eqb-pl-group .eqb-pl-name { font-weight: bold; background: var(--eqb-surface-2); height: 30px; }
.eqb-pl-group .eqb-pl-track { height: 30px; background: rgba(245, 247, 250, .6); }
.eqb-pl-group-tool .eqb-pl-name { box-shadow: inset 4px 0 0 var(--eqb-tool); }
.eqb-pl-group-truck .eqb-pl-name { box-shadow: inset 4px 0 0 var(--eqb-truck); }

.eqb-pl-toggle, .eqb-pl-toggle-none {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.eqb-pl-toggle::before, .eqb-pl-toggle-none::before {
  content: '';
  display: inline-block;
  width: 12px;
  flex: 0 0 12px;
  font-size: 9px;
  color: var(--eqb-ink-2);
}
.eqb-pl-toggle::before { content: '\25B6'; }
.eqb-pl-toggle.open::before { content: '\25BC'; }
.eqb-pl-toggle:hover { text-decoration: none; }
.eqb-pl-toggle .eqb-dot { margin-right: 2px; }

/* resource line */
.eqb-pl-resource .eqb-pl-name { height: 38px; padding-left: 18px; }
.eqb-pl-resource .eqb-pl-track { height: 38px; }
.eqb-pl-resource .eqb-pl-toggle, .eqb-pl-resource .eqb-pl-toggle-none { flex: 1 1 auto; }
.eqb-pl-resinfo { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.eqb-pl-resname { font-weight: bold; overflow: hidden; text-overflow: ellipsis; }
.eqb-pl-code { font-size: 10px; color: var(--eqb-ink-2); font-weight: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eqb-pl-resource .eqb-pl-toggle, .eqb-pl-resource .eqb-pl-toggle-none { min-width: 0; overflow: hidden; }
.eqb-pl-units {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--eqb-surface-2);
  border: 1px solid var(--eqb-line);
  color: var(--eqb-ink-2);
}
.eqb-pl-load {
  position: absolute;
  top: 9px;
  height: 20px;
  line-height: 20px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  z-index: 1;
  overflow: hidden;
}
.eqb-load-partial { background: #d4ecdf; color: #1c6e48; }
.eqb-load-full    { background: #f8dfb8; color: #8a5200; }
.eqb-load-over    { background: #f3c9c9; color: #9e2b2b; }

/* issue lines */
.eqb-pl-issue .eqb-pl-name { height: 26px; padding-left: 40px; font-size: 12px; }
.eqb-pl-issue .eqb-pl-name a { overflow: hidden; text-overflow: ellipsis; }
.eqb-pl-issue .eqb-pl-track { height: 26px; }
.eqb-pl-bar {
  position: absolute;
  top: 4px;
  height: 18px;
  line-height: 18px;
  box-sizing: border-box;
  border-radius: 4px;
  padding: 0 6px;
  color: #fff;
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
a.eqb-pl-bar, a.eqb-pl-bar:link, a.eqb-pl-bar:visited, a.eqb-pl-bar:hover { color: #fff; text-decoration: none; }
.eqb-pl-bar:hover { filter: brightness(1.1); }

.eqb-planner-narrow .eqb-pl-toggle-all,
.eqb-planner-narrow .eqb-pl-units { display: none; }
.eqb-planner-narrow .eqb-pl-resource .eqb-pl-name { padding-left: 6px; }
.eqb-planner-narrow .eqb-pl-issue .eqb-pl-name { padding-left: 20px; }

.eqb-pl-empty .eqb-pl-name { height: 40px; color: var(--eqb-ink-2); font-style: italic; }
.eqb-pl-empty .eqb-pl-track { height: 40px; }

.eqb-planner-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 12px; color: var(--eqb-ink-2); }
.eqb-planner-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.eqb-load-swatch { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }
.eqb-today-swatch { display: inline-block; width: 0; height: 12px; border-left: 2px dashed var(--eqb-ko); }

/* free equipment page */
.eqb-free-link { font-weight: bold; }
.eqb-free-all  { background: #e3f4ea; color: #1c6e48; }
.eqb-free-some { background: #bfe3cd; color: #155a3a; }
.eqb-free-none { background: #f3c9c9; color: #9e2b2b; }

.eqb-footnote { font-size: 12px; color: var(--eqb-ink-2); margin-top: 10px; }

/* =============================== billing =============================== */

.eqb-billing { max-width: 1280px; }
.eqb-billing-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.eqb-billing-head h2 { margin: 0; }
.eqb-billing-sub { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--eqb-ink-2); }
.eqb-period-name { display: inline-block; }
.eqb-period-name::first-letter { text-transform: uppercase; }

.eqb-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid var(--eqb-line); border-radius: var(--eqb-radius);
  background: var(--eqb-surface-2);
}
.eqb-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.eqb-field select { min-height: 30px; max-width: 260px; }
.eqb-field.eqb-check { flex-direction: row; align-items: center; gap: 6px; min-height: 30px; }

/* buttons */
.eqb-btn, a.eqb-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 30px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid var(--eqb-line); border-radius: var(--eqb-radius);
  background: var(--eqb-surface); color: var(--eqb-tool);
  font-size: 12px; font-weight: bold; text-decoration: none; white-space: nowrap;
}
a.eqb-btn:hover { border-color: var(--eqb-tool); text-decoration: none; background: #f0f5fa; }
.eqb-btn-sm, a.eqb-btn-sm { min-height: 24px; padding: 0 8px; font-size: 11px; }
a.eqb-btn-danger { color: var(--eqb-ko); border-color: #e7c3c3; padding-left: 26px; background-position: 8px center; }
a.eqb-btn-danger:hover { border-color: var(--eqb-ko); background-color: #fbeeee; }
.eqb-btn-group { display: inline-flex; align-items: center; gap: 4px; }
.eqb-btn-group-label { font-size: 12px; color: var(--eqb-ink-2); margin-right: 2px; }

/* summary cards */
.eqb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.eqb-card {
  padding: 12px 14px;
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  background: var(--eqb-surface);
  box-shadow: inset 0 3px 0 var(--eqb-line);
}
.eqb-card-tool  { box-shadow: inset 0 3px 0 var(--eqb-tool); }
.eqb-card-truck { box-shadow: inset 0 3px 0 var(--eqb-truck); }
.eqb-card-total { background: var(--eqb-tool); border-color: var(--eqb-tool); box-shadow: none; }
.eqb-card-total .eqb-card-label, .eqb-card-total .eqb-card-value { color: #fff; }
.eqb-card-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--eqb-ink-2); }
.eqb-card-value { display: block; margin-top: 2px; font-size: 22px; font-weight: bold; font-variant-numeric: tabular-nums; }

/* search + exports */
.eqb-field-search { flex: 1 1 320px; }
.eqb-search-row { display: flex; gap: 6px; }
.eqb-search-row input.eqb-search { flex: 1 1 auto; width: auto; }
.eqb-result-count { font-size: 13px; color: var(--eqb-ink-2); }
.eqb-pagination { margin-top: 16px; }
.eqb-billing-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.eqb-exports { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0; }

/* invoice cards */
.eqb-invoice-list { display: flex; flex-direction: column; gap: 14px; }
.eqb-invoice-card {
  border: 1px solid var(--eqb-line);
  border-radius: var(--eqb-radius);
  background: var(--eqb-surface);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.eqb-invoice-card-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--eqb-line);
  background: linear-gradient(var(--eqb-surface-2), var(--eqb-surface));
}
.eqb-invoice-id { min-width: 0; }
.eqb-invoice-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
a.eqb-invoice-number { font-size: 15px; font-weight: bold; font-variant-numeric: tabular-nums; text-decoration: none; }
a.eqb-invoice-number:hover { text-decoration: underline; }
.eqb-invoice-issue { margin-top: 4px; font-size: 13px; }
.eqb-invoice-project { margin-top: 2px; font-size: 12px; color: var(--eqb-ink-2); }
.eqb-invoice-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.eqb-invoice-amount { font-size: 20px; font-weight: bold; font-variant-numeric: tabular-nums; }
.eqb-invoice-pdfs { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--eqb-ink-2); }

.eqb-status {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: bold; text-transform: none; letter-spacing: 0;
}
.eqb-status-open    { background: #e5eef7; color: var(--eqb-tool); }
.eqb-status-partial { background: #fbecd4; color: #8a5200; }
.eqb-status-closed  { background: #d4ecdf; color: var(--eqb-ok); }

.eqb-invoice-table-wrap { overflow-x: auto; }
.eqb-invoice-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.eqb-invoice-table th {
  padding: 7px 12px; text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: normal; text-transform: uppercase; letter-spacing: .04em;
  color: var(--eqb-ink-2); border-bottom: 1px solid var(--eqb-line);
}
.eqb-invoice-table td { padding: 8px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.eqb-invoice-table tbody tr:hover td { background: #fafbfc; }
.eqb-invoice-table tbody tr.eqb-line-match td { background: #fff8d6; }
.eqb-invoice-table th.eqb-num, .eqb-invoice-table td.eqb-num { text-align: right; white-space: nowrap; }
.eqb-invoice-table tfoot td { border-bottom: 0; background: var(--eqb-surface-2); font-weight: bold; text-align: right; }
.eqb-invoice-table .eqb-res { white-space: nowrap; }
.eqb-invoice-table .eqb-badge { margin-left: 4px; font-size: 10px; padding: 1px 6px; }
.eqb-muted { color: var(--eqb-ink-2); }

/* 📄 invoice link (issue page) */
.eqb-issue-invoices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 12px; }
.eqb-invoice-pdf { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--eqb-line); border-radius: var(--eqb-radius); background: var(--eqb-surface); }
.eqb-invoice-pdf a.eqb-invoice-number { font-size: 12px; }

.eqb-empty {
  padding: 40px 20px; text-align: center; color: var(--eqb-ink-2);
  border: 1px dashed var(--eqb-line); border-radius: var(--eqb-radius);
}

.eqb-settings-links p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 4px 0; }
.eqb-admin-table tr.eqb-inactive { opacity: .55; }

/* Redmine's mobile header is fixed (64px high): keep the month view's day names below it */
@media screen and (max-width: 899px) {
  .eqb-grid-headrow { top: 64px; }
  .eqb-pl-scroll { max-height: calc(100vh - 150px); }
}

@media (max-width: 700px) {
  input.eqb-invoice-search { width: 100%; }
  .eqb-invoice-side { align-items: flex-start; }
  .eqb-row { flex-direction: column; align-items: stretch; }
  .eqb-row .eqb-cell { flex-basis: auto; }
  .eqb-row .eqb-cell-km input.eqb-km { width: 100%; font-size: 16px; }
  .eqb-row .eqb-cell-actions { margin-left: 0; }
  .eqb-day { min-height: 64px; }
}
