:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe2ea;
  --primary: #0284c7;
  --primary-soft: #e0f2fe;
  --soft: #f8fafc;
  --success-soft: #ecfdf5;
  --success: #047857;
  --warn-soft: #fffbeb;
  --warn: #b45309;
  --error-soft: #fef2f2;
  --error: #b91c1c;
  --radius: 22px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  min-width: 0;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0369a1;
  margin-bottom: 8px;
}

h1, h2, h3 { margin: 0; }

.lead,
.muted {
  color: var(--muted);
  line-height: 1.5;
}

.lead {
  max-width: 760px;
  margin-top: 10px;
}

.muted {
  font-size: 14px;
  margin-top: 6px;
}

.compact {
  margin-top: 4px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: 34px;
  line-height: 1.1;
}

.brand-block {
  min-width: 0;
}

.brand-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
}

.brand-title {
  min-width: 0;
}

.brand-title h1 {
  overflow-wrap: anywhere;
}

.brand-icon {
  flex: 0 0 auto;
  width: auto;
  height: 60px;
  object-fit: contain;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.userbox {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  min-width: 180px;
}

.userbox small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  min-width: 0;
}

.layout > *,
main,
.panel {
  min-width: 0;
  max-width: 100%;
}

.sidebar-card {
  height: fit-content;
}

.sidebar-title,
.section-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  width: 100%;
  min-width: 0;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
}

.tab.active {
  background: var(--primary-soft);
  border-color: #7dd3fc;
}

.tab-title {
  font-weight: 700;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.tab-desc {
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.quickbox {
  margin-top: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
}

.quickrow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 7px 0;
}

.quickrow span:first-child {
  color: var(--muted);
}

.fuel-meter {
  width: 200px;
  max-width: 100%;
  margin: 12px auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.fuel-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.fuel-meter-head span {
  color: var(--muted);
}

.fuel-meter-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
}

.fuel-meter-track,
.fuel-meter-segment {
  fill: none;
  stroke-linecap: round;
  stroke-width: 16;
}

.fuel-meter-track {
  stroke: #dbe2ea;
}

.fuel-meter-segment-red {
  stroke: #dc2626;
}

.fuel-meter-segment-orange {
  stroke: #f59e0b;
}

.fuel-meter-segment-green-light {
  stroke: #22c55e;
}

.fuel-meter-segment-green-dark {
  stroke: #15803d;
}

.fuel-meter-needle {
  stroke: #0f172a;
  stroke-width: 6;
  stroke-linecap: round;
}

.fuel-meter-hub {
  fill: #0f172a;
  stroke: #0f172a;
  stroke-width: 2;
}

.fuel-meter-reading {
  margin-top: -10px;
  text-align: center;
}

.fuel-meter-reading strong,
.fuel-meter-reading span {
  display: block;
}

.fuel-meter-reading strong {
  font-size: 1.05rem;
  color: var(--fuel-accent);
}

.fuel-meter-reading span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.fuel-meter-scale {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.fuel-meter-scale-red {
  color: #dc2626;
}

.fuel-meter-scale-green-light {
  color: #22c55e;
}

.fuel-meter-scale-green-dark {
  color: #15803d;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.slim-gap {
  margin-bottom: 16px;
}

.stack-gap {
  margin-bottom: 16px;
}

.stack-gap:last-child {
  margin-bottom: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 18px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.form-note {
  color: var(--muted);
  font-size: 14px;
  padding: 12px 14px;
  border: 1px dashed #bfdbfe;
  border-radius: 18px;
  background: #eff6ff;
}

.form-note strong {
  color: #0f172a;
}

.btn {
  border: 0;
  border-radius: 18px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  background: white;
  color: #334155;
  border: 1px solid var(--line);
}

.btn-block {
  width: 100%;
}

.flash {
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  font-weight: 700;
}

.flash-success {
  color: var(--success);
  background: var(--success-soft);
  border-color: #a7f3d0;
}

.flash-error {
  color: var(--error);
  background: var(--error-soft);
  border-color: #fecaca;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
}

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

.table-pager-status {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.table-pager-btn {
  min-width: 104px;
}

.table-pager-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.desktop-table-filler-row td {
  color: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: var(--soft);
  color: var(--muted);
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-top: 1px solid #edf2f7;
  vertical-align: top;
}

th {
  border-top: 0;
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-top: 16px;
  min-width: 0;
}

.content-grid > * {
  min-width: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

.full {
  grid-column: 1 / -1;
}

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

.badge-success {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #a7f3d0;
}

.mobile-list {
  display: none;
  margin-top: 8px;
}

.mobile-usage-list {
  display: grid;
  gap: 12px;
}

.mobile-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--soft);
  padding: 14px;
  margin-bottom: 12px;
}

.mobile-usage-list .mobile-item {
  margin-bottom: 0;
}

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

.mobile-pager-status {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.mobile-pager-btn {
  min-width: 104px;
}

.mobile-pager-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.mobile-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.usage-mobile-head {
  margin-bottom: 12px;
}

.usage-mobile-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.usage-mobile-date {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 2px;
}

.usage-mobile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
  min-width: 0;
}

.usage-mobile-grid > *,
.form-grid > * {
  min-width: 0;
}

.mini-card,
.note-box,
.calendar-item {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}

.mini-card {
  font-size: 14px;
}

.mini-card small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.note-box {
  margin-top: 12px;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}

.calendar-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.calendar-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  min-width: 0;
}

.calendar-item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.calendar-item-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.calendar-item-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.calendar-item-time {
  text-align: right;
  white-space: nowrap;
  color: #0f172a;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 440px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card form label {
  margin-top: 8px;
}

.login-title {
  font-size: 34px;
  line-height: 1.1;
}

.login-lead {
  color: var(--muted);
  margin: 10px 0 18px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-hint {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
}

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

  .tabs {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .container {
    padding: 12px;
  }

  .app-shell,
  .layout,
  main,
  .panel,
  .sidebar-card,
  .quickbox,
  .tabs,
  .tab,
  .table-wrap,
  .mobile-list,
  .mobile-usage-list {
    width: 100%;
    max-width: 100%;
  }

  .topbar h1,
  .login-title {
    font-size: 28px;
  }

  .brand-heading {
    gap: 12px;
  }

  .brand-icon {
    height: 53px;
  }

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

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

  .desktop-table {
    display: none;
  }

  .table-pager {
    display: none;
  }

  .mobile-list {
    display: block;
  }
}

@media (max-width: 520px) {
  .topbar h1,
  .login-title {
    font-size: 24px;
  }

  .brand-heading {
    gap: 8px;
  }

  .brand-icon {
    height: 49px;
  }

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

  .calendar-item,
  .quickrow {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-item-time {
    text-align: left;
  }

  .usage-mobile-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }

  .usage-mobile-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .mobile-pager {
    flex-wrap: wrap;
  }

  .table-pager {
    flex-wrap: wrap;
  }

  .mobile-pager-btn,
  .mobile-pager-status,
  .table-pager-btn,
  .table-pager-status {
    width: 100%;
  }
}
