:root {
  --bg: #050b13;
  --bg-2: #07111f;
  --panel: rgba(10, 22, 38, 0.90);
  --panel-2: rgba(13, 29, 48, 0.82);
  --line: rgba(88, 188, 226, 0.19);
  --line-strong: rgba(88, 188, 226, 0.42);
  --cyan: #58bce2;
  --cyan-strong: #78d6f6;
  --gold: #d7ae45;
  --text: #eef6fb;
  --muted: #8196aa;
  --muted-2: #607487;
  --danger: #ee6771;
  --success: #66d6a3;
  --warning: #e6c86f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 5%, rgba(27, 104, 145, 0.18), transparent 34rem),
    radial-gradient(circle at 92% 86%, rgba(215, 174, 69, 0.07), transparent 30rem),
    linear-gradient(145deg, #040910 0%, #07111f 52%, #050a12 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image:
    linear-gradient(rgba(89, 188, 226, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 188, 226, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), transparent 90%);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.landing-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.hero-panel {
  width: min(780px, 100%);
  padding: clamp(34px, 7vw, 68px);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(12, 27, 44, .93), rgba(5, 13, 23, .94));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.025);
  position: relative;
  overflow: hidden;
}
.hero-panel::before,
.hero-panel::after {
  content: "";
  position: absolute;
  width: 86px;
  height: 86px;
  border-color: rgba(88, 188, 226, .38);
  pointer-events: none;
}
.hero-panel::before { left: 16px; top: 16px; border-left: 1px solid; border-top: 1px solid; }
.hero-panel::after { right: 16px; bottom: 16px; border-right: 1px solid; border-bottom: 1px solid; }
.agency-mark {
  width: 126px;
  height: 126px;
  margin: 0 auto 28px;
  border: 1px solid rgba(215,174,69,.48);
  clip-path: polygon(50% 0%, 90% 16%, 86% 73%, 50% 100%, 14% 73%, 10% 16%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(215,174,69,.08), rgba(88,188,226,.04));
  box-shadow: inset 0 0 28px rgba(88,188,226,.06);
}
.agency-mark__top { font-weight: 900; letter-spacing: .12em; font-size: 25px; color: #f5e1a4; }
.agency-mark__line { width: 54px; height: 1px; background: var(--cyan); margin: 8px 0; opacity: .65; }
.agency-mark__bottom { font-size: 10px; color: var(--muted); letter-spacing: .25em; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.eyebrow.danger { color: var(--danger); }
.hero-panel h1, .page-heading h1 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.02;
}
.hero-panel h1 { font-size: clamp(34px, 7vw, 62px); }
.hero-panel h1 span { color: #dcecf5; text-shadow: 0 0 28px rgba(88,188,226,.12); }
.hero-copy {
  max-width: 590px;
  margin: 22px auto 24px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}
.security-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 10px 14px;
  color: #a8c3d4;
  border: 1px solid rgba(88,188,226,.16);
  background: rgba(88,188,226,.035);
  border-radius: 5px;
  font-size: 12px;
  letter-spacing: .04em;
}
.security-note span { color: var(--gold); font-size: 9px; }
.primary-button, .ghost-button, .back-button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: .18s ease;
}
.primary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  border: 1px solid rgba(88,188,226,.55);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(25, 91, 127, .9), rgba(14, 58, 84, .95));
  color: #effaff;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(20, 108, 150, .14), inset 0 1px rgba(255,255,255,.08);
}
.primary-button:hover { transform: translateY(-1px); border-color: var(--cyan-strong); filter: brightness(1.08); }
.primary-button:disabled { opacity: .5; cursor: wait; transform: none; }
.discord-login { min-width: 235px; }
.button-icon { color: var(--cyan-strong); font-size: 16px; }
.microcopy { color: var(--muted-2); font-size: 11px; margin: 16px 0 0; }
.denied-symbol {
  width: 70px; height: 70px; margin: 0 auto 20px; border: 1px solid rgba(238,103,113,.45);
  display: grid; place-items: center; color: var(--danger); font-size: 40px; border-radius: 50%;
  box-shadow: inset 0 0 25px rgba(238,103,113,.06);
}
.denied-panel h1 span { color: var(--danger); }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  min-height: 72px;
  padding: 12px clamp(18px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 11, 19, .84);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand-button {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.mini-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid rgba(215,174,69,.45);
  color: #f0d992;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  clip-path: polygon(50% 0%, 91% 17%, 87% 74%, 50% 100%, 13% 74%, 9% 17%);
}
.brand-button strong { display: block; font-size: 12px; letter-spacing: .11em; }
.brand-button small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .2em; margin-top: 3px; }
.user-area { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip img, .avatar-fallback {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(88,188,226,.3);
  object-fit: cover; background: #0d2133;
}
.avatar-fallback { display: grid; place-items: center; color: var(--cyan); font-weight: 800; }
.user-chip small { display: block; color: var(--muted-2); font-size: 8px; letter-spacing: .13em; }
.user-chip strong { display: block; font-size: 11px; margin-top: 2px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghost-button {
  color: var(--muted);
  border: 1px solid rgba(129,150,170,.18);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 11px;
}
.ghost-button:hover { color: var(--text); border-color: rgba(129,150,170,.4); }

.workspace { width: min(1120px, calc(100% - 36px)); margin: 0 auto; flex: 1; padding: 58px 0 70px; }
.view { display: none; animation: view-in .22s ease both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-heading { margin-bottom: 30px; }
.page-heading.compact { text-align: center; max-width: 760px; margin: 20px auto 38px; }
.page-heading h1 { font-size: clamp(30px, 5vw, 48px); }
.page-heading p:not(.eyebrow) { color: var(--muted); line-height: 1.6; margin: 12px 0 0; }
.back-button {
  color: var(--muted);
  background: transparent;
  padding: 0;
  margin-bottom: 26px;
  font-size: 12px;
  letter-spacing: .06em;
}
.back-button:hover { color: var(--cyan); }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; max-width: 850px; margin: 0 auto; }
.action-card {
  min-height: 245px;
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(12,27,44,.92), rgba(6,15,26,.95));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: .2s ease;
  box-shadow: 0 18px 45px rgba(0,0,0,.22);
}
.action-card::after {
  content: ""; position: absolute; inset: auto -35px -70px auto; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(88,188,226,.11), transparent 68%);
}
.new-card::after { background: radial-gradient(circle, rgba(215,174,69,.11), transparent 68%); }
.action-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 24px 60px rgba(0,0,0,.30); }
.action-code { position: absolute; right: 22px; top: 18px; color: var(--muted-2); font-size: 10px; letter-spacing: .16em; }
.action-icon { display: block; color: var(--cyan); font-size: 52px; font-weight: 200; line-height: 1; margin: 34px 0 28px; }
.new-card .action-icon { color: var(--gold); }
.action-card strong { display: block; text-transform: uppercase; font-size: 20px; letter-spacing: .06em; }
.action-card small { display: block; color: var(--muted); margin-top: 8px; font-size: 12px; }
.policy-strip {
  max-width: 850px; margin: 18px auto 0; padding: 14px 16px; border: 1px solid rgba(88,188,226,.10); border-radius: 5px;
  display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 11px; background: rgba(7,17,31,.55);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 14px rgba(102,214,163,.6); flex: 0 0 auto; }

.search-panel, .record-form, .citizen-card, .record-card {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(11,25,42,.90), rgba(6,15,26,.92));
  box-shadow: 0 16px 50px rgba(0,0,0,.20);
}
.search-panel {
  display: flex; align-items: end; gap: 12px; padding: 18px; border-radius: 7px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field.grow { flex: 1; }
.field.mode-field { width: 180px; flex: 0 0 180px; }
.field > span {
  color: #9db0c0; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
}
.field em { color: var(--muted-2); font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 5px; }
input, select, textarea {
  width: 100%;
  color: var(--text);
  background: rgba(3, 10, 18, .78);
  border: 1px solid rgba(100,153,183,.22);
  border-radius: 4px;
  outline: none;
  transition: .15s ease;
}
input, select { height: 44px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; min-height: 110px; }
input::placeholder, textarea::placeholder { color: #40586a; }
input:focus, select:focus, textarea:focus { border-color: rgba(88,188,226,.62); box-shadow: 0 0 0 3px rgba(88,188,226,.07); }
.search-submit { height: 44px; min-height: 44px; }
.feedback {
  margin-top: 16px; padding: 13px 15px; border: 1px solid rgba(88,188,226,.18); border-radius: 5px;
  color: #b8cbd7; background: rgba(88,188,226,.045); font-size: 12px;
}
.feedback.error { color: #ffc1c6; border-color: rgba(238,103,113,.26); background: rgba(238,103,113,.055); }
.feedback.success { color: #baf1d6; border-color: rgba(102,214,163,.25); background: rgba(102,214,163,.05); }
.results { display: grid; gap: 16px; margin-top: 24px; }
.citizen-card { border-radius: 7px; overflow: hidden; }
.citizen-summary { padding: 20px 22px; display: flex; justify-content: space-between; gap: 18px; align-items: start; border-bottom: 1px solid var(--line); }
.citizen-summary h3 { margin: 3px 0 4px; text-transform: uppercase; font-size: 18px; letter-spacing: .04em; }
.citizen-summary p { margin: 0; color: var(--muted); font-size: 11px; }
.weapon-total { min-width: 140px; text-align: right; }
.weapon-total strong { display: block; color: var(--cyan-strong); font-size: 34px; line-height: 1; }
.weapon-total span { color: var(--muted); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.caliber-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.caliber-pill { padding: 5px 8px; border: 1px solid rgba(129,150,170,.16); border-radius: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.records-list { padding: 8px; }
.record-card {
  box-shadow: none; margin: 8px 0; border-radius: 5px; padding: 15px 16px; background: rgba(4,13,23,.48);
}
.record-line { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.serial { color: #e8d79c; font-weight: 900; letter-spacing: .08em; font-size: 13px; }
.record-meta { color: var(--muted); font-size: 10px; margin-top: 7px; display: flex; flex-wrap: wrap; gap: 7px 12px; }
.status-badge { padding: 5px 8px; border: 1px solid rgba(88,188,226,.24); color: #acd7e9; border-radius: 3px; text-transform: uppercase; font-size: 8px; letter-spacing: .1em; white-space: nowrap; }
.record-details { margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(88,188,226,.08); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 16px; }
.detail { font-size: 10px; color: var(--muted); line-height: 1.45; }
.detail strong { display: block; color: #9fb5c5; font-size: 8px; text-transform: uppercase; letter-spacing: .09em; margin-bottom: 2px; }
.detail.full { grid-column: 1 / -1; }
.empty-state { padding: 36px; text-align: center; color: var(--muted); border: 1px dashed rgba(88,188,226,.2); border-radius: 7px; }

.record-form { border-radius: 8px; overflow: hidden; }
.form-section { padding: 24px; border-bottom: 1px solid var(--line); display: grid; gap: 16px; }
.form-section:last-of-type { border-bottom: 0; }
.section-label { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.section-label > span { color: var(--cyan); font-size: 9px; letter-spacing: .12em; }
.section-label strong { text-transform: uppercase; font-size: 12px; letter-spacing: .11em; }
.section-label em { margin-left: auto; color: var(--muted-2); font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .09em; }
.form-grid.two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.conditional-field { padding: 14px; border: 1px solid rgba(215,174,69,.20); background: rgba(215,174,69,.025); border-radius: 5px; }
.form-notice { margin: 18px 24px 0; padding: 14px 16px; display: flex; gap: 11px; color: #aabcc8; background: rgba(215,174,69,.035); border: 1px solid rgba(215,174,69,.15); border-radius: 5px; font-size: 11px; line-height: 1.5; }
.form-notice span { color: var(--gold); }
.form-notice p { margin: 0; }
.record-form > .feedback { margin: 16px 24px 0; }
.save-button { margin: 18px 24px 24px; width: calc(100% - 48px); }
.site-footer { padding: 20px; text-align: center; color: #41596b; font-size: 8px; letter-spacing: .16em; border-top: 1px solid rgba(88,188,226,.07); }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; }
  .brand-button strong { font-size: 10px; }
  .user-chip span:not(.avatar-fallback) { display: none; }
  .workspace { width: min(100% - 24px, 1120px); padding-top: 38px; }
  .action-grid, .form-grid.two { grid-template-columns: 1fr; }
  .action-card { min-height: 190px; }
  .search-panel { flex-direction: column; align-items: stretch; }
  .field.mode-field { width: 100%; flex-basis: auto; }
  .search-submit { width: 100%; }
  .citizen-summary { flex-direction: column; }
  .weapon-total { text-align: left; }
  .record-details { grid-template-columns: 1fr; }
  .detail.full { grid-column: auto; }
}

@media (max-width: 480px) {
  .hero-panel { padding: 34px 22px; }
  .agency-mark { width: 105px; height: 105px; }
  .topbar { padding-inline: 12px; }
  .ghost-button { padding: 7px 9px; }
  .brand-button small { display: none; }
  .page-heading h1 { font-size: 29px; }
  .form-section { padding: 18px; }
  .form-notice { margin-inline: 18px; }
  .save-button { margin-inline: 18px; width: calc(100% - 36px); }
}

/* El atributo hidden debe imponerse sobre el display de .field. */
[hidden] { display: none !important; }

.record-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid rgba(123, 157, 184, .12);
}
.danger-button {
  border: 1px solid rgba(239, 92, 92, .42);
  background: rgba(139, 32, 32, .10);
  color: #ff9e9e;
  padding: 9px 13px;
  border-radius: 4px;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.danger-button:hover { background: rgba(184, 45, 45, .18); border-color: rgba(255, 115, 115, .66); }
.danger-button:disabled { opacity: .55; cursor: wait; }

/* V5 · Gestión y auditoría */
.secondary-button {
  border: 1px solid rgba(88,188,226,.28);
  background: rgba(88,188,226,.055);
  color: #b9d9e9;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  transition: .18s ease;
}
.secondary-button:hover { border-color: rgba(88,188,226,.6); color: #effaff; background: rgba(88,188,226,.1); }
.edit-button { border-color: rgba(215,174,69,.3); color: #e6ce8b; background: rgba(215,174,69,.045); }
.edit-button:hover { border-color: rgba(215,174,69,.62); color: #f7e2a6; background: rgba(215,174,69,.09); }
.modal-open { overflow: hidden; }
.modal-shell { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal-shell[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(1,6,11,.78); backdrop-filter: blur(8px); }
.modal-card {
  position: relative; z-index: 1; width: min(820px, 100%); max-height: min(88vh, 920px); overflow: auto;
  border: 1px solid rgba(88,188,226,.28); border-radius: 10px;
  background: linear-gradient(155deg, rgba(10,24,40,.99), rgba(4,12,21,.99));
  box-shadow: 0 34px 100px rgba(0,0,0,.58); padding: clamp(24px, 4vw, 38px);
}
.modal-close { position: absolute; right: 15px; top: 11px; border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-title { margin: 2px 36px 6px 0; font-size: clamp(25px,4vw,36px); text-transform: uppercase; letter-spacing: .03em; }
.modal-copy { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.modal-form { display: grid; gap: 15px; }
.modal-grid { display: grid; gap: 14px; }
.modal-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; padding-top: 17px; border-top: 1px solid var(--line); }
.history-loading { color: var(--muted); padding: 24px 0; }
.history-list { display: grid; gap: 12px; margin-top: 24px; }
.history-event { border: 1px solid var(--line); border-radius: 7px; padding: 18px; background: rgba(7,18,31,.68); }
.history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.history-head strong { display: block; font-size: 13px; letter-spacing: .04em; color: #edf7fb; }
.history-head span { display: block; margin-top: 4px; color: var(--cyan); font-size: 11px; }
.history-head time { color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.history-changes { display: grid; gap: 8px; margin-top: 15px; }
.history-changes > div { display: grid; grid-template-columns: minmax(130px,.8fr) minmax(0,1fr) 20px minmax(0,1fr); align-items: center; gap: 9px; padding-top: 8px; border-top: 1px solid rgba(88,188,226,.08); font-size: 11px; }
.history-changes b { color: #a8bdcb; font-weight: 700; }
.history-changes .old-value { color: #c78b92; overflow-wrap: anywhere; }
.history-changes .new-value { color: #81d8af; overflow-wrap: anywhere; }
.history-changes .arrow { color: var(--muted-2); text-align: center; }
.history-note { color: var(--muted); font-size: 11px; margin: 13px 0 0; }
@media (max-width: 650px) {
  .modal-shell { padding: 10px; }
  .modal-card { max-height: 94vh; padding: 24px 18px; }
  .modal-grid.two { grid-template-columns: 1fr; }
  .history-head { display: block; }
  .history-head time { display: block; margin-top: 7px; }
  .history-changes > div { grid-template-columns: 1fr; gap: 4px; }
  .history-changes .arrow { text-align: left; transform: rotate(90deg); transform-origin: left center; height: 14px; }
  .record-actions { flex-wrap: wrap; }
}


/* V6 · trazabilidad de seriales */
.serial-warning, .serial-search-summary {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px;
  border: 1px solid rgba(215,174,69,.28); border-radius: 5px;
  background: rgba(215,174,69,.055); color: #cfdae2;
}
.serial-warning[hidden] { display: none; }
.serial-warning-icon {
  width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center;
  border: 1px solid rgba(215,174,69,.5); border-radius: 50%; color: #ecd27c;
  font-weight: 900; font-size: 12px;
}
.serial-warning strong, .serial-search-summary strong { display: block; color: #ecd27c; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.serial-warning p, .serial-search-summary p { margin: 4px 0 0; color: #aebfca; font-size: 11px; line-height: 1.5; }
.serial-warning small { display: block; margin-top: 5px; color: #7890a1; font-size: 9px; }
.serial-search-summary { margin-bottom: 0; }
.serial-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.serial-repeat-badge {
  padding: 3px 6px; border-radius: 3px; border: 1px solid rgba(215,174,69,.24);
  color: #d9c57f; background: rgba(215,174,69,.045); font-size: 8px;
  text-transform: uppercase; letter-spacing: .08em;
}
.duplicate-history { display: grid; gap: 7px; margin: 17px 0; max-height: 260px; overflow: auto; }
.duplicate-row { padding: 10px 12px; border: 1px solid rgba(88,188,226,.12); border-radius: 4px; background: rgba(4,13,23,.5); }
.duplicate-row strong { display: block; color: #dbe7ed; font-size: 11px; }
.duplicate-row span { display: block; color: #7890a1; font-size: 9px; margin-top: 3px; }
.duplicate-notice { padding: 11px 12px; border-left: 2px solid var(--gold); background: rgba(215,174,69,.04); color: #aebfca; font-size: 10px; line-height: 1.55; }
.eyebrow.warning { color: #e2c568; }

/* V7 · Pulido visual final */
:root {
  --cyan-soft: rgba(88,188,226,.12);
  --gold-soft: rgba(215,174,69,.10);
  --danger-soft: rgba(238,103,113,.10);
}

/* Portada */
.action-card {
  border-color: rgba(88,188,226,.22);
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 30%),
    linear-gradient(145deg, rgba(13,30,49,.95), rgba(5,15,26,.98));
}
.action-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: .55;
}
.new-card::before { background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.action-card:hover::before { opacity: 1; }
.action-icon {
  width: 64px; height: 64px; display: grid; place-items: center;
  border: 1px solid rgba(88,188,226,.23); border-radius: 50%;
  background: rgba(88,188,226,.035); font-size: 42px;
  box-shadow: inset 0 0 24px rgba(88,188,226,.035);
}
.new-card .action-icon { border-color: rgba(215,174,69,.25); background: rgba(215,174,69,.035); }
.policy-strip { backdrop-filter: blur(12px); }

/* Buscador */
.search-panel {
  position: relative;
  padding: 20px;
  border-color: rgba(88,188,226,.24);
  background: linear-gradient(145deg, rgba(12,28,46,.95), rgba(5,14,24,.97));
  box-shadow: 0 18px 55px rgba(0,0,0,.26), inset 0 1px rgba(255,255,255,.02);
}
.search-panel::before {
  content: "SEARCH / FIB DATABASE";
  position: absolute; top: -9px; left: 18px;
  padding: 0 8px; background: #07111f;
  color: #557288; font-size: 8px; font-weight: 800; letter-spacing: .16em;
}
.search-submit { min-width: 126px; }
.results { gap: 22px; margin-top: 22px; }
.feedback { backdrop-filter: blur(8px); }
.feedback.success { box-shadow: inset 3px 0 var(--success); }
.feedback.error { box-shadow: inset 3px 0 var(--danger); }
.empty-state {
  min-height: 140px; display: grid; place-items: center;
  background: rgba(6,16,27,.48); letter-spacing: .04em;
}

/* Ficha de ciudadano */
.citizen-card {
  border-radius: 10px;
  border-color: rgba(88,188,226,.24);
  box-shadow: 0 24px 65px rgba(0,0,0,.26);
  background: linear-gradient(160deg, rgba(10,25,42,.96), rgba(5,14,24,.97));
}
.citizen-summary {
  position: relative;
  padding: 24px 26px;
  background:
    radial-gradient(circle at 92% 30%, rgba(88,188,226,.08), transparent 220px),
    linear-gradient(90deg, rgba(88,188,226,.025), transparent 52%);
}
.citizen-summary::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px;
  background: linear-gradient(180deg, transparent, var(--cyan), transparent);
}
.citizen-kicker {
  color: #7f9bad; font-size: 9px; font-weight: 800; letter-spacing: .17em;
  text-transform: uppercase; display: flex; align-items: center; gap: 8px;
}
.citizen-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px rgba(88,188,226,.55); }
.citizen-summary h3 { margin-top: 7px; font-size: 22px; }
.weapon-total {
  min-width: 170px; padding-left: 24px; border-left: 1px solid rgba(88,188,226,.10);
  display: grid; justify-items: end;
}
.weapon-total small { color: #60798b; font-size: 7px; letter-spacing: .16em; margin-bottom: 5px; }
.weapon-total strong { font-size: 42px; font-variant-numeric: tabular-nums; text-shadow: 0 0 25px rgba(88,188,226,.13); }
.weapon-total span { margin-top: 4px; }
.caliber-row { gap: 7px; }
.caliber-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px;
  background: rgba(255,255,255,.018); border-radius: 4px;
}
.caliber-pill b { font-size: 11px; color: #dbe8ef; }
.caliber-low { border-color: rgba(88,188,226,.26); color: #82cce9; }
.caliber-medium { border-color: rgba(215,174,69,.28); color: #d7c27f; }
.caliber-high { border-color: rgba(238,103,113,.27); color: #e99aa1; }
.records-header {
  padding: 11px 18px 9px; display: flex; justify-content: space-between; gap: 12px;
  color: #526c7f; font-size: 8px; font-weight: 800; letter-spacing: .14em;
  border-bottom: 1px solid rgba(88,188,226,.08);
}
.records-list { padding: 10px 12px 12px; }

/* Ficha de arma */
.record-card {
  position: relative; overflow: hidden;
  margin: 10px 0; padding: 20px 20px 16px;
  border-color: rgba(88,188,226,.14);
  border-radius: 7px;
  background: linear-gradient(155deg, rgba(5,16,28,.9), rgba(3,10,18,.76));
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.record-card:hover { border-color: rgba(88,188,226,.29); background: linear-gradient(155deg, rgba(7,20,34,.94), rgba(3,11,20,.82)); }
.record-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: #58788c; opacity: .8; }
.record-card.record-status-evidencia::before { background: var(--cyan); }
.record-card.record-status-traslado::before { background: var(--gold); }
.record-card.record-status-retirada::before { background: var(--danger); }
.record-sequence {
  position: absolute; right: 18px; bottom: 14px;
  color: rgba(101,133,153,.14); font-size: 34px; font-weight: 900; letter-spacing: .02em;
  pointer-events: none;
}
.record-line { align-items: flex-start; }
.serial-block { display: grid; gap: 4px; }
.serial-caption { color: #4f6a7d; font-size: 7px; font-weight: 800; letter-spacing: .17em; }
.serial { font-size: 15px; color: #f0db9e; text-shadow: 0 0 18px rgba(215,174,69,.08); }
.status-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px;
  background: rgba(88,188,226,.035);
}
.status-badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.status-evidencia { color: #8fd8f2; border-color: rgba(88,188,226,.31); background: rgba(88,188,226,.055); }
.status-traslado { color: #e1c66f; border-color: rgba(215,174,69,.31); background: rgba(215,174,69,.055); }
.status-retirada { color: #ef939b; border-color: rgba(238,103,113,.30); background: rgba(238,103,113,.05); }
.record-meta { margin-top: 12px; gap: 7px; }
.meta-chip {
  min-height: 24px; display: inline-flex; align-items: center; padding: 0 8px;
  border: 1px solid rgba(129,150,170,.12); border-radius: 3px;
  background: rgba(255,255,255,.018); color: #8197a7;
  font-size: 9px; text-transform: uppercase; letter-spacing: .055em;
}
.caliber-tag.caliber-bajo { color: #81cce9; border-color: rgba(88,188,226,.20); }
.caliber-tag.caliber-medio { color: #d7c27f; border-color: rgba(215,174,69,.21); }
.caliber-tag.caliber-alto { color: #ea959d; border-color: rgba(238,103,113,.21); }
.record-details { margin-top: 15px; padding-top: 14px; gap: 12px 22px; }
.detail { position: relative; padding-left: 10px; }
.detail::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 1px; background: rgba(88,188,226,.09); }
.detail strong { color: #6f899a; margin-bottom: 4px; }
.record-actions { gap: 8px; align-items: center; position: relative; z-index: 1; }
.record-actions button { min-height: 34px; }
.record-actions button span { font-size: 13px; line-height: 1; margin-right: 5px; }
.history-button { margin-right: auto; }
.danger-button { background: rgba(139,32,32,.06); }

/* Trazabilidad repetida */
.serial-search-summary {
  border-radius: 7px; padding: 14px 16px;
  box-shadow: inset 2px 0 rgba(215,174,69,.62);
}
.serial-repeat-badge { border-radius: 999px; padding: 4px 8px; }

/* Formulario */
.record-form { border-color: rgba(88,188,226,.23); box-shadow: 0 22px 65px rgba(0,0,0,.25); }
.form-section { position: relative; }
.section-label > span {
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(88,188,226,.23); background: rgba(88,188,226,.035);
}
.optional-section { background: rgba(255,255,255,.006); }
.conditional-field { box-shadow: inset 2px 0 rgba(215,174,69,.45); }
.save-button { min-height: 52px; }

/* Modales y auditoría */
.modal-card { border-color: rgba(88,188,226,.34); }
.history-event { transition: border-color .15s ease; }
.history-event:hover { border-color: rgba(88,188,226,.28); }

@media (max-width: 760px) {
  .citizen-summary { padding: 20px; }
  .weapon-total { width: 100%; min-width: 0; padding-left: 0; padding-top: 14px; border-left: 0; border-top: 1px solid rgba(88,188,226,.09); justify-items: start; }
  .records-header { padding-inline: 14px; }
  .record-card { padding: 17px 15px 14px; }
  .record-actions { justify-content: stretch; }
  .record-actions button { flex: 1 1 auto; }
  .history-button { margin-right: 0; }
  .record-sequence { font-size: 28px; }
}
