/* MEJOR Gestión — approved V3 presentation. No remote fonts or dependencies. */
:root {
  --ink:#101c53; --muted:#5e6f95; --line:#e1e8f7; --paper:#fff;
  --canvas:#f8fbff; --nav:#f9fbff; --nav-soft:#edf0ff;
  --teal:#3454e8; --teal-dark:#2845c7; --mint:#eaf2ff;
  --lime:#7d65de; --blue:#375fbd;
  --shadow:0 8px 28px rgba(43,65,139,.055); --radius:16px;
  font-family:Inter,"Segoe UI",Arial,sans-serif;
}
body { line-height:1.5; }
button,input,select,textarea { font-family:inherit; }
a { text-underline-offset:3px; }
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline:3px solid #3454e8; outline-offset:3px;
}
.app-shell { grid-template-columns:252px minmax(0,1fr); }
/* A single sidebar palette for every internal route and every role. */
.sidebar { background:var(--nav); color:var(--ink); border-right:1px solid var(--line); padding:30px 18px 24px; overflow-y:auto; }
.brand { flex-direction:column; align-items:flex-start; gap:0; padding:0 10px; }
.brand-logo { display:block; width:158px; max-width:100%; height:auto; object-fit:contain; }
.brand .product-name { color:var(--muted); opacity:1; font-size:11px; letter-spacing:.09em; padding-left:4px; line-height:1.5; }
.context-card { margin:27px 0 24px; padding:16px 13px; background:linear-gradient(120deg,#fff,#f0f4ff); border:1px solid var(--line); gap:5px; }
.context-card strong { font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.context-card small { color:var(--muted); font-size:12px; }
.context-card details { font-size:12px; }
.eyebrow { color:#6578a8; font-size:10px; letter-spacing:.15em; }
.eyebrow.accent,.eyebrow.light { color:#3d59b7; }
.sidebar-nav { gap:7px; }
.sidebar-nav a,.nav-disabled { padding:12px 13px; min-height:47px; color:#465b87; font-size:13px; gap:12px; }
.sidebar-nav a:hover { background:#eff3ff; color:#2845c7; }
.sidebar-nav a.active { background:var(--nav-soft); color:#2c48d2; box-shadow:inset 3px 0 #4b60ef; font-weight:750; }
.sidebar-nav .visual-icon { width:19px; height:19px; flex:none; }
.nav-disabled { opacity:1; color:#7a87a5; }
.nav-disabled small { font-size:11px; letter-spacing:0; background:#eef0fb; color:#677499; border-radius:5px; padding:3px; }
.sidebar-footer { border-top:1px solid var(--line); margin-top:auto; padding-top:22px; }
.user-chip > span { background:#e8edff; color:#3c53c8; }
.user-chip small { color:var(--muted); font-size:12px; }
.user-chip strong { white-space:normal; overflow-wrap:anywhere; }
.link-button { color:#53678e; min-height:36px; font-size:12px; }
.link-button:hover { color:#2845c7; }
.main-panel { background:var(--canvas) url("visual-waves.7d5c19342100.svg") right top / cover no-repeat; }
.page-wrap { max-width:1560px; padding:44px 40px 52px; }
.page-header { margin-bottom:25px; align-items:center; }
.page-header h1 { font-size:clamp(28px,2.8vw,40px); font-weight:750; line-height:1.2; letter-spacing:-.04em; margin:8px 0 7px; }
.page-header p { font-size:13px; line-height:1.6; }
.page-wrap > .card,.page-wrap > .grid { margin-bottom:22px; }
.page-wrap > .card + .page-header { margin-top:30px; }
.card { padding:24px; border-color:#e9edf8; box-shadow:var(--shadow); min-width:0; }
.card h2 { font-size:17px; line-height:1.4; margin:0 0 12px; letter-spacing:-.02em; }
.card-header { margin-bottom:22px; }
.card-header h2 { margin:0; }
.card p { font-size:12px; color:var(--muted); }
.card-header p { line-height:1.6; margin-top:5px; }
.grid { gap:18px; }
.grid.two { grid-template-columns:minmax(0,1.7fr) minmax(280px,.9fr); }
.page-home .grid.two > .card { min-height:300px; }
.page-periods .grid.two > .card { min-height:360px; }
.grid.cards-4 { gap:16px; }
.metric-card { min-height:150px; padding:20px; }
.metric-card .metric-icon { width:37px; height:37px; background:#e8f6ff; color:#357ac0; font-size:20px; font-weight:500; }
.metric-card:nth-child(2) .metric-icon { background:#e3f7f4; color:#208078; }
.metric-card:nth-child(3) .metric-icon { background:#efebff; color:#7961bd; }
.metric-card:nth-child(4) .metric-icon { background:#e9f3ff; color:#447fbb; }
.metric-card small { display:block; font-size:12px; margin-top:12px; }
.metric-card strong { display:block; font-size:20px; line-height:1.35; margin-top:3px; }
.button { border-radius:9px; min-height:44px; font-size:12px; font-weight:650; padding:11px 18px; }
.button.primary { background:linear-gradient(110deg,#3067d6,#4054e8); box-shadow:0 4px 12px rgba(52,84,232,.16); }
.button.primary:hover { background:var(--teal-dark); }
.button.secondary:hover { background:#f3f6ff; border-color:#b8c5eb; }
.page-upload .stack-form > .button.primary { background:linear-gradient(105deg,#08739c,#6245d9); }
.button.small { min-height:36px; }
.data-table { font-size:13px; line-height:1.6; }
.data-table th { color:#52658d; font-size:12px; font-weight:650; padding:13px 12px; }
.data-table td { padding:17px 12px; border-color:#edf1fa; }
.data-table tbody tr:hover { background:#f8faff; }
.data-table a { color:#3154c6; }
.table-wrap { position:relative; max-width:100%; scrollbar-color:#c4cdec #f4f7ff; }
.page-header h1,.page-header p,.delivery-note { overflow-wrap:anywhere; }
.page-periods .data-table,.page-results .data-table { min-width:540px; }
.page-results .data-table th { background:#f5f7fc; }
.status { font-size:12px; letter-spacing:0; padding:5px 9px; }
.status.PUBLICADO { color:#147454; background:#e5f6ee; }
.status-dot.success { background:#147454; box-shadow:none; }
.artifact-row { padding:12px 10px; border-color:#e8edf8; text-decoration:none; background:#fcfdff; }
.artifact-row:hover { background:#f4f7ff; }
.artifact-icon { background:#eaf5ff; color:#3574b6; }
.artifact-row strong { white-space:normal; overflow-wrap:anywhere; }
.section-title { font-size:17px; }
.page-home .section-title { margin:24px 0 12px; }
.stack-form { gap:10px; }
label { font-size:13px; color:var(--ink); }
input,select,textarea { border-color:#d8e0f1; border-radius:8px; padding:12px; min-height:44px; }
input:focus,select:focus,textarea:focus { border-color:#6981e6; box-shadow:0 0 0 3px #ebefff; }
input[type=checkbox],input[type=radio] { width:18px; height:18px; min-height:18px; flex:none; vertical-align:middle; accent-color:#3454e8; }
.check-row { font-size:12px; line-height:1.6; margin:7px 0; }
.file-drop { padding:28px 18px; border:1px dashed #c8d9f3; background:#f4f9ff; gap:8px; }
.file-drop .visual-icon { width:42px; height:42px; padding:9px; color:#4d65d5; background:#e8eeff; border-radius:12px; }
.file-drop strong { font-size:13px; }
.file-drop p { margin:0; }
.file-drop input { background:white; max-width:100%; font-size:11px; padding:7px; }
input[type=file]::file-selector-button { border:1px solid #d7e0f3; border-radius:5px; background:#f5f7ff; padding:7px; color:var(--ink); margin-right:8px; cursor:pointer; }
.file-name { color:var(--muted); font-size:11px; overflow-wrap:anywhere; max-width:100%; }
.timeline { margin-top:28px; }
.timeline-item { gap:16px; min-height:85px; }
.timeline-marker { background:#b7c5fb; width:12px; height:12px; box-shadow:0 0 0 5px #f0f3ff; }
.timeline-marker::after { background:#dce4fa; height:70px; left:5px; }
.timeline-item strong { font-size:12px; }
.timeline-item p { line-height:1.65; margin-top:5px; }
.tracking-update h2 { font-size:22px; margin:0 0 5px; }
.tracking-update form { display:grid; gap:14px; margin-top:18px; justify-items:start; }
.tracking-update label { width:100%; display:grid; gap:6px; }
.empty-state { padding:55px 20px; }
.empty-state .empty-icon { color:#5261d5; background:#f0f2ff; border-radius:50%; }
.empty-state h3 { font-size:16px; }
.empty-state p { font-size:12px; line-height:1.7; }
.report-card::after { background:#eaf4ff; }
.report-copy p { color:var(--muted); }
.delivery-note { background:linear-gradient(100deg,#eef4ff,#f4f0ff); border:1px solid #e8eafb; border-radius:11px; padding:12px 16px; font-size:12px; color:var(--muted); }
.document-grid { grid-template-columns:repeat(4,minmax(0,1fr)); align-items:start; margin-top:20px; gap:14px; }
.document-grid .card { min-height:230px; padding:20px 16px; }
.document-grid h2 { display:flex; align-items:center; gap:10px; font-size:15px; margin-bottom:24px; }
.document-grid .visual-icon { flex:none; width:34px; height:34px; padding:8px; background:#e9f4ff; color:#3b6ede; border-radius:10px; }
.document-grid .card:nth-child(2) .visual-icon { background:#e5f7f4; color:#1f8c8b; }
.document-grid .card:nth-child(3) .visual-icon { background:#f1ecff; color:#855cc2; }
.document-grid .card:nth-child(4) .visual-icon { background:#fff5df; color:#ac7c12; }
.document-grid a { display:inline-block; font-size:12px; text-decoration:none; font-weight:650; color:#3454c9; overflow-wrap:anywhere; }
.document-grid .button { color:#3454c9; background:#f4f7ff; border:1px solid #e0e8fa; box-shadow:none; font-size:12px; min-height:36px; padding:8px 10px; }
.document-grid .button:hover { color:#243f9e; background:#eaf0ff; }
details { margin-top:12px; }
summary { cursor:pointer; color:#4a5ca2; font-size:12px; font-weight:600; padding:6px 0; }
details[open] { background:#f8faff; border-radius:8px; padding:0 8px 8px; }
details p { overflow-wrap:anywhere; }
.page-detail .data-table { min-width:850px; }
.page-detail .data-table td { vertical-align:top; }
.page-detail .data-table td:first-child { font-weight:650; }
.page-detail .data-table td:nth-child(4) { min-width:235px; max-width:310px; }
.page-detail details input { margin:8px 0; font-size:12px; background:#fff; }
.page-detail details small { font-size:12px; color:var(--muted); }
.result-history p { display:inline-block; vertical-align:top; margin:8px 12px 0 0; border:1px solid #e9eef8; background:#fcfdff; border-radius:10px; padding:12px 15px; }
.result-history a { color:#4561b8; text-decoration:none; }
.message-stack { max-width:calc(100vw - 32px); }
.message { background:#edf2ff; color:#243e82; border:1px solid #c7d4f3; }
.page-wrap > .message { position:static; }
.privacy-note,.approved-summary { background:#eef4ff; color:#425b8d; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
/* Login retains the original Django form; only the visual composition changes. */
.login-body { background:var(--canvas) url("visual-waves.7d5c19342100.svg") center / cover no-repeat; }
.login-brand { position:absolute; z-index:1; top:48px; left:5.5vw; }
.login-brand .brand-logo { width:185px; }
.login-shell { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr); align-items:center; gap:6vw; min-height:100vh; max-width:1600px; margin:auto; padding:180px 6vw 75px; }
.login-form-panel { grid-column:2; grid-row:1; padding:36px; background:#fff; border:1px solid #edf0fa; border-radius:20px; box-shadow:0 16px 48px #355bb514; display:block; }
.login-inner { width:100%; }
.login-heading { margin:0 0 28px; }
.login-heading h1 { font-size:32px; margin:8px 0; letter-spacing:-.04em; }
.login-heading p { font-size:13px; }
.security-note { color:#5e6f95; line-height:1.6; font-size:12px; }
.login-visual { grid-column:1; grid-row:1; padding:0; color:var(--ink); background:none; overflow:visible; }
.visual-glow { display:none; }
.visual-copy { margin:0; max-width:590px; }
.visual-copy h2 { font-size:clamp(32px,4vw,55px); line-height:1.1; letter-spacing:-.045em; font-weight:750; }
.visual-copy p { color:var(--muted); font-size:16px; line-height:1.7; }
@media(min-width:1700px) { .page-wrap { padding-top:50px; } }
@media(max-width:1250px) {
  .page-wrap { padding:32px 28px 44px; }
  .document-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .document-grid .card { min-height:190px; }
  .grid.two { grid-template-columns:1fr; }
  .page-periods .grid.two > .card,.page-home .grid.two > .card { min-height:auto; }
}
@media(max-width:1000px) { .grid.cards-4 { grid-template-columns:repeat(2,minmax(0,1fr)); } .login-shell { gap:4vw; padding-left:5vw; padding-right:5vw; } .login-form-panel { padding:28px; } }
@media(max-width:760px) {
  .app-shell { grid-template-columns:minmax(0,1fr); }
  .sidebar { width:270px; height:100dvh; max-width:85vw; box-shadow:12px 0 40px #1e366022; }
  .sidebar:not(.open) { visibility:hidden; }
  .sidebar.open { visibility:visible; }
  .mobile-header { display:flex; justify-content:space-between; align-items:center; height:82px; padding:10px 18px; background:var(--nav); }
  .mobile-brand { padding:0; }
  .mobile-brand .brand-logo { width:116px; }
  .mobile-brand .product-name { font-size:9px; }
  .menu-toggle { width:44px; height:44px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:#fff; }
  .page-wrap { padding:26px 16px 40px; }
  .page-header { gap:16px; align-items:flex-start; }
  .page-header h1 { font-size:30px; }
  .card { padding:20px 16px; }
  .grid.cards-4 { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .metric-card { min-height:155px; padding:16px; }
  .metric-card strong { font-size:17px; }
  .document-grid { grid-template-columns:1fr; }
  .document-grid .card { min-height:0; padding:22px; }
  .document-grid h2 { margin-bottom:18px; }
  .table-wrap { border-radius:8px; }
  .data-table th,.data-table td { padding:12px 9px; }
  .file-drop { padding:22px 12px; }
  .empty-state { padding:40px 10px; }
  .card-header { flex-wrap:wrap; }
  .tracking-update h2 { font-size:20px; }
  .login-brand { position:static; padding:26px 24px 0; }
  .login-brand .brand-logo { width:150px; }
  .login-shell { min-height:0; display:flex; flex-direction:column; padding:34px 20px 45px; gap:24px; }
  .login-visual { display:block; order:-1; width:100%; }
  .visual-copy h2 { font-size:32px; margin:12px 0; }
  .visual-copy p { font-size:13px; margin:0; }
  .login-form-panel { min-height:0; width:100%; max-width:460px; padding:26px 22px; }
  .login-heading h1 { font-size:27px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; } }

/* Preventive V3.1: presentation only; approved V3 is preserved separately. */
.data-table small,.artifact-row small,.help-text { font-size:12px; line-height:1.6; }
.mono { font-size:12px; }
.timeline-item time { font-size:12px; color:var(--muted); }
.json-view { font-size:12px; }
.definition-list dd { min-width:0; overflow-wrap:anywhere; }
.page-wrap > p { overflow-wrap:anywhere; }
.page-wrap pre:not(.json-view) { max-width:100%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; }
.button:disabled { cursor:not-allowed; opacity:.55; box-shadow:none; }
.page-upload .stack-form > .button.primary:hover { background:linear-gradient(105deg,#075b7b,#5034bf); }
