#app {
  min-height: 100vh;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 45%, #14b8a6 100%);
}

.auth-card {
  width: min(100%, 460px);
  padding: 32px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.auth-brand-logo {
  width: 92px;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.auth-eyebrow {
  margin: 0 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
}

.auth-card h2 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
}

.auth-description {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-message {
  min-height: 20px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 600;
}

.auth-message.is-error {
  color: #b91c1c;
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #f8fafc;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 18px 0 40px rgba(2, 6, 23, 0.16);
}

.sidebar.collapsed {
  width: 84px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1rem;
}

.sidebar-brand > div {
  white-space: nowrap;
}

.sidebar-brand .brand-logo {
  width: 120px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  background: #ffffff;
  border-radius: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #d1d5db;
  transition: 180ms ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 168, 107, 0.18) 0%, rgba(30, 64, 175, 0.16) 100%);
  color: white;
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.95) 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 253, 247, 0.96) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -1px 0 rgba(229, 231, 235, 0.7);
}

.topbar h1 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
}

.content {
  padding: 24px 28px 36px;
  background: transparent;
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfb 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

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

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

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

.stat-card {
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fcfb 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
}

.stat-card h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
}

.panel {
  padding: 22px;
  border-left: 4px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border-radius: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

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

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
}

.evolution-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.evolution-card {
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.9) 0%, #ffffff 100%);
}

.evolution-title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1e3a8a;
}

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

.labor-kpi-card {
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.92) 0%, #ffffff 100%);
  display: grid;
  gap: 4px;
}

.labor-kpi-card span {
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #475569;
  font-weight: 600;
}

.labor-kpi-card strong {
  font-size: 1.1rem;
  color: #0f172a;
}

.labor-kpi-card small {
  color: #64748b;
  font-size: 0.78rem;
}

.labor-section-block {
  margin-bottom: 12px;
}

.labor-section-title {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1e3a8a;
}

.labor-subgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.obra-overview-panel {
  border-left-color: rgba(14, 165, 233, 0.24);
}

.obra-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.obra-overview-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #0f766e;
  background: linear-gradient(135deg, rgba(153, 246, 228, 0.42), rgba(191, 219, 254, 0.44));
  border: 1px solid rgba(15, 118, 110, 0.14);
}

.obra-overview-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.obra-overview-kpi {
  border: 1px solid rgba(14, 116, 144, 0.14);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.92) 0%, #ffffff 100%);
  display: grid;
  gap: 4px;
}

.obra-overview-kpi span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  font-weight: 600;
}

.obra-overview-kpi strong {
  color: #0f172a;
  font-size: 1rem;
}

.obra-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.obra-overview-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.obra-overview-card h5 {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1e3a8a;
}

.obra-overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.34);
  font-size: 0.9rem;
}

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

.obra-overview-row span {
  color: #475569;
}

.obra-overview-row strong {
  color: #0f172a;
}

.snapshot-overview-card {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--surface-alt, #f8fafc), var(--surface, #fff));
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.snapshot-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.snapshot-overview-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.snapshot-overview-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #1e3a8a;
  background: linear-gradient(135deg, rgba(191, 219, 254, 0.45), rgba(167, 243, 208, 0.4));
  border: 1px solid rgba(30, 64, 175, 0.12);
}

.snapshot-overview-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.snapshot-overview-kpi {
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
  display: grid;
  gap: 4px;
}

.snapshot-overview-kpi span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  font-weight: 600;
}

.snapshot-overview-kpi strong {
  font-size: 1rem;
  color: #0f172a;
}

.snapshot-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.snapshot-overview-section {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.84);
}

.snapshot-overview-section h6 {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1e3a8a;
}

.snapshot-overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.34);
  font-size: 0.9rem;
}

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

.snapshot-overview-row span {
  color: #475569;
}

.snapshot-overview-row strong {
  color: #0f172a;
  text-align: right;
}

.snapshot-overview-text {
  color: #0f172a;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 6px;
}

.budget-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.budget-overview-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.budget-overview-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #7c2d12;
  background: linear-gradient(135deg, rgba(254, 215, 170, 0.45), rgba(253, 230, 138, 0.36));
  border: 1px solid rgba(194, 65, 12, 0.12);
}

.budget-overview-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.budget-overview-kpi {
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.88);
  display: grid;
  gap: 4px;
}

.budget-overview-kpi span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  font-weight: 600;
}

.budget-overview-kpi strong {
  font-size: 0.98rem;
  color: #0f172a;
}

.budget-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.budget-overview-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.budget-overview-card h5 {
  margin: 0 0 0.6rem;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1e3a8a;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}

.modal-floating-panel {
  width: min(96vw, 980px);
  max-height: calc(100vh - 40px);
  margin: 0;
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  border-left-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-floating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 253, 247, 0.92) 100%);
}

.modal-floating-title {
  margin: 0;
  font-size: 15px;
}

.modal-floating-body {
  padding: 16px;
  overflow-y: auto;
  min-height: 0;
}
