:root {
      --blue: #034EA2;
      --blue-d: #023a7a;
      --blue-l: #e8f0fa;
      --green: #00A651;
      --green-l: #e5f6ed;
      --yellow: #FFDD00;
      --yellow-l: #fff8cc;
      --red: #d93636;
      --red-l: #fdecec;
      --amber: #b7791f;
      --amber-l: #fdf3e1;
      --bg: #f4f6f9;
      --card: #fff;
      --ink: #1b2430;
      --muted: #667085;
      --line: #e4e8ee;
      --radius: 10px;
      --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    }

    * {
      box-sizing: border-box
    }

    html,
    body {
      margin: 0
    }

    body {
      font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
      background: var(--bg);
      color: var(--ink);
      font-size: 14px;
      line-height: 1.45
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
      color: inherit
    }

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

    /* sidebar */
    .side {
      background: var(--blue);
      color: #fff;
      display: flex;
      flex-direction: column;
      position: sticky;
      top: 0;
      height: 100vh
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 18px 16px;
      border-bottom: 1px solid rgba(255, 255, 255, .12)
    }

    .brand img {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: #fff;
      padding: 2px
    }

    .brand b {
      display: block;
      font-size: 15px
    }

    .brand span {
      font-size: 11.5px;
      opacity: .75
    }

    .nav {
      padding: 10px 8px;
      flex: 1;
      overflow: auto
    }

    .nav .grp {
      font-size: 10.5px;
      letter-spacing: .08em;
      text-transform: uppercase;
      opacity: .55;
      padding: 14px 10px 6px
    }

    .nav button {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      background: none;
      border: 0;
      color: #fff;
      opacity: .85;
      padding: 9px 10px;
      border-radius: 8px;
      cursor: pointer;
      text-align: left
    }

    .nav button:hover {
      background: rgba(255, 255, 255, .08);
      opacity: 1
    }

    .nav button.on {
      background: #fff;
      color: var(--blue);
      opacity: 1;
      font-weight: 600
    }

    .nav svg {
      width: 18px;
      height: 18px;
      flex: none
    }

    .nav .count {
      margin-left: auto;
      background: var(--yellow);
      color: #222;
      border-radius: 10px;
      font-size: 11px;
      font-weight: 700;
      padding: 0 7px
    }

    .side .foot {
      padding: 12px 16px;
      font-size: 11px;
      opacity: .6;
      border-top: 1px solid rgba(255, 255, 255, .12)
    }

    /* main */
    .main {
      min-width: 0;
      overflow: auto
    }

    .top {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 24px;
      background: #fff;
      border-bottom: 1px solid var(--line);
      position: sticky;
      top: 0;
      z-index: 5
    }

    .top h1 {
      font-size: 18px;
      margin: 0;
      flex: 1
    }

    .role {
      white-space: nowrap;
      display: flex;
      gap: 8px;
      align-items: center;
      font-size: 12.5px;
      color: var(--muted)
    }

    .role select {
      padding: 6px 8px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff
    }

    .menu-btn {
      display: none;
      background: none;
      border: 0;
      cursor: pointer;
      padding: 4px
    }

    .content {
      padding: 22px 24px 60px;
      min-width: 0
    }

    .card {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      min-width: 0
    }

    .card .hd {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line)
    }

    .card .hd h3 {
      margin: 0;
      font-size: 14.5px;
      flex: 1
    }

    .card .bd {
      padding: 16px
    }

    .grid {
      display: grid;
      gap: 16px
    }

    .g2 {
      grid-template-columns: 1fr 1fr
    }

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

    .g21 {
      grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
      align-items: start
    }

    .g12 {
      grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.6fr);
      align-items: start
    }

    .grid>* {
      min-width: 0
    }

    .kpis {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 14px;
      margin-bottom: 16px
    }

    .kpi {
      padding: 14px 16px;
      border-left: 4px solid var(--blue)
    }

    .kpi .l {
      font-size: 12px;
      color: var(--muted);
      white-space: normal
    }

    .kpi .v {
      font-size: 26px;
      font-weight: 700;
      margin-top: 2px;
      font-variant-numeric: tabular-nums
    }

    .kpi .s {
      font-size: 11.5px;
      color: var(--muted);
      white-space: normal
    }

    .kpi.g {
      border-color: var(--green)
    }

    .kpi.y {
      border-color: #e6c200
    }

    .kpi.r {
      border-color: var(--red)
    }

    .kpi.a {
      border-color: var(--amber)
    }

    table {
      width: max-content;
      min-width: 100%;
      border-collapse: collapse
    }

    table.order-items {
      width: 100%;
      min-width: 0;
      margin-bottom: 16px;
      border: 1px solid var(--line)
    }

    td.namecell {
      text-transform: uppercase;
      font-weight: 600;
      letter-spacing: .02em
    }

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

    .pumpblock {
      min-width: 0
    }

    .poc {
      margin-top: 2px;
      font-size: 12px;
      font-weight: 500;
      letter-spacing: 0;
      text-transform: none;
      color: #667085;
      white-space: normal;
      overflow-wrap: anywhere
    }

    .pin,
    .pinbtn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      flex: none;
      color: var(--blue);
      background: var(--blue-l);
      text-decoration: none;
      text-transform: none;
      letter-spacing: 0;
      font-weight: 600
    }

    .pin {
      width: 26px;
      height: 26px;
      border-radius: 8px
    }

    .pinbtn {
      margin-top: 8px;
      padding: 6px 10px;
      border-radius: 8px;
      font-size: 12.5px
    }

    .pin:hover,
    .pinbtn:hover {
      background: var(--blue);
      color: #fff
    }

    th,
    td {
      padding: 9px 12px;
      text-align: left;
      border-bottom: 1px solid var(--line);
      vertical-align: middle;
      white-space: nowrap
    }

    th {
      font-size: 11.5px;
      text-transform: uppercase;
      letter-spacing: .04em;
      color: var(--muted);
      font-weight: 600;
      background: #fafbfc;
      position: sticky;
      top: 0
    }

    td.n,
    th.n {
      text-align: right;
      font-variant-numeric: tabular-nums
    }

    tr.click {
      cursor: pointer
    }

    tr.click:hover td {
      background: #f7f9fc
    }

    .tbl {
      overflow: auto;
      width: 100%;
      max-width: 100%;
      max-height: calc(100vh - 210px)
    }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 2px 9px;
      border-radius: 20px;
      font-size: 11.5px;
      font-weight: 600;
      white-space: nowrap
    }

    .pill:before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: currentColor
    }

    .st-Pending {
      background: var(--yellow-l);
      color: #8a6d00
    }

    .st-Assigned {
      background: var(--blue-l);
      color: var(--blue)
    }

    .st-Picked {
      background: #efe8fb;
      color: #6b3fb8
    }

    .st-Delivered {
      background: var(--green-l);
      color: #067a3e
    }

    .sla-ok {
      color: #067a3e
    }

    .sla-warn {
      color: var(--amber)
    }

    .sla-bad {
      color: var(--red);
      font-weight: 600
    }

    .btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: 1px solid var(--line);
      background: #fff;
      border-radius: 8px;
      padding: 7px 12px;
      cursor: pointer;
      font-weight: 500;
      white-space: nowrap
    }

    .btn:hover {
      background: #f6f8fb
    }

    .btn.p {
      background: var(--blue);
      border-color: var(--blue);
      color: #fff
    }

    .btn.p:hover {
      background: var(--blue-d)
    }

    .btn.g {
      background: var(--green);
      border-color: var(--green);
      color: #fff
    }

    .btn.wa {
      background: #25D366;
      border-color: #25D366;
      color: #fff
    }

    .btn.sm {
      padding: 4px 9px;
      font-size: 12.5px
    }

    .btn:disabled,
    .btn.is-loading {
      opacity: .7;
      cursor: not-allowed;
      pointer-events: none
    }

    .spin {
      width: 14px;
      height: 14px;
      border: 2px solid currentColor;
      border-right-color: transparent;
      border-radius: 50%;
      display: inline-block;
      flex: 0 0 auto;
      animation: spin .6s linear infinite
    }

    @keyframes spin {
      to { transform: rotate(360deg) }
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 5px;
      margin-bottom: 12px
    }

    .field label {
      font-size: 12.5px;
      font-weight: 600;
      color: #344054
    }

    input[type=text],
    input[type=number],
    input[type=date],
    input[type=search],
    select,
    textarea {
      border: 1px solid #d0d5dd;
      border-radius: 8px;
      padding: 8px 10px;
      background: #fff;
      width: 100%
    }

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

    .filters {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center
    }

    .filters select,
    .filters input {
      width: auto;
      min-width: 140px
    }

    .filters select.qtypick {
      min-width: 0;
      width: auto;
      padding: 4px 8px;
      font-size: 12px;
      border-radius: 8px
    }

    .tabs {
      display: flex;
      gap: 4px;
      flex-wrap: wrap
    }

    .tabs button {
      border: 1px solid var(--line);
      background: #fff;
      padding: 6px 12px;
      border-radius: 20px;
      cursor: pointer;
      font-size: 12.5px
    }

    .tabs button.on {
      background: var(--blue);
      color: #fff;
      border-color: var(--blue)
    }

    .muted {
      color: var(--muted)
    }

    .small {
      font-size: 12px
    }

    .bar {
      height: 8px;
      background: #eef1f5;
      border-radius: 5px;
      overflow: hidden
    }

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

    .hbars .row {
      display: grid;
      grid-template-columns: 170px 1fr 50px;
      gap: 10px;
      align-items: center;
      padding: 5px 0;
      font-size: 12.5px
    }

    .hbars .row .bar {
      height: 14px
    }

    .hbars .row .nm {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap
    }

    .thumb {
      width: 40px;
      height: 52px;
      object-fit: cover;
      border-radius: 4px;
      border: 1px solid var(--line);
      cursor: zoom-in;
      background: #fff
    }

    .low {
      background: var(--red-l);
      color: var(--red);
      font-weight: 600
    }

    .mid {
      background: var(--amber-l);
      color: var(--amber)
    }

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

    /* order form */
    .lines .ln {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 120px 40px;
      gap: 8px;
      align-items: center;
      margin-bottom: 8px
    }

    .lines .ln select,
    .lines .ln input {
      height: 38px
    }

    .lines .stock {
      margin: -2px 0 8px;
      font-size: 12.5px
    }

    .icon-btn {
      border: 0;
      background: none;
      cursor: pointer;
      color: var(--muted);
      padding: 6px;
      border-radius: 6px
    }

    .icon-btn:hover {
      background: #f1f3f6;
      color: var(--red)
    }

    .avail {
      font-size: 12px
    }

    /* modal */
    .ov {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, .45);
      display: none;
      align-items: flex-start;
      justify-content: center;
      z-index: 50;
      padding: 40px 16px;
      overflow: auto
    }

    .ov.on {
      display: flex
    }

    .modal {
      background: #fff;
      border-radius: 12px;
      width: min(1080px, 100%);
      box-shadow: 0 20px 50px rgba(0, 0, 0, .25)
    }

    .modal .mh {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 16px 20px;
      border-bottom: 1px solid var(--line)
    }

    .modal .mh h2 {
      margin: 0;
      font-size: 17px;
      flex: 1
    }

    .modal .mb {
      padding: 20px;
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
      gap: 20px
    }

    .modal .mb > * {
      min-width: 0
    }

    .modal .mb.one {
      grid-template-columns: minmax(0, 1fr)
    }

    .kv {
      display: grid;
      grid-template-columns: 130px 1fr;
      gap: 6px 12px;
      font-size: 13px;
      margin-bottom: 14px
    }

    .kv dt {
      color: var(--muted)
    }

    .kv dd {
      margin: 0;
      font-weight: 500
    }

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

    .tl li {
      position: relative;
      padding: 0 0 16px 28px
    }

    .tl li:before {
      content: "";
      position: absolute;
      left: 8px;
      top: 18px;
      bottom: 0;
      width: 2px;
      background: var(--line)
    }

    .tl li:last-child:before {
      display: none
    }

    .tl .dot {
      position: absolute;
      left: 0;
      top: 2px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      border: 2px solid #cfd6df;
      background: #fff
    }

    .tl li.done .dot {
      background: var(--green);
      border-color: var(--green)
    }

    .tl li.done .dot:after {
      content: "";
      position: absolute;
      left: 5px;
      top: 2px;
      width: 4px;
      height: 8px;
      border: solid #fff;
      border-width: 0 2px 2px 0;
      transform: rotate(45deg)
    }

    .tl li.cur .dot {
      border-color: var(--blue);
      box-shadow: 0 0 0 4px var(--blue-l)
    }

    .tl b {
      display: block;
      font-size: 13px
    }

    .tl span {
      font-size: 12px;
      color: var(--muted)
    }

    /* whatsapp */
    .wa {
      background: #efeae2;
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid var(--line);
      min-width: 0;
      max-width: 100%
    }

    .wa .wh {
      background: #075E54;
      color: #fff;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 13px
    }

    .wa .wh .av {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: #fff;
      display: grid;
      place-items: center
    }

    .wa .wh .av img {
      width: 26px;
      height: 26px
    }

    .wa .wb {
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 420px;
      overflow: auto;
      min-height: 160px
    }

    .msg {
      max-width: min(85%, 100%);
      padding: 7px 10px 16px;
      border-radius: 8px;
      font-size: 12.5px;
      position: relative;
      box-shadow: 0 1px .5px rgba(0, 0, 0, .13);
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      word-break: break-word
    }

    .otp-pop {
      display: block;
      margin-top: 8px;
      padding: 12px 8px;
      border-radius: 12px;
      background: #fff4cc;
      border: 2px solid #e6a700;
      text-align: center;
      box-shadow: 0 0 0 4px rgba(230, 167, 0, .28);
      animation: otpPulse 1.1s ease-in-out 3
    }

    .otp-pop b {
      display: block;
      line-height: 1.25
    }

    .otp-pop b:nth-of-type(2) {
      font-size: 30px;
      letter-spacing: 3px;
      margin: 6px 0
    }

    @keyframes otpPulse {

      0%,
      100% {
        transform: scale(1)
      }

      50% {
        transform: scale(1.05)
      }
    }

    .msg.in {
      background: #fff;
      align-self: flex-start
    }

    .msg.out {
      background: #d9fdd3;
      align-self: flex-end
    }

    .msg .t {
      position: absolute;
      right: 8px;
      bottom: 2px;
      font-size: 10px;
      color: #667
    }

    .msg img {
      max-width: 180px;
      border-radius: 6px;
      display: block;
      margin-bottom: 4px
    }

    .msg .qr {
      display: block;
      margin-top: 8px;
      border-top: 1px solid #e5e5e5;
      padding-top: 6px;
      text-align: center;
      color: #0a7cff;
      font-weight: 600
    }

    .msg .maplink {
      display: inline-flex;
      align-items: center;
      margin-top: 8px;
      padding: 4px 8px;
      border-radius: 6px;
      background: #e7f3ff;
      color: #027eb5;
      font-weight: 600;
      text-decoration: none;
      overflow-wrap: normal;
      word-break: normal
    }

    .wa .wf {
      padding: 10px;
      background: #f0f2f5;
      display: flex;
      gap: 8px;
      flex-wrap: wrap
    }

    .note {
      background: var(--yellow-l);
      border: 1px solid #f1dc6b;
      color: #6b5500;
      border-radius: 8px;
      padding: 9px 12px;
      font-size: 12.5px;
      margin-bottom: 12px
    }

    .toast {
      position: fixed;
      bottom: 22px;
      right: 22px;
      background: #12263f;
      color: #fff;
      padding: 11px 16px;
      border-radius: 10px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
      z-index: 80;
      font-size: 13px;
      transform: translateY(120%);
      transition: transform .25s
    }

    .toast.on {
      transform: none
    }

    .lightbox img {
      max-width: 100%;
      max-height: 80vh;
      display: block;
      margin: auto
    }

    .rider-card {
      display: flex;
      gap: 12px;
      align-items: center;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 10px
    }

    .rider-card .av {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--blue-l);
      color: var(--blue);
      display: grid;
      place-items: center;
      font-weight: 700
    }

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

    .sectitle h2 {
      margin: 0;
      font-size: 16px;
      flex: 1
    }

    .hide {
      display: none !important
    }

    .gallery {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
      gap: 12px
    }

    .ph {
      border: 1px solid var(--line);
      border-radius: 10px;
      overflow: hidden;
      background: #fff
    }

    .ph img {
      width: 100%;
      height: 190px;
      object-fit: cover;
      object-position: top;
      display: block;
      cursor: zoom-in;
      background: #f4f6f9;
      border-bottom: 1px solid var(--line)
    }

    .ph .pc {
      padding: 8px 10px
    }

    .ph .lock {
      margin-left: auto;
      font-size: 12px;
      opacity: .6
    }

    @media (max-width:1100px) {
      .kpis {
        grid-template-columns: repeat(3, 1fr)
      }

      .g21,
      .g12,
      .g2,
      .g3 {
        grid-template-columns: 1fr
      }

      .modal .mb {
        grid-template-columns: minmax(0, 1fr)
      }
    }

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

      .side {
        position: fixed;
        left: 0;
        top: 0;
        width: 250px;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform .2s
      }

      .side.open {
        transform: none
      }

      .menu-btn {
        display: block
      }

      .content {
        padding: 16px
      }

      .top {
        padding: 12px 16px;
        flex-wrap: wrap
      }

      .kpis {
        grid-template-columns: 1fr 1fr
      }

      .lines .ln {
        grid-template-columns: minmax(0, 1fr) 90px 36px
      }

      .lines .ln .avail {
        grid-column: 1/-1;
        order: 5
      }

      .hbars .row {
        grid-template-columns: 110px 1fr 40px
      }

      .role {
        width: 100%
      }
    }

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

    .login-card {
      width: min(420px, 100%);
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 12px;
      box-shadow: var(--shadow);
      padding: 28px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .login-card img {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      background: #fff;
    }

    .login-card h1 {
      margin: 8px 0 0;
      font-size: 20px;
    }

    .login-card label {
      margin-top: 8px;
      font-size: 12.5px;
      font-weight: 600;
    }

    .login-card input {
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
    }

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

    #login[hidden],
    #app[hidden] {
      display: none !important;
    }

    .wa-link {
      display: flex;
      gap: 16px;
      align-items: center;
      margin: 0 0 14px;
      padding: 12px 14px;
      background: var(--yellow-l);
      border: 1px solid #ead56a;
      border-radius: var(--radius);
    }

    .wa-link[hidden] {
      display: none;
    }

    .wa-link img {
      width: 180px;
      height: 180px;
      background: #fff;
    }
