/* Flesk panel: paleta menta/verde (v1.0.0-rc2), Bootstrap 5 local.
   Legibilidad primero: tarjetas blancas, texto oscuro, decoración de triángulos a baja opacidad. */
:root {
  --fresk-navy: #282F4D;
  --fresk-navy-light: #3a4266;
  --fresk-ink: #0f3d35;
  --fresk-deep: #1f7f6d;
  --fresk-mint: #5fc4ad;
  --fresk-mint-2: #8fdcc8;
  --fresk-mint-3: #bff0e2;
  --fresk-mint-4: #e6fbf5;
  --fresk-bg: #f5faf8;
  --fresk-text: #1d2b33;
  --fresk-orange: #e67e22;
  --fresk-blue: #2f6fed;
  --fresk-yellow: #e6b800;
  --fresk-green: #1a7f37;
  --fresk-red: #b42318;
  --fresk-sidebar-w: 240px;
  --fresk-sidebar-bg: linear-gradient(180deg, #17404a 0%, #123a36 55%, #0f3d35 100%);
  --fresk-shadow: 0 2px 6px rgba(15,61,53,.05), 0 8px 24px rgba(15,61,53,.07);
  --fresk-shadow-hover: 0 4px 10px rgba(15,61,53,.07), 0 14px 32px rgba(15,61,53,.11);
}

body.fresk-app {
  background: var(--fresk-bg);
  color: var(--fresk-text);
  min-height: 100vh;
}
a { color: var(--fresk-deep); }
a:hover { color: var(--fresk-ink); }

/* ---------- Decoración de fondo (triángulos) ---------- */
.fresk-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(191,240,226,.45), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(230,251,245,.8), transparent 60%);
}
.fresk-deco { position: absolute; inset: 0; width: 100%; height: 100%; }
.fresk-deco g { transform-box: fill-box; transform-origin: center; }
.fresk-deco .d1 { animation: freskDrift1 22s ease-in-out infinite alternate; }
.fresk-deco .d2 { animation: freskDrift2 18s ease-in-out infinite alternate; }
.fresk-deco .d3 { animation: freskDrift3 25s ease-in-out infinite alternate; }
@keyframes freskDrift1 { from { transform: translate(0,0); } to { transform: translate(-2.5%, 2%); } }
@keyframes freskDrift2 { from { transform: translate(0,0); } to { transform: translate(2%, -2.5%); } }
@keyframes freskDrift3 { from { transform: translate(0,0) rotate(0); } to { transform: translate(2%, -1.5%) rotate(2deg); } }
.fresk-sweep {
  position: absolute; top: 0; bottom: 0; left: -30%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  animation: freskSweep 20s linear infinite;
}
@keyframes freskSweep { 0% { transform: translateX(0); } 60%, 100% { transform: translateX(480%); } }

/* ---------- Sidebar ---------- */
.fresk-sidebar {
  width: var(--fresk-sidebar-w);
  background: var(--fresk-sidebar-bg);
  color: #fff;
  min-height: 100vh;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 1040;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.fresk-sidebar > *:not(.fresk-deco) { position: relative; z-index: 1; }
.fresk-deco-sidebar { top: auto; height: 60%; bottom: 0; }
.fresk-sidebar .brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1.25rem;
  color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.fresk-sidebar .brand .brand-word { font-weight: 800; font-size: 1.2rem; letter-spacing: .14em; }
.fresk-logo { width: 34px; height: 34px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
.fresk-logo .cube { animation: freskCube 4.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.fresk-logo .c2 { animation-delay: .3s; }
.fresk-logo .c3 { animation-delay: .6s; }
@keyframes freskCube { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-6%); } }
.fresk-sidebar .nav-link {
  color: rgba(255,255,255,.88);
  border-radius: 0;
  padding: .62rem 1.25rem;
  border-left: 3px solid transparent;
  display: flex; align-items: center; gap: .65rem;
  transition: background .2s, color .2s, padding-left .2s;
}
.fresk-sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.07); padding-left: 1.4rem; }
.fresk-sidebar .nav-link.active {
  color: #fff;
  background: rgba(95,196,173,.18);
  border-left-color: var(--fresk-mint);
}
.fresk-sidebar .nav-link i { font-size: 1.1rem; color: var(--fresk-mint-2); }
.fresk-sidebar .sidebar-user { color: rgba(255,255,255,.65); border-top: 1px solid rgba(255,255,255,.08); }

.fresk-main {
  position: relative; z-index: 1;
  margin-left: var(--fresk-sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ---------- Header ---------- */
.fresk-header {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid rgba(15,61,53,.08);
  padding: .65rem 1.5rem;
}
.min-w-0 { min-width: 0; }
.fresk-header .breadcrumb { flex-wrap: nowrap; }
.fresk-header .breadcrumb a { color: var(--fresk-deep); text-decoration: none; }
.fresk-user-btn {
  --bs-btn-bg: #1f9d74; --bs-btn-border-color: #1f9d74;
  --bs-btn-hover-bg: #178a64; --bs-btn-hover-border-color: #178a64;
  --bs-btn-active-bg: #127553; --bs-btn-active-border-color: #127553;
  display: inline-flex; align-items: center; gap: .4rem;
  border-radius: 999px; padding: .3rem .8rem; font-weight: 600;
  box-shadow: 0 2px 8px rgba(31,157,116,.3);
}
.fresk-user-btn .fresk-user-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fresk-user-menu { min-width: 14rem; border: 0; border-radius: 12px; padding: .4rem; }
.fresk-user-menu .dropdown-item { border-radius: 8px; display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; }
.fresk-user-menu .dropdown-item i { color: var(--fresk-deep); width: 1.1rem; }
.fresk-user-menu .dropdown-item.text-danger i { color: inherit; }
.fresk-user-menu .dropdown-item:hover { background: var(--fresk-mint-4); }
.fresk-user-menu .dropdown-item.active, .fresk-user-menu .dropdown-item:active { background: var(--fresk-deep); color: #fff; }
.fresk-user-menu .dropdown-item.active i { color: #fff; }

.fresk-content { padding: 1.5rem; flex: 1; }

/* ---------- Tarjetas ---------- */
.fresk-card {
  background: #fff;
  border: 1px solid rgba(15,61,53,.05);
  border-radius: 14px;
  box-shadow: var(--fresk-shadow);
  margin-bottom: 1.25rem;
  transition: box-shadow .25s, transform .25s;
}
.fresk-card:hover { box-shadow: var(--fresk-shadow-hover); }
.fresk-card .card-body { padding: 1.25rem 1.5rem; }
.fresk-card h2, .fresk-card .card-title {
  color: var(--fresk-ink);
  font-size: 1.1rem; font-weight: 600;
  margin-bottom: .75rem;
}
h1.h4 { color: var(--fresk-ink) !important; font-weight: 700; }

.kpi-card {
  position: relative;
  border: 1px solid rgba(15,61,53,.05);
  border-radius: 14px;
  box-shadow: var(--fresk-shadow);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.kpi-card::after {
  content: ""; position: absolute; right: 0; top: 0; width: 64px; height: 64px;
  background: linear-gradient(225deg, var(--fresk-mint-3), var(--fresk-mint-4));
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  opacity: .9;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--fresk-shadow-hover); }
.kpi-card .kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
}
.kpi-card .kpi-value { font-size: 1.85rem; font-weight: 700; color: var(--fresk-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-card .kpi-label { color: #5b6b73; font-size: .85rem; }
.kpi-orange .kpi-icon { background: linear-gradient(135deg, #f0a04b, var(--fresk-orange)); }
.kpi-blue .kpi-icon { background: linear-gradient(135deg, #5b8ff2, var(--fresk-blue)); }
.kpi-green .kpi-icon { background: linear-gradient(135deg, var(--fresk-mint), var(--fresk-deep)); }
.kpi-navy .kpi-icon { background: linear-gradient(135deg, #2a6f78, var(--fresk-ink)); }

.table { --bs-table-bg: transparent; }
.table > thead th { color: #50616a; font-weight: 600; font-size: .85rem; border-bottom-color: rgba(15,61,53,.12); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--fresk-mint-4); }

.badge-status-active { background: #e3f7ef; color: #13704f; }
.badge-status-pending { background: #fff4e5; color: #a65a10; }
.badge-status-error,
.badge-status-expired { background: #fdecea; color: var(--fresk-red); }
.badge-status-none { background: #eef2f1; color: #55615f; }

.btn { transition: transform .15s, box-shadow .2s, background-color .2s, filter .2s; }
.btn:active { transform: translateY(1px); }
.btn-fresk { background: var(--fresk-ink); border-color: var(--fresk-ink); color: #fff; }
.btn-fresk:hover, .btn-fresk:focus { background: var(--fresk-deep); border-color: var(--fresk-deep); color: #fff; }
.btn-fresk-primary { background: var(--fresk-deep); border-color: var(--fresk-deep); color: #fff; }
.btn-fresk-primary:hover, .btn-fresk-primary:focus { background: #19695a; border-color: #19695a; color: #fff; box-shadow: 0 4px 12px rgba(31,127,109,.25); }
.btn-fresk-success { background: #1f9d74; border-color: #1f9d74; color: #fff; }
.btn-fresk-success:hover { filter: brightness(1.06); color: #fff; }
.btn-fresk-danger { background: var(--fresk-red); border-color: var(--fresk-red); color: #fff; }
.btn-fresk-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-fresk-warning { background: var(--fresk-yellow); border-color: var(--fresk-yellow); color: #333; }
.form-control:focus, .form-select:focus { border-color: var(--fresk-mint); box-shadow: 0 0 0 .2rem rgba(95,196,173,.25); }
.form-check-input:checked { background-color: var(--fresk-deep); border-color: var(--fresk-deep); }

.pwd-once {
  background: #fff8e6; border: 1px solid #f0c36d; color: #7a4e00;
  border-radius: 10px; padding: .85rem 1rem; margin-bottom: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

/* Reglas de contraseña (usuarios) */
.pw-rules { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .82rem; }
.pw-rules li { color: #7a868c; }
.pw-rules li::before { content: "\F28A"; font-family: "bootstrap-icons"; margin-right: .3rem; }
.pw-rules li.ok { color: #13704f; }
.pw-rules li.ok::before { content: "\F26A"; }

/* Info */
.fresk-feature { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem 0; }
.fresk-feature i { color: var(--fresk-deep); background: var(--fresk-mint-4); border-radius: 10px; width: 2.2rem; height: 2.2rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fresk-hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #ffffff 0%, var(--fresk-mint-4) 100%); }
.fresk-hero .fresk-logo { width: 64px; height: 64px; }

/* ---------- Pie ---------- */
.fresk-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem .5rem;
  padding: 1rem 1.5rem 1.25rem;
  color: #5b6b73; font-size: .8rem;
}
.fresk-footer a { color: var(--fresk-deep); text-decoration: none; font-weight: 600; }
.fresk-footer a:hover { text-decoration: underline; }
.fresk-footer .sep { color: #a9b6b3; }
.fresk-footer-brand { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; color: var(--fresk-ink); }
.fresk-footer-logo { width: 16px; height: 16px; }

/* ---------- Login (más expresivo) ---------- */
body.fresk-login-body { margin: 0; min-height: 100vh; background: linear-gradient(135deg, #e6fbf5 0%, #bff0e2 45%, #8fdcc8 100%); }
.fresk-login-body .fresk-bg { background: none; }
.fresk-login-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1rem;
}
.fresk-login-card {
  width: 100%; max-width: 410px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 18px;
  background: rgba(255,255,255,.93);
  box-shadow: 0 10px 40px rgba(15,61,53,.16);
}
.fresk-login-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; }
.fresk-login-brand .fresk-logo { width: 52px; height: 52px; }
.fresk-login-brand .word { font-weight: 800; font-size: 1.6rem; letter-spacing: .18em; color: var(--fresk-ink); }
.fresk-login-card .badge-fresk { background: var(--fresk-ink); color: #fff; font-size: .75rem; }
.fresk-login-card h1 { color: var(--fresk-ink); }
.fresk-login-body .fresk-footer { position: relative; z-index: 1; color: #2d4b45; }
.fresk-login-body .fresk-footer a { color: var(--fresk-ink); }
.fresk-lang-switch a { color: var(--fresk-deep); text-decoration: none; }
.fresk-lang-switch a.active { font-weight: 700; color: var(--fresk-ink); text-decoration: underline; }

@media (max-width: 991.98px) {
  .fresk-sidebar { display: none; }
  .fresk-main { margin-left: 0; }
  .fresk-header { padding: .6rem .9rem; }
  .fresk-content { padding: 1rem; }
  .fresk-offcanvas {
    background: var(--fresk-sidebar-bg);
    color: #fff;
    width: var(--fresk-sidebar-w) !important;
  }
  .fresk-offcanvas .fresk-logo { width: 28px; height: 28px; }
  .fresk-offcanvas .nav-link { color: rgba(255,255,255,.88); border-left: 3px solid transparent; border-radius: 0; display: flex; gap: .6rem; align-items: center; }
  .fresk-offcanvas .nav-link i { color: var(--fresk-mint-2); }
  .fresk-offcanvas .nav-link.active { background: rgba(95,196,173,.18); border-left-color: var(--fresk-mint); color: #fff; }
  .fresk-offcanvas .nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
}
@media (max-width: 575.98px) {
  .fresk-user-btn .fresk-user-name { max-width: 8ch; }
  .fresk-sweep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fresk-deco g, .fresk-sweep, .fresk-logo .cube { animation: none !important; }
  .fresk-sweep { display: none; }
  .kpi-card, .fresk-card, .btn, .fresk-sidebar .nav-link { transition: none !important; }
  .kpi-card:hover { transform: none; }
}

/* Filtros laterales */
/* Barra de filtros: una sola línea en escritorio; se parte solo por debajo de 768px */
.fresk-toolbar { display: flex; flex-wrap: nowrap; align-items: center; gap: .5rem; margin: 0; }
.fresk-toolbar-search { flex: 1 1 auto; min-width: 8rem; width: auto; }
.fresk-toolbar .fresk-toolbar-select { flex: 0 0 10rem; width: 10rem; min-width: 0; text-overflow: ellipsis; }
.fresk-toolbar #mdom.fresk-toolbar-select { flex-basis: 14rem; width: 14rem; }
.fresk-toolbar .input-group-text { background: var(--fresk-mint-4); color: var(--fresk-deep); border-color: #dee2e6; }
.fresk-toolbar .btn { white-space: nowrap; flex: 0 0 auto; }
.fresk-toolbar-count { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 767.98px) {
  .fresk-toolbar { flex-wrap: wrap; }
  .fresk-toolbar-search { flex-basis: 100%; }
  .fresk-toolbar .fresk-toolbar-select { flex: 1 1 calc(50% - .25rem); max-width: none; min-width: 0; }
}

/* ---------- Gestor de archivos ---------- */
.fm-shell { position: relative; overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 200px); min-height: 480px; }
.fm-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .5rem .75rem; border-bottom: 1px solid rgba(15,61,53,.08); background: linear-gradient(90deg, #fff, var(--fresk-mint-4)); }
.fm-toolbar .btn-light { background: #fff; border-color: rgba(15,61,53,.12); color: var(--fresk-ink); }
.fm-toolbar .btn-light:hover { background: var(--fresk-mint-4); }
.fm-body { flex: 1; display: flex; min-height: 0; }
.fm-tree { width: 290px; flex-shrink: 0; overflow: auto; border-right: 1px solid rgba(15,61,53,.08); background: #fbfdfc; padding: .35rem 0; font-size: .86rem; }
.fm-tree-root { padding: .35rem .75rem; font-weight: 700; color: var(--fresk-ink); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.fm-list { list-style: none; margin: 0; padding: 0 0 0 .7rem; }
#fmRootList { padding-left: .15rem; }
.fm-row { display: flex; align-items: center; gap: .3rem; padding: .18rem .5rem; border-radius: 6px; cursor: pointer; white-space: nowrap; color: #26363d; margin-right: .35rem; }
.fm-row:hover { background: var(--fresk-mint-4); }
.fm-row.sel { background: rgba(95,196,173,.22); color: var(--fresk-ink); }
.fm-row:focus-visible { outline: 2px solid var(--fresk-mint); }
.fm-caret { width: .9rem; font-size: .7rem; color: #7a8a88; }
.fm-ic { color: var(--fresk-deep); }
.is-dir > .fm-row .fm-ic { color: #e0a526; }
.fm-name { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.fm-lock { font-size: .7rem; color: #a3b0ad; }
.fm-acts { display: none; gap: .1rem; }
.fm-check { margin: 0 .35rem 0 0; flex: 0 0 auto; cursor: pointer; }
.fm-row.picked { background: var(--fresk-mint-4); }
.fm-selbar { display: flex; align-items: center; gap: .4rem; padding: .15rem .5rem; border-radius: 10px; background: var(--fresk-mint-4); }
.fm-selbar[hidden] { display: none; }
.fm-selbar > * { white-space: nowrap; flex: 0 0 auto; }
.fm-toolbar .fm-selbar { order: 3; flex: 1 0 100%; }
.fm-del-list { max-height: 45vh; overflow: auto; font-family: var(--bs-font-monospace); }
.fm-del-list li { padding: .15rem 0; border-bottom: 1px dashed #e3efe9; word-break: break-all; }
.fm-zip-btn { border: 0; background: transparent; color: var(--fresk-deep); padding: .1rem .35rem; border-radius: 6px; line-height: 1; }
.fm-zip-btn:hover, .fm-zip-btn:focus-visible { background: var(--fresk-mint-4); }
.fm-ctx { z-index: 1080; min-width: 190px; font-size: .88rem; box-shadow: var(--fresk-shadow); }
.fm-ctx .dropdown-item:active { background: var(--fresk-deep); }
.fm-row:hover .fm-acts, .fm-row.sel .fm-acts { display: inline-flex; }
.fm-act { border: 0; background: transparent; color: #5b6b73; padding: 0 .2rem; border-radius: 4px; line-height: 1.2; }
.fm-act:hover { background: #fff; color: var(--fresk-deep); }
.fm-loading, .fm-err, .fm-emptydir { padding: .2rem .8rem; color: #7a868c; font-size: .8rem; }
.fm-err { color: var(--fresk-red); }
.fm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fm-tabs { display: flex; overflow-x: auto; background: #f1f6f4; border-bottom: 1px solid rgba(15,61,53,.08); min-height: 36px; }
.fm-tab { display: flex; align-items: center; gap: .35rem; padding: .4rem .5rem .4rem .75rem; font-size: .82rem; border-right: 1px solid rgba(15,61,53,.07); cursor: pointer; white-space: nowrap; color: #50616a; border-top: 2px solid transparent; }
.fm-tab.active { background: #fff; color: var(--fresk-ink); border-top-color: var(--fresk-mint); }
.fm-tab i { color: var(--fresk-deep); }
.fm-tab.dirty .fm-tab-name::after { content: " ●"; color: var(--fresk-orange); }
.fm-tab-x { border: 0; background: transparent; padding: 0 .15rem; border-radius: 4px; color: #7a868c; }
.fm-tab-x:hover { background: var(--fresk-mint-4); color: var(--fresk-red); }
.fm-view { flex: 1; min-height: 0; position: relative; background: #fff; }
.fm-pane { position: absolute; inset: 0; display: flex; flex-direction: column; }
.fm-infobar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem .75rem; border-bottom: 1px solid rgba(15,61,53,.06); font-size: .8rem; }
.fm-editor { flex: 1; min-height: 0; }
.fm-editor .CodeMirror { height: 100%; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fm-editor .CodeMirror-gutters { background: #f7fbfa; border-right: 1px solid #e3eeeb; }
.fm-editor .CodeMirror-activeline-background { background: #f0faf7; }
.fm-preview { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: repeating-conic-gradient(#f4f8f7 0% 25%, #fff 0% 50%) 50% / 20px 20px; }
.fm-preview img { max-width: 100%; max-height: 100%; box-shadow: var(--fresk-shadow); border-radius: 6px; background: #fff; }
.fm-preview video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.fm-preview-pdf, .fm-preview-doc { padding: 0; align-items: stretch; background: #f5faf8; }
.fm-doc { border: 0; width: 100%; height: 100%; background: #fff; }
.fm-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #50616a; padding: 1rem; }
.fm-empty .fresk-logo { width: 72px; height: 72px; opacity: .85; margin-bottom: .75rem; }
.fm-pane .fm-empty { position: static; flex: 1; }
.fm-status { font-size: .78rem; padding: .25rem .75rem; min-height: 1.6rem; border-top: 1px solid rgba(15,61,53,.06); color: #5b6b73; background: #fbfdfc; }
.fm-status.ok { color: #13704f; }
.fm-status.err { color: var(--fresk-red); background: #fdf1f0; }
.fm-drop { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(230,251,245,.92); border: 3px dashed var(--fresk-mint); border-radius: 14px; z-index: 5; text-align: center; color: var(--fresk-ink); pointer-events: none; }
.fm-drop i { font-size: 3rem; color: var(--fresk-deep); }
.fm-drop.on { display: flex; }
@media (max-width: 767.98px) {
  .fm-shell { height: auto; }
  .fm-body { flex-direction: column; }
  .fm-tree { width: 100%; max-height: 38vh; border-right: 0; border-bottom: 1px solid rgba(15,61,53,.08); }
  .fm-view { min-height: 60vh; }
}

/* ---------- Mostrar contraseña + captcha deslizante ---------- */
.fresk-pw .fresk-pw-toggle { border-color: #dee2e6; color: #5b6b73; background: #fff; }
.fresk-pw .fresk-pw-toggle:hover, .fresk-pw .fresk-pw-toggle[aria-pressed="true"] { color: var(--fresk-deep); background: var(--fresk-mint-4); }
.fresk-captcha { width: 100%; }
.fresk-captcha-box { width: 100%; padding: 8px; border-radius: 12px; background: #f7fcfa; box-shadow: inset 0 0 0 1px rgba(15,61,53,.1); }
.fresk-captcha-stage { position: relative; width: 100%; overflow: hidden; border-radius: 9px; user-select: none; -webkit-user-select: none; touch-action: none; }
.fresk-captcha-img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.fresk-captcha-piece { position: absolute; left: 0; cursor: grab; border-radius: 18%; background: rgba(255,255,255,.94); box-shadow: 0 4px 12px rgba(15,61,53,.3); display: flex; align-items: center; justify-content: center; will-change: transform; }
.fresk-captcha-piece .fresk-logo { width: 76%; height: 76%; filter: none; }
.fresk-captcha-track { position: relative; width: 100%; height: 38px; margin-top: 8px; border-radius: 999px; background: #e8f2ef; box-shadow: inset 0 1px 3px rgba(15,61,53,.12); touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; }
.fresk-captcha-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 22px; border-radius: 999px; background: linear-gradient(90deg, var(--fresk-mint-3), var(--fresk-mint)); }
.fresk-captcha-handle { position: absolute; left: 0; top: 0; height: 38px; border-radius: 999px; background: var(--fresk-deep); color: #fff; display: flex; align-items: center; justify-content: center; cursor: grab; box-shadow: 0 2px 8px rgba(31,127,109,.4); will-change: transform; }
.fresk-captcha-handle:focus-visible { outline: 3px solid var(--fresk-mint-2); outline-offset: -3px; }
.fresk-captcha.dragging .fresk-captcha-handle, .fresk-captcha.dragging .fresk-captcha-piece { cursor: grabbing; }

/* ---------- Inteligencia Artificial ---------- */
.ai-shell { overflow: hidden; }
.ai-body { display: flex; height: calc(100vh - 230px); min-height: 460px; }
.ai-side { width: 240px; flex: 0 0 240px; border-right: 1px solid rgba(15,61,53,.08); padding: .75rem; overflow-y: auto; background: linear-gradient(180deg, #fff, var(--fresk-mint-4)); }
.ai-convs .ai-conv { display: flex; align-items: center; border-radius: 8px; }
.ai-convs .ai-conv.active, .ai-convs .ai-conv:hover { background: #fff; box-shadow: 0 1px 3px rgba(15,61,53,.08); }
.ai-conv-open { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: .4rem .5rem; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fresk-text); }
.ai-conv-del { border: 0; background: transparent; color: #b4c2bd; padding: .25rem .45rem; }
.ai-conv-del:hover { color: #c0392b; }
.ai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ai-log { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; background: #fbfefd; }
.ai-empty { text-align: center; margin: 2rem auto; max-width: 560px; }
.ai-empty:has(.ai-examples) { max-width: 920px; }
.ai-examples { margin-top: 1rem; }
.ai-examples-title { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--fresk-deep); margin-bottom: .5rem; }
.ai-chip.ai-example { border-radius: .6rem; text-align: left; width: 100%; line-height: 1.3; }
.ai-empty .fresk-logo { width: 56px; height: 56px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1rem; }
.ai-chip { border: 1px solid rgba(31,127,109,.25); background: #fff; color: var(--fresk-deep); border-radius: 999px; padding: .4rem .85rem; font-size: .86rem; transition: background .2s, transform .15s; }
.ai-chip:hover { background: var(--fresk-mint-4); transform: translateY(-1px); }
.ai-msg { display: flex; margin: .5rem 0; }
.ai-user { justify-content: flex-end; }
.ai-bubble { max-width: min(760px, 85%); padding: .6rem .9rem; border-radius: 14px; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.ai-user .ai-bubble { background: var(--fresk-deep); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ai-assistant .ai-bubble { background: #fff; border: 1px solid rgba(15,61,53,.08); border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(15,61,53,.05); }
.ai-assistant .ai-bubble p:last-child { margin-bottom: 0; }
.ai-assistant .ai-bubble pre { background: #0f3d35; color: #e6fbf5; padding: .6rem .8rem; border-radius: 8px; font-size: .8rem; overflow-x: auto; }
.ai-note .ai-bubble { background: #fff8e6; border: 1px solid #f3dca4; color: #6b5314; font-size: .85rem; }
.ai-card { margin: .35rem 0 .35rem 0; max-width: min(760px, 85%); border: 1px solid rgba(15,61,53,.1); border-left: 4px solid var(--fresk-mint); border-radius: 10px; background: #fff; font-size: .85rem; }
.ai-card.err { border-left-color: #d9534f; }
.ai-card.cancelled { border-left-color: #adb5bd; opacity: .85; }
.ai-card summary { padding: .45rem .7rem; cursor: pointer; list-style: none; display: flex; align-items: center; gap: .2rem; min-width: 0; }
.ai-card summary::-webkit-details-marker { display: none; }
.ai-card.ok summary .bi { color: var(--fresk-deep); }
.ai-card.err summary .bi { color: #d9534f; }
.ai-card-brief { color: #6c7a76; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ai-card-body { padding: 0 .7rem .6rem; }
.ai-card-body pre { background: var(--fresk-mint-4); border-radius: 6px; padding: .4rem .6rem; font-size: .76rem; max-height: 220px; overflow: auto; margin-bottom: .4rem; white-space: pre-wrap; }
.ai-secret { margin: 0 .7rem .6rem; padding: .45rem .6rem; background: #fff8e6; border: 1px dashed #e0b84a; border-radius: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; }
/* Tarjeta «Credencial generada» (contraseñas generadas por la IA; persistente hasta «Olvidar») */
.ai-cred { margin: .35rem 0 .6rem; padding: .7rem .85rem; background: #fff8e6; border: 1px solid #e0b84a; border-left: 5px solid #d39e00; border-radius: 10px; box-shadow: 0 2px 6px rgba(160, 120, 0, .12); max-width: 46rem; }
.ai-cred-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: .45rem; color: #6b4e00; }
.ai-cred-head .bi { color: #d39e00; font-size: 1.1rem; }
.ai-cred-label { font-size: .85rem; color: #6c757d; }
.ai-cred-row { display: grid; grid-template-columns: 6.5rem 1fr; gap: .25rem .5rem; align-items: center; margin-bottom: .3rem; font-size: .9rem; }
.ai-cred-row > span:first-child { color: #6c757d; }
.ai-cred-row code { word-break: break-all; }
.ai-cred-pwbox { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.ai-cred-pw { font-family: var(--bs-font-monospace); max-width: 22rem; flex: 1 1 12rem; background: #fff; }
.ai-cred-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .35rem; }
.ai-cred.forgotten { background: #f6f7f8; border-color: #ced4da; border-left-color: #adb5bd; box-shadow: none; color: #6c757d; font-size: .88rem; padding: .45rem .75rem; }
@media (max-width: 575.98px) { .ai-cred-row { grid-template-columns: 1fr; } }
.ai-image { display: block; padding: 0 .7rem .7rem; }
.ai-image img { max-width: 320px; width: 100%; border-radius: 10px; box-shadow: var(--fresk-shadow); }
.ai-pending { max-width: min(760px, 85%); margin: .5rem 0; padding: .75rem .9rem; border: 1px solid #f1b0ad; background: #fff5f4; border-radius: 12px; }
.ai-pending pre { background: #fff; border-radius: 6px; padding: .4rem .6rem; font-size: .76rem; max-height: 160px; overflow: auto; }
.ai-pending-item { background: #fff; border: 1px solid #f6d3d1; border-radius: 8px; padding: .5rem .65rem; margin-bottom: .5rem; }
.ai-pending-names { columns: 2; column-gap: 1.2rem; margin: .25rem 0 .25rem 1rem; padding: 0; max-height: 220px; overflow: auto; word-break: break-all; }
@media (max-width: 575.98px) { .ai-pending-names { columns: 1; } }
.ai-input { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid rgba(15,61,53,.08); background: #fff; }
.ai-input textarea { resize: none; max-height: 200px; }
.ai-att-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .75rem 0; border-top: 1px solid rgba(15,61,53,.08); background: #fff; }
.ai-att-strip + .ai-input { border-top: 0; }
.ai-att-item { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(15,61,53,.15); }
.ai-att-item img { width: 100%; height: 100%; object-fit: cover; }
.ai-att-x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; line-height: 20px; font-size: .8rem; }
.ai-att-hint { color: #6c7a76; flex: 1 1 200px; }
.ai-att-imgs { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; white-space: normal; }
.ai-att-imgs img { max-width: 160px; max-height: 160px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); }
@media (max-width: 767.98px) {
  .ai-body { flex-direction: column; height: auto; }
  .ai-side { width: auto; flex: none; border-right: 0; border-bottom: 1px solid rgba(15,61,53,.08); max-height: 180px; }
  .ai-log { min-height: 55vh; }
  .ai-bubble, .ai-card, .ai-pending { max-width: 100%; }
}
