* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #F5F6F8;
  color: #161B22;
}
a { color: #2452C8; text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: #12182B; color: #C7CEDC;
  display: flex; flex-direction: column; padding: 24px 0;
}
.brand { padding: 0 24px 28px; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: #fff; }
.brand-badge {
  width: 30px; height: 30px; border-radius: 8px; background: #2452C8;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: #fff;
}
.nav-item { display: block; padding: 9px 24px; font-size: 14px; color: #C7CEDC; }
.nav-item:hover { text-decoration: none; background: #1D2642; }
.nav-item.active { background: #1D2642; color: #fff; }
.logout-form { margin-top: auto; padding: 0 24px; }
.nav-footer { font-size: 12px; color: #6B7690; margin-bottom: 6px; }
.link-button { background: none; border: none; color: #C7CEDC; font-size: 13px; cursor: pointer; padding: 0; }

.content { flex-grow: 1; padding: 32px 40px; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.titulo-con-pill { display: flex; align-items: center; gap: 10px; }
h1 { margin: 0; font-size: 22px; font-weight: 600; }
.muted { color: #5B6472; }
.muted.small { font-size: 12px; color: #8A93A3; }
.back-link { font-size: 13px; color: #5B6472; display: inline-block; margin-bottom: 12px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; background: #2452C8; color: #fff;
  padding: 10px 18px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn-primary:hover { text-decoration: none; opacity: .92; }
.btn-secundario { padding: 10px 18px; font-size: 14px; color: #5B6472; }
.btn-dashed {
  display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px dashed #C7CEDC;
  color: #2452C8; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.btn-quitar {
  background: transparent; border: 1px solid #E4E7EC; border-radius: 8px; height: 38px; width: 38px;
  color: #A32D2D; cursor: pointer;
}

.card { background: #fff; border: 1px solid #E4E7EC; border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #E4E7EC; }
.form-seccion { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.seccion-titulo { font-size: 15px; font-weight: 600; }
.seccion-titulo-sm { font-size: 14px; font-weight: 600; }
.seccion-header { display: flex; align-items: center; justify-content: space-between; }

.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla thead tr { background: #FAFBFC; text-align: left; }
.tabla th { padding: 10px 20px; font-weight: 500; color: #5B6472; }
.tabla td { padding: 12px 20px; border-top: 1px solid #EEF0F3; }
.text-right { text-align: right; }
.mono { font-family: monospace; }

.pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.pill-blue { background: #E6F1FB; color: #0C447C; }
.pill-green { background: #E1F5EE; color: #0F6E56; }
.pill-amber { background: #FAEEDA; color: #854F0B; }
.pill-red { background: #FCEBEB; color: #A32D2D; }
.pill-gray { background: #F1EFE8; color: #444441; }

.form-ancho { max-width: 720px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sangria { padding-left: 24px; }
label { display: block; font-size: 13px; font-weight: 500; color: #3C4451; margin-bottom: 6px; }
input[type=text], input[type=password], select {
  width: 100%; padding: 9px 12px; border: 1px solid #D7DBE2; border-radius: 8px; font-size: 14px; background: #fff;
}
input[type=text]:focus, input[type=password]:focus, select:focus {
  outline: none; border-color: #2452C8; box-shadow: 0 0 0 3px rgba(36,82,200,0.12);
}
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: #3C4451; margin: 0; }
.checkbox-label input { width: auto; }
.error-text { font-size: 12px; color: #A32D2D; margin-top: 4px; }
.nota-matriz { display: flex; align-items: center; gap: 10px; background: #F5F6F8; border-radius: 8px; padding: 12px 14px; font-size: 13px; }
.sucursales-lista { display: flex; flex-direction: column; gap: 10px; }
.sucursal-fila { display: grid; grid-template-columns: 1fr 160px 38px; gap: 10px; }
.acciones-form { display: flex; justify-content: flex-end; gap: 10px; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  background: #fff; border: 1px solid #E4E7EC; border-radius: 12px; padding: 32px; width: 320px;
  display: flex; flex-direction: column; gap: 4px; text-align: center;
}
.login-badge { margin: 0 auto 12px; }
.login-card label { text-align: left; margin-top: 12px; }
.error-box { background: #FCEBEB; color: #993556; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-top: 8px; }
.login-card .btn-primary { margin-top: 16px; justify-content: center; }

textarea { width: 100%; padding: 10px 12px; border: 1px solid #D5D9E0; border-radius: 8px; font: inherit; min-height: 80px; box-sizing: border-box; }
.aviso { padding: 12px 16px; border-radius: 8px; font-size: 13px; background: #FAEEDA; color: #854F0B; }
.aviso-error { background: #FCEBEB; color: #A32D2D; }
.btn-chico { padding: 4px 10px; font-size: 12px; border: 1px solid #D5D9E0; border-radius: 6px; color: #3C4451; }
.btn-chico:hover { text-decoration: none; background: #F4F5F7; }
.fila-permisos { display: flex; align-items: center; gap: 20px; }
.aviso-ok { background: #E1F5EE; color: #0F6E56; }
