﻿:root {
  --navy: #0b1726;
  --navy-2: #122238;
  --navy-line: #243955;
  --ink: #132033;
  --muted: #6d7b8e;
  --line: #dde6ef;
  --soft: #f4f7fa;
  --panel: #ffffff;
  --cyan: #06b6d4;
  --cyan-dark: #0e7490;
  --green: #16a34a;
  --blue: #2563eb;
  --red: #dc2626;
  --gold: #f59e0b;
  --purple: #7c3aed;
  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(6, 182, 212, .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(--navy);
}

.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(--cyan);
}
.brand-mark span {
  width: 26px;
  height: 22px;
  display: block;
  position: relative;
  background: var(--navy);
  clip-path: polygon(18% 100%, 82% 100%, 68% 0, 32% 0);
}
.brand-mark::after {
  content: "";
  width: 36px;
  height: 5px;
  border-radius: 999px;
  position: absolute;
  left: 7px;
  bottom: 11px;
  background: var(--navy);
}
.brand strong { display: block; font-size: 30px; line-height: 1; }
.brand small { display: block; margin-top: 8px; color: #9bb0c8; }

.company-card,
.side-metric {
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  background: var(--navy-2);
}
.company-card {
  min-height: 62px;
  padding: 12px 18px;
  color: #fff;
  text-align: left;
}
.company-card span { display: block; margin-top: 7px; color: #9bb0c8; font-size: 12px; }

.nav { display: grid; gap: 8px; }
.nav-item,
.sub-nav {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: #d4deea;
  background: transparent;
  font-weight: 760;
  text-align: left;
}
.nav-item i { color: #7f90a8; font-style: normal; }
.nav-item.active,
.sub-nav.active {
  min-height: 46px;
  color: #05131d;
  background: var(--cyan);
}
.nav-item.active i { color: #05131d; }
.sub-nav {
  margin-left: 36px;
  min-height: 32px;
  color: #93a4bc;
  font-size: 12px;
}

.side-metric {
  margin-top: auto;
  min-height: 158px;
  padding: 24px 20px 14px;
}
.side-metric p { margin: 0 0 12px; color: #9bb0c8; font-size: 13px; }
.side-metric strong { display: block; font-size: 34px; line-height: 1; }
.side-metric span { display: block; margin-top: 16px; color: #5eead4; font-size: 13px; font-weight: 800; }
.progress {
  height: 10px;
  margin-top: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--navy-line);
}
.progress em { height: 100%; display: block; border-radius: inherit; background: var(--cyan); }
.side-metric svg { width: 100%; height: 42px; margin-top: 8px; }
.side-metric path { fill: none; stroke: var(--gold); 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(6, 182, 212, .28); border-radius: 999px; padding: 5px 10px; color: var(--cyan-dark); background: #ecfeff; font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.demo-strip { margin: 14px 40px 0; border: 1px solid rgba(6, 182, 212, .24); border-radius: 8px; padding: 12px 14px; color: #0e7490; background: linear-gradient(135deg, #ecfeff, #f8feff); 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: #f8fafc;
  font-weight: 760;
}
.notice-btn {
  width: 40px;
  padding: 0;
  border-radius: 50%;
  color: var(--cyan-dark);
  background: #ecfeff;
  border-color: #a5f3fc;
  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: #eff6ff; }
.red-icon { color: var(--red); background: #fee2e2; }
.green-icon { color: var(--green); background: #ecfdf5; }
.gold-icon { color: var(--gold); background: #fef3c7; }
.purple-icon { color: var(--purple); background: #f5f3ff; }

.dashboard-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.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;
}
.risk-map-panel,
.action-panel { min-height: 320px; }
.risk-map {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.risk-tile {
  min-height: 166px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 22px;
  display: grid;
  align-content: start;
  gap: 16px;
  text-align: left;
  background: #f8fafc;
}
.risk-tile b { font-size: 15px; }
.risk-tile span,
.tag {
  width: max-content;
  min-height: 30px;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 800;
}
.risk-tile em,
.compliance-row div,
.flow-row div {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5eaf1;
}
.risk-tile em i,
.compliance-row i,
.flow-row i {
  height: 100%;
  display: block;
  border-radius: inherit;
}
.risk-tile small { font-size: 13px; font-weight: 800; }
.risk-tile.critical span { color: var(--red); background: #fee2e2; }
.risk-tile.critical em i { background: var(--red); }
.risk-tile.critical small { color: var(--red); }
.risk-tile.warning span { color: #b45309; background: #fef3c7; }
.risk-tile.warning em i { background: var(--gold); }
.risk-tile.warning small { color: #b45309; }
.risk-tile.safe span { color: var(--green); background: #dcfce7; }
.risk-tile.safe em i { background: var(--green); }
.risk-tile.safe small { color: var(--green); }

.action-list { margin-top: 28px; display: grid; gap: 12px; }
.action-list button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: #f8fafc;
}
.action-list b { color: var(--blue); }
.action-list span { font-size: 13px; font-weight: 760; }
.action-list em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 800; }
.action-list button:first-child em { color: var(--red); }

.compliance-panel,
.revenue-panel { min-height: 292px; }
.compliance-row,
.flow-row {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 170px minmax(120px, 1fr) 44px;
  align-items: center;
  gap: 16px;
}
.compliance-row span,
.flow-row span { font-size: 14px; font-weight: 780; }
.compliance-row b,
.flow-row b { color: var(--muted); font-size: 13px; }
.compliance-row:nth-of-type(1) i { background: var(--green); }
.compliance-row:nth-of-type(2) i { background: var(--cyan); }
.compliance-row:nth-of-type(3) i { background: var(--gold); }
.compliance-row:nth-of-type(4) i { background: var(--blue); }
.revenue-panel svg {
  width: 100%;
  height: 160px;
  margin-top: 18px;
  overflow: visible;
}
.revenue-panel polyline {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.revenue-panel path {
  fill: none;
  stroke: var(--gold);
  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; }
.cyan-tag { color: var(--cyan-dark); background: #ecfeff; }

.audit-layout,
.automation-layout {
  display: grid;
  grid-template-columns: 382px minmax(420px, 1fr) 284px;
  gap: 28px;
}
.firm-list,
.inspection-panel,
.side-action,
.employee-panel,
.document-panel,
.whatsapp-panel { min-height: 792px; }
.firm-list input {
  width: 100%;
  height: 42px;
  margin: 24px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  outline: none;
  background: #f8fafc;
}
.firm-card {
  width: 100%;
  min-height: 92px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px 14px 70px;
  display: grid;
  position: relative;
  text-align: left;
  background: #fff;
}
.firm-card.active { background: #ecfeff; border-color: #67e8f9; }
.firm-card i {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: absolute;
  left: 20px;
  top: 18px;
  color: #fff;
  background: var(--red);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.firm-card.warning i { background: var(--gold); }
.firm-card.safe i { background: var(--green); }
.firm-card b { font-size: 15px; }
.firm-card span { margin-top: 6px; color: var(--muted); font-size: 13px; }
.firm-card em {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: currentColor;
}
.firm-card.critical { color: var(--red); }
.firm-card.warning { color: var(--gold); }
.firm-card.safe { color: var(--green); }
.firm-card b,
.firm-card span { color: var(--ink); }
.firm-card span { color: var(--muted); }

.score-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 18px;
  font-weight: 900;
}
.photo-proof {
  min-height: 118px;
  margin-top: 30px;
  border-radius: 10px;
  padding: 28px 30px;
  position: relative;
  color: #fff;
  overflow: hidden;
  background: #0f172a;
}
.photo-proof::before {
  content: "";
  width: 72%;
  height: 54px;
  position: absolute;
  left: 30px;
  bottom: 22px;
  background:
    linear-gradient(135deg, transparent 0 18%, #38bdf8 18% 22%, transparent 22% 38%, #38bdf8 38% 42%, transparent 42% 62%, #38bdf8 62% 66%, transparent 66%);
  opacity: .9;
}
.photo-proof span,
.photo-proof small { display: block; position: relative; z-index: 1; }
.photo-proof span { font-size: 16px; font-weight: 850; }
.photo-proof small { margin-top: 10px; color: #cbd5e1; font-size: 13px; }
.photo-proof b {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: absolute;
  right: 34px;
  top: 32px;
  color: var(--red);
  background: #fee2e2;
  font-size: 26px;
}
.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) 88px;
  align-items: center;
  gap: 18px;
  text-align: left;
  background: #fff;
}
.check-row i { width: 20px; height: 20px; border-radius: 5px; }
.check-row span b,
.check-row span small { display: block; }
.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;
}
.check-row.danger i { background: var(--red); }
.check-row.danger em { color: var(--red); background: #fee2e2; }
.check-row.warn i { background: var(--gold); }
.check-row.warn em { color: #b45309; background: #fef3c7; }
.check-row.ok i { background: var(--green); }
.check-row.ok em { color: var(--green); background: #dcfce7; }

.owner-card {
  min-height: 72px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  background: #f8fafc;
}
.owner-card b,
.owner-card span { display: block; }
.owner-card span { margin-top: 10px; color: var(--red); font-size: 13px; font-weight: 800; }
.owner-card:nth-of-type(3) span { color: var(--gold); }
.owner-card:nth-of-type(4) span { color: var(--blue); }
.notify-card {
  min-height: 150px;
  margin-top: 28px;
  border: 1px solid #67e8f9;
  border-radius: 12px;
  padding: 24px 20px;
  background: #ecfeff;
}
.notify-card b,
.notify-card span,
.notify-card strong { display: block; }
.notify-card b { color: var(--cyan-dark); font-size: 17px; }
.notify-card span { margin-top: 12px; color: var(--muted); font-size: 13px; }
.notify-card strong { margin-top: 20px; color: var(--cyan-dark); }
.legal-card {
  min-height: 92px;
  margin-top: 38px;
  border-radius: 12px;
  padding: 22px 20px;
  color: #fff;
  background: #0f172a;
}
.legal-card span,
.legal-card strong { display: block; }
.legal-card span { color: #cbd5e1; }
.legal-card strong { margin-top: 12px; font-size: 34px; }

.employee-card {
  width: 100%;
  min-height: 96px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px 18px 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  position: relative;
  text-align: left;
  background: #fff;
}
.employee-card.active { border-color: #67e8f9; background: #ecfeff; }
.employee-card.urgent { border-color: #fdba74; background: #fff7ed; }
.employee-card i {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: absolute;
  left: 20px;
  top: 24px;
  color: #fff;
  background: var(--green);
  font-size: 20px;
  font-style: normal;
  font-weight: 900;
}
.employee-card.red i { background: var(--red); }
.employee-card.blue i { background: var(--blue); }
.employee-card.gold i { background: var(--gold); }
.employee-card.purple i { background: var(--purple); }
.employee-card b { font-size: 16px; }
.employee-card span,
.employee-card em,
.employee-card small { font-size: 13px; }
.employee-card span { margin-top: 6px; color: var(--muted); }
.employee-card em { margin-top: 16px; color: var(--green); font-style: normal; font-weight: 800; }
.employee-card.red em { color: var(--red); }
.employee-card.blue em { color: var(--blue); }
.employee-card.gold em { color: var(--gold); }
.employee-card.purple em { color: var(--purple); }
.employee-card small { align-self: end; color: var(--muted); font-weight: 700; }

.flow-row { margin-top: 34px; grid-template-columns: minmax(150px, 1fr) minmax(120px, 1fr) 48px; }
.flow-row i { background: var(--green); }
.flow-row.red i { background: var(--red); }
.flow-row.gold i { background: var(--gold); }
.flow-row.blue i { background: var(--blue); }
.flow-row.cyan i { background: var(--cyan); }
.pdf-card {
  min-height: 134px;
  margin-top: 70px;
  border-radius: 12px;
  padding: 28px 24px;
  color: #fff;
  background: #0f172a;
}
.pdf-card b,
.pdf-card span,
.pdf-card strong { display: block; }
.pdf-card b { font-size: 17px; }
.pdf-card span { margin-top: 12px; color: #cbd5e1; font-size: 13px; }
.pdf-card strong { margin-top: 22px; color: #67e8f9; font-size: 13px; }

.phone {
  width: 228px;
  height: 500px;
  margin: 34px auto 0;
  border-radius: 28px;
  padding: 28px 16px;
  background: #101827;
}
.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: 78px;
  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: 92px; }
.queue-card {
  min-height: 86px;
  margin-top: 34px;
  border: 1px solid #67e8f9;
  border-radius: 12px;
  padding: 24px;
  background: #ecfeff;
}
.queue-card b,
.queue-card span { display: block; }
.queue-card b { color: var(--cyan-dark); font-size: 15px; }
.queue-card span { margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }

.selected {
  outline: 3px solid rgba(6, 182, 212, .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: #0f172a;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .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,
  .audit-layout,
  .automation-layout { grid-template-columns: 1fr; }
  .firm-list,
  .inspection-panel,
  .side-action,
  .employee-panel,
  .document-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,
  .risk-map { grid-template-columns: 1fr; }
  .panel { padding: 22px; }
  .compliance-row,
  .flow-row { grid-template-columns: 1fr; }
}
