/* Shell visual replicando Altcom Web (sistema altcom web) */
:root {
  --alt-blue: #1f9edd;
  --alt-blue-2: #2ba7e6;
  --alt-blue-dk: #1683bd;
  --alt-nav: #2f3d4c;
  --alt-nav-hover: #3d4f61;
  --alt-nav-active: #212c37;
  --alt-band: #33607a;
  --alt-green: #7cc04b;
  --alt-green-dk: #5fa733;
  --alt-teal: #16a085;
  --alt-pink: #e5205f;
  --alt-yellow: #ffd23f;
  --alt-card: #ffffff;
  --alt-border: #d7e3ec;
  --alt-thead: #6c7a89;
  --alt-text: #2b3a45;
  --alt-muted: #7b8a97;
  --alt-font: "Segoe UI", "Open Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body.shell-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--alt-font);
  background: linear-gradient(180deg, var(--alt-blue-2) 0%, var(--alt-blue) 55%, var(--alt-blue-dk) 100%);
  background-attachment: fixed;
  color: var(--alt-text);
}

/* ---- Cabecera (logo + usuario + TC) ---- */
.shell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 26px 8px;
  color: #fff;
}

.shell-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}
.shell-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--alt-blue);
  font-size: 17px;
  font-weight: 900;
}
.shell-brand span {
  color: var(--alt-yellow);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0;
}

.shell-user {
  text-align: right;
  font-size: 12px;
  line-height: 1.5;
}
.shell-user .u-name { font-weight: 700; font-size: 14px; }
.shell-user .u-mail { opacity: 0.95; }
.shell-user .u-tc { color: var(--alt-yellow); font-weight: 600; }
.shell-user .u-tc a { color: var(--alt-yellow); text-decoration: none; margin-left: 8px; }
.shell-user .u-tc a:hover { text-decoration: underline; }

/* ---- Menú de pestañas oscuras (centrado) ---- */
.shell-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  padding: 4px 12px 0;
  margin: 6px auto 0;
  max-width: 1000px;
}
.shell-nav a {
  padding: 13px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #dfe8ef;
  text-decoration: none;
  background: var(--alt-nav);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.shell-nav a:first-child { border-top-left-radius: 4px; }
.shell-nav a:last-child { border-top-right-radius: 4px; border-right: none; }
.shell-nav a:hover { background: var(--alt-nav-hover); color: #fff; }
.shell-nav a.active { background: var(--alt-nav-active); color: #fff; }
.shell-nav a.nav-extra { color: #ffe9a8; }
.shell-nav a.nav-extra.active { color: #fff; }

/* ---- Área de contenido (tarjeta blanca) ---- */
.shell-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 16px 40px;
}
.shell-card {
  background: var(--alt-card);
  border-radius: 5px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16);
  padding: 22px 26px 28px;
}

/* Banda tipo Altcom (Emitido / cliente) */
.alt-band {
  background: var(--alt-band);
  color: #fff;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
}

.shell-card h1 { margin: 0 0 0.5rem; font-size: 1.2rem; color: var(--alt-band); }
.shell-card h2 { font-size: 14px; color: var(--alt-muted); margin: 18px 0 8px; }

.hint { font-size: 12px; color: var(--alt-muted); line-height: 1.5; }
.hint code { background: #eef4f8; padding: 1px 5px; border-radius: 3px; font-size: 11px; }

label { display: block; font-size: 12px; color: var(--alt-muted); margin: 10px 0 4px; }

input[type="text"], input[type="url"], input[type="email"], input[type="password"],
input[type="number"], input[type="time"], input[type="date"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--alt-border);
  border-radius: 3px;
  background: #fbfdff;
  font-size: 14px;
  color: var(--alt-text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--alt-blue);
  box-shadow: 0 0 0 2px rgba(31, 158, 221, 0.15);
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 700px) { .row2, .row3 { grid-template-columns: 1fr; } }

/* Buscador estilo Altcom (input + botón contiguo) */
.alt-search {
  display: flex;
  gap: 0;
  max-width: 460px;
  margin: 4px 0 18px;
}
.alt-search input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}
.alt-search button {
  border: none;
  background: var(--alt-blue);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 0 22px;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
  cursor: pointer;
}
.alt-search button:hover { background: var(--alt-blue-dk); }

.btn {
  display: inline-block;
  padding: 9px 18px;
  background: var(--alt-blue);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  margin-right: 6px;
  text-decoration: none;
}
.btn:hover { background: var(--alt-blue-dk); }
.btn.secondary { background: var(--alt-muted); }
.btn.secondary:hover { background: #5f6d79; }
.btn.green { background: var(--alt-green); }
.btn.green:hover { background: var(--alt-green-dk); }
.btn.danger { background: var(--alt-pink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ok {
  background: #eaf6e1; color: #2f6b17;
  padding: 10px 12px; border-radius: 3px; font-size: 12px;
  margin-bottom: 12px; border-left: 3px solid var(--alt-green);
}
.err {
  background: #fdeaf0; color: #a01243;
  padding: 10px 12px; border-radius: 3px; font-size: 12px;
  margin-bottom: 12px; border-left: 3px solid var(--alt-pink);
}
.sep { border: none; border-top: 1px solid var(--alt-border); margin: 16px 0; }

/* ---- Tablas estilo Altcom ---- */
.lines-scroll { overflow-x: auto; margin: 8px 0; }
.lines-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lines-table th {
  text-align: left;
  background: var(--alt-thead);
  color: #fff;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
}
.lines-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef2f5;
  vertical-align: top;
}
.lines-table tbody tr:nth-child(even) td { background: #f7fafc; }
.lines-table tbody tr:hover td { background: #eef7fd; }
.lines-table td.num, .lines-table th.num { text-align: right; }

.check-ok {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--alt-green); color: #fff; font-size: 12px;
}

.shell-footer {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  padding: 6px 12px 26px;
}

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-ok { background: #eaf6e1; color: #2f6b17; }
.badge-warn { background: #fff8e1; color: #f57f17; }
.badge-err { background: #fdeaf0; color: #a01243; }
.badge-draft { background: #eceff1; color: #546e7a; }

.narrow { max-width: 480px; margin: 40px auto; }

.empty-hint {
  text-align: center;
  color: var(--alt-muted);
  font-size: 13px;
  padding: 30px 10px;
}

/* Configurar — pestañas */
.cfg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--alt-border);
  padding-bottom: 0;
}
.cfg-tab {
  display: inline-block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--alt-muted);
  text-decoration: none;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
}
.cfg-tab:hover { color: var(--alt-text); background: #f3f7fa; }
.cfg-tab.active {
  color: var(--alt-band);
  font-weight: 600;
  background: #fff;
  border-color: var(--alt-border);
  border-bottom-color: #fff;
}
.cfg-panel { padding-top: 4px; }
.cfg-panel[hidden] { display: none !important; }
.cfg-h {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 8px;
}
.cfg-inline label { display: block; }
