﻿:root {
  --navy: #071d3b;
  --ink: #08172b;
  --muted: #617187;
  --line: #dce6ef;
  --blue: #0f72e5;
  --teal: #089b94;
  --green: #12a66b;
  --orange: #ff9f1f;
  --red: #ef4657;
  --purple: #7162ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eef3f8; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(15, 114, 229, .28); outline-offset: 2px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #f1f8ff;
  background:
    radial-gradient(circle at 15% 0%, rgba(47, 188, 255, .28), transparent 28%),
    linear-gradient(180deg, #0a315f, #061e3f 62%, #03142c);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 8px; }
.brand-mark {
  width: 43px;
  height: 43px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #062144;
  background: linear-gradient(135deg, #25d4ff, #38f0bc);
  font-size: 24px;
  font-weight: 950;
}
.brand strong { font-size: 30px; letter-spacing: 0; }

.company-select {
  border: 1px solid rgba(226, 241, 255, .22);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, .055);
}
.company-select span { font-size: 13px; font-weight: 780; }
.company-select select { width: 100%; color: #d9eaff; background: transparent; border: 0; outline: 0; }

.nav { display: grid; gap: 7px; }
.nav-item, .sub-nav {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #eaf5ff;
  background: transparent;
  font-weight: 730;
  text-align: left;
}
.nav-item i {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(213, 232, 248, .45);
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #9fd7e5;
  font-size: 10px;
  font-style: normal;
}
.nav-item b {
  margin-left: auto;
  min-width: 30px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--blue);
  font-size: 12px;
}
.nav-item.active, .nav-item:hover {
  background: linear-gradient(135deg, rgba(15, 114, 229, .98), rgba(8, 83, 154, .94));
}
.sub-nav {
  margin-left: 42px;
  min-height: 30px;
  color: #bdd0e6;
  border-left: 1px solid rgba(220, 236, 255, .24);
}
.sub-nav.active { color: #27d9c6; }

.summary-card, .user-card {
  border: 1px solid rgba(226, 241, 255, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}
.summary-card { margin-top: auto; padding: 16px; }
.summary-card p { margin: 0 0 8px; }
.summary-card strong { display: block; font-size: 28px; }
.summary-card small { color: #d8eaff; }
.spark {
  height: 58px;
  margin: 10px 0;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent, rgba(15, 114, 229, .25)),
    repeating-linear-gradient(135deg, #28cfff 0 3px, transparent 3px 22px);
}
.target { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.target i { display: block; height: 100%; background: linear-gradient(90deg, #20c8ff, #37e09e); }
.summary-card button {
  width: 100%;
  height: 40px;
  margin-top: 14px;
  border: 1px solid #2ab8f4;
  border-radius: 8px;
  color: #e8f7ff;
  background: transparent;
}
.user-card { display: flex; gap: 12px; align-items: center; padding: 12px; }
.user-card span {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #062045;
  background: #d8eaff;
  font-weight: 850;
}
.user-card small { display: block; color: #bdd0e6; }

.workspace-shell { min-width: 0; overflow-x: auto; }
.topbar {
  min-height: 76px;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  position: sticky;
  top: 0;
  z-index: 20;
}
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-badge { border: 1px solid rgba(15, 114, 229, .22); border-radius: 999px; padding: 5px 10px; color: #075bb8; background: #e8f2ff; font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.demo-strip { margin: 14px 24px 0; border: 1px solid rgba(15, 114, 229, .2); border-radius: 8px; padding: 12px 14px; color: #07487f; background: linear-gradient(135deg, #e8f2ff, #f8fbff); font-weight: 750; }
.topbar h1 { margin: 0; font-size: 24px; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.top-select { margin-left: auto; }
.top-select select, .date-btn, .icon-btn {
  height: 42px;
  border: 1px solid #cbd8e5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.top-select select { min-width: 190px; padding: 0 12px; }
.date-btn { padding: 0 18px; }
.icon-btn { width: 42px; font-weight: 850; }
.alert { color: var(--red); }

.view { display: none; padding: 20px 24px; }
.view.active { display: block; }
.panel, .kpi-card, .quick-actions, .flow-section, .metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 14px 32px rgba(25, 46, 72, .06);
}
.panel { padding: 16px; min-width: 0; }
.panel h2 { margin: 0 0 14px; font-size: 16px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 14px; }
.kpi-card { min-height: 118px; padding: 20px; display: flex; align-items: center; gap: 16px; }
.kpi-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 950;
  font-size: 22px;
}
.blue { background: linear-gradient(135deg, #1786ff, #045fd0); }
.green { background: linear-gradient(135deg, #33c388, #078a5b); }
.teal { background: linear-gradient(135deg, #21c7c0, #058a84); }
.orange { background: linear-gradient(135deg, #ffb43f, #ff8b00); }
.red { background: linear-gradient(135deg, #ff7d88, #ff4658); }
.kpi-card p { margin: 0; color: var(--muted); font-weight: 760; }
.kpi-card strong { display: block; margin: 3px 0; color: var(--ink); font-size: 29px; }
.kpi-card small { color: var(--green); }

.quick-actions {
  min-height: 78px;
  margin: 14px 0;
  padding: 16px;
  display: grid;
  grid-template-columns: 150px repeat(5, 1fr);
  gap: 12px;
  align-items: center;
}
.quick-actions h2 { margin: 0; font-size: 16px; }
.quick-actions button {
  height: 50px;
  border: 1px solid rgba(15, 116, 232, .35);
  border-radius: 8px;
  color: #066bd4;
  background: #f7fbff;
  font-weight: 850;
}
.quick-actions button:nth-child(3), .quick-actions button:nth-child(5) {
  color: #087545;
  border-color: rgba(19, 168, 109, .34);
  background: #f6fffb;
}
.quick-actions button:nth-child(4) {
  color: #6d35c9;
  border-color: rgba(123, 97, 255, .35);
  background: #fbf8ff;
}

.dashboard-grid { display: grid; grid-template-columns: 1.12fr .95fr 1.25fr; gap: 14px; }
.calendar-panel, .requests-panel { grid-column: span 2; }
.route-layout { display: grid; grid-template-columns: 270px 1fr; gap: 16px; }
.route-layout ol { margin: 0; padding-left: 28px; border-left: 2px dashed #bdd1e5; }
.route-layout li { margin-bottom: 14px; }
.route-layout b, .route-layout small { display: block; }
.route-layout b { color: var(--blue); }
.route-layout small { color: var(--muted); }
.route-map {
  min-height: 240px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, #e7edf4 0 2px, transparent 2px 28px),
    repeating-linear-gradient(90deg, #e7edf4 0 2px, transparent 2px 34px),
    #f7fafc;
}
.route-map svg { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
.route-map path { fill: none; stroke: #0876e8; stroke-width: 7; stroke-linecap: round; }
.pin {
  position: absolute;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}
.p1 { left: 52%; top: 11%; }
.p2 { right: 12%; top: 45%; }
.p3 { left: 35%; bottom: 16%; }
.p4 { right: 23%; bottom: 12%; }
.link-btn { width: 100%; height: 36px; border: 0; margin-top: 10px; color: var(--blue); background: transparent; font-weight: 780; }

.fleet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.fleet-grid button, .payment-grid button {
  min-height: 91px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  background: #fff;
}
.fleet-grid strong, .fleet-grid span, .fleet-grid em { display: block; }
.fleet-grid span { margin: 5px 0 10px; color: var(--muted); font-size: 12px; }
.fleet-grid em { width: fit-content; padding: 4px 8px; border-radius: 7px; font-style: normal; font-size: 11px; }

.funnel { display: grid; gap: 3px; padding: 14px 20px; }
.funnel i { height: 42px; background: linear-gradient(135deg, #1786ff, #045fd0); clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); }
.funnel i:nth-child(2) { margin: 0 18px; background: linear-gradient(135deg, #20c8d8, #07a899); }
.funnel i:nth-child(3) { margin: 0 36px; background: linear-gradient(135deg, #8176ff, #665bdc); }
.funnel i:nth-child(4) { margin: 0 54px; background: linear-gradient(135deg, #ffb43f, #ff8b00); }
.funnel i:nth-child(5) { margin: 0 72px; background: linear-gradient(135deg, #33c388, #078a5b); }
.funnel-panel p { display: flex; justify-content: space-between; margin: 8px 0; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 10px 8px; border-bottom: 1px solid #ebf1f6; text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 740; }
.tag { padding: 4px 8px; border-radius: 7px; font-size: 11px; white-space: nowrap; }
.green-tag { color: #087545; background: #dff8e9; }
.blue-tag { color: #0a5fca; background: #e2efff; }
.orange-tag { color: #b45700; background: #fff0df; }
.red-tag { color: #d82929; background: #ffe5e5; }
.green-text { color: #087545; }
.payment-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.payment-grid small, .payment-grid span { display: block; color: var(--muted); }
.payment-grid strong { display: block; margin: 7px 0; font-size: 22px; }
.revenue-panel svg { width: 100%; height: 150px; }
.revenue-panel polyline { fill: none; stroke: var(--blue); stroke-width: 4; }
.revenue-panel polygon { fill: rgba(15, 114, 229, .12); }
.revenue-panel strong { display: block; color: var(--blue); font-size: 18px; }

.moving-layout { display: grid; grid-template-columns: 330px minmax(760px, 1fr) 390px; gap: 14px; }
.request-list-panel, .quote-main, .operation-side { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.request-list-panel { padding: 14px; }
.request-list-panel h2 { margin: 0 0 14px; }
.search-box {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  overflow: hidden;
}
.search-box input { border: 0; outline: 0; padding-left: 12px; }
.search-box span { height: 100%; display: grid; place-items: center; color: var(--muted); border-left: 1px solid var(--line); font-size: 12px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.filter-grid button { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #53657c; }
.filter-grid .active { color: #087545; border-color: #8bd8bd; background: #f4fffb; }
.request-list { display: grid; gap: 9px; }
.request-card {
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  background: #fff;
  text-align: left;
}
.request-card.active { border-color: var(--blue); background: #f3f8ff; }
.request-card span, .request-card small, .request-card b { grid-column: 1 / -1; }
.request-card span { font-size: 17px; font-weight: 800; }
.request-card small, .request-card b { color: var(--muted); font-weight: 500; }
.request-card em { padding: 4px 8px; border-radius: 7px; color: #b45700; background: #fff0df; font-style: normal; font-size: 11px; }
.request-card .green-status { color: #087545; background: #dff8e9; }
.request-card .blue-status { color: #0a5fca; background: #e2efff; }
.request-card .red-status { color: #d82929; background: #ffe5e5; }
.new-request { width: 100%; height: 54px; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #334155; }

.quote-head {
  min-height: 82px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.quote-head h1 { margin: 0; font-size: 30px; }
.quote-head small { color: var(--muted); }
.quote-head button { margin-left: auto; height: 42px; border: 1px solid #ccd8e5; border-radius: 8px; background: #fff; padding: 0 16px; }
.quote-head button + button { margin-left: 0; }
.green-btn { color: #fff !important; border: 0 !important; background: var(--green) !important; }
.blue-btn { color: #fff !important; border: 0 !important; background: var(--blue) !important; }
.quote-grid { padding: 14px; display: grid; grid-template-columns: .8fr .95fr 1.1fr; gap: 12px; }
.info-card p, .team-card p, .quote-summary p { color: var(--muted); margin: 11px 0; }
.info-card b, .team-card strong { display: block; color: var(--ink); margin-top: 4px; }
.address-pair { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.address-pair div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfdff; }
.address-pair small, .address-pair span { display: block; color: var(--muted); }
.address-pair strong { display: block; margin: 6px 0; }
.mini-map {
  height: 164px;
  border-radius: 8px;
  margin-top: 14px;
  position: relative;
  background: repeating-linear-gradient(35deg, #e5ebf1 0 3px, transparent 3px 24px), #f5f8fb;
}
.mini-map:after { content: ""; position: absolute; left: 23%; right: 23%; top: 50%; height: 4px; border-radius: 999px; background: var(--blue); }
.mini-map span {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  transform: translateY(-50%);
  font-weight: 900;
}
.mini-map span:first-child { left: 18%; }
.mini-map span:last-child { right: 18%; background: var(--green); }
.inventory-card table { margin-top: 4px; }
.volume-total, .quote-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
}
.volume-total strong, .quote-total strong { color: var(--blue); font-size: 22px; }
.quote-table { grid-column: 1 / -1; }
.quote-total button { border: 0; color: var(--blue); background: transparent; font-weight: 800; }
.operation-side { padding: 12px; display: grid; gap: 12px; align-content: start; }
.chat { min-height: 250px; padding: 18px; border-radius: 8px; background: #f5efe9; }
.chat p { width: fit-content; max-width: 86%; padding: 12px 14px; border-radius: 8px; line-height: 1.45; background: #fff; }
.chat small { display: block; margin-top: 8px; color: var(--muted); text-align: right; }
.outgoing { margin-left: auto; background: #dcf8c6 !important; }
.team-card span, .team-card small { display: block; color: var(--muted); }
.quote-summary p { display: flex; justify-content: space-between; }
.quote-summary b { color: var(--ink); }
.quote-summary p:first-of-type b { color: var(--blue); font-size: 22px; }
.quote-summary button {
  width: 100%;
  height: 52px;
  border: 1px solid #ffc174;
  border-radius: 8px;
  color: #b45700;
  background: #fffaf2;
  font-weight: 850;
}
.notes-card label { display: block; margin: 13px 0; color: #334155; }

.automation-layout { display: grid; grid-template-columns: minmax(900px, 1fr) 390px; gap: 14px; }
.flow-section { padding: 14px; }
.rule-head { min-height: 64px; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
.rule-head div { margin-right: auto; }
.rule-head h1 { margin: 0 0 8px; font-size: 20px; }
.rule-head h2 { margin: 0; font-size: 17px; }
.rule-head h2 span { margin-left: 12px; padding: 4px 10px; border-radius: 999px; color: var(--green); background: #dff8e9; font-size: 12px; }
.rule-head button { height: 38px; min-width: 92px; border: 1px solid #ccd8e5; border-radius: 8px; background: #fff; }
.publish-btn { color: #fff !important; border: 0 !important; background: linear-gradient(135deg, #0bb58a, #079c8f) !important; }
.flow-canvas {
  height: 640px;
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(#dce7ef 1px, transparent 1px);
  background-size: 14px 14px;
}
.flow-canvas:before { content: ""; position: absolute; left: 178px; right: 190px; top: 112px; height: 2px; background: #0b2447; }
.flow-canvas:after { content: ""; position: absolute; left: 100px; right: 200px; top: 392px; height: 2px; background: #0b2447; }
.toolbox {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 42px;
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  z-index: 2;
}
.toolbox button { height: 30px; border: 0; background: transparent; font-size: 10px; }
.node {
  position: absolute;
  min-width: 142px;
  min-height: 62px;
  border: 1px solid #91d8bd;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  place-items: center;
  background: #f8fffc;
  color: #172033;
  font-weight: 780;
  text-align: center;
  box-shadow: 0 10px 24px rgba(14, 42, 70, .06);
}
.node.blue { border-color: #7eb6f4; background: #f4f9ff; }
.node.purple { border-color: #b5a4f5; background: #fbf8ff; }
.node.green { border-color: #8bd8bd; background: #f6fffb; }
.node.orange { border-color: #ffc174; background: #fffaf2; }
.node.red { border-color: #ff9d9d; background: #fff8f8; }
.decision {
  min-width: 88px;
  min-height: 88px;
  transform: rotate(45deg);
  border-color: #ffa826;
  color: #d77100;
  background: #fffaf0;
}
.decision span { transform: rotate(-45deg); display: block; }
.decision:hover { transform: rotate(45deg) translateY(-2px); }
.n1 { left: 80px; top: 80px; }
.n2 { left: 260px; top: 80px; }
.n3 { left: 440px; top: 80px; }
.d1 { left: 625px; top: 68px; }
.n4 { left: 780px; top: 80px; }
.n5 { right: 70px; top: 80px; }
.n6 { left: 520px; top: 220px; }
.n7 { right: 70px; top: 205px; }
.n8 { right: 70px; top: 320px; }
.n9 { right: 270px; top: 360px; }
.n10 { right: 470px; top: 360px; }
.n11 { left: 320px; top: 360px; }
.n12 { left: 80px; top: 500px; }
.n13 { left: 430px; top: 500px; }
.n14 { left: 660px; top: 500px; }
.automation-side { display: grid; gap: 12px; align-content: start; }
.preview-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: #334155;
  background: #dcf8c6;
  line-height: 1.45;
}
.preview-message small { display: block; margin-top: 8px; color: var(--muted); text-align: right; }
.pdf-card { display: grid; gap: 12px; background: #fbfdff; }
.pdf-card b { color: var(--blue); font-size: 26px; }
.pdf-card button, .warning-card button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 820;
}
.variables p {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid #edf2f7;
  color: var(--teal);
  font-weight: 850;
}
.variables span { color: var(--muted); font-weight: 500; }
.failed-wa h2 b {
  float: right;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--red);
  background: #ffe2e2;
  font-size: 12px;
}
.automation-bottom { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 180px) 1.2fr 1fr; gap: 12px; }
.metric-card { min-height: 118px; padding: 16px; }
.metric-card small, .metric-card span { color: var(--muted); }
.metric-card strong { display: block; margin: 10px 0; font-size: 30px; }
.warning-card p { color: var(--muted); line-height: 1.45; }

.selected { outline: 2px solid rgba(15, 116, 232, .34) !important; outline-offset: -2px; }
tbody tr, .kpi-card, .node, .metric-card, .fleet-grid button { cursor: pointer; }
tbody tr:hover, .kpi-card:hover, .node:hover, .metric-card:hover, .request-card:hover, .fleet-grid button:hover {
  outline: 2px solid rgba(8, 168, 153, .22);
  outline-offset: -2px;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  background: #061f3f;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: .2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1350px) {
  .app-shell { grid-template-columns: 230px 1fr; }
  .kpi-grid, .dashboard-grid, .moving-layout, .automation-layout, .automation-bottom { grid-template-columns: 1fr; }
  .calendar-panel, .requests-panel, .quote-table { grid-column: auto; }
  .flow-canvas { min-width: 1120px; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .topbar { flex-wrap: wrap; }
  .top-select { margin-left: 0; width: 100%; }
  .top-select select { width: 100%; }
  .quick-actions, .quote-grid, .filter-grid, .payment-grid, .route-layout, .address-pair, .fleet-grid { grid-template-columns: 1fr; }
}
