:root {
  --app-bg: #f5f7fb;
  --app-surface: #ffffff;
  --app-surface-alt: #eef3fb;
  --app-border: #d7dfec;
  --app-text: #1f2937;
  --app-muted: #667085;
  --app-primary: #2f6fec;
  --app-primary-dark: #1f4fb6;
  --app-sidebar: #1d4ed8;
  --app-sidebar-dark: #173ea8;
  --app-positive: #1f9d57;
  --app-negative: #d14343;
  --app-warning: #b7791f;
  --shadow-soft: 0 16px 42px rgba(32, 55, 99, 0.12);
}

body.redesign-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(47, 111, 236, 0.16), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--app-bg) 100%);
  color: var(--app-text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

.redesign-body *,
.redesign-body *::before,
.redesign-body *::after {
  box-sizing: border-box;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
}

.login-showcase {
  position: relative;
  overflow: hidden;
  padding: 56px 56px 48px;
  background:
    linear-gradient(145deg, rgba(14, 39, 122, 0.96), rgba(47, 111, 236, 0.92)),
    linear-gradient(180deg, #2f6fec, #1f4fb6);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-showcase::before,
.login-showcase::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.login-showcase::before {
  width: 320px;
  height: 320px;
  right: -80px;
  top: -80px;
}

.login-showcase::after {
  width: 220px;
  height: 220px;
  left: -60px;
  bottom: -40px;
}

.login-brand,
.login-copy,
.login-metrics {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.login-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 3vw, 3.5rem);
  line-height: 1.05;
}

.login-copy p {
  margin: 0;
  max-width: 540px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  line-height: 1.7;
}

.login-points {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.login-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
}

.login-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #93c5fd;
  flex: none;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.login-metric {
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.login-metric-value {
  display: block;
  margin-bottom: 6px;
  font-size: 1.35rem;
  font-weight: 700;
}

.login-metric-label {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.86rem;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}

.login-panel-card {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(215, 223, 236, 0.92);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow-soft);
}

.login-panel-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
}

.login-panel-subtitle {
  margin: 0 0 24px;
  color: var(--app-muted);
  line-height: 1.6;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #344054;
}

.login-field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--app-border);
  background: #fff;
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-field input:focus {
  outline: none;
  border-color: rgba(47, 111, 236, 0.78);
  box-shadow: 0 0 0 4px rgba(47, 111, 236, 0.12);
}

.login-submit {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(47, 111, 236, 0.28);
}

.login-submit:hover {
  filter: brightness(1.03);
}

.login-alert {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #f3c2c2;
  background: #fff3f3;
  color: #b3261e;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 26px 20px 22px;
  background:
    linear-gradient(180deg, var(--app-sidebar) 0%, var(--app-sidebar-dark) 100%);
  color: #fff;
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.app-sidebar-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.app-sidebar-brand-text strong {
  display: block;
  font-size: 0.98rem;
}

.app-sidebar-brand-text span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  margin-top: 2px;
}

.app-sidebar-section {
  margin-top: 20px;
}

.app-sidebar-caption {
  padding: 0 12px;
  margin-bottom: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}

.app-sidebar-nav {
  display: grid;
  gap: 4px;
}

.app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.app-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  transform: translateX(1px);
}

.app-sidebar-link.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.app-sidebar-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex: none;
}

.app-sidebar-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.app-sidebar-user {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.86rem;
}

.app-sidebar-logout {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.app-main {
  min-width: 0;
  padding: 24px 28px 36px;
}

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

.app-topbar-title h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  line-height: 1.1;
}

.app-topbar-title p {
  margin: 8px 0 0;
  color: var(--app-muted);
  line-height: 1.5;
}

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

.app-select {
  min-width: 180px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 11px 14px;
  background: var(--app-surface);
  color: var(--app-text);
  font: inherit;
}

.app-select:focus {
  outline: none;
  border-color: rgba(47, 111, 236, 0.72);
  box-shadow: 0 0 0 4px rgba(47, 111, 236, 0.12);
}

.dashboard-alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.dashboard-alert {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid #f4d28b;
  background: #fff7e6;
  color: #8a5a00;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card,
.panel-card {
  background: var(--app-surface);
  border: 1px solid rgba(215, 223, 236, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.kpi-card {
  padding: 18px 20px;
}

.kpi-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--app-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi-value {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
}

.kpi-subtle {
  margin-top: 10px;
  color: var(--app-muted);
  font-size: 0.88rem;
}

.panel-card {
  padding: 20px 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.dashboard-dual-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 18px;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(47, 111, 236, 0.12);
  color: var(--app-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-badge.positive {
  background: rgba(31, 157, 87, 0.12);
  color: var(--app-positive);
}

.metric-badge.negative {
  background: rgba(209, 67, 67, 0.12);
  color: var(--app-negative);
}

.revenue-bars,
.expense-bars {
  display: grid;
  gap: 14px;
}

.revenue-row,
.expense-row {
  display: grid;
  gap: 8px;
}

.revenue-meta,
.expense-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.revenue-meta strong,
.expense-meta strong {
  font-size: 0.95rem;
}

.revenue-meta span,
.expense-meta span {
  color: var(--app-muted);
  font-size: 0.84rem;
}

.revenue-track,
.expense-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef7;
}

.revenue-fill,
.expense-fill {
  height: 100%;
  border-radius: inherit;
}

.revenue-fill {
  background: linear-gradient(90deg, #5b8cff, #2f6fec);
}

.expense-fill {
  background: linear-gradient(90deg, #9db7ec, #6387d7);
}

.gsm-grid {
  display: grid;
  gap: 14px;
}

.gsm-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 14px;
  align-items: center;
}

.gsm-vehicle strong {
  display: block;
  font-size: 0.92rem;
}

.gsm-vehicle span {
  color: var(--app-muted);
  font-size: 0.8rem;
}

.gsm-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  min-height: 110px;
}

.gsm-bar-group {
  width: 58px;
  text-align: center;
}

.gsm-bar-label {
  margin-top: 8px;
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.gsm-bar-value {
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--app-text);
}

.gsm-bar-track {
  position: relative;
  height: 74px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 16px 16px 10px 10px;
  background: #eef3fb;
}

.gsm-bar-fill {
  width: 100%;
  border-radius: 14px 14px 10px 10px;
}

.gsm-bar-fill.actual {
  background: linear-gradient(180deg, #4f7cf7, #2f6fec);
}

.gsm-bar-fill.norm {
  background: linear-gradient(180deg, #b7c6e8, #92a9d9);
}

.gsm-side {
  color: var(--app-muted);
  font-size: 0.84rem;
  text-align: right;
}

.dashboard-table-wrap {
  border: 1px solid #e5ebf5;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.dashboard-table-scroll {
  max-height: 420px;
  overflow: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fd;
  color: #5e6a7d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.74rem;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e5ebf5;
}

.dashboard-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f8;
  vertical-align: middle;
  font-size: 0.9rem;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: none;
}

.dashboard-table tbody tr:hover td {
  background: #f9fbff;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.status-dot.in-transit {
  background: #f59e0b;
}

.status-dot.completed {
  background: #10b981;
}

.panel-empty {
  border-radius: 16px;
  padding: 24px 18px;
  background: #f8faff;
  color: var(--app-muted);
  text-align: center;
}

.text-positive {
  color: var(--app-positive);
}

.text-negative {
  color: var(--app-negative);
}

@media (max-width: 1180px) {
  .kpi-grid,
  .dashboard-dual-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
}

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

  .app-sidebar {
    position: static;
    height: auto;
  }

  .app-main {
    padding: 20px 16px 28px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-showcase {
    min-height: 360px;
    padding: 36px 28px 28px;
  }

  .login-metrics {
    grid-template-columns: 1fr;
  }
}

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

  .app-topbar {
    flex-direction: column;
  }

  .app-topbar-actions,
  .app-select {
    width: 100%;
  }

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

  .gsm-side {
    text-align: left;
  }
}
