﻿:root {
      --nav: #061d35;
      --nav-dark: #02111f;
      --page: #f4f8fc;
      --panel: #ffffff;
      --ink: #102033;
      --muted: #65758a;
      --line: #dce6f2;
      --blue: #1466df;
      --green: #19aa66;
      --amber: #f5a524;
      --orange: #fb7a21;
      --red: #ef4056;
      --violet: #9b5cf6;
      --cyan: #17b8ca;
      --shadow: 0 12px 32px rgba(16, 32, 51, .08);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: Inter, Arial, sans-serif;
      color: var(--ink);
      background: var(--page);
    }

    button { font: inherit; }

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

    .sidebar {
      position: sticky;
      top: 0;
      height: 100vh;
      padding: 24px 16px;
      display: flex;
      flex-direction: column;
      gap: 24px;
      color: #d8e6f7;
      background:
        radial-gradient(circle at 0 0, rgba(0, 174, 202, .16), transparent 30%),
        linear-gradient(180deg, var(--nav), var(--nav-dark));
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 8px 12px;
    }

    .brand-mark {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      color: white;
      font-size: 34px;
      font-weight: 900;
      line-height: 1;
    }

    .brand strong {
      display: block;
      color: white;
      font-size: 20px;
      text-transform: uppercase;
      line-height: 1;
    }

    .brand span {
      display: block;
      color: #c3d5eb;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 4px;
      text-transform: uppercase;
      margin-top: 5px;
    }

    .nav {
      display: grid;
      gap: 7px;
    }

    .nav a {
      min-height: 45px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 14px;
      color: #d7e5f8;
      text-decoration: none;
      font-size: 13px;
      font-weight: 750;
    }

    .nav a.active {
      color: white;
      background: linear-gradient(90deg, #135fc8, #0b4eaa);
    }

    .help {
      margin-top: auto;
      padding: 18px;
      border-radius: 8px;
      background: linear-gradient(145deg, rgba(0, 174, 202, .32), rgba(8, 63, 93, .92));
      border: 1px solid rgba(105, 221, 237, .24);
    }

    .help strong {
      display: block;
      color: white;
      font-size: 14px;
      margin-bottom: 8px;
    }

    .help p {
      margin: 0 0 14px;
      color: #d8f7ff;
      font-size: 12px;
      line-height: 1.45;
    }

    .help button {
      width: 100%;
      min-height: 38px;
      border: 1px solid rgba(255, 255, 255, .62);
      border-radius: 8px;
      color: white;
      background: rgba(255, 255, 255, .06);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 850;
      cursor: pointer;
    }

    .copyright {
      color: #8098b3;
      font-size: 11px;
      padding: 0 10px;
    }

    main {
      padding: 18px;
      overflow: hidden;
    }

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

    .title-row {
      display: flex;
      align-items: end;
      gap: 16px;
      min-width: 0;
    }

    h1 {
      margin: 0;
      font-size: 26px;
      line-height: 1;
      letter-spacing: 0;
    }

    .title-row p {
      margin: 0 0 2px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 700;
    }

    .top-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .bell {
      width: 38px;
      height: 38px;
      border: 0;
      background: transparent;
      color: #223b58;
      display: grid;
      place-items: center;
      position: relative;
      cursor: pointer;
    }

    .bell span {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: #f04438;
      color: white;
      font-size: 10px;
      font-weight: 900;
      border: 2px solid white;
    }

    .account {
      border: 0;
      background: transparent;
      display: inline-flex;
      align-items: center;
      gap: 9px;
      color: #12233a;
      font-size: 12px;
      font-weight: 850;
      cursor: pointer;
    }

    .avatar {
      width: 31px;
      height: 31px;
      border-radius: 50%;
      background: #08294e;
      color: white;
      display: grid;
      place-items: center;
      font-size: 11px;
      font-weight: 900;
    }

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

    .left,
    .right {
      display: grid;
      align-content: start;
      gap: 16px;
      min-width: 0;
    }

    .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }

    .filters {
      min-height: 74px;
      padding: 15px;
      display: grid;
      grid-template-columns: 260px 160px 150px 1fr;
      gap: 13px;
      align-items: center;
    }

    .select {
      min-height: 40px;
      border: 1px solid #d4e0ee;
      border-radius: 7px;
      background: white;
      color: #253a54;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 9px;
      padding: 0 12px;
      font-size: 12px;
      font-weight: 750;
    }

    .field-label {
      display: block;
      color: #52657e;
      font-size: 10px;
      font-weight: 900;
      margin-bottom: 6px;
    }

    .export {
      justify-self: end;
      min-height: 40px;
      border: 1px solid #d4e0ee;
      border-radius: 7px;
      background: white;
      color: #193754;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 0 14px;
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
    }

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

    .stat {
      min-height: 98px;
      padding: 16px;
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr);
      align-items: center;
      gap: 12px;
    }

    .stat-icon {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: var(--blue);
      background: #edf5ff;
    }

    .stat:nth-child(2) .stat-icon { color: var(--green); background: #e9f9f1; }
    .stat:nth-child(3) .stat-icon { color: var(--violet); background: #f1eafe; }
    .stat:nth-child(4) .stat-icon { color: var(--orange); background: #fff0e5; }
    .stat:nth-child(5) .stat-icon { color: var(--cyan); background: #e8fbfd; }

    .stat small {
      display: block;
      color: var(--muted);
      font-size: 10px;
      font-weight: 850;
    }

    .stat strong {
      display: block;
      margin-top: 4px;
      font-size: 22px;
      line-height: 1;
    }

    .stat span {
      display: block;
      color: var(--green);
      margin-top: 8px;
      font-size: 10px;
      font-weight: 850;
    }

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

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

    .section {
      padding: 18px;
    }

    .section h2 {
      margin: 0 0 14px;
      font-size: 13px;
      font-weight: 900;
    }

    .line-chart {
      height: 188px;
      position: relative;
      border-left: 1px solid #d9e4f0;
      border-bottom: 1px solid #d9e4f0;
      background:
        linear-gradient(#edf2f8 1px, transparent 1px) 0 0 / 100% 42px;
      margin: 8px 8px 2px 22px;
    }

    .line-chart svg {
      position: absolute;
      inset: 0;
      overflow: visible;
    }

    .axis-y {
      position: absolute;
      left: -22px;
      top: 0;
      bottom: 0;
      display: grid;
      align-content: space-between;
      color: #718196;
      font-size: 10px;
      font-weight: 750;
    }

    .axis-x {
      position: absolute;
      left: 0;
      right: 0;
      bottom: -25px;
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      color: #718196;
      font-size: 10px;
      font-weight: 750;
    }

    .point-label {
      position: absolute;
      color: #193754;
      font-size: 11px;
      font-weight: 900;
    }

    .state-chart,
    .cargo-chart {
      display: grid;
      grid-template-columns: 190px minmax(0, 1fr);
      gap: 24px;
      align-items: center;
      min-height: 188px;
    }

    .donut {
      width: 166px;
      aspect-ratio: 1;
      border-radius: 50%;
      display: grid;
      place-items: center;
      justify-self: center;
    }

    .donut.state {
      background: conic-gradient(var(--green) 0 87.5%, var(--amber) 87.5% 95.3%, var(--blue) 95.3% 98.4%, var(--red) 98.4% 100%);
    }

    .donut.cargo {
      background: conic-gradient(var(--blue) 0 32%, var(--green) 32% 56%, var(--amber) 56% 72%, var(--violet) 72% 84%, var(--cyan) 84% 100%);
    }

    .donut::after {
      content: "128\A Total";
      white-space: pre;
      width: 94px;
      height: 94px;
      border-radius: 50%;
      background: white;
      display: grid;
      place-items: center;
      text-align: center;
      color: #18304e;
      font-size: 24px;
      line-height: 1.05;
      font-weight: 900;
      box-shadow: inset 0 0 0 1px #edf2f7;
    }

    .donut.cargo::after {
      content: "2,456\A CBM";
    }

    .legend {
      display: grid;
      gap: 13px;
    }

    .legend div {
      display: grid;
      grid-template-columns: 10px minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      color: #304863;
      font-size: 11px;
      font-weight: 850;
    }

    .dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--green);
    }

    .legend div:nth-child(2) .dot { background: var(--amber); }
    .legend div:nth-child(3) .dot { background: var(--blue); }
    .legend div:nth-child(4) .dot { background: var(--red); }
    .legend.cargo div:nth-child(1) .dot { background: var(--blue); }
    .legend.cargo div:nth-child(2) .dot { background: var(--green); }
    .legend.cargo div:nth-child(3) .dot { background: var(--amber); }
    .legend.cargo div:nth-child(4) .dot { background: var(--violet); }
    .legend.cargo div:nth-child(5) .dot { background: var(--cyan); }

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

    th {
      color: #60728a;
      text-align: left;
      font-size: 10px;
      font-weight: 900;
      text-transform: uppercase;
      padding: 0 0 10px;
    }

    td {
      border-top: 1px solid #e6eef7;
      padding: 10px 0;
      font-size: 11px;
      font-weight: 800;
    }

    .good { color: var(--green); background: #e9f9f1; }
    .warn { color: #b56a08; background: #fff4df; }
    .bad { color: var(--red); background: #ffeaec; }

    .pill {
      border-radius: 999px;
      padding: 5px 9px;
      font-size: 10px;
      font-weight: 900;
      display: inline-flex;
    }

    .link-row {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid #e6eef7;
      color: var(--blue);
      text-decoration: none;
      display: flex;
      justify-content: space-between;
      font-size: 11px;
      font-weight: 900;
    }

    .transit-bar {
      display: grid;
      grid-template-columns: 28.1fr 42.2fr 21.9fr 7.8fr;
      height: 17px;
      border-radius: 999px;
      overflow: hidden;
      margin: 6px 0 18px;
    }

    .transit-bar span:nth-child(1) { background: var(--green); }
    .transit-bar span:nth-child(2) { background: var(--amber); }
    .transit-bar span:nth-child(3) { background: var(--orange); }
    .transit-bar span:nth-child(4) { background: var(--red); }

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

    .transit-card {
      border: 1px solid #e6eef7;
      border-radius: 8px;
      padding: 13px;
    }

    .transit-card strong {
      display: block;
      font-size: 12px;
      margin-bottom: 12px;
    }

    .transit-card span {
      display: flex;
      justify-content: space-between;
      color: #304863;
      font-size: 11px;
      font-weight: 800;
    }

    .transit-card b { color: var(--green); }
    .transit-card:nth-child(2) b { color: var(--amber); }
    .transit-card:nth-child(3) b { color: var(--orange); }
    .transit-card:nth-child(4) b { color: var(--red); }

    .side-card {
      padding: 18px;
    }

    .side-card h2 {
      margin: 0 0 16px;
      font-size: 12px;
      font-weight: 900;
      text-transform: uppercase;
    }

    .route-bars {
      display: grid;
      gap: 13px;
    }

    .bar-row {
      display: grid;
      gap: 6px;
    }

    .bar-label {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      font-size: 11px;
      font-weight: 850;
    }

    .bar-track {
      height: 7px;
      border-radius: 999px;
      background: #e6edf6;
      overflow: hidden;
    }

    .bar-track span {
      display: block;
      height: 100%;
      border-radius: 999px;
      background: var(--blue);
    }

    .mini-bars {
      height: 170px;
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 18px;
      align-items: end;
      padding: 0 8px;
    }

    .mini-bar {
      display: grid;
      gap: 8px;
      justify-items: center;
      color: #304863;
      font-size: 10px;
      font-weight: 850;
    }

    .mini-bar span {
      width: 30px;
      border-radius: 7px 7px 0 0;
      background: linear-gradient(180deg, #25bd76, #0c9c5a);
    }

    .downloads {
      display: grid;
      gap: 13px;
    }

    .download {
      display: grid;
      grid-template-columns: 24px minmax(0, 1fr) 24px;
      align-items: center;
      gap: 10px;
      color: #304863;
      font-size: 11px;
      font-weight: 800;
    }

    .download i {
      color: #1f4770;
    }

    @media (max-width: 1260px) {
      .layout { grid-template-columns: 1fr; }
      .right { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    }

    @media (max-width: 1100px) {
      .app { grid-template-columns: 82px minmax(0, 1fr); }
      .sidebar { align-items: center; padding: 20px 12px; }
      .brand { padding: 0; }
      .brand div:not(.brand-mark), .nav span, .help, .copyright { display: none; }
      .nav a { width: 50px; justify-content: center; padding: 0; }
      .filters, .stats, .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .export { justify-self: stretch; }
    }

    @media (max-width: 760px) {
      .app { display: block; }
      .sidebar {
        position: static;
        height: auto;
        display: block;
      }
      .brand div:not(.brand-mark), .nav span { display: block; }
      .nav {
        grid-template-columns: repeat(4, 1fr);
        margin-top: 14px;
      }
      .nav a { justify-content: center; padding: 0; }
      .nav span { display: none !important; }
      main { padding: 14px; }
      .topbar, .title-row, .top-actions { display: grid; align-items: start; }
      .top-actions { grid-template-columns: auto 1fr; }
      .account { justify-content: end; }
      .filters, .stats, .dashboard-grid, .right, .state-chart, .cargo-chart, .transit-cards { grid-template-columns: 1fr; }
      .line-chart { margin-right: 0; }
    }

