:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --panel: #ffffff;
  --border: #d8dee9;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0b5cab;
  --primary-hover: #094a8a;
  --accent: #0d9488;
  --danger: #b91c1c;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --elevated: #ffffff;
  --elevated-subtle: #fafbfc;
  --elevated-muted: #f8fafc;
  --elevated-hover: #f0f7ff;
  --input-bg: #ffffff;
  --table-head-bg: #f8fafc;
  --table-row-hover: #f8fbff;
  --secondary-bg: #ffffff;
  --secondary-hover: #f8fafc;
  --nav-active-bg: #e8f2fc;
  --detail-bg: #f8fafc;
  --map-bg: #e8eef4;
  --photo-thumb-bg: #eef2f7;
  --photo-hover-bg: #f0f6fc;
  --lightbox-bg: #ffffff;
  --status-overlay-bg: rgba(255, 255, 255, 0.92);
  --legend-dot-border: #ffffff;
  --map-empty-bg: #f8fafc;
  --map-empty-border: #c5d3e0;
  --badge-bg: #e0f2fe;
  --badge-fg: #075985;
  --badge-meter-bg: #e0f2fe;
  --badge-meter-fg: #0369a1;
  --badge-warn-bg: #fef3c7;
  --badge-warn-fg: #92400e;
  --badge-warn-border: #fcd34d;
  --badge-ok-bg: #dcfce7;
  --badge-ok-fg: #166534;
  --badge-expired-bg: #fef3c7;
  --badge-expired-fg: #92400e;
  --badge-expired-border: #fcd34d;
  --badge-imported-bg: #ecfdf5;
  --badge-imported-fg: #047857;
  --badge-imported-border: #a7f3d0;
  --badge-mandatory-bg: #ffedd5;
  --badge-mandatory-fg: #c2410c;
  --badge-zip-bg: #dbeafe;
  --badge-zip-fg: #1e40af;
  --row-expired-bg: #fffbeb;
  --row-imported-bg: #f0fdf8;
  --row-pending-bg: #fff7ed;
  --row-imported-expired-bg: #fff7ed;
  --warn-banner-bg: #fffbeb;
  --warn-banner-fg: #92400e;
  --warn-banner-border: #fde68a;
  --error-banner-bg: #fef2f2;
  --error-banner-border: #fecaca;
  --overload-banner-bg: #fff7ed;
  --overload-banner-border: #fdba74;
  --overload-banner-fg: #9a3412;
  --map-error-fg: #7c2d12;
  --map-error-bg: rgba(255, 247, 237, 0.92);
  --map-error-border: #fdba74;
  --map-loading-bg: rgba(232, 238, 244, 0.82);
  --workflow-warn-bg: #fff7ed;
  --workflow-warn-border: #fdba74;
  --workflow-action-bg: #eff6ff;
  --workflow-action-border: #93c5fd;
  --import-highlight-bg: #f0f7ff;
  --import-highlight-border: rgba(11, 92, 171, 0.35);
  --attachment-pdf-bg: #f8fbff;
  --attachment-pdf-border: #bfdbfe;
  --on-primary: #ffffff;
  --focus-ring: rgba(11, 92, 171, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

.app-sidebar {
  position: sticky;
  top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 10;
}

.app-sidebar-title {
  margin: 0 0 10px;
  padding: 4px 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--elevated-subtle);
}

.sidebar-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  background: var(--elevated);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.sidebar-group-toggle:hover {
  background: var(--elevated-muted);
}

.sidebar-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-top: -2px;
}

.sidebar-group.open .sidebar-chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.sidebar-group-panel {
  display: none;
  padding: 0 10px 10px;
}

.sidebar-group.open .sidebar-group-panel {
  display: block;
}

.sidebar-group-hint {
  margin: 0 0 8px;
  padding: 0 2px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

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

.sidebar-item {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--elevated);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-item:hover {
  background: var(--elevated-hover);
  border-color: rgba(11, 92, 171, 0.25);
  text-decoration: none;
}

.sidebar-item.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sidebar-item.accent:hover {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.sidebar-item.link {
  color: var(--primary);
}

.sidebar-item.navlink {
  color: var(--primary);
}

.sidebar-item.navlink.active {
  background: var(--nav-active-bg);
  border-color: rgba(11, 92, 171, 0.35);
  color: var(--primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.stats-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.stats-total {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.stats-meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.sidebar-item.button {
  appearance: none;
}

.sidebar-item.button.secondary {
  background: var(--secondary-bg);
  color: var(--muted);
  font-weight: 500;
}

.app-main {
  min-width: 0;
}

.app-main .stats-row {
  margin-top: 0;
}

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

  .app-sidebar {
    position: static;
  }
}

header.app-header {
  background: linear-gradient(135deg, #0b5cab, #0d9488);
  color: #fff;
  padding: 20px 0;
  box-shadow: var(--shadow);
}

header.app-header .container {
  padding-top: 0;
  padding-bottom: 0;
}

header.app-header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

header.app-header p {
  margin: 6px 0 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

.header-with-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.app-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.9rem;
  opacity: 0.92;
}

.app-nav a:hover,
.app-nav a.active {
  background: rgba(255, 255, 255, 0.18);
  opacity: 1;
  text-decoration: none;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

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

.stat-card .label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 4px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.panel-hint {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}

.filters > div {
  display: flex;
  flex-direction: column;
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--elevated);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.filter-check input {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.filter-check-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  padding-left: 2px;
}

.filter-entity-type {
  grid-column: 1 / -1;
}

.filter-entity-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--border, #c8c8c8);
  background: var(--surface, #fff);
  color: inherit;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
}

.filter-chip:hover {
  border-color: var(--accent, #2a6f97);
}

.filter-chip.is-active {
  background: var(--accent, #2a6f97);
  border-color: var(--accent, #2a6f97);
  color: #fff;
}

.filter-active-summary {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

tr.row-expired td {
  background: var(--row-expired-bg);
}

.badge-expired {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--badge-expired-bg);
  color: var(--badge-expired-fg);
  border: 1px solid var(--badge-expired-border);
}

.badge-expired-sub {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fdba74;
}

tr.row-expired-sub td {
  background: rgba(251, 146, 60, 0.08);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--input-bg);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--focus-ring);
  border-color: var(--primary);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.import-groups {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.import-group {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--elevated-muted);
}

.import-group h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.import-group .import-hint {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.import-group-highlight {
  border-color: var(--import-highlight-border);
  background: var(--import-highlight-bg);
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: var(--on-primary);
}

button:hover,
.btn:hover {
  background: var(--primary-hover);
}

button.secondary,
.btn.secondary {
  background: var(--secondary-bg);
  color: var(--text);
  border-color: var(--border);
}

button.secondary:hover,
.btn.secondary:hover {
  background: var(--secondary-hover);
}

button.accent,
.btn.accent {
  background: var(--accent);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.expiry-edit {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 11rem;
}

.expiry-actions {
  flex-wrap: wrap;
  gap: 0.35rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--table-head-bg);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  position: sticky;
  top: 0;
}

tbody tr:hover {
  background: var(--table-row-hover);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.error-state {
  color: var(--danger);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-size: 0.78rem;
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 260px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.detail-item {
  background: var(--detail-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.detail-item .label {
  font-size: 0.78rem;
  color: var(--muted);
}

.detail-item .value {
  font-weight: 600;
  margin-top: 2px;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 600;
}

.badge-imported {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--badge-imported-bg);
  color: var(--badge-imported-fg);
  border: 1px solid var(--badge-imported-border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

tr.row-imported td {
  background: var(--row-imported-bg);
}

tr.row-imported.row-expired td {
  background: var(--row-imported-expired-bg);
}

.map-panel {
  position: relative;
  z-index: 1;
}

.map-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--legend-dot-border);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.map-filter-hint {
  margin: 0 0 8px;
  font-size: 0.88rem;
}
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin: 0 0 10px;
}

.map-filter-field {
  flex: 1 1 140px;
  min-width: 0;
}

.map-filter-field label {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 4px;
  color: var(--muted);
}

.map-filter-field select {
  width: 100%;
}

.map-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  padding-bottom: 1px;
}

.map-filter-actions .secondary {
  white-space: nowrap;
}

.map-status {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.map-status code {
  font-size: 0.85em;
}

.map-container {
  height: 420px;
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--map-bg);
  position: relative;
}

.map-container.leaflet-container {
  height: 420px;
  min-height: 420px;
  background: var(--map-bg);
}

.map-container .leaflet-tile-pane img {
  max-width: none !important;
}

.map-container-customer-tab {
  height: 480px;
  min-height: 480px;
}

.map-container-customer-tab.leaflet-container {
  height: 480px;
  min-height: 480px;
}

.meter-section-subtitle {
  margin: 1rem 0 0.65rem;
  font-size: 0.98rem;
}

.meter-card.compact {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.meter-card.compact h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.detail-grid.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.map-container-sm {
  height: 260px;
  min-height: 260px;
}

.map-container-sm.leaflet-container {
  height: 260px;
  min-height: 260px;
}

.map-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--map-empty-bg);
  border: 1px dashed var(--map-empty-border);
}

.map-loading,
.map-tiles-error {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 0.9rem;
  pointer-events: none;
}

.map-loading {
  color: var(--muted);
  background: var(--map-loading-bg);
}

.map-tiles-error {
  color: var(--map-error-fg);
  background: var(--map-error-bg);
  border: 1px solid var(--map-error-border);
}

.leaflet-popup-content {
  margin: 10px 12px;
  line-height: 1.45;
  font-size: 0.92rem;
}

.leaflet-popup-content a {
  font-weight: 600;
}

.consumption-chart {
  min-height: 120px;
}

.chart-hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.chart-svg-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.consumption-svg {
  width: 100%;
  min-width: 320px;
  max-width: 720px;
  display: block;
}

.chart-bar {
  fill: #0b5cab;
  transition: fill 0.15s ease;
}

.chart-bar-group:hover .chart-bar {
  fill: #0d9488;
}

.chart-bar-estimate {
  fill: #94a3b8;
  stroke: #64748b;
  stroke-width: 1;
  stroke-dasharray: 4 2;
}

.chart-bar-group:hover .chart-bar-estimate {
  fill: #64748b;
}

.legend-estimate {
  color: #64748b;
  font-weight: 600;
}

.estimate-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.estimate-col {
  background: var(--elevated-muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}

.estimate-col .estimate-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.estimate-col .estimate-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.meter-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--elevated);
}

.meter-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(11, 92, 171, 0.15);
}

.meter-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.meter-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--badge-meter-bg);
  color: var(--badge-meter-fg);
  margin-left: 8px;
}

.row-estimate td {
  color: var(--muted);
  font-style: italic;
}

.meter-reading-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.meter-card h4 {
  margin: 12px 0 6px;
  font-size: 0.9rem;
}

.work-report-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--elevated-subtle);
}

.work-report-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.work-report-card .internal-form {
  margin-top: 8px;
}

.meter-edit-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.meter-edit-form .internal-form {
  margin-top: 0;
}

.field-empty-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 700px) {
  .estimate-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.chart-value {
  font-size: 11px;
  font-weight: 600;
  fill: var(--text);
}

.chart-label {
  font-size: 10px;
  fill: var(--muted);
}

.chart-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.chart-axis-line {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.chart-axis {
  font-size: 10px;
  fill: var(--muted);
}

.photo-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.photo-upload-row select,
.photo-upload-row input[type='text'] {
  width: auto;
  min-width: 160px;
  flex: 1;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--elevated);
  box-shadow: var(--shadow);
}

.attachment-card.pdf {
  border-color: var(--attachment-pdf-border);
  background: var(--attachment-pdf-bg);
}

.attachment-card-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.attachment-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.attachment-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.attachment-sub,
.attachment-filename {
  font-size: 0.82rem;
  color: var(--muted);
}

.attachment-filename {
  margin-top: 4px;
  word-break: break-all;
}

.attachment-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.photo-work-group-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
}

.photo-work-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.panel-head-row h2 {
  margin: 0;
}

.photo-share-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.photo-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.photo-filter-row label {
  margin: 0;
  white-space: nowrap;
}

.photo-filter-row select {
  width: auto;
  min-width: 180px;
}

.photo-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--elevated);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.photo-card-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--photo-thumb-bg);
  cursor: pointer;
}

.photo-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: var(--photo-thumb-bg);
}

.photo-card-meta {
  padding: 8px 10px;
  font-size: 0.8rem;
  flex: 1;
}

.photo-card-meta .photo-label {
  font-weight: 600;
  margin-bottom: 2px;
}

.photo-card-meta .photo-sub {
  color: var(--muted);
}

.photo-source-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: var(--photo-thumb-bg);
  color: var(--muted);
}

.photo-source-badge.zip {
  background: var(--badge-zip-bg);
  color: var(--badge-zip-fg);
}

.photo-card-actions {
  display: flex;
  border-top: 1px solid var(--border);
}

.photo-action {
  flex: 1;
  border: 0;
  background: var(--elevated);
  padding: 8px 4px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--primary);
  text-align: center;
  text-decoration: none;
}

.photo-action:hover {
  background: var(--photo-hover-bg);
}

.photo-action + .photo-action {
  border-left: 1px solid var(--border);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.photo-lightbox[hidden] {
  display: none !important;
}

.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
}

.photo-lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: min(920px, 96vw);
  max-height: 92vh;
  background: var(--lightbox-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.photo-lightbox-dialog img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #111;
}

.photo-lightbox-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.photo-lightbox-caption {
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.photo-lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.inline-share-btn {
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--elevated);
  color: var(--primary);
  font-size: 0.75rem;
  cursor: pointer;
  vertical-align: middle;
}

.inline-share-btn:hover {
  background: var(--photo-hover-bg);
}

.panel-hint {
  margin: -4px 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.phone-list-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.phone-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated, rgba(255, 255, 255, 0.02));
}

.phone-rank {
  min-width: 72px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.phone-value {
  flex: 1;
  font-weight: 500;
}

.phone-list-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone-list-actions .secondary {
  min-width: 34px;
  padding: 4px 8px;
}

.phone-add-form {
  margin-top: 4px;
}

.period-stats-filters {
  flex-wrap: wrap;
  gap: 10px 16px;
}

.consumption-chart-filters {
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.consumption-entry-form .form-actions {
  align-self: end;
}

.btn-compact {
  padding: 4px 10px;
  font-size: 0.85rem;
}

tr.row-estimate td {
  background: rgba(148, 163, 184, 0.08);
}

.period-bucket-row {
  cursor: pointer;
}

.period-bucket-row:hover td {
  background: rgba(59, 130, 246, 0.08);
}

.internal-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
}

.internal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.internal-form label.full-width {
  grid-column: 1 / -1;
}

.internal-form input,
.internal-form textarea {
  font-weight: 400;
  color: var(--text);
}

.internal-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-status {
  font-size: 0.9rem;
  color: var(--muted);
}

.save-status.ok {
  color: #0d7a3e;
}

.save-status.err {
  color: #b42318;
}

.network-map-page {
  min-height: 100vh;
}

.network-map-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  min-height: calc(100vh - 88px);
}

.network-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 16px 24px;
  overflow: auto;
}

.network-sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.network-sidebar .app-sidebar-title {
  margin-top: 0;
}

.network-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.network-sidebar-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.network-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}

.network-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--elevated-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.network-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.network-marker-icon {
  background: transparent;
  border: none;
}

.network-marker-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--legend-dot-border);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
  display: inline-block;
  flex-shrink: 0;
}

.leaflet-marker-icon.network-marker-icon .network-marker-dot {
  width: 18px;
  height: 18px;
}

.network-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.btn.full-width {
  width: 100%;
  text-align: center;
  display: block;
}

.network-hover-card,
.network-detail-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--elevated-muted);
  margin-top: 12px;
}

.network-hover-card.hidden,
.network-detail-panel.hidden {
  display: none;
}

.network-hover-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.network-hover-type {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.network-hover-meta,
.network-hover-notes {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.network-hover-notes {
  white-space: pre-wrap;
}

.network-hover-cta {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.network-hover-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.network-detail-close {
  float: right;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.network-detail-panel h3 {
  margin: 0 0 12px;
  padding-right: 28px;
}

.network-detail-panel h4 {
  margin: 16px 0 8px;
  font-size: 0.95rem;
}

.network-detail-fields {
  display: grid;
  gap: 8px;
}

.network-detail-notes pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.network-detail-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.network-map-wrap {
  position: relative;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.network-map-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 600;
}

.network-map-toolbar-spacer {
  flex: 1;
  min-width: 8px;
}

.network-map-toolbar-status {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

#btnToggleSegmentsPanel.is-open {
  background: var(--elevated-muted);
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}

.network-segments-panel {
  border-bottom: 1px solid var(--border);
  background: var(--elevated-muted);
  max-height: min(42vh, 420px);
  overflow: auto;
  z-index: 550;
}

.network-segments-panel.hidden,
.network-segments-panel[hidden] {
  display: none !important;
}

.network-segments-panel-inner {
  padding: 12px 14px 16px;
}

.network-segments-panel-head {
  margin-bottom: 8px;
}

.network-segments-panel-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.network-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.network-actions-inline .btn,
.network-actions-inline label.btn {
  width: auto;
}

.network-actions-inline .segment-import-mode {
  margin-bottom: 0;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.network-segment-samples {
  font-size: 0.88rem;
}

.map-container-network {
  height: calc(100vh - 88px - 52px);
  min-height: 420px;
  border-radius: 0;
  flex: 1;
}

.network-map-stage {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

.network-map-stage .map-container-network {
  flex: 1;
  width: 100%;
  min-width: 0;
}

.network-segment-dock {
  width: min(340px, 42vw);
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow: auto;
  z-index: 520;
}

.network-segment-dock.hidden,
.network-segment-dock[hidden] {
  display: none !important;
}

.network-segment-dock-inner {
  padding: 14px 14px 18px;
}

.network-segment-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.network-segment-dock-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.network-segment-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.segment-tool {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.segment-tool.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.network-segment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.network-segment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  margin-bottom: 12px;
}

.segment-list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.segment-list-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.segment-list-label {
  font-size: 13px;
}

.segment-list-len {
  font-size: 12px;
  color: var(--muted);
}

.segment-map-label span {
  display: inline-block;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.segment-vertex-handle span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7c3aed;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.network-customer-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0b5cab;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(11, 92, 171, 0.35);
}

.network-segment-form label {
  display: block;
  margin-bottom: 10px;
}

.network-segment-form label span {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.network-segment-form input,
.network-segment-form textarea {
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn.danger {
  background: #b91c1c;
  color: #fff;
}

.map-container-network.leaflet-container {
  height: calc(100vh - 88px - 52px);
}

@media (max-width: 900px) {
  .network-map-layout {
    grid-template-columns: 1fr;
  }

  .network-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 42vh;
  }

  .network-map-stage {
    flex-direction: column;
  }

  .network-segment-dock {
    width: 100%;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .map-container-network,
  .map-container-network.leaflet-container {
    height: 52vh;
    min-height: 320px;
  }
}

@media (max-width: 700px) {
  .map-container {
    height: 300px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 8px;
  }
}

.dashboard-panel {
  margin-bottom: 0;
}

.dashboard-row {
  margin: 0;
}

.stat-card-action {
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card-action:hover,
.stat-card-action:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.15);
}

.stat-card-split {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.stat-card-split .stat-card-main {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 14px 6px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.stat-card-split .stat-card-main:hover,
.stat-card-split .stat-card-main:focus-visible {
  outline: none;
}

.stat-card-export {
  display: block;
  padding: 6px 14px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border-top: 1px solid var(--border);
  background: rgba(14, 116, 144, 0.04);
}

.stat-card-export:hover,
.stat-card-export:focus-visible {
  text-decoration: underline;
  background: rgba(14, 116, 144, 0.08);
}

.import-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.import-history-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--bg);
}

.import-history-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.import-history-date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.import-history-meta {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.import-history-error {
  border-color: var(--error-banner-border);
  background: var(--error-banner-bg);
}

.api-error-banner {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--error-banner-bg);
  border: 1px solid var(--error-banner-border);
  color: var(--danger);
  font-size: 0.95rem;
  line-height: 1.45;
}

.import-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}

.import-modal[hidden] {
  display: none;
}

.import-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.import-modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: min(90vh, calc(100dvh - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: auto;
}

.import-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 18px 20px 12px;
}

.import-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.import-modal-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
}

.import-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px 12px;
}

.import-modal-filename,
.import-modal-summary {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.45;
}

.import-modal-filename {
  font-size: 0.9rem;
  color: var(--muted);
}

.import-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  padding: 14px 20px 18px;
  margin-top: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.detail-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.92rem;
  cursor: pointer;
}

.detail-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.detail-tab-panel {
  display: none;
}

.detail-tab-panel.active {
  display: block;
}

html[data-theme='dark'] {
  --bg: #0f172a;
  --surface: #1e293b;
  --panel: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --accent: #2dd4bf;
  --danger: #f87171;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --elevated: #334155;
  --elevated-subtle: #1e293b;
  --elevated-muted: #273548;
  --elevated-hover: #3d4f66;
  --input-bg: #0f172a;
  --table-head-bg: #273548;
  --table-row-hover: #334155;
  --secondary-bg: #334155;
  --secondary-hover: #3d4f66;
  --nav-active-bg: #1e3a5f;
  --detail-bg: #273548;
  --map-bg: #1e293b;
  --photo-thumb-bg: #273548;
  --photo-hover-bg: #334155;
  --lightbox-bg: #1e293b;
  --status-overlay-bg: rgba(30, 41, 59, 0.92);
  --legend-dot-border: #475569;
  --map-empty-bg: #273548;
  --map-empty-border: #475569;
  --badge-bg: #1e3a5f;
  --badge-fg: #7dd3fc;
  --badge-meter-bg: #1e3a5f;
  --badge-meter-fg: #7dd3fc;
  --badge-warn-bg: #78350f;
  --badge-warn-fg: #fde68a;
  --badge-warn-border: #b45309;
  --badge-ok-bg: #14532d;
  --badge-ok-fg: #86efac;
  --badge-expired-bg: #78350f;
  --badge-expired-fg: #fde68a;
  --badge-expired-border: #b45309;
  --badge-imported-bg: #064e3b;
  --badge-imported-fg: #6ee7b7;
  --badge-imported-border: #047857;
  --badge-mandatory-bg: #7c2d12;
  --badge-mandatory-fg: #fdba74;
  --badge-zip-bg: #1e3a8a;
  --badge-zip-fg: #bfdbfe;
  --row-expired-bg: rgba(120, 53, 15, 0.35);
  --row-imported-bg: rgba(6, 78, 59, 0.35);
  --row-pending-bg: rgba(124, 45, 18, 0.35);
  --row-imported-expired-bg: rgba(124, 45, 18, 0.45);
  --warn-banner-bg: rgba(120, 53, 15, 0.45);
  --warn-banner-fg: #fde68a;
  --warn-banner-border: #b45309;
  --error-banner-bg: rgba(127, 29, 29, 0.45);
  --error-banner-border: #b91c1c;
  --overload-banner-bg: rgba(124, 45, 18, 0.45);
  --overload-banner-border: #ea580c;
  --overload-banner-fg: #fdba74;
  --map-error-fg: #fdba74;
  --map-error-bg: rgba(124, 45, 18, 0.85);
  --map-error-border: #ea580c;
  --map-loading-bg: rgba(30, 41, 59, 0.82);
  --workflow-warn-bg: rgba(124, 45, 18, 0.45);
  --workflow-warn-border: #ea580c;
  --workflow-action-bg: rgba(30, 58, 138, 0.45);
  --workflow-action-border: #3b82f6;
  --import-highlight-bg: rgba(30, 58, 138, 0.35);
  --import-highlight-border: rgba(56, 189, 248, 0.45);
  --attachment-pdf-bg: rgba(30, 58, 138, 0.35);
  --attachment-pdf-border: #3b82f6;
  --on-primary: #ffffff;
  --focus-ring: rgba(56, 189, 248, 0.35);
}

.header-icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  margin-right: 8px;
}

header.app-header .header-icon-btn {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

header.app-header .global-search-input {
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  border-color: rgba(255, 255, 255, 0.5);
}

header.app-header .global-search-input::placeholder {
  color: #6b7280;
}

.global-search-wrap {
  position: relative;
  min-width: 220px;
  margin-right: 8px;
}

.global-search-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.global-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow: auto;
}

.global-search-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.global-search-item:hover {
  background: rgba(56, 189, 248, 0.08);
}

.stat-card-link {
  text-decoration: none;
  color: inherit;
}

.dispatch-pending-panel {
  margin-top: 12px;
}

.quality-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quality-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.customer-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.table-select-hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.table-select-footer-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.table-select-all-filtered {
  color: var(--primary);
}

.selection-banner {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--nav-active-bg);
  border: 1px solid var(--import-highlight-border);
  color: var(--text);
  font-size: 0.9rem;
}

.pagination-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.import-diff-customers ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.import-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.system-status-banner {
  display: none !important;
}

.system-restore-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.provisional-bulk-panel {
  margin-bottom: 12px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 12px;
  font-size: 0.92rem;
  color: var(--muted);
}

.table-select-col {
  width: 2.25rem;
  min-width: 2.25rem;
  max-width: 2.25rem;
  padding: 8px 4px;
  vertical-align: middle;
  text-align: center;
}

.table-wrap table td:first-child {
  width: 2.25rem;
  min-width: 2.25rem;
  max-width: 2.25rem;
  padding: 8px 4px;
  text-align: center;
  vertical-align: middle;
}

.table-wrap table td:first-child input[type='checkbox'] {
  width: auto;
  margin: 0;
}

.table-select-all-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

.table-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.table-select-all-footer,
.table-select-all-filtered {
  white-space: normal;
}

.table-select-all input {
  width: auto;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.table-select-all-footer {
  padding: 2px 0;
}

tfoot td {
  background: var(--table-head-bg);
  border-top: 1px solid var(--border);
}

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

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: var(--accent);
}

tr.customer-row {
  cursor: pointer;
}

tr.customer-row.row-focused {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.quality-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.dispatch-exports-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dispatch-export-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
}

.dispatch-export-card.reconciled {
  opacity: 0.85;
}

.dispatch-export-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.dispatch-export-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.dispatch-export-progress {
  margin: 10px 0 4px;
}

.dispatch-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dispatch-progress-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--elevated-muted, #e5e7eb);
  overflow: hidden;
}

.dispatch-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b5cab, #22a06b);
  transition: width 0.25s ease;
}

.dispatch-progress-label {
  min-width: 3.2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dispatch-export-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.badge-progress {
  background: #e0f2fe;
  color: #075985;
}

.dispatch-detail-progress {
  margin-bottom: 12px;
}

.dispatch-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dispatch-assignee-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin: 8px 0 12px;
}

.dispatch-assignee-edit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 220px;
  min-width: 180px;
}

.dispatch-assignee-edit input {
  width: 100%;
}

.badge-warn {
  background: var(--badge-warn-bg);
  color: var(--badge-warn-fg);
}

.badge-ok {
  background: var(--badge-ok-bg);
  color: var(--badge-ok-fg);
}

.monthly-chart-panel {
  margin-bottom: 16px;
}

.stats-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 140px;
  padding: 12px 4px 0;
  overflow-x: auto;
}

.stats-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}

.stats-bar-stack {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
}

.stats-bar {
  width: 14px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
}

.stats-bar-readings {
  background: #0b5cab;
}

.stats-bar-replacements {
  background: #ea580c;
}

.stats-bar-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
  writing-mode: horizontal-tb;
}

.stats-chart-legend {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

.stats-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.login-panel {
  width: min(360px, 92vw);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.badge-mandatory {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--badge-mandatory-bg);
  color: var(--badge-mandatory-fg);
}

.badge-phone-attempt {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.estimate-overload-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--overload-banner-bg);
  border: 1px solid var(--overload-banner-border);
  color: var(--overload-banner-fg);
}

.duplicate-merge-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.duplicate-merge-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.duplicate-merge-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.duplicate-keep-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.duplicate-keep-option {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

@media print {
  .app-header,
  .app-sidebar,
  .detail-tabs,
  .customer-quick-actions,
  .no-print,
  .toast,
  .import-modal,
  .back-link {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .panel {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}

/* Index page collapsible sections */
.index-collapse {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 12px;
  overflow: hidden;
}

.index-collapse.panel {
  padding: 0;
}

.index-collapse > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.index-collapse > summary::-webkit-details-marker {
  display: none;
}

.index-collapse > summary::after {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-top: -0.15rem;
}

.index-collapse[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.index-collapse > summary:hover {
  background: var(--elevated-muted);
}

.index-collapse-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.index-collapse-map-filters {
  margin-top: 12px;
  border: none;
  background: transparent;
}

.index-collapse-map-filters > summary {
  padding: 10px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.index-collapse-map-filters > summary:hover {
  background: transparent;
  color: var(--text);
}

.index-collapse-map-filters .index-collapse-body {
  padding: 0 0 4px;
  border-top: none;
}

.map-panel .map-status {
  margin-top: 0;
}

.map-panel .map-container {
  margin-bottom: 0;
}

.index-collapse-body .stats-row {
  margin: 0;
}

.index-collapse-body .stats-grid {
  margin: 0;
}

.panel-head-row-compact {
  justify-content: flex-end;
  margin-bottom: 10px;
}

.panel-head-row-compact:empty {
  display: none;
}

.index-collapse-body .stats-panel {
  margin-bottom: 0;
}

.index-collapse-body .stats-panel + .stats-panel {
  margin-top: 12px;
}

.sidebar-backup-host {
  margin-top: auto;
  padding-top: 8px;
}

.sidebar-backup-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0 12px;
}

.sidebar-backup-warn {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--warn-banner-fg);
  line-height: 1.35;
}

.sidebar-backup-restore {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.sidebar-backup-restore select {
  width: 100%;
  font-weight: 400;
}

.sidebar-item.full-width {
  width: 100%;
  justify-content: center;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
}

.app-sidebar #appSidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-sidebar #appSidebar .sidebar-nav {
  flex: 1;
}

/* Workflow, drawer, saved views, quality assistant */
.workflow-panel {
  margin-bottom: 16px;
}

.workflow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 140px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.workflow-step-count {
  font-size: 1.4rem;
  font-weight: 700;
}

.workflow-step-warn {
  border-color: var(--workflow-warn-border);
  background: var(--workflow-warn-bg);
  color: var(--text);
}

.workflow-step-action {
  border-color: var(--workflow-action-border);
  background: var(--workflow-action-bg);
  color: var(--text);
}

.workflow-step-ok {
  opacity: 0.85;
}

.workflow-tomorrow-form {
  margin-bottom: 12px;
}

.saved-views-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.customer-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.customer-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.customer-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(480px, 96vw);
  height: 100%;
  background: var(--panel);
  color: var(--text);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.customer-drawer-head,
.customer-drawer-foot {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.customer-drawer-foot {
  border-bottom: none;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.customer-drawer-body {
  padding: 16px;
  overflow: auto;
  flex: 1;
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.drawer-meta-grid-wide .detail-item {
  min-width: 0;
}

.drawer-meta-grid .full-width {
  grid-column: 1 / -1;
}

.drawer-detail-tabs {
  margin: -4px 0 14px;
}

.drawer-tab-panel {
  display: none;
}

.drawer-tab-panel.active {
  display: block;
}

.drawer-map-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-map-toolbar {
  display: flex;
  justify-content: flex-end;
}

.drawer-map-toolbar-top {
  margin-bottom: 12px;
}

.map-container-drawer {
  min-height: 240px;
  height: 240px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.drawer-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.drawer-photo-grid-full {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.drawer-photo-thumb {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.drawer-photo-thumb img {
  display: block;
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.drawer-photo-grid-full .drawer-photo-thumb img {
  height: auto;
  min-height: 120px;
  max-height: 220px;
  object-fit: contain;
  background: #111;
}

.drawer-photo-caption {
  display: block;
  padding: 6px 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.drawer-table-wrap {
  max-height: 220px;
  overflow: auto;
}

.map-point-drawer-full .customer-drawer-panel {
  width: min(720px, 96vw);
}

.customer-drawer-foot .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 8px;
}

.import-modal-diff {
  margin: 0 0 8px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  max-height: min(50vh, 420px);
  overflow-y: auto;
}

.import-modal-diff ul {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.quality-assistant-start-row {
  margin-bottom: 12px;
}

.quality-assistant-panel .actions {
  margin-top: 12px;
}

.weekly-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.badge-warn-text {
  color: var(--badge-mandatory-fg);
  font-weight: 600;
}

.row-pending-dispatch {
  background: var(--row-pending-bg);
}

.global-search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

.global-search-item:hover {
  background: var(--bg);
}

button[title]:not(:disabled),
a.btn[title],
a.sidebar-item[title],
label.sidebar-item[title],
.stat-card-action[title],
.header-icon-btn[title] {
  cursor: help;
}

.badge-sync {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 0.15rem;
}
.badge-sync-imported { background: var(--badge-imported-bg); color: var(--badge-imported-fg); border: 1px solid var(--badge-imported-border); }
.badge-sync-never { background: var(--elevated); color: var(--text-muted); border: 1px solid var(--border); }
.badge-sync-pending { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-sync-returned { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none !important; }
.modal-card {
  background: var(--panel-bg, var(--bg));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}
.modal-card-wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.modal-head h3 { margin: 0; font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }

.customer-create-form {
  max-height: min(70vh, 720px);
  overflow-y: auto;
  padding-right: 4px;
}

.customer-create-fieldset {
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: 12px 14px 6px;
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
}

.customer-create-fieldset legend {
  font-weight: 700;
  padding: 0 6px;
  color: var(--text);
}

.customer-create-fieldset label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.customer-create-fieldset label.full-width {
  grid-column: 1 / -1;
}

.contract-card {
  margin-bottom: 12px;
}

.contract-version-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contract-card.contract-current {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #2563eb) 25%, transparent);
}

.contract-current-badge {
  margin-left: 8px;
  vertical-align: middle;
}

.contract-version-note {
  font-style: italic;
}

.contract-upload-row input[type='date'],
.contract-upload-row input[type='text'] {
  min-width: 180px;
}

.transfer-history-table td,
.transfer-history-table th {
  white-space: nowrap;
}

.transfer-history-table td:nth-child(2),
.transfer-history-table td:nth-child(3) {
  white-space: normal;
  min-width: 120px;
}

.replacement-history-table td,
.replacement-history-table th {
  white-space: nowrap;
}

.replacement-history-table td:nth-child(2),
.replacement-history-table td:nth-child(4) {
  white-space: normal;
  min-width: 120px;
}

#replacementHistoryPanel .panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.feature-pack-actions { display: contents; }
.export-preview-zones { margin: 0.5rem 0 1rem; padding-left: 1.2rem; }

.export-split-panel {
  margin: 12px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #ddd);
}

.export-split-names {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.export-split-names label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.export-split-names input {
  width: 100%;
}
.shortcuts-list { list-style: none; padding: 0; margin: 0; }
.shortcuts-list li { padding: 0.35rem 0; }
.shortcuts-list kbd { background: var(--elevated); border: 1px solid var(--border); border-radius: 4px; padding: 0.1rem 0.4rem; font-family: inherit; }
.timeline-list { margin: 0.25rem 0 1rem; padding-left: 1.2rem; font-size: 0.92rem; }
.convention-member-form { max-width: 40rem; }
.convention-member-search { display: block; margin-bottom: 0.35rem; }
.convention-member-search input[type='search'] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.convention-member-selected {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--elevated);
}

.meter-tree-list { margin: 0.5rem 0 1rem; padding-left: 0; list-style: none; }
.meter-tree-sublist { margin: 0.35rem 0 0.5rem 1rem; padding-left: 0; list-style: none; }
.meter-tree-node { margin-bottom: 0.75rem; }
.meter-tree-node-head { margin-bottom: 0.35rem; }
.meter-tree-node-edit {
  margin-left: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.work-report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.5rem;
}

.work-report-card-head h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.work-report-card-compact {
  padding-bottom: 0.25rem;
}

.work-report-note {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.work-report-note .label {
  font-weight: 600;
  color: var(--text);
}

.work-report-edit-toggle {
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.work-report-edit-toggle summary {
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.work-report-edit-toggle .work-report-form {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--border);
}

.work-report-group {
  margin: 0.65rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.work-report-group summary {
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.work-report-group-body {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--border);
}

.meter-tree-form { margin-top: 0.75rem; max-width: 36rem; }

@media print {
  body.print-weekly-only .app-header,
  body.print-weekly-only .app-sidebar,
  body.print-weekly-only .index-collapse:not(#weeklyReportPanel),
  body.print-weekly-only .app-main > .panel {
    display: none !important;
  }

  body.print-weekly-only #weeklyReportPanel {
    display: block !important;
  }

  body.print-weekly-only #weeklyReportPanel[open] .index-collapse-body,
  body.print-weekly-only #weeklyReportPanel .index-collapse-body {
    display: block !important;
  }
}
