:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --accent: #0f9d84;
  --border: #dbe3ef;
  --danger: #d9485f;
  --warning: #c58a12;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }

h1, h2, h3 { color: #0f172a; }

.topbar {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 32px 12px;
}

.topbar > div:first-child {
  margin: 0 auto;
  text-align: center;
}

.brand-lockup {
  margin-bottom: 12px;
}

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

.topbar-lockup {
  max-width: 620px;
  margin: 0 auto 12px;
}

.login-lockup {
  max-width: 620px;
  margin-bottom: 18px;
  justify-content: center;
  text-align: center;
}

.brand-logo {
  display: block;
  height: auto;
}

.proflow-logo {
  width: min(260px, 100%);
}

.caja-logo {
  width: min(210px, 100%);
}

.brand-connector {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.topbar-actions {
  position: absolute;
  right: 32px;
  top: 28px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.container {
  padding: 0 32px 40px;
  display: grid;
  gap: 20px;
}

.eyebrow {
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .08em;
  font-size: 12px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card, .panel, .login-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}

.metric-card { padding: 18px; }
.metric-card.compact { padding: 16px; }
.metric-title { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.metric-value { font-size: 30px; font-weight: 700; margin-bottom: 10px; }
.metric-detail { color: #c3d0eb; font-size: 14px; }

.panel { padding: 20px; }
.machine-panel { padding: 20px; }
.machine-grid { margin-top: 14px; }
.machine-notes { margin-top: 18px; }
.story-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.story-block {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}
.story-block h3 {
  margin: 0 0 12px;
}
.two-col {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 20px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.muted { color: var(--muted); }
.badge, .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.pill.ok { background: rgba(83, 209, 182, .12); color: var(--accent); }
.pill.pending { background: rgba(255, 189, 89, .12); color: var(--warning); }

.login-body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
}

.login-card h1,
.login-card p {
  text-align: center;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #cfd8ef;
}

input, button {
  font: inherit;
  border-radius: 12px;
}

input {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
}

button {
  background: var(--accent);
  color: #ffffff;
  border: 0;
  padding: 13px 16px;
  font-weight: 700;
  cursor: pointer;
}

.error-box {
  background: rgba(255,123,123,.12);
  color: #ffb1b1;
  border: 1px solid rgba(255,123,123,.28);
  border-radius: 12px;
  padding: 12px;
  margin-top: 16px;
}

.demo-note { color: var(--muted); margin-top: 14px; font-size: 14px; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  font-size: 14px;
}

th { color: var(--muted); font-weight: 600; }

.notes-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.6;
}

@media (max-width: 960px) {
  .two-col { grid-template-columns: 1fr; }
  .topbar, .container { padding-left: 16px; padding-right: 16px; }
  .topbar {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 20px;
  }
  .topbar > div:first-child {
    width: 100%;
  }
  .topbar-actions {
    position: static;
    margin-bottom: 12px;
  }
  .brand-inline { gap: 10px; }
  .proflow-logo { width: min(220px, 100%); }
  .caja-logo { width: min(170px, 100%); }
}
