:root {
  --bg: #f6f3ed;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --surface-soft: #faf8f4;
  --line: #ded4c2;
  --text: #17120d;
  --muted: #6d6355;
  --brand-deep: #11100e;
  --brand: #9b7417;
  --brand-soft: #f1ead9;
  --accent: #5e4220;
  --accent-soft: #f6eddd;
  --alert: #8e311f;
  --brand-deep-rgb: 17, 16, 14;
  --brand-rgb: 155, 116, 23;
  --accent-rgb: 94, 66, 32;
  --muted-rgb: 109, 99, 85;
  --alert-rgb: 142, 49, 31;
  --shadow: 0 12px 30px rgba(36, 28, 16, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--bg);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
  position: relative;
}

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

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.scene-glow {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 18%, rgba(var(--brand-rgb), 0.12), transparent 26%),
    linear-gradient(135deg, #fffdf8 0%, var(--bg) 48%, #ebe2d3 100%);
}

.login-card {
  width: min(100%, 860px);
  display: grid;
  gap: 20px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 70px rgba(var(--brand-deep-rgb), 0.16);
}

.login-brand {
  display: grid;
  grid-template-columns: minmax(128px, 180px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.login-logo {
  width: 100%;
  max-height: 176px;
  object-fit: contain;
}

.login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.login-error {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid rgba(var(--alert-rgb), 0.22);
  border-radius: var(--radius);
  color: var(--alert);
  background: rgba(var(--alert-rgb), 0.08);
  font-weight: 700;
}

.login-profile-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.login-permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-demo-note {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  position: relative;
  z-index: 1;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  padding: 18px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-logo {
  flex-shrink: 0;
  display: block;
}

.brand-logo-horizontal {
  width: 120px;
  max-width: 100%;
  max-height: 90px;
  height: auto;
  object-fit: contain;
}

.brand-logo-role {
  width: clamp(116px, 12vw, 150px);
  max-width: 100%;
  max-height: 150px;
  height: auto;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-title {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 30px;
  line-height: 1;
  color: var(--brand-deep);
}

.hero-app-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
}

.dashboard-head {
  align-items: center;
}

.dashboard-branding {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.dashboard-logo {
  width: 96px;
  max-width: 100%;
  max-height: 80px;
  height: auto;
  object-fit: contain;
}

.dashboard-logo-role {
  width: clamp(108px, 12vw, 136px);
  max-height: 136px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
}

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

.topbar-actions,
.status-stack {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-badge {
  min-width: 190px;
  display: grid;
  gap: 2px;
  padding: 10px 13px;
  border: 1px solid rgba(var(--brand-rgb), 0.22);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.session-badge span,
.session-badge small {
  color: var(--muted);
  font-size: 12px;
}

.session-badge strong {
  color: var(--brand-deep);
  line-height: 1.15;
}

.access-card {
  border-color: rgba(var(--brand-rgb), 0.22);
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%);
}

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand-deep);
  font-weight: 700;
}

.status-muted {
  background: rgba(var(--muted-rgb), 0.12);
  color: var(--muted);
}

.status-danger {
  background: rgba(var(--alert-rgb), 0.14);
  color: var(--alert);
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card,
.panel,
.subpanel,
.stat-card,
.totals-card,
.quote-preview,
.note-box,
.list-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar-card,
.panel,
.subpanel,
.quote-preview {
  padding: 18px;
}

.hero-card {
  background: var(--brand-deep);
  color: #fffaf0;
}

.hero-card .eyebrow,
.hero-card .muted {
  color: rgba(255, 250, 240, 0.78);
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.nav-link {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--text);
  font-weight: 700;
  text-align: left;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--brand);
  background: var(--brand-deep);
  color: #fffaf0;
}

.compact-card strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 20px;
}

.workspace {
  min-width: 0;
}

.view {
  display: block;
}

.page-head,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.page-head {
  margin-bottom: 18px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head.mini {
  margin-bottom: 12px;
}

.section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdfa;
  color: var(--text);
  font-weight: 800;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.filter-pill span {
  min-width: 24px;
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand-deep);
  padding: 2px 7px;
  text-align: center;
}

.filter-pill:hover,
.filter-pill.active {
  border-color: var(--brand);
  background: var(--brand-deep);
  color: #fffaf0;
}

.filter-pill.active span,
.filter-pill:hover span {
  background: rgba(255, 255, 255, 0.18);
  color: #fffaf0;
}

.stats-grid,
.grid.two,
.grid.three,
.toggle-grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
}

.stat-card {
  padding: 18px;
  background: var(--surface-soft);
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.stat-card strong {
  font-size: 30px;
  color: var(--brand-deep);
}

.stack,
.stack-list {
  display: grid;
  gap: 12px;
}

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

.area-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
}

.clickable-card {
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.clickable-card:hover,
.clickable-card.active {
  border-color: rgba(var(--brand-rgb), 0.48);
  box-shadow: 0 14px 30px rgba(var(--brand-deep-rgb), 0.12);
}

.clickable-card.active {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.12), rgba(255, 255, 255, 0.92));
}

.area-detail-pane {
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 180px);
  align-content: start;
}

.area-detail-head {
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.back-button {
  width: fit-content;
  gap: 8px;
  margin-bottom: 14px;
  padding-inline: 12px;
}

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

.area-tool-card {
  display: grid;
  gap: 7px;
  min-height: 106px;
  width: 100%;
  padding: 14px;
  color: var(--text);
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

button.area-tool-card:hover {
  border-color: rgba(var(--brand-rgb), 0.5);
  box-shadow: 0 12px 24px rgba(var(--brand-deep-rgb), 0.1);
  transform: translateY(-1px);
}

.area-tool-card strong {
  color: var(--brand-deep);
}

.area-tool-card small {
  color: var(--muted);
  line-height: 1.45;
}

.area-tool-card-info {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.14), rgba(255, 255, 255, 0.96));
}

.stat-card.clickable-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-chart-panel {
  display: grid;
  gap: 16px;
}

.dashboard-chart-panel-primary {
  border-color: rgba(var(--brand-rgb), 0.28);
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), 0.08), rgba(var(--accent-rgb), 0.06)),
    var(--panel);
}

.chart-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.compact-field {
  min-width: min(100%, 220px);
}

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

.chart-card {
  min-height: 280px;
  display: grid;
  gap: 14px;
  align-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.chart-card h3 {
  margin: 8px 0 6px;
}

.chart-card p {
  margin-bottom: 0;
}

.chart-donut {
  --score: 0%;
  width: min(168px, 52vw);
  aspect-ratio: 1;
  justify-self: center;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: conic-gradient(var(--brand) var(--score), rgba(var(--muted-rgb), 0.16) 0);
}

.chart-donut::before {
  content: "";
  position: absolute;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
}

.chart-donut strong {
  position: relative;
  color: var(--brand-deep);
  font-size: 30px;
}

.chart-bars {
  display: grid;
  gap: 10px;
}

.chart-bar-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.chart-bar-row span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-weight: 700;
}

.chart-bar-row i {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--muted-rgb), 0.14);
}

.chart-bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.chart-bar-row strong {
  color: var(--brand-deep);
  white-space: nowrap;
}

.chart-columns {
  min-height: 170px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 10px;
  align-items: end;
}

.chart-column {
  min-height: 170px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 6px;
  align-items: end;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: center;
}

.chart-column i {
  width: 100%;
  min-height: 12px;
  border-radius: var(--radius) var(--radius) 4px 4px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.chart-column strong {
  color: var(--brand-deep);
}

.chart-column span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.dashboard-insight {
  display: grid;
  gap: 16px;
}

.dashboard-overview-content {
  display: grid;
  gap: 18px;
}

.dashboard-detail-view {
  min-height: calc(100vh - 180px);
  align-content: start;
}

.dashboard-detail-head {
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dashboard-insight-shell {
  display: grid;
  gap: 16px;
}

.dashboard-insight-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), 0.1), rgba(255, 255, 255, 0.92)),
    var(--panel-solid);
}

.dashboard-insight-hero h4,
.insight-card h4 {
  margin: 6px 0 8px;
  color: var(--brand-deep);
}

.dashboard-insight-hero p {
  margin: 0 0 8px;
}

.insight-summary {
  color: var(--text);
  font-weight: 700;
  line-height: 1.5;
}

.insight-donut {
  width: 148px;
}

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

.insight-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
}

.insight-factor-list {
  display: grid;
  gap: 10px;
}

.insight-factor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.insight-factor.severity-alta,
.insight-factor.severity-critica,
.insight-factor.severity-emergencia {
  border-left-color: var(--alert);
}

.insight-factor.severity-media {
  border-left-color: var(--accent);
}

.insight-factor strong {
  display: block;
  color: var(--brand-deep);
}

.insight-factor small {
  color: var(--muted);
  line-height: 1.35;
}

.insight-factor span {
  font-weight: 900;
  color: var(--brand-deep);
  white-space: nowrap;
}

.insight-bars .static-row {
  cursor: default;
}

.command-center-panel {
  border-color: rgba(var(--brand-rgb), 0.34);
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), 0.08), rgba(var(--brand-deep-rgb), 0.04)),
    var(--panel-solid);
}

.work-inbox-list {
  display: grid;
  gap: 10px;
}

.work-inbox-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid rgba(var(--brand-rgb), 0.42);
  border-radius: var(--radius);
  background: #fffdf8;
}

.work-inbox-card.severity-alta,
.work-inbox-card.severity-critica,
.work-inbox-card.severity-emergencia {
  border-left-color: var(--alert);
}

.work-inbox-card.severity-media {
  border-left-color: var(--brand);
}

.work-inbox-main,
.work-inbox-side {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.work-inbox-main h4,
.state-flow-card h4 {
  margin: 0;
  font-size: 17px;
}

.work-inbox-main p {
  margin: 0;
  color: var(--text);
  line-height: 1.4;
}

.work-inbox-main small,
.work-inbox-side small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.work-inbox-side {
  justify-items: end;
  align-content: center;
  text-align: right;
}

.approval-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fffaf0;
  background: var(--alert);
  font-size: 12px;
  font-weight: 800;
}

.approval-chip.quiet {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.state-flow-grid {
  display: grid;
  gap: 10px;
}

.state-flow-card,
.automation-rule-card,
.notification-policy-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.state-flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.state-flow-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 800;
}

.automation-rule-card {
  border-left: 5px solid rgba(var(--brand-rgb), 0.45);
}

.automation-rule-card.severity-alta {
  border-left-color: var(--alert);
}

.automation-rule-card.severity-media {
  border-left-color: var(--brand);
}

.automation-rule-card.severity-baja {
  border-left-color: var(--accent);
}

.automation-rule-card span {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 800;
}

.notification-policy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.notification-policy-card {
  border-top: 5px solid rgba(var(--brand-rgb), 0.45);
}

.notification-policy-card.severity-emergencia,
.notification-policy-card.severity-alta {
  border-top-color: var(--alert);
}

.notification-policy-card.severity-media {
  border-top-color: var(--brand);
}

.notification-policy-card.severity-info {
  border-top-color: rgba(var(--muted-rgb), 0.46);
}

.emergency-alert-zone {
  display: grid;
  gap: 10px;
}

.emergency-alarm-banner {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(var(--alert-rgb), 0.36);
  border-left: 7px solid var(--alert);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(var(--alert-rgb), 0.14), rgba(var(--brand-rgb), 0.08)),
    #fffaf5;
  box-shadow: 0 18px 40px rgba(var(--alert-rgb), 0.14);
}

.emergency-alarm-pulse {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--alert);
  box-shadow: 0 0 0 0 rgba(var(--alert-rgb), 0.4);
  animation: alarmPulse 1.25s ease-out infinite;
}

.emergency-alarm-content {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.emergency-alarm-content h3,
.emergency-alarm-content p {
  margin: 0;
}

.emergency-alarm-content h3 {
  color: var(--alert);
}

.emergency-nature-pill,
.emergency-phone-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.emergency-nature-pill {
  color: #ffffff;
  background: var(--alert);
}

.emergency-phone-status {
  color: var(--alert);
  background: rgba(var(--alert-rgb), 0.1);
}

.emergency-phone-status.en_cola {
  color: #5d3e00;
  background: rgba(var(--brand-rgb), 0.18);
}

.emergency-phone-status.muted-status,
.emergency-phone-status.pendiente_configuracion {
  color: var(--muted);
  background: rgba(var(--muted-rgb), 0.1);
}

.emergency-alarm-card {
  border-left: 6px solid var(--alert);
  background:
    linear-gradient(135deg, rgba(var(--alert-rgb), 0.1), rgba(var(--brand-rgb), 0.04)),
    #fffdf8;
}

.emergency-alarm-card.severity-media,
.emergency-alarm-card.severity-baja {
  border-left-color: var(--brand);
}

.emergency-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.simulation-panel {
  border-color: rgba(var(--brand-rgb), 0.3);
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), 0.08), rgba(var(--accent-rgb), 0.04)),
    var(--panel-solid);
}

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

.simulation-action-card {
  display: grid;
  gap: 7px;
  min-height: 108px;
  padding: 13px;
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  background: #fffdf8;
  box-shadow: none;
}

.simulation-action-card:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--brand-rgb), 0.56);
  box-shadow: 0 12px 24px rgba(var(--brand-deep-rgb), 0.08);
}

.simulation-action-card.danger {
  border-color: rgba(var(--alert-rgb), 0.35);
  background: rgba(var(--alert-rgb), 0.06);
}

.simulation-action-card strong {
  color: var(--brand-deep);
}

.simulation-action-card.danger strong {
  color: var(--alert);
}

.simulation-log {
  display: grid;
  gap: 8px;
}

.simulation-run-card {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid rgba(var(--brand-rgb), 0.5);
  border-radius: var(--radius);
  background: #fffdf8;
}

.simulation-run-card.severity-alta,
.simulation-run-card.severity-critica,
.simulation-run-card.severity-emergencia {
  border-left-color: var(--alert);
}

@keyframes alarmPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--alert-rgb), 0.44);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(var(--alert-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--alert-rgb), 0);
  }
}

.empty-inline {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
}

.area-card h3 {
  margin: 8px 0 6px;
}

.area-card small {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.1);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--muted-rgb), 0.14);
  margin: 10px 0 6px;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.chat-log {
  min-height: 420px;
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.chat-panel {
  min-height: 100%;
  display: grid;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.chat-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chat-panel-head h3 {
  margin: 0 0 4px;
}

.chat-log.compact-chat {
  min-height: 280px;
  max-height: 380px;
}

.secretary-layout {
  align-items: stretch;
}

.secretary-command-panel {
  border-left: 5px solid var(--brand);
}

.secretary-action-list {
  display: grid;
  gap: 12px;
}

.secretary-action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  background: var(--panel-solid);
}

.secretary-action-card.severity-alta,
.secretary-action-card.severity-critica,
.secretary-action-card.severity-emergencia {
  border-left-color: var(--danger);
}

.secretary-action-main h4 {
  margin: 8px 0 6px;
  color: var(--text);
}

.secretary-action-main p {
  margin: 0 0 8px;
  color: var(--muted);
}

.secretary-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secretary-agent-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}

.secretary-agent-chip {
  padding: 7px 9px;
  border: 1px solid rgba(var(--brand-rgb), 0.24);
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.1);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 800;
}

.secretary-missing-list,
.secretary-route {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.secretary-missing-list strong,
.secretary-route strong {
  color: var(--brand-deep);
}

.secretary-action-buttons {
  justify-content: flex-end;
  min-width: 190px;
}

.secretary-chat-panel {
  background: var(--surface-soft);
}

.chat-message {
  max-width: 92%;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-solid);
}

.chat-message.user {
  justify-self: end;
  max-width: 88%;
  background: rgba(var(--brand-rgb), 0.08);
  border-color: rgba(var(--brand-rgb), 0.22);
}

.chat-message.assistant {
  justify-self: start;
  background: rgba(var(--accent-rgb), 0.09);
  border-color: rgba(var(--accent-rgb), 0.22);
}

.chat-message p {
  margin: 6px 0;
  color: var(--text);
}

.chat-message small {
  color: var(--muted);
}

.generated-doc-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 12px 0 8px;
  padding: 12px;
  border: 1px solid rgba(var(--brand-rgb), 0.26);
  border-radius: var(--radius);
  background: rgba(var(--brand-rgb), 0.08);
}

.generated-doc-chip strong,
.generated-document-card strong {
  color: var(--brand-deep);
}

.generated-doc-chip small {
  display: block;
  margin-top: 4px;
}

.generated-document-card {
  border-left: 5px solid var(--brand);
}

.document-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 16, 14, 0.62);
}

.document-preview-shell {
  width: min(1120px, 100%);
  height: min(92vh, 1100px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(var(--brand-rgb), 0.34);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: 0 28px 90px rgba(17, 16, 14, 0.34);
}

.document-preview-shell .section-head {
  align-items: start;
}

.document-preview-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.drilldown-detail-host {
  display: none;
}

.view.detail-open .drilldown-detail-host {
  display: block;
}

.view.detail-open > :not(.page-head):not(.drilldown-detail-host) {
  display: none !important;
}

.drilldown-detail-panel {
  display: grid;
  gap: 18px;
}

.drilldown-head {
  align-items: flex-start;
}

.drilldown-content {
  display: grid;
  gap: 16px;
}

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

.detail-field,
.detail-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.detail-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-field strong {
  display: block;
  color: var(--brand-deep);
  overflow-wrap: anywhere;
}

.detail-section h4 {
  margin: 0 0 8px;
  color: var(--brand-deep);
}

.detail-section p {
  line-height: 1.55;
}

.detail-progress {
  margin: 0;
}

.section-option-card .open-hint {
  margin-top: 8px;
  color: var(--brand);
  font-weight: 800;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(var(--brand-rgb), 0.08);
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.selectable-list {
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.list-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}

.list-card:hover,
.list-card.active {
  transform: translateY(-1px);
  border-color: rgba(var(--brand-rgb), 0.45);
}

.list-card strong {
  display: block;
  margin-bottom: 4px;
}

.list-card small {
  display: block;
  color: var(--muted);
}

.list-card a {
  color: var(--brand-deep);
  font-weight: 700;
  text-decoration: none;
}

.list-card a:hover {
  text-decoration: underline;
}

.list-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  color: #fffaf0;
  text-decoration: none;
}

.list-card .btn-ghost {
  color: var(--brand-deep);
}

.download-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.download-layout {
  display: grid;
  gap: 18px;
}

.app-install-grid {
  align-items: stretch;
}

.app-profile-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.app-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 136px;
  padding: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #faf7f0 100%);
  border: 1px solid rgba(var(--brand-rgb), 0.2);
  border-radius: var(--radius);
}

.app-card-logo img {
  width: min(100%, 126px);
  max-height: 126px;
  object-fit: contain;
}

.panel.app-profile-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.app-card-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 800;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-tabs {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 10px 0 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.section-tab {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--brand-deep);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.section-tab.active {
  color: #fffaf0;
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.compact-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.actions-field {
  justify-content: flex-end;
}

.toggle-field,
.toggle-pill {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.toggle-field span,
.toggle-pill span {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(var(--brand-rgb), 0.66);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.14);
}

input:not([type="checkbox"]):not([type="radio"])[readonly] {
  background: rgba(246, 237, 221, 0.95);
  color: var(--brand-deep);
  font-weight: 700;
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  min-width: 20px;
  height: 20px;
  margin: 1px 0 0;
  padding: 0;
  flex: 0 0 20px;
  accent-color: var(--brand);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 140ms ease, opacity 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fffaf0;
  background: var(--brand-deep);
}

.btn-ghost {
  color: var(--brand-deep);
  background: rgba(var(--brand-rgb), 0.12);
}

.btn-danger {
  color: #fffaf0;
  background: var(--alert);
}

.top-space {
  margin-top: 18px;
}

.note-box {
  color: var(--text);
  background: var(--surface-soft);
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.compliance-row.status-vencido,
.compliance-row.status-pendiente_cargar {
  background: rgba(var(--alert-rgb), 0.08);
}

.compliance-row.status-por_validar,
.compliance-row.status-por_vencer {
  background: rgba(var(--brand-rgb), 0.08);
}

.contractor-card,
.contractor-member-card,
.portal-upload-card {
  background: linear-gradient(180deg, #fffefa 0%, #fff8ef 100%);
}

.portal-upload-card strong {
  color: var(--brand-deep);
}

.maintenance-center-panel {
  margin-bottom: 18px;
}

.maintenance-banner {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid rgba(var(--brand-rgb), 0.22);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.maintenance-banner.active {
  border-color: rgba(var(--alert-rgb), 0.34);
  background: rgba(var(--alert-rgb), 0.08);
}

.maintenance-check-card.done {
  border-left: 5px solid var(--brand);
}

.maintenance-change-card,
.maintenance-impact-card {
  cursor: default;
}

.maintenance-change-card.risk-alta,
.maintenance-change-card.risk-critica {
  border-left: 5px solid var(--alert);
}

.maintenance-change-card.risk-media {
  border-left: 5px solid var(--brand);
}

.inline-remove {
  border: 0;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(var(--alert-rgb), 0.12);
  color: var(--alert);
  font-weight: 700;
}

.inline-action {
  border: 0;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand-deep);
  font-weight: 700;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.status-danger-text {
  color: var(--alert);
  font-weight: 800;
}

.project-timeline {
  display: grid;
  gap: 10px;
}

.gantt-section {
  overflow: hidden;
}

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

.gantt-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  padding: 14px;
  overflow-x: auto;
}

.gantt-axis {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 8px;
  min-width: 720px;
  margin: 8px 0 10px 248px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gantt-axis span:nth-child(n + 2) {
  text-align: center;
}

.gantt-axis span:last-child {
  text-align: right;
}

.gantt-rows {
  display: grid;
  gap: 10px;
  min-width: 980px;
}

.gantt-row {
  display: grid;
  grid-template-columns: 240px minmax(480px, 1fr);
  gap: 12px;
  align-items: center;
}

.gantt-row[data-project-work-order-id] {
  cursor: pointer;
}

.gantt-row-label {
  min-width: 0;
}

.gantt-row-label strong,
.gantt-row-label small {
  display: block;
}

.gantt-row-label strong {
  line-height: 1.25;
}

.gantt-row-label small {
  margin-top: 3px;
  color: var(--muted);
}

.gantt-dependency {
  color: var(--brand-deep) !important;
  font-weight: 800;
}

.gantt-row.locked .gantt-dependency {
  color: var(--alert) !important;
}

.gantt-lane {
  position: relative;
  height: 34px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(var(--muted-rgb), 0.12) 0,
      rgba(var(--muted-rgb), 0.12) 1px,
      transparent 1px,
      transparent 20%
    ),
    rgba(var(--brand-rgb), 0.06);
  overflow: hidden;
}

.gantt-bar {
  position: absolute;
  top: 7px;
  bottom: 7px;
  min-width: 28px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 6px 14px rgba(var(--brand-rgb), 0.22);
  overflow: hidden;
}

.gantt-bar-progress {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.5);
}

.gantt-bar.pendiente,
.gantt-bar.programado,
.gantt-bar.programada {
  background: var(--brand);
}

.gantt-bar.en_curso {
  background: #0f766e;
}

.gantt-bar.ejecutada,
.gantt-bar.ejecutado,
.gantt-bar.cerrada {
  background: #166534;
}

.gantt-bar.retrasada,
.gantt-bar.retrasado,
.gantt-row.locked .gantt-bar {
  background: var(--alert);
}

.gantt-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gantt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gantt-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
}

.gantt-dot.en_curso {
  background: #0f766e;
}

.gantt-dot.ejecutada {
  background: #166534;
}

.gantt-dot.retrasada {
  background: var(--alert);
}

.project-order-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}

.compact-field {
  min-width: min(100%, 220px);
}

.compact-stats {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.commercial-visit-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.visit-form-surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  padding: 16px;
}

.commercial-visit-card {
  cursor: pointer;
}

.supplier-intelligence {
  display: grid;
  gap: 16px;
}

.supplier-flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.supplier-research-pane {
  border-color: rgba(var(--brand-rgb), 0.25);
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), 0.08), rgba(255, 255, 255, 0.92)),
    var(--panel-solid);
}

.supplier-pane {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.supplier-pane .selectable-list {
  max-height: 430px;
}

.supplier-pane textarea {
  resize: vertical;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.work-order-card {
  cursor: pointer;
}

.work-order-card.locked {
  background: rgba(var(--alert-rgb), 0.05);
}

.dependency-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 800;
}

.dependency-chip.ready {
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand-deep);
}

.dependency-chip.locked {
  background: rgba(var(--alert-rgb), 0.12);
  color: var(--alert);
}

.timeline-card.retrasado,
.work-order-card.retrasada,
.work-order-card.locked {
  border-left: 5px solid rgba(var(--alert-rgb), 0.7);
}

.notification-card {
  border-left: 5px solid rgba(var(--brand-rgb), 0.45);
}

.notification-card.alta,
.notification-card.critica,
.notification-card.emergencia {
  border-left-color: var(--alert);
}

.notification-card.phone-escalated {
  background:
    linear-gradient(135deg, rgba(var(--alert-rgb), 0.09), rgba(var(--brand-rgb), 0.04)),
    #fffdf8;
}

.notification-card.media {
  border-left-color: var(--accent);
}

.audit-card {
  border-left: 5px solid rgba(var(--muted-rgb), 0.38);
}

.totals-card {
  padding: 18px;
  background: var(--surface-soft);
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.total-row:last-child {
  border-bottom: 0;
}

.total-row.grand strong,
.total-row.accent strong {
  font-size: 20px;
}

.total-row.accent {
  color: var(--brand-deep);
}

.quote-preview {
  min-height: 260px;
  background: var(--panel-solid);
}

.preview-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.preview-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.preview-brand-right {
  justify-content: flex-end;
  text-align: right;
}

.preview-document-meta {
  min-width: 150px;
  text-align: center;
}

.preview-logo {
  width: 62px;
  height: 62px;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(var(--brand-rgb), 0.08);
  flex: 0 0 auto;
}

.preview-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 18px;
}

.preview-lines {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.preview-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(var(--brand-rgb), 0.05);
}

.preview-foot {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.preview-sections {
  margin-top: 18px;
}

.preview-section-title {
  margin: 0 0 10px;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.preview-blocks,
.preview-list-grid {
  display: grid;
  gap: 10px;
}

.preview-block,
.preview-list-item {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-solid);
}

.preview-block strong,
.preview-list-item strong {
  display: block;
  margin-bottom: 6px;
}

.attachment-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.1);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.preview-attachment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed rgba(var(--brand-rgb), 0.26);
  border-radius: var(--radius);
  background: rgba(var(--brand-rgb), 0.05);
}

.preview-attachment-image {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}

.logo-preview {
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed rgba(var(--brand-rgb), 0.28);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.logo-preview img {
  max-height: 120px;
  object-fit: contain;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 220px;
  max-width: 340px;
  padding: 14px 16px;
  border-radius: var(--radius);
  color: #fffaf0;
  background: var(--brand-deep);
  box-shadow: 0 20px 40px rgba(var(--brand-deep-rgb), 0.24);
}

@media (max-width: 1180px) {
  .layout,
  .quote-layout {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notification-policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simulation-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-insight-grid {
    grid-template-columns: 1fr;
  }

  .grid.three,
  .area-grid,
  .area-tool-grid,
  .supplier-flow-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    padding: 18px;
  }

  .topbar,
  .brand-strip,
  .topbar-actions {
    align-items: flex-start;
  }

  .topbar,
  .brand-strip,
  .topbar-actions,
  .login-form,
  .panel.app-profile-card,
  .emergency-alarm-banner,
  .project-toolbar,
  .section-head,
  .page-head {
    flex-direction: column;
  }

  .emergency-alarm-banner,
  .login-brand,
  .login-form {
    grid-template-columns: 1fr;
  }

  .simulation-action-grid {
    grid-template-columns: 1fr;
  }

  .login-logo {
    max-height: 142px;
  }

  .session-badge {
    width: 100%;
  }

  .stats-grid,
  .grid.two,
  .commercial-visit-layout,
  .dashboard-chart-grid,
  .notification-policy-grid,
  .form-grid,
  .preview-grid,
  .preview-header,
  .chat-input-row,
  .supplier-flow-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .work-inbox-card {
    grid-template-columns: 1fr;
  }

  .secretary-action-card {
    grid-template-columns: 1fr;
  }

  .secretary-action-buttons {
    justify-content: flex-start;
    min-width: 0;
  }

  .dashboard-insight-hero {
    grid-template-columns: 1fr;
  }

  .insight-donut {
    justify-self: start;
    width: 132px;
  }

  .work-inbox-side {
    justify-items: start;
    text-align: left;
  }

  .chart-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-bar-row {
    grid-template-columns: 1fr;
  }

  .generated-doc-chip {
    grid-template-columns: 1fr;
  }

  .panel.app-profile-card {
    grid-template-columns: 1fr;
  }

  .button-row {
    justify-content: flex-start;
  }

  .filter-pills {
    justify-content: flex-start;
    width: 100%;
  }

  .gantt-axis {
    margin-left: 188px;
    min-width: 620px;
  }

  .gantt-rows {
    min-width: 800px;
  }

  .gantt-row {
    grid-template-columns: 180px minmax(420px, 1fr);
  }

  .preview-brand-right,
  .preview-document-meta {
    justify-content: flex-start;
    text-align: left;
  }

  .brand-logo {
    width: 120px;
    height: auto;
  }

  .brand-logo-horizontal,
  .dashboard-logo {
    width: 100px;
  }

  .brand-logo-role,
  .dashboard-logo-role {
    width: min(100%, 132px);
    max-height: 132px;
  }

  .app-card-logo {
    min-height: 126px;
  }

  .app-card-logo img {
    width: min(100%, 118px);
    max-height: 118px;
  }

  .nav-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-link {
    text-align: center;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .scene-glow,
  .topbar,
  .sidebar,
  .quote-editor,
  .section-actions,
  .page-head,
  #quoteList {
    display: none !important;
  }

  .app-shell,
  .layout,
  .workspace,
  .quote-layout {
    display: block;
    padding: 0;
    margin: 0;
  }

  #view-quotes {
    display: block !important;
  }

  .quote-side,
  .quote-preview {
    border: 0;
    box-shadow: none;
    background: #ffffff;
    padding: 0;
  }
}
