*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #f0f6f9;
  color: #1a1a2e;
}

/* LOGIN */
.login-overlay {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f6f9;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(19,74,107,.12);
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: #134a6b;
  margin-bottom: 6px;
}

.login-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e4eff5;
}
.login-logos--center {
  justify-content: center;
}

.login-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.login-logo {
  height: 68px;
  width: auto;
  object-fit: contain;
}

.login-by {
  font-size: 11px;
  font-weight: 600;
  color: #134a6b;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .6;
}

.login-sub {
  color: #666;
  font-size: 13px;
  margin-bottom: 28px;
}

.login-card button {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  justify-content: center;
}

/* HEADER */
header {
  background: #134a6b;
  color: #fff;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

header h1 { font-size: 20px; font-weight: 600; }
header h1 small { font-size: 13px; font-weight: 400; opacity: .7; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-size: 13px;
  padding: 5px 14px;
  align-self: auto;
}
.btn-logout:hover { background: rgba(255,255,255,.12); }

main {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

section {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(19,74,107,.08);
}

section h2 {
  font-size: 16px;
  font-weight: 600;
  color: #134a6b;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e4eff5;
}

/* FORM */
form { display: flex; flex-direction: column; gap: 16px; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 180px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; color: #555; }
.field input, .field select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fafafa;
  transition: border-color .15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: #27b378;
  background: #fff;
}

.optional { font-weight: 400; color: #aaa; font-size: 12px; }

button {
  align-self: flex-start;
  padding: 9px 20px;
  background: #134a6b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
button:hover { background: #0d3550; }
button:disabled { background: #aaa; cursor: not-allowed; }

/* MENSAJES */
.msg {
  margin-top: 10px;
  min-height: 20px;
  font-size: 13px;
}
.msg.ok   { color: #1a7a4e; }
.msg.err  { color: #c62828; }
.msg.info { color: #134a6b; }

/* BADGE */
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-off { background: #fce4e4; color: #c62828; }
.badge-on  { background: #e5f7ef; color: #1a7a4e; }

/* TOOLBAR */
.toolbar { margin-bottom: 12px; }
.toolbar button { background: #6c757d; }
.toolbar button:hover { background: #545b62; }

/* TABLA */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  padding: 8px 10px;
  background: #eaf2f7;
  color: #134a6b;
  font-weight: 600;
  border-bottom: 2px solid #c2d9e8;
}
td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
.empty { text-align: center; color: #aaa; padding: 24px; }

/* ESTADO BADGES EN TABLA */
.estado-3    { color: #1a7a4e; font-weight: 600; }
.estado-2    { color: #e65100; font-weight: 600; }
.estado-1    { color: #134a6b; font-weight: 600; }
.estado-err  { color: #c62828; font-weight: 600; }

/* BOTONES PEQUEÑOS */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  margin-right: 4px;
  align-self: auto;
}
.btn-dl  { background: #27b378; }
.btn-dl:hover { background: #1e9060; }
.btn-del { background: #c62828; }
.btn-del:hover { background: #8e1010; }

/* MOTIVO DE RECHAZO */
.motivo {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #c62828;
  margin-top: 3px;
}

/* REPORTE */
.hint { color: #666; margin-bottom: 16px; font-size: 13px; }

#reporte-link { margin-top: 14px; }
#reporte-link a {
  display: inline-block;
  padding: 9px 20px;
  background: #27b378;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}
#reporte-link a:hover { background: #1e9060; }

.hidden { display: none; }

/* BOTÓN MANUAL EN HEADER */
.btn-manual {
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-size: 13px;
  padding: 5px 14px;
  align-self: auto;
}
.btn-manual:hover { background: rgba(255,255,255,.12); }

/* PANTALLA MANUAL */
#screen-manual {
  min-height: 100vh;
  background: #f0f6f9;
}

.manual-wrap {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 16px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

/* NAV LATERAL */
.manual-nav {
  flex-shrink: 0;
  width: 200px;
  background: #fff;
  border-radius: 8px;
  padding: 18px 16px;
  box-shadow: 0 1px 4px rgba(19,74,107,.08);
  position: sticky;
  top: 24px;
}

.manual-nav-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #888;
  margin-bottom: 10px;
}

.manual-nav ol {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manual-nav a {
  color: #134a6b;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
}
.manual-nav a:hover { color: #27b378; text-decoration: underline; }

/* CONTENIDO DEL MANUAL */
.manual-content {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  padding: 36px 40px;
  box-shadow: 0 1px 4px rgba(19,74,107,.08);
  line-height: 1.65;
}

.manual-content h1 {
  font-size: 22px;
  font-weight: 700;
  color: #134a6b;
  margin-bottom: 8px;
}

.manual-intro {
  color: #555;
  margin-bottom: 32px;
  font-size: 14px;
}

.manual-content h2 {
  font-size: 17px;
  font-weight: 700;
  color: #134a6b;
  margin-top: 36px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e4eff5;
}

.manual-content h3 {
  font-size: 14px;
  font-weight: 600;
  color: #134a6b;
  margin-top: 18px;
  margin-bottom: 8px;
}

.manual-content p {
  margin-bottom: 10px;
  color: #333;
  font-size: 14px;
}

.manual-content ol,
.manual-content ul {
  padding-left: 22px;
  margin-bottom: 12px;
}

.manual-content li {
  margin-bottom: 5px;
  font-size: 14px;
  color: #333;
}

.manual-content table {
  margin: 12px 0 18px;
  font-size: 13px;
  border: 1px solid #e4eff5;
  border-radius: 6px;
  overflow: hidden;
}

.manual-content th {
  background: #eaf2f7;
  font-size: 12px;
}

.manual-content td,
.manual-content th {
  padding: 8px 12px;
}

.manual-content code {
  background: #eaf2f7;
  color: #134a6b;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.manual-note {
  background: #eaf7f1;
  border-left: 3px solid #27b378;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  margin: 12px 0 18px;
  font-size: 13px;
  color: #0e4a2e;
}

.manual-footer {
  margin-top: 40px;
  font-size: 12px;
  color: #aaa;
  text-align: right;
}

/* POWERED BY AWS */
.powered-aws {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #e4eff5;
  text-align: center;
  font-size: 12px;
  color: #999;
}
.aws-name {
  color: #FF9900;
  font-weight: 700;
  letter-spacing: .02em;
}

/* PIE DE PÁGINA */
.app-footer {
  background: #134a6b;
  color: rgba(255,255,255,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 32px;
  font-size: 12px;
  margin-top: 12px;
}
.app-footer strong { color: #fff; }
.footer-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .85;
}
.footer-link {
  color: inherit;
  text-decoration: none;
  opacity: .85;
  transition: opacity .15s;
}
.footer-link:hover { opacity: 1; }

@media (max-width: 640px) {
  .manual-wrap { flex-direction: column; }
  .manual-nav  { width: 100%; position: static; }
  .manual-content { padding: 24px 18px; }
  .app-footer { flex-direction: column; gap: 8px; text-align: center; }
}
