﻿:root {
  --dark: #101827;
  --dark-2: #19263b;
  --dark-line: #2c3e59;
  --ink: #162033;
  --muted: #6e7a8d;
  --line: #dde4ef;
  --soft: #f4f6fa;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --cyan: #06b6d4;
  --cyan-soft: #e8fbff;
  --green: #16a34a;
  --green-soft: #eafbf1;
  --amber: #f59e0b;
  --amber-soft: #fff5db;
  --red: #dc2626;
  --red-soft: #feecec;
  --violet: #7c3aed;
  --violet-soft: #f3eeff;
  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: var(--soft); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 286px minmax(0, 1fr); }
.sidebar {
  min-height: 100vh;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: #fff;
  background: var(--dark);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--blue);
}
.brand-mark span {
  width: 34px;
  height: 38px;
  display: block;
  background: var(--dark);
  clip-path: polygon(50% 0, 88% 18%, 88% 50%, 50% 100%, 12% 50%, 12% 18%);
}
.brand-mark::after {
  content: "";
  width: 16px;
  height: 8px;
  border-left: 4px solid var(--blue);
  border-bottom: 4px solid var(--blue);
  position: absolute;
  transform: rotate(-45deg);
}
.brand strong { display: block; font-size: 30px; line-height: 1; }
.brand small { display: block; margin-top: 8px; color: #9eadc5; }

.company-card, .side-metric { border: 1px solid var(--dark-line); border-radius: 8px; background: var(--dark-2); }
.company-card { min-height: 62px; padding: 12px 18px; color: #fff; text-align: left; }
.company-card span { display: block; margin-top: 7px; color: #9eadc5; font-size: 12px; }

.nav { display: grid; gap: 8px; }
.nav-item {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d7e1f0;
  background: transparent;
  font-weight: 760;
  text-align: left;
}
.nav-item i { color: #7c8da8; font-style: normal; }
.nav-item.active { min-height: 46px; color: #06111f; background: var(--blue); }
.nav-item.active i { color: #06111f; }

.side-metric { margin-top: auto; min-height: 158px; padding: 24px 20px 14px; }
.side-metric p { margin: 0 0 12px; color: #9eadc5; font-size: 13px; }
.side-metric strong { display: block; font-size: 34px; line-height: 1; }
.side-metric span { display: block; margin-top: 16px; color: #7dd3fc; font-size: 13px; font-weight: 800; }
.progress { height: 10px; margin-top: 18px; border-radius: 999px; overflow: hidden; background: var(--dark-line); }
.progress em { height: 100%; display: block; border-radius: inherit; background: var(--blue); }
.side-metric svg { width: 100%; height: 42px; margin-top: 8px; }
.side-metric path { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; }

.workspace { max-height: 100vh; overflow: auto; }
.topbar {
  min-height: 84px;
  padding: 18px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 26px; line-height: 1.1; }
.topbar p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-badge { border: 1px solid rgba(37, 99, 235, .28); border-radius: 999px; padding: 5px 10px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.demo-strip { margin: 14px 40px 0; border: 1px solid rgba(37, 99, 235, .22); border-radius: 8px; padding: 12px 14px; color: #1d4ed8; background: linear-gradient(135deg, var(--blue-soft), #f8fbff); font-weight: 760; }
.select-btn, .notice-btn, .panel-heading button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 20px;
  color: var(--ink);
  background: #f8fafd;
  font-weight: 760;
}
.notice-btn {
  width: 40px;
  padding: 0;
  border-radius: 50%;
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecaca;
  font-weight: 900;
}

.view { display: none; padding: 32px 40px 48px; }
.view.active { display: block; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 20px; }
.kpi-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  display: flex;
  gap: 20px;
  background: #fff;
}
.kpi-card span {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 900;
}
.kpi-card p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 760; }
.kpi-card strong { display: block; margin-top: 10px; color: var(--ink); font-size: 34px; line-height: 1; }
.kpi-card small { display: block; margin-top: 10px; font-size: 12px; }
.blue-icon { color: var(--blue); background: var(--blue-soft); }
.green-icon { color: var(--green); background: var(--green-soft); }
.cyan-icon { color: var(--cyan); background: var(--cyan-soft); }
.red-icon { color: var(--red); background: var(--red-soft); }
.amber-icon { color: var(--amber); background: var(--amber-soft); }

.dashboard-grid { margin-top: 34px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .65fr); gap: 28px; }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 28px; background: #fff; }
.panel h2 { margin: 0; font-size: 20px; }
.panel p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }

.location-panel, .flow-panel { min-height: 322px; }
.location-grid { margin-top: 30px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.location-tile {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  text-align: left;
  background: #f8fafd;
}
.location-tile b { color: var(--ink); font-size: 14px; }
.location-tile small { color: var(--muted); font-size: 12px; font-weight: 700; }
.location-tile span, .tag {
  width: max-content;
  min-height: 30px;
  border-radius: 999px;
  padding: 8px 14px;
  grid-row: 1 / 3;
  grid-column: 2;
  font-size: 12px;
  font-weight: 800;
  background: color-mix(in srgb, currentColor 14%, #fff);
}
.location-tile em, .progress-row div {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  grid-column: 1 / -1;
  background: #e6ecf5;
}
.location-tile em i, .progress-row i { height: 100%; display: block; border-radius: inherit; background: currentColor; }
.blue { color: var(--blue); }
.cyan { color: var(--cyan); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.red { color: var(--red); }
.violet { color: var(--violet); }

.flow-panel { display: grid; align-content: start; gap: 12px; }
.flow-panel h2 { margin-bottom: 16px; }
.flow-panel button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: #f8fafd;
}
.flow-panel b { color: var(--blue); }
.flow-panel span { font-size: 13px; font-weight: 760; }
.flow-panel em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 800; }
.flow-panel button:nth-of-type(2) em, .flow-panel button:nth-of-type(3) em { color: var(--red); }

.coverage-panel, .revenue-panel { min-height: 292px; }
.progress-row {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 166px minmax(120px, 1fr) 48px;
  align-items: center;
  gap: 16px;
}
.progress-row span { font-size: 14px; font-weight: 780; }
.progress-row b { color: var(--muted); font-size: 13px; }
.blue-tag { color: var(--blue); background: var(--blue-soft); }
.revenue-panel svg { width: 100%; height: 160px; margin-top: 18px; overflow: visible; }
.revenue-panel polyline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.revenue-panel path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.revenue-footer { display: flex; align-items: baseline; gap: 32px; }
.revenue-footer strong { font-size: 30px; }
.revenue-footer span { color: var(--muted); font-weight: 760; }

.shift-layout, .automation-layout { display: grid; grid-template-columns: 382px minmax(420px, 1fr) 284px; gap: 28px; }
.staff-list, .patrol-panel, .equipment-panel, .rule-panel, .payroll-panel, .whatsapp-panel { min-height: 792px; }
.staff-list input {
  width: 100%;
  height: 42px;
  margin: 24px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  outline: none;
  background: #f8fafd;
}
.staff-card, .rule-card {
  width: 100%;
  min-height: 92px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px 14px 74px;
  display: grid;
  position: relative;
  text-align: left;
  background: #fff;
}
.staff-card.active, .rule-card.active { background: var(--blue-soft); border-color: #bfdbfe; }
.staff-card i, .rule-card i {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: absolute;
  left: 20px;
  top: 20px;
  color: #fff;
  background: currentColor;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}
.rule-card i { font-size: 18px; }
.staff-card b, .rule-card b { color: var(--ink); font-size: 15px; }
.staff-card span, .rule-card span { margin-top: 6px; color: var(--muted); font-size: 13px; }
.staff-card em, .rule-card em { margin-top: 12px; font-style: normal; font-size: 13px; font-weight: 850; }

.patrol-badge {
  min-width: 66px;
  height: 44px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}
.route-card {
  min-height: 118px;
  margin-top: 30px;
  border-radius: 12px;
  padding: 28px 30px;
  position: relative;
  color: #fff;
  overflow: hidden;
  background: var(--dark);
}
.route-card::before {
  content: "";
  width: 84%;
  height: 54px;
  position: absolute;
  left: 30px;
  bottom: 20px;
  background:
    linear-gradient(135deg, transparent 0 18%, var(--cyan) 18% 22%, transparent 22% 38%, var(--cyan) 38% 42%, transparent 42% 62%, var(--cyan) 62% 66%, transparent 66%);
}
.route-card span, .route-card small { display: block; position: relative; z-index: 1; }
.route-card span { font-size: 16px; font-weight: 850; }
.route-card small { margin-top: 12px; color: #d7e1f0; font-size: 13px; }
.route-card b {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: absolute;
  right: 34px;
  top: 32px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 24px;
}
.checklist { margin-top: 28px; display: grid; gap: 18px; }
.check-row {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 18px;
  text-align: left;
  background: #fff;
}
.check-row i { width: 20px; height: 20px; border-radius: 5px; background: currentColor; }
.check-row span b, .check-row span small { display: block; color: var(--ink); }
.check-row span small { margin-top: 6px; color: var(--muted); font-size: 12px; }
.check-row em {
  min-height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  background: color-mix(in srgb, currentColor 14%, #fff);
}

.location-card {
  min-height: 72px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  background: #f8fafd;
}
.location-card.active { border-color: #bfdbfe; background: var(--blue-soft); }
.location-card b, .location-card span { display: block; }
.location-card span { margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.location-card em { grid-row: 1 / 3; grid-column: 2; align-self: end; color: var(--red); font-style: normal; font-weight: 900; }
.equipment-card {
  min-height: 150px;
  margin-top: 28px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 24px 20px;
  background: var(--blue-soft);
}
.equipment-card b, .equipment-card span, .equipment-card strong { display: block; }
.equipment-card b { color: var(--blue); font-size: 17px; }
.equipment-card span { margin-top: 12px; color: var(--muted); font-size: 13px; }
.equipment-card strong { margin-top: 20px; color: var(--blue); }
.completion-card {
  min-height: 92px;
  margin-top: 38px;
  border-radius: 12px;
  padding: 22px 20px;
  color: #fff;
  background: var(--dark);
}
.completion-card span, .completion-card strong { display: block; }
.completion-card span { color: #d7e1f0; }
.completion-card strong { margin-top: 12px; font-size: 34px; }

.rule-card { min-height: 96px; margin-top: 24px; border-radius: 12px; }
.payroll-panel .progress-row { margin-top: 34px; grid-template-columns: minmax(150px, 1fr) minmax(120px, 1fr) 48px; }
.report-card {
  min-height: 134px;
  margin-top: 70px;
  border-radius: 12px;
  padding: 28px 24px;
  color: #fff;
  background: var(--dark);
}
.report-card b, .report-card span, .report-card strong { display: block; }
.report-card b { font-size: 17px; }
.report-card span { margin-top: 12px; color: #d7e1f0; font-size: 13px; }
.report-card strong { margin-top: 22px; color: #7dd3fc; font-size: 13px; }

.phone { width: 228px; height: 500px; margin: 34px auto 0; border-radius: 28px; padding: 28px 16px; background: var(--dark); }
.phone-screen { height: 100%; border-radius: 20px; padding: 28px 18px; background: #eaf7ef; }
.phone-screen h3 { margin: 0 0 24px; color: #075e54; font-size: 14px; }
.bubble {
  width: 150px;
  min-height: 92px;
  margin-top: 26px;
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}
.bubble.outgoing { width: 120px; min-height: 70px; margin-left: auto; color: #075e54; background: #dcf8c6; font-weight: 800; }
.bubble.wide { width: 158px; min-height: 78px; }
.queue-card {
  min-height: 86px;
  margin-top: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 24px;
  background: var(--blue-soft);
}
.queue-card b, .queue-card span { display: block; }
.queue-card b { color: var(--blue); font-size: 15px; }
.queue-card span { margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.selected { outline: 3px solid rgba(37, 99, 235, .24); outline-offset: 2px; }

#toast {
  min-width: 260px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: 10px;
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 10;
  color: #fff;
  background: var(--dark);
  box-shadow: 0 20px 50px rgba(16, 24, 39, .24);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: .2s ease;
}
#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar { padding: 24px 18px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .dashboard-grid, .shift-layout, .automation-layout { grid-template-columns: 1fr; }
  .staff-list, .patrol-panel, .equipment-panel, .rule-panel, .payroll-panel, .whatsapp-panel { min-height: auto; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { min-height: auto; }
  .topbar { grid-template-columns: 1fr; position: static; }
  .view { padding: 22px; }
  .kpi-grid, .location-grid { grid-template-columns: 1fr; }
  .panel { padding: 22px; }
  .progress-row { grid-template-columns: 1fr; }
}
