/* Design system · Quemotero (Honda) — docs/modulo1/design-kit.md · Figma node 70-214 */
:root {
  --qm-brand-red: #CC0000;
  --qm-brand-red-pressed: #A00000;
  --qm-brand-black: #161616;
  --qm-brand-white: #FFFFFF;
  --qm-destructive: #B42318;
  --qm-bg-app: #F4F2ED;
  --qm-bg-subtle: #F7F5F0;
  --qm-bg-neutral: #EFECE6;
  --qm-bg-sidebar: #FBFAF7;
  --qm-border-default: #DCD8D0;
  --qm-border-divider: #EEEBE5;
  --qm-border-sidebar: #E7E5DE;
  --qm-text-body: #3A3733;
  --qm-text-secondary: #6F6A63;
  --qm-text-muted: #8C8780;
  --qm-icon: #57524B;
  --qm-alert-green: #2E8B57;
  --qm-alert-green-bg: #E8F3EC;
  --qm-alert-amber: #B26A00;
  --qm-alert-amber-bg: #FBF0DC;
  --qm-alert-red: #CC0000;
  --qm-alert-red-bg: #FBE7E7;
  --qm-row-hover: #FBF7F2;
  --qm-radius-ctrl: 12px;
  --qm-radius-card: 18px;
  --qm-sidebar-width: 256px;
}

html, body {
  background: var(--qm-bg-app);
  color: var(--qm-text-body);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

.qm-shell {
  min-height: 100vh;
  display: flex;
  background: var(--qm-bg-app);
}

.qm-sidebar {
  width: var(--qm-sidebar-width);
  flex-shrink: 0;
  background: var(--qm-bg-sidebar);
  border-right: 1px solid var(--qm-border-sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  box-sizing: border-box;
}

.qm-sidebar__brand { margin-bottom: 28px; padding: 0 4px; }
.qm-sidebar__brand-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qm-text-secondary);
  margin: 8px 0 0;
}
.qm-sidebar__section {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--qm-text-muted);
  margin: 0 4px 10px;
}

.qm-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.qm-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 40px;
  border-radius: 14px;
  color: var(--qm-text-body);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  box-sizing: border-box;
}
.qm-sidebar__link:hover { background: var(--qm-bg-neutral); }
.qm-sidebar__link.active {
  background: var(--qm-brand-black);
  color: var(--qm-brand-white);
  font-weight: 600;
}
.qm-sidebar__link .mud-icon-root { color: inherit; font-size: 16px !important; }

.qm-sidebar__footer {
  margin: 16px 0 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--qm-brand-black);
  color: var(--qm-brand-white);
  font-size: 10px;
  line-height: 1.35;
}
.qm-sidebar__footer strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.qm-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 32px 32px;
}

.qm-page-overline {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--qm-text-muted);
  margin: 28px 0 6px;
}

.qm-topbar {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-top: 4px;
  margin-bottom: 20px;
}
.qm-topbar__greet {
  flex: 1;
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--qm-text-body);
  line-height: 1.2;
}

.qm-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--qm-brand-white);
  border: 1px solid var(--qm-border-default);
  border-radius: 999px;
  text-align: left;
}
.qm-user-chip__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--qm-brand-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qm-user-chip__meta { line-height: 1.25; }
.qm-user-chip__name { font-size: 12px; font-weight: 700; color: var(--qm-text-body); }
.qm-user-chip__role { font-size: 10px; color: var(--qm-text-secondary); }
.qm-user-chip__logout {
  display: inline;
  border: 0;
  background: none;
  padding: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--qm-brand-red);
  cursor: pointer;
  font-family: inherit;
}
.qm-user-chip__logout:hover { text-decoration: underline; }

.qm-content { flex: 1; }

.qm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .qm-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.qm-kpi {
  background: var(--qm-brand-white);
  border: 1px solid var(--qm-border-default);
  border-radius: var(--qm-radius-card);
  padding: 20px;
  min-height: 126px;
  box-sizing: border-box;
  position: relative;
}
.qm-kpi__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qm-text-secondary);
  margin: 0 36px 10px 0;
}
.qm-kpi__icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--qm-bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--qm-icon);
}
.qm-kpi__value {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--qm-text-body);
  line-height: 1.1;
}
.qm-kpi__unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--qm-text-secondary);
  margin-left: 6px;
}
.qm-kpi__hint {
  font-size: 11px;
  color: var(--qm-text-muted);
  margin: 8px 0 0;
}

.qm-page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.qm-page-head h1 {
  flex: 1;
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--qm-text-body);
}

.qm-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  height: 22px;
  box-sizing: border-box;
}
.qm-pill--active { background: var(--qm-alert-green-bg); color: var(--qm-alert-green); }
.qm-pill--inactive { background: var(--qm-bg-neutral); color: var(--qm-text-secondary); }
.qm-pill--warning { background: var(--qm-alert-amber-bg); color: var(--qm-alert-amber); }
.qm-pill--danger { background: var(--qm-alert-red-bg); color: var(--qm-alert-red); }

.qm-btn-primary {
  background: var(--qm-brand-red) !important;
  color: #fff !important;
  border-radius: 999px !important;
  text-transform: none !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  height: 42px !important;
  padding: 0 18px !important;
}
.qm-btn-secondary {
  background: var(--qm-brand-white) !important;
  color: var(--qm-text-body) !important;
  border: 1px solid var(--qm-border-default) !important;
  border-radius: 999px !important;
  text-transform: none !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  height: 42px !important;
}

.qm-table-card {
  background: var(--qm-brand-white);
  border: 1px solid var(--qm-border-default);
  border-radius: var(--qm-radius-card);
  padding: 20px;
  overflow: hidden;
}
.qm-table-card__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
}
.qm-table-card__sub {
  font-size: 11px;
  color: var(--qm-text-secondary);
  margin: 0 0 16px;
}
.qm-table-card .mud-table { background: transparent; }
.qm-table-card .mud-table-cell { border-bottom-color: var(--qm-border-divider) !important; }
.qm-action-link {
  display: block;
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--qm-brand-red);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  text-align: right;
  line-height: 1.5;
}
.qm-action-link:hover { text-decoration: underline; }
.qm-action-link--muted { color: var(--qm-text-muted); cursor: default; }
.qm-action-link--muted:hover { text-decoration: none; }

.qm-banner-impersonation {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--qm-alert-amber-bg);
  border: 1px solid #E5C88A;
  border-radius: var(--qm-radius-ctrl);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Login (Figma 145:1138) */
.qm-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--qm-bg-app);
  padding: 24px;
}
.qm-auth-card {
  width: 420px;
  max-width: 100%;
  background: var(--qm-brand-white);
  border-radius: 20px;
  padding: 32px;
  box-sizing: border-box;
  box-shadow: 0 8px 28px rgba(58, 55, 51, 0.06);
}
.qm-auth-brand {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--qm-text-muted);
  margin: 0 0 12px;
}
.qm-auth-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--qm-text-body);
}
/* FocusOnNavigate / foco programático: sin anillo del navegador; teclado sí. */
.qm-auth-title:focus { outline: none; }
.qm-auth-title:focus-visible {
  outline: 2px solid var(--qm-brand-red);
  outline-offset: 3px;
}
.qm-topbar__greet:focus { outline: none; }
.qm-topbar__greet:focus-visible {
  outline: 2px solid var(--qm-brand-red);
  outline-offset: 3px;
}
.qm-auth-sub {
  margin: 0 0 24px;
  color: var(--qm-text-secondary);
  font-size: 12px;
}
.qm-auth-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qm-text-muted);
  margin-bottom: 6px;
}
.qm-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--qm-border-default);
  border-radius: var(--qm-radius-ctrl);
  background: var(--qm-bg-app);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--qm-text-body);
  box-sizing: border-box;
}
.qm-input:focus {
  outline: none;
  border-color: var(--qm-brand-black);
}
.qm-auth-submit {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: var(--qm-radius-ctrl);
  background: var(--qm-brand-black);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.qm-auth-submit:hover { background: #000; }
.qm-auth-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--qm-brand-black);
  text-decoration: none;
}
.qm-auth-link:hover { text-decoration: underline; }
.qm-auth-error {
  background: var(--qm-alert-red-bg);
  color: var(--qm-alert-red);
  border-radius: var(--qm-radius-ctrl);
  padding: 12px 14px;
  font-size: 12px;
  margin-bottom: 16px;
}
.qm-auth-status {
  margin-top: 20px;
  border: 1px solid var(--qm-border-default);
  border-radius: 14px;
  padding: 14px;
  background: var(--qm-bg-app);
  font-size: 12px;
  color: var(--qm-text-secondary);
}
.qm-auth-status-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qm-text-muted);
  margin-bottom: 8px;
}
