
.fpg-fuel-surcharge * { box-sizing: border-box; }
.fpg-fuel-surcharge { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f4f4f2; color: #1a1a1a; }
.fpg-fuel-surcharge *, .fpg-fuel-surcharge *::before, .fpg-fuel-surcharge *::after { box-sizing: border-box; }

/* header { background: #0a2540; color: #fff; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; height: 56px; }
header h1 { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
header h1 span { color: #60a5fa; } */

/* .page { max-width: 1120px; margin: 0 auto; padding: 22px 22px 60px; } */

/* Entry card */
.entry-card { background: #fff; border: 1px solid #e5e5e3; border-radius: 10px; padding: 20px 22px; margin-bottom: 18px; }
.entry-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.entry-header h2 { font-size: 14px; font-weight: 700; color: #0a2540; }
.week-input-wrap { display: flex; align-items: center; gap: 10px; }
.week-input-wrap label { font-size: 13px; color: #888; font-weight: 500; }
input[type="date"], input[type="number"] { font-family: inherit; border: 1px solid #d1d5db; border-radius: 7px; padding: 7px 11px; font-size: 13px; color: #0a2540; background: #fff; }
input:focus { outline: 2px solid #2563eb; outline-offset: 1px; }

.padd-inputs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.padd-input-group { display: flex; flex-direction: column; gap: 5px; }
.padd-input-group > label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.padd-input-group .padd-name { font-size: 11px; color: #888; margin-top: -2px; }
.price-field-wrap { position: relative; }
.price-field-wrap .dollar { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; color: #bbb; pointer-events: none; }
.price-field-wrap input { width: 100%; padding-left: 22px; }
.fsc-preview { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; color: #ccc; transition: color 0.15s; min-height: 28px; }
.fsc-preview.filled { color: var(--padd-color); }
.fsc-bracket { font-size: 10px; color: #ccc; min-height: 14px; }

.entry-footer { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #f0f0ee; }
.btn-save { background: #0a2540; color: #fff; border: none; border-radius: 7px; padding: 9px 22px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.14s; }
.btn-save:hover { background: #0f3460; }
.save-msg { font-size: 13px; color: #16a34a; font-weight: 500; opacity: 0; transition: opacity 0.3s; }
.save-msg.show { opacity: 1; }

/* Rate cards */
.rate-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.rate-card { background: #fff; border: 1px solid #e5e5e3; border-radius: 10px; padding: 14px 16px; border-top: 3px solid var(--padd-color); cursor: pointer; transition: box-shadow 0.14s, opacity 0.14s; }
.rate-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.rate-card.dimmed { opacity: 0.38; }
.rate-card .rc-label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #888; }
.rate-card .rc-name { font-size: 11px; color: #999; margin-bottom: 10px; }
.rate-card .rc-price { font-size: 12px; color: #777; margin-bottom: 3px; }
.rate-card .rc-price b { color: #0a2540; }
.rate-card .rc-fsc { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--padd-color); min-height: 38px; }

/* Main grid */
.main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; margin-bottom: 18px; }

/* Map card */
.map-card { background: #fff; border: 1px solid #e5e5e3; border-radius: 10px; overflow: hidden; }
.map-card-body { padding: 18px 20px 0; }
.map-card h3 { font-size: 13px; font-weight: 700; color: #0a2540; margin-bottom: 14px; }
.map-wrap { border: 1px solid #e9e9e7; border-radius: 8px; overflow: hidden; background: #f8f8f6; min-height: 160px; margin-bottom: 0; }
#map { width: 100%; height: auto; display: none; }
#map-loading { display: flex; align-items: center; justify-content: center; height: 200px; font-size: 13px; color: #aaa; gap: 8px; }
.spin { width: 14px; height: 14px; border: 2px solid #ddd; border-top-color: #2563eb; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* CSS map region coloring */
.state { transition: fill 0.2s; }
.s1{fill:#B5D4F4} .s2{fill:#C0DD97} .s3{fill:#FAC775} .s4{fill:#CECBF6} .s5{fill:#9FE1CB}
[data-sel] .state{fill:#e0e0de}
[data-sel="1"] .s1{fill:#2563eb}
[data-sel="2"] .s2{fill:#3B6D11}
[data-sel="3"] .s3{fill:#b45309}
[data-sel="4"] .s4{fill:#4f46e5}
[data-sel="5"] .s5{fill:#0e7490}

/* Terminals side panel */
.map-detail { display: none; padding: 4px 0 0; }
.map-detail.visible { display: block; }
.map-detail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.map-detail-head .padd-label { font-size: 13px; font-weight: 700; }
.map-detail-head .padd-nm { font-size: 12px; color: #888; }
.map-detail-dismiss { font-size: 18px; color: #ccc; background: none; border: none; cursor: pointer; line-height: 1; padding: 0 2px; }
.map-detail-dismiss:hover { color: #888; }

.detail-stats { display: flex; gap: 20px; margin-bottom: 14px; }
.detail-stat .ds-label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #aaa; margin-bottom: 2px; }
.detail-stat .ds-value { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.detail-stat .ds-sub { font-size: 10px; color: #bbb; margin-top: 1px; }

.terminal-section-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #aaa; margin-bottom: 8px; }
.terminal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.terminal-item { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; border-bottom: 1px solid #f4f4f2; font-size: 12px; color: #444; }
.terminal-item:last-child { border-bottom: none; }
.terminal-item .t-code { font-size: 10px; font-weight: 700; color: #bbb; letter-spacing: 0.5px; }

.map-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 12px 20px 14px; border-top: 1px solid #f0f0ee; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #666; cursor: pointer; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* Right column: history */
.history-card { background: #fff; border: 1px solid #e5e5e3; border-radius: 10px; padding: 18px 20px; overflow-x: auto; }
.history-table { min-width: 860px; }
.terminals-card { background: #fff; border: 1px solid #e5e5e3; border-radius: 10px; padding: 18px 20px; }
.terminals-empty { font-size: 13px; color: #bbb; font-style: italic; text-align: center; padding: 32px 0; }
.history-section { }
.history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.history-header h3 { font-size: 13px; font-weight: 700; color: #0a2540; }
.btn-clear { font-size: 12px; color: #ef4444; background: none; border: none; cursor: pointer; font-family: inherit; padding: 2px 6px; border-radius: 4px; }
.btn-clear:hover { background: #fef2f2; }
.history-empty { font-size: 13px; color: #ccc; font-style: italic; text-align: center; padding: 24px 0; }
.history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-table thead th { text-align: right; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #aaa; padding: 0 6px 8px; border-bottom: 1px solid #e5e5e3; }
.history-table thead tr:first-child th:first-child { text-align: left; }
.history-table tbody tr { border-bottom: 1px solid #f4f4f2; cursor: pointer; }
.history-table tbody tr:last-child { border-bottom: none; }
.history-table tbody tr:hover { background: #fafafa; }
.history-table tbody tr.current-week { background: #eff6ff; }
.history-table tbody td { padding: 7px 6px; text-align: right; color: #555; }
.history-table tbody td:first-child { text-align: left; font-weight: 600; color: #0a2540; }
.del-btn { background: none; border: none; color: #ddd; cursor: pointer; font-size: 15px; padding: 2px 4px; border-radius: 3px; }
.del-btn:hover { color: #ef4444; background: #fef2f2; }

@media (max-width: 900px) {
  .padd-inputs { grid-template-columns: repeat(3, 1fr); }
  .rate-cards { grid-template-columns: repeat(3, 1fr); }
  .main-grid { grid-template-columns: 1fr; }
  .terminal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .padd-inputs { grid-template-columns: 1fr 1fr; }
  .rate-cards { grid-template-columns: 1fr 1fr; }
  .page { padding: 14px 14px 48px; }
}

/* EIA fetch bar */
.eia-bar { background: #fff; border: 1px solid #e5e5e3; border-radius: 10px; padding: 12px 18px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eia-bar-left { display: flex; align-items: center; gap: 10px; }
.eia-logo { background: #0a5c2f; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 3px 7px; border-radius: 4px; flex-shrink: 0; }
.eia-label { font-size: 13px; font-weight: 600; color: #0a2540; }
.eia-status { font-size: 12px; color: #888; }
.eia-status.ok { color: #16a34a; }
.eia-status.err { color: #dc2626; }
.eia-status.loading { color: #2563eb; }
.eia-bar-right { display: flex; align-items: center; gap: 8px; }
.eia-key-wrap { display: flex; gap: 6px; }
#eia-key-input { font-family: 'Courier New', monospace; font-size: 12px; width: 260px; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 7px; color: #0a2540; }
.btn-key-save { background: #0a2540; color: #fff; border: none; border-radius: 7px; padding: 7px 14px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn-key-save:hover { background: #0f3460; }
.btn-fetch { background: #0a5c2f; color: #fff; border: none; border-radius: 7px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: background 0.14s; }
.btn-fetch:hover { background: #0d7a3d; }
.btn-fetch:disabled { background: #aaa; cursor: default; }
.btn-key-change { background: none; border: 1px solid #e5e5e3; border-radius: 7px; padding: 7px 12px; font-size: 12px; color: #888; cursor: pointer; font-family: inherit; }
.btn-key-change:hover { border-color: #ccc; color: #555; }
.spin-inline { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }

/* History chart */
.chart-section { background: #fff; border: 1px solid #e5e5e3; border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.chart-header h3 { font-size: 13px; font-weight: 700; color: #0a2540; }
.chart-toggle { display: flex; gap: 0; border: 1px solid #e5e5e3; border-radius: 7px; overflow: hidden; }
.chart-toggle button { background: #fff; border: none; padding: 6px 14px; font-size: 12px; font-weight: 500; color: #888; cursor: pointer; font-family: inherit; transition: all 0.12s; }
.chart-toggle button.active { background: #0a2540; color: #fff; }
.chart-toggle button:first-child { border-right: 1px solid #e5e5e3; }
.chart-empty { font-size: 13px; color: #bbb; font-style: italic; text-align: center; padding: 32px 0; }
.chart-wrap { position: relative; height: 260px; }

/* FSC override */
.rc-fsc-wrap { position: relative; }
.rc-fsc { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--padd-color); min-height: 38px; cursor: pointer; display: inline-block; }
.rc-fsc:hover::after { content: ' ✎'; font-size: 14px; opacity: 0.4; }
.rc-fsc.overridden { color: #b45309; }
.override-badge { font-size: 10px; font-weight: 600; color: #b45309; letter-spacing: 0.5px; text-transform: uppercase; display: none; margin-bottom: 2px; }
.override-badge.visible { display: flex; align-items: center; gap: 6px; }
.override-badge button { background: none; border: none; color: #b45309; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; opacity: 0.7; }
.override-badge button:hover { opacity: 1; }
.override-input-wrap { display: none; align-items: center; gap: 6px; margin-top: 2px; }
.override-input-wrap.visible { display: flex; }
.override-input-wrap input { width: 70px; padding: 4px 8px; border: 1px solid #b45309; border-radius: 5px; font-size: 14px; font-weight: 700; color: #b45309; font-family: inherit; text-align: right; }
.override-input-wrap input:focus { outline: 2px solid #b45309; outline-offset: 1px; }
.override-input-wrap span { font-size: 14px; font-weight: 700; color: #b45309; }
.override-input-wrap button { background: #0a2540; color: #fff; border: none; border-radius: 5px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
