/* =========================================================================
   VISOR DE ARCHIVOS CCC Salamanca — Hoja de estilos (v2)
   Manual de Identidad Gráfica CFE 2026:
     - Verde CFE #008E60 (único verde institucional; sin variantes ni degradados)
     - Paleta Gobierno de México para acentos y fondos (vino, verde 626/627, oro, beige, gris, negro)
     - Tipografía Noto Sans, alojada en el propio sitio (sin Google Fonts)
     - Logotipos: solo archivos oficiales (isologotipo y convivencia), nunca redibujados
     - Fondo de la entrada: patrón institucional de hojas de la plantilla oficial 2026
   ========================================================================= */

@font-face{font-family:'Noto Sans';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/noto-sans-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Noto Sans';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/noto-sans-latin-ext-400-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Noto Sans';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/noto-sans-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Noto Sans';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/noto-sans-latin-ext-600-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Noto Sans';font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/noto-sans-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Noto Sans';font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/noto-sans-latin-ext-700-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Noto Sans';font-style:normal;font-weight:800;font-display:swap;src:url(../fonts/noto-sans-latin-800-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Noto Sans';font-style:normal;font-weight:800;font-display:swap;src:url(../fonts/noto-sans-latin-ext-800-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}

:root {
  --cfe: #008E60;            /* Verde CFE normativo — NO cambiar */
  --gm-vino: #9b2247;
  --gm-verde: #1e5b4f;
  --gm-verde-osc: #002f2a;
  --gm-cafe: #7e664a;
  --gm-cafe2: #806b4a;
  --gm-oro: #c39326;
  --gm-oro2: #a57f2c;
  --gm-beige: #e6d194;
  --gm-gris: #98989a;
  --gm-negro: #161a1d;

  --ink: var(--gm-negro);
  --muted: var(--gm-cafe);
  --line: rgba(152, 152, 154, .38);
  --soft: rgba(152, 152, 154, .10);
  --font: 'Noto Sans', sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 26, 29, .08), 0 6px 18px rgba(22, 26, 29, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: #ffffff; font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button { font-family: var(--font); cursor: pointer; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gm-oro); outline-offset: 2px; }

svg.ic, svg.item-icon, svg.ic-sort, svg.ic-xl { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* -------------------------------------------------------------------------
   ENTRADA (login): fondo verde oscuro con el patrón institucional de hojas
------------------------------------------------------------------------- */
.login-page, .pagina-error {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: linear-gradient(rgba(0, 47, 42, .55), rgba(0, 47, 42, .55)), url(../img/patron-hojas.webp) center / cover no-repeat, var(--gm-verde-osc);
}
.login-card, .error-card {
  background: #ffffff; border-radius: 18px; box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  width: 100%; max-width: 420px; padding: 34px 32px 26px; text-align: center; border-top: 5px solid var(--cfe);
}
.login-logo-img, .logo-cfe { display: block; width: 200px; max-width: 70%; height: auto; margin: 6px auto 22px; }
.login-title { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.login-subtitle { color: var(--muted); font-size: .86rem; margin: 4px 0 22px; }
.login-form { text-align: left; }
.field-label { display: block; font-size: .8rem; font-weight: 600; margin: 14px 0 6px; }
.field-label:first-of-type { margin-top: 0; }
.field-input {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font: 400 1rem var(--font); color: var(--ink); background: #ffffff; transition: border-color .15s ease;
}
.field-input:focus { outline: none; border-color: var(--cfe); box-shadow: 0 0 0 3px rgba(0, 142, 96, .15); }
.field-pass { position: relative; }
.field-pass .field-input { padding-right: 48px; }
.btn-ojo { position: absolute; right: 4px; top: 4px; width: 38px; height: 38px; border: 0; background: none; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.btn-ojo[aria-pressed="true"] { color: var(--cfe); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 10px 16px;
  border-radius: 10px; border: 1.5px solid transparent; font: 700 .95rem var(--font); text-decoration: none; transition: background .15s ease;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--cfe); color: #ffffff; margin-top: 16px; }
.btn-primary:hover:not(:disabled) { background: var(--gm-verde); }
.btn-secondary { background: #ffffff; color: var(--cfe); border-color: var(--cfe); }
.btn-secondary:hover:not(:disabled) { background: rgba(0, 142, 96, .06); }
.btn-auto { width: auto; display: inline-flex; }

.divider { display: flex; align-items: center; gap: 10px; color: var(--gm-gris); font-size: .78rem; margin: 18px 0 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.alert { background: rgba(155, 34, 71, .08); border-left: 4px solid var(--gm-vino); color: var(--gm-vino); border-radius: 8px; padding: 10px 12px; font-size: .86rem; font-weight: 600; margin: 0 0 14px; text-align: left; }
.aviso-ok { background: rgba(0, 142, 96, .08); border-left: 4px solid var(--cfe); border-radius: 8px; padding: 12px 14px; font-size: .9rem; font-weight: 500; margin: 0 0 16px; }
.login-sso { display: flex; gap: 8px; align-items: flex-start; text-align: left; margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: .8rem; color: var(--ink); }
.login-sso svg { color: var(--cfe); margin-top: 1px; }
.login-sso a, .guest-notice a { color: var(--cfe); font-weight: 600; }
.guest-notice a { display: block; margin-top: 4px; }
.login-sitio { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--cfe); font-size: .86rem; font-weight: 600; text-decoration: none; }
.login-sitio:hover { text-decoration: underline; }
.login-footer { margin: 24px 0 0; font-size: .74rem; color: var(--gm-gris); line-height: 1.5; }

.error-code { font-size: 2.6rem; font-weight: 800; margin: 0; color: var(--gm-verde); }
.error-msg { margin: 4px 0 8px; color: var(--ink); }

/* -------------------------------------------------------------------------
   ENCABEZADO: convivencia oficial Gobierno de México | CFE sobre fondo blanco
------------------------------------------------------------------------- */
.head-in { max-width: 1120px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-header { background: #ffffff; border-bottom: 1px solid var(--line); }
.app-header > .head-in { min-height: 84px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: stretch; gap: 12px; text-decoration: none; min-width: 0; }
.brand-pleca { width: 5px; border-radius: 3px; background: var(--cfe); flex: none; }
.brand-txt { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.brand-txt strong { font-size: 1.12rem; font-weight: 700; line-height: 1.2; }
.brand-txt small { font-size: .78rem; color: var(--muted); }
.convivencia { height: 46px; width: auto; flex: none; }

.head-bar { background: linear-gradient(rgba(0, 47, 42, .72), rgba(0, 47, 42, .72)), url(../img/patron-hojas.webp) left center / cover no-repeat, var(--gm-verde-osc); color: #ffffff; }
.head-bar .head-in { min-height: 52px; }
.head-acc { display: flex; gap: 8px; }
.role-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; padding: 5px 12px; border-radius: 99px; letter-spacing: .04em; text-transform: uppercase; }
.role-badge.full { background: rgba(255, 255, 255, .14); color: var(--gm-beige); }
.rol-nombre { text-transform: none; letter-spacing: 0; font-weight: 600; }
.role-badge.guest { background: var(--gm-oro); color: var(--gm-negro); }
.btn-head { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px; border-radius: 9px; border: 1.5px solid rgba(230, 209, 148, .55); color: var(--gm-beige); font-size: .8rem; font-weight: 600; text-decoration: none; }
.btn-head:hover { background: rgba(230, 209, 148, .12); }

/* -------------------------------------------------------------------------
   EXPLORADOR
------------------------------------------------------------------------- */
.container { max-width: 1120px; margin: 0 auto; padding: 22px 20px 8px; }
.container.estrecho { max-width: 640px; }

.guest-notice { display: flex; gap: 10px; align-items: flex-start; background: rgba(230, 209, 148, .35); border-left: 4px solid var(--gm-oro); border-radius: 10px; padding: 11px 14px; font-size: .86rem; margin-bottom: 18px; }
.guest-notice svg { margin-top: 2px; color: var(--gm-oro2); }

.breadcrumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumbs a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--cfe); font-weight: 600; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--gm-gris); }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 600; }

.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.title-row h1 { margin: 0; font-size: 1.4rem; font-weight: 700; line-height: 1.2; word-break: break-word; }
.stats { margin: 0; font-size: .82rem; color: var(--muted); }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.search { position: relative; flex: 1; display: flex; align-items: center; }
.search > svg { position: absolute; left: 13px; color: var(--gm-gris); pointer-events: none; }
.search-input { width: 100%; min-height: 44px; padding: 9px 14px 9px 40px; border-radius: 10px; border: 1.5px solid var(--line); font: 400 .95rem var(--font); background: #ffffff; color: var(--ink); }
.search-input:focus { outline: none; border-color: var(--cfe); box-shadow: 0 0 0 3px rgba(0, 142, 96, .15); }

.btn-subir { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 10px; background: var(--cfe); color: #ffffff; font-weight: 700; font-size: .9rem; cursor: pointer; flex: none; }
.btn-subir:hover { background: var(--gm-verde); }
.btn-subir:focus-within { outline: 3px solid var(--gm-oro); outline-offset: 2px; }
.subida { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: rgba(0, 142, 96, .06); border-left: 4px solid var(--cfe); font-size: .88rem; font-weight: 500; }
.subida.mal { background: rgba(155, 34, 71, .08); border-left-color: var(--gm-vino); color: var(--gm-vino); }
.subida.ok { background: rgba(0, 142, 96, .08); }
.subida ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }
.subida .barra { height: 6px; margin-top: 8px; border-radius: 99px; background: rgba(152, 152, 154, .25); overflow: hidden; }
.subida .barra i { display: block; height: 100%; width: 0; background: var(--cfe); transition: width .2s; }
.panel.soltar { outline: 3px dashed var(--cfe); outline-offset: -6px; background: rgba(0, 142, 96, .04); }
.file-table tbody tr.nuevo { background: rgba(230, 209, 148, .35); }
.orden-movil { display: none; }
.orden-movil select { min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); font: 600 .86rem var(--font); color: var(--ink); background: #ffffff; }
.panel { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.file-table { width: 100%; border-collapse: collapse; }
.file-table thead th { text-align: left; padding: 0; border-bottom: 1px solid var(--line); background: var(--soft); }
.file-table thead th button { display: inline-flex; align-items: center; gap: 6px; width: 100%; padding: 11px 18px; border: 0; background: none; font: 700 .72rem var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; }
.file-table thead th button:hover { color: var(--ink); }
.file-table thead th .ic-sort { width: 14px; height: 14px; opacity: .35; }
.file-table thead th[aria-sort="ascending"] .ic-sort, .file-table thead th[aria-sort="descending"] .ic-sort { opacity: 1; color: var(--cfe); }
.file-table thead th.col-size button, .file-table thead th.col-date button { justify-content: flex-start; }
.file-table tbody tr { border-bottom: 1px solid var(--soft); }
.file-table tbody tr:last-child { border-bottom: none; }
.file-table tbody tr:hover { background: rgba(0, 142, 96, .04); }
.file-table td { padding: 10px 18px; font-size: .9rem; vertical-align: middle; }

.item-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 500; min-width: 0; }
a.item-link:hover .item-name { color: var(--cfe); text-decoration: underline; }
.item-icon { width: 26px !important; height: 26px !important; stroke-width: 1.6 !important; }
.item-name { display: flex; flex-direction: column; min-width: 0; word-break: break-word; }
.item-name small { font-size: .74rem; color: var(--muted); font-weight: 400; }
.item-link.folder { font-weight: 700; }
.m-meta { display: none; }
.k-carpeta { color: var(--gm-oro); fill: rgba(195, 147, 38, .14) !important; }
.k-web { color: var(--cfe); }
.k-pdf { color: var(--gm-vino); }
.k-doc, .k-hoja { color: var(--gm-verde); }
.k-pres { color: var(--gm-oro2); }
.k-img, .k-video, .k-audio { color: var(--gm-cafe2); }
.k-zip, .k-texto, .k-archivo { color: var(--gm-gris); }
.row-up td { padding: 8px 18px; background: var(--soft); }
.row-up .item-link { color: var(--cfe); font-weight: 600; font-size: .86rem; }
.row-up .item-icon { width: 20px !important; height: 20px !important; }
.row-none td { text-align: center; color: var(--muted); padding: 22px; }
.up-row { display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--soft); color: var(--cfe); font-weight: 600; font-size: .86rem; text-decoration: none; }

.col-size, .col-date { color: var(--muted); white-space: nowrap; width: 1%; }
.col-actions { text-align: right; white-space: nowrap; width: 1%; }
.col-actions a + a { margin-left: 6px; }

.download-link, .view-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: .8rem; font-weight: 700; text-decoration: none;
  border: 1.5px solid var(--cfe); padding: 5px 12px; border-radius: 9px; color: var(--cfe); background: #ffffff;
}
.download-link:hover { background: rgba(0, 142, 96, .08); }
.view-link { background: var(--cfe); color: #ffffff; }
.view-link:hover { background: var(--gm-verde); border-color: var(--gm-verde); }
.download-link svg, .view-link svg { width: 16px; height: 16px; }

.del-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-left: 6px; vertical-align: middle; border: 1.5px solid var(--line); border-radius: 9px; background: #ffffff; color: var(--gm-vino); }
.del-link:hover { border-color: var(--gm-vino); background: rgba(155, 34, 71, .06); }
.del-link svg { width: 17px; height: 17px; }
.dlg { border: 0; border-radius: 16px; padding: 0; width: min(440px, calc(100% - 32px)); box-shadow: 0 18px 48px rgba(0, 0, 0, .3); color: var(--ink); }
.dlg::backdrop { background: rgba(0, 47, 42, .55); }
.dlg form { padding: 22px; border-top: 5px solid var(--gm-vino); }
.dlg h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1.1rem; }
.dlg h2 svg { color: var(--gm-vino); width: 22px; height: 22px; }
.dlg p { margin: 0 0 8px; word-break: break-word; }
.dlg-err { color: var(--gm-vino); font-weight: 600; font-size: .86rem; }
.dlg-acc { display: flex; gap: 10px; margin-top: 16px; }
.dlg-acc .btn { margin-top: 0; }
.btn-peligro { background: var(--gm-vino); color: #ffffff; }
.btn-peligro:hover:not(:disabled) { background: #611232; }
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state .ic-xl { width: 48px; height: 48px; color: var(--gm-oro); stroke-width: 1.4; }
.empty-state p { margin: 8px 0 0; }

.form-panel { padding: 24px; }
.form-panel h1 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 0 0 8px; }
.form-panel h1 svg { color: var(--cfe); width: 22px; height: 22px; }
.ayuda { color: var(--muted); font-size: .86rem; margin: 0 0 16px; }

.app-footer { max-width: 1120px; margin: 0 auto; padding: 28px 20px 30px; display: flex; align-items: center; gap: 16px; }
.app-footer img { width: 120px; height: auto; flex: none; }
.app-footer p { margin: 0; font-size: .74rem; color: var(--gm-gris); line-height: 1.5; }

/* -------------------------------------------------------------------------
   CELULAR
------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .app-header > .head-in { min-height: 0; flex-direction: column-reverse; align-items: flex-start; gap: 10px; }
  .convivencia { height: 34px; }
  .head-bar .head-in { padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; gap: 8px; }
  .btn-head span { display: none; }
  .btn-head { padding: 6px 10px; }
  .container { padding: 16px 16px 4px; }
  .orden-movil { display: block; flex: none; }
  .toolbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .btn-subir { flex: 1; justify-content: center; }

  .file-table thead { display: none; }
  .file-table, .file-table tbody, .file-table tr, .file-table td { display: block; width: 100%; }
  .file-table tbody tr { padding: 10px 14px; }
  .file-table td { padding: 0; }
  .file-table td.col-size, .file-table td.col-date { display: none; }
  .m-meta { display: inline; }
  .file-table td.col-actions { text-align: left; width: 100%; padding-top: 8px; display: flex; gap: 8px; }
  .file-table td.col-actions:empty { display: none; }
  .col-actions a { flex: 1; justify-content: center; }
  .col-actions .del-link { flex: none; margin-left: 0; width: 44px; height: auto; min-height: 36px; }
  .col-actions a + a { margin-left: 0; }
  .row-up td { padding: 0; background: none; }
  .file-table tr.row-up { background: var(--soft); }
  .app-footer { flex-direction: column; text-align: center; gap: 10px; }
}
