:root {
  /* Paleta de constructoracarran.cl */
  --brand: #c19253; --brand-h: #a97b3f; --brand-d: #424242; --navy: #424242; --blue: #424242; --accent: #c19253; --sand: #d6d0a1;
  --tint: #f6efe3; --bg: #f5f3ee; --card: #fff; --line: #e3ded4; --text: #2f2f2f; --muted: #6b6b6b; --danger: #c0392b;
  --radius: 2px; --shadow: 0 1px 3px rgba(40,32,20,.08);
  --font-head: "Space Grotesk", Inter, "Segoe UI", Arial, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --side: #2b2926; --side-text: #cfc9be; --side-muted: #8d867a; --side-w: 240px; --top-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 Inter, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, .nav-title, .qname { font-family: var(--font-head); }
h1 { font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; margin: 0; color: #2f2f2f; }
h1 .muted { font: 500 13px var(--font-mono); letter-spacing: 0; vertical-align: middle; border: 1px solid var(--line); padding: 2px 8px; color: var(--muted); background: #fff; }
h3 { margin: 0 0 10px; font-weight: 600; }
h4 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.error { color: var(--danger); font-size: 14px; margin: 0; flex: 1; }
.hint { color: var(--muted); font-size: 12.5px; margin: 6px 0; }
.center { text-align: center; }
.spacer { flex: 1; }

/* Botones */
.btn { border: 1px solid var(--line); background: #fff; color: var(--text); padding: 9px 16px; border-radius: var(--radius); font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.small { padding: 6px 12px; font-size: 13.5px; }
.btn.block { display: block; width: 100%; }
.btn.primary { background: #2f2f2f; border-color: #2f2f2f; color: #fff; font: 600 13px var(--font-head); letter-spacing: .04em; text-transform: uppercase; border-radius: 0; padding: 10px 18px; }
.btn.primary.small { font-size: 12px; padding: 7px 14px; }
.btn.primary:hover { background: var(--brand); border-color: var(--brand); color: #1f1c18; filter: none; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.outline, .btn.outline-brand { border-color: var(--brand); color: var(--brand-h); font-weight: 600; }
.btn.outline-brand { text-transform: uppercase; letter-spacing: .06em; font: 700 13px var(--font-head); }
.btn.outline-blue { border-color: var(--navy); color: var(--navy); }
.btn.ghost-light { background: transparent; border-color: rgba(255,255,255,.6); color: #fff; }
.danger-text { color: var(--danger) !important; background: none; border: none; cursor: pointer; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--tint); }
.icon-btn.tiny { font-size: 14px; padding: 2px 6px; }
.icon-btn.brand { color: var(--brand-h); }

/* Inputs */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 500; margin-bottom: 12px; flex: 1; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus { outline: 2px solid rgba(193,146,83,.35); border-color: var(--brand); }
input[type=color] { padding: 2px; height: 38px; cursor: pointer; }
input[type=range] { padding: 0; accent-color: var(--brand); }
label.check { flex-direction: row; align-items: center; gap: 8px; }
label.check input { width: auto; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > .btn { margin-bottom: 12px; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.input-prefix span { padding: 8px 10px; background: #f1f3f5; color: var(--muted); font-size: 13px; white-space: nowrap; }
.input-prefix input { border: none; border-radius: 0; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M20 16v8M16 20h8' stroke='%23ffffff' stroke-opacity='.08' stroke-width='1'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #2e2b27 0%, #4a4136 55%, #6b5a40 100%); }
.login-card { background: #fff; padding: 36px 32px; border-radius: 0; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.2); border-top: 4px solid var(--accent); }
.login-card .brand { color: var(--brand-d); flex-direction: column; gap: 6px; }
.login-logo { width: 200px; height: auto; }
.login-card .app-name { font: 800 15px var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.local-login { display: flex; flex-direction: column; gap: 14px; }
.btn.ms-login { display: flex; align-items: center; justify-content: center; gap: 10px; border-color: #8c8c8c; color: #5e5e5e; font-weight: 600; text-decoration: none; }
.login-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Layout */
.brand { display: flex; align-items: center; gap: 12px; font: 600 18px var(--font-head); }
.brand.big { font-size: 22px; justify-content: center; }
.topbar-logo { height: 42px; width: auto; display: block; }
.brand-sep { width: 1px; height: 28px; background: var(--line); }
.topbar .app-name { font: 800 14px var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.topbar { position: fixed; inset: 0 0 auto 0; height: 70px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); box-shadow: 0 2px 12px rgba(40,32,20,.06); color: var(--brand-d); display: flex; align-items: center; gap: 12px; padding: 0 20px; z-index: 20; }
.menu-toggle { display: none; color: var(--brand-d); }
.user-name { font-size: 13px; font-weight: 600; color: var(--brand-d); }
.topbar .btn.ghost-light { border-color: var(--brand-d); color: var(--brand-d); text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; font-weight: 700; border-radius: 0; }
.topbar .btn.ghost-light:hover { background: var(--brand-d); color: #fff; filter: none; }
.sidebar { position: fixed; top: 70px; bottom: 0; left: 0; width: 230px; background: #fff; border-right: 1px solid var(--line); padding: 16px; overflow-y: auto; z-index: 15; }
.nav-title { font-weight: 800; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; margin: 20px 0 6px; color: var(--brand); }
.nav-item { display: block; padding: 8px 12px; border-radius: 0; cursor: pointer; color: #4b4b4b; font-weight: 500; }
.nav-item:hover, .folder-item:hover { background: var(--tint); }
.nav-item.active, .folder-item.active { background: var(--tint); color: var(--brand-d); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand); }
.sep { border-top: 1px solid var(--line); margin: 16px 0 0; }
#folderList { margin-top: 8px; }
.folder-item { display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 10px; border-radius: 0; cursor: pointer; font-size: 14px; }
.folder-item .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-item .count { font-size: 12px; color: var(--muted); }
.main { margin: 70px 0 0 230px; padding: 28px 32px 60px; max-width: 1260px; }

.page-head { margin-bottom: 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar select { width: auto; }
.search { display: flex; gap: 8px; flex: 0 1 420px; }

/* Tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 20px; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: #fff; border-radius: var(--radius); border: 1px dashed var(--line); grid-column: 1/-1; }
.card { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.thumb { width: 130px; height: 145px; display: grid; place-items: center; }
.thumb img { max-width: 100%; max-height: 100%; }
.type { color: var(--brand-h); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.qname { font-size: 19px; font-weight: 700; margin: 0 30px 2px 0; display: flex; align-items: center; gap: 4px; }
.qname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: 14px; margin-top: 7px; display: flex; align-items: center; gap: 4px; min-width: 0; }
.meta a:hover { text-decoration: underline; }
.meta .trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.meta.link { cursor: pointer; color: #4b4b4b; }
.meta.link:hover { color: var(--brand-h); }

/* Modales */
.modal { position: fixed; inset: 0; background: rgba(30,26,20,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: #fff; border-radius: 6px; border-top: 4px solid var(--brand); width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.small-card { max-width: 460px; } .small-card.wide { max-width: 680px; }
.editor-card { max-width: 1040px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2, .modal-head h3 { margin: 0; font-weight: 600; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.dialog-body { padding: 18px 20px; overflow-y: auto; }
.editor-body { display: flex; overflow: hidden; flex: 1; min-height: 0; }
.editor-form { flex: 1; padding: 0 22px 18px; overflow-y: auto; }
.editor-preview { width: 360px; flex-shrink: 0; background: #faf8f3; border-left: 1px solid var(--line); padding: 20px; overflow-y: auto; }
.preview-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; place-items: center; min-height: 300px;
  background-image: linear-gradient(45deg,#f0f0f0 25%,transparent 25%),linear-gradient(-45deg,#f0f0f0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#f0f0f0 75%),linear-gradient(-45deg,transparent 75%,#f0f0f0 75%);
  background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0; }
.preview-box img { width: 100%; max-width: 300px; }
.dl-box { margin-top: 14px; }
.dl-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-buttons .btn { flex: 1; font-weight: 600; }
.tabs { display: flex; gap: 4px; position: sticky; top: 0; background: #fff; padding: 14px 0 12px; z-index: 2; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { border: none; background: none; padding: 8px 14px; border-radius: 0; cursor: pointer; font: inherit; color: var(--muted); white-space: nowrap; }
.tab.active { background: var(--tint); color: var(--brand-d); font-weight: 700; box-shadow: inset 0 -2px 0 var(--brand); }
.logo-drop { display: flex; gap: 16px; align-items: center; border: 2px dashed var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.logo-drop.drag { border-color: var(--brand); background: var(--tint); }
.logo-drop img { width: 80px; height: 80px; object-fit: contain; background: #f4f4f4; border-radius: 8px; }

.popmenu { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; z-index: 60; min-width: 170px; display: flex; flex-direction: column; }
.popmenu button { background: none; border: none; text-align: left; padding: 8px 12px; border-radius: 6px; font: inherit; cursor: pointer; }
.popmenu button:hover { background: var(--tint); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #2f2f2f; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 80; font-size: 14px; }
.toast.err { background: var(--danger); }

/* Estadísticas */
.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.kpis > div { flex: 1; min-width: 140px; background: #faf8f3; border: 1px solid var(--line); border-radius: 0; padding: 12px 14px; display: flex; flex-direction: column; }
.kpis.big > div { background: #fff; }
.kpis b { font: 700 28px var(--font-head); letter-spacing: -.02em; } .kpis b.smallb { font-size: 14px; }
.kpis span { color: var(--muted); font-size: 13px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-top: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart { width: 100%; height: auto; }
.chart .bar { fill: var(--brand); } .chart .axis { font-size: 10px; fill: var(--muted); }
.dev { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.dev span { flex: 0 0 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.devbar { flex: 1.5; height: 8px; background: #eef1f4; border-radius: 4px; overflow: hidden; }
.devbar i { display: block; height: 100%; background: var(--blue); }

/* Plantillas */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; }
.tcard img { width: 140px; height: 150px; object-fit: contain; }
.tcard .tname { font-weight: 600; margin: 8px 0; }
.tcard .row { justify-content: center; }

/* Fichas PDF: lista */
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1f2937; font-weight: 700; }
.btn.accent:hover { filter: brightness(.95); }
.drop-zone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 18px; background: #fff; }
.drop-zone.drag { border-color: var(--brand); background: var(--tint); color: var(--brand-d); }
.flist { display: flex; flex-direction: column; gap: 12px; }
.fcard { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.ficon { width: 48px; height: 58px; flex-shrink: 0; border-radius: 6px; background: var(--tint); color: var(--brand-d); display: grid; place-items: center; font: 700 13px var(--font-head); border-bottom: 4px solid var(--accent); }
.fbody { flex: 1; min-width: 0; }
.fbody .qname { margin-right: 0; }
.fbody .meta { margin-top: 4px; }
.factions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Fichas PDF: editor */
body.no-scroll { overflow: hidden; }
.fe { position: fixed; inset: 0; z-index: 45; background: var(--bg); display: flex; flex-direction: column; }
.fe-head { height: 58px; flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--side); color: #fff; border-bottom: 3px solid var(--accent); }
.fe-head h2 { margin: 0; font: 600 17px var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fe-close { color: #fff; font-size: 20px; }
.fe-close:hover { background: rgba(255,255,255,.15); }
.fe-status { font-size: 12.5px; opacity: .8; white-space: nowrap; }
.fe-status.dirty { color: var(--accent); opacity: 1; font-weight: 600; }
.fe-body { flex: 1; display: flex; min-height: 0; }
.fe-side { width: 290px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 4px 16px 16px; overflow-y: auto; display: flex; flex-direction: column; }
.fe-side h4 { margin-top: 14px; }
.fe-side label { flex: 0 0 auto; }
.fe-side input[type=search] { margin-bottom: 4px; }
.fe-qrlist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.fe-qr { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: grab; font: inherit; color: var(--text); min-width: 0; }
.fe-qr:hover { border-color: var(--brand); background: var(--tint); }
.fe-qr img { width: 72px; height: 72px; object-fit: contain; }
.fe-qr-name { font-size: 12px; line-height: 1.25; text-align: center; width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.badge { position: absolute; top: 4px; right: 4px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 1px 6px; }
.fe-selpanel { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
.fe-selname { font-weight: 600; margin-bottom: 10px; color: var(--brand-d); }
.fe-selbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.fe-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fe-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); font-size: 14px; }
.fe-zoomlbl { min-width: 46px; text-align: center; }
.fe-viewport { flex: 1; overflow: auto; padding: 24px; background: #d9dee5; }
.fe-page { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.fe-page.loading::after { content: "Cargando página…"; position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.9); padding: 4px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); }
.fe-canvas { display: block; }
.fe-overlay { position: absolute; inset: 0; }
.pl { position: absolute; cursor: move; touch-action: none; outline: 1px dashed transparent; aspect-ratio: 1; }
.pl img { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.pl:hover { outline-color: var(--brand); }
.pl.sel { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 2; }
.pl.archived img { opacity: .55; }
.pl-name { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 4px; white-space: nowrap; background: var(--brand-d); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; pointer-events: none; display: none; }
.pl:hover .pl-name, .pl.sel .pl-name { display: block; }
.pl-del, .pl-handle { position: absolute; display: none; }
.pl.sel .pl-del, .pl.sel .pl-handle { display: block; }
.pl-del { top: -11px; right: -11px; width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--danger); color: #fff; font-size: 11px; line-height: 22px; padding: 0; cursor: pointer; }
.pl-handle { right: -6px; bottom: -6px; width: 14px; height: 14px; background: var(--accent); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; }

/* Responsive */
@media (max-width: 900px) {
  .menu-toggle { display: inline-block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.1); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; padding: 20px 16px 60px; }
  .grid { grid-template-columns: 1fr; }
  .editor-body { flex-direction: column; overflow-y: auto; }
  .editor-form { overflow: visible; }
  .editor-preview { width: 100%; border-left: none; border-top: 1px solid var(--line); }
  .two-col { grid-template-columns: 1fr; }
  .topbar .ghost-light { padding: 6px 10px; font-size: 13px; }
  .user-name, #adminLink { display: none; }
  .topbar .brand-sep, .topbar .app-name { display: none; }
  .topbar-logo { height: 34px; }
  .fcard { flex-wrap: wrap; }
  .factions { width: 100%; }
  .fe-body { flex-direction: column-reverse; }
  .fe-side { width: 100%; max-height: 42vh; border-right: none; border-top: 1px solid var(--line); }
  .fe-qrlist { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .fe-head #feDownload { padding: 6px 10px; font-size: 13px; }
  .fe-status { display: none; }
  .fe-viewport { padding: 12px; }
}
@media (max-width: 520px) {
  .card { flex-direction: column; }
  .search { flex: 1 1 100%; }
}

/* Perfiles y áreas */
.readonly .needs-edit { display: none !important; }
.role-badge { font-size: 11px; padding: 3px 8px; background: var(--brand-d); color: #fff; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.area-badge { font-size: 12px; padding: 5px 12px; background: var(--tint); color: var(--brand-d); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border-left: 3px solid var(--brand); }
.area-sel { width: auto; max-width: 220px; padding: 6px 10px; font-weight: 600; border-color: var(--brand); color: var(--brand-d); }
.area-sel option { color: var(--text); background: #fff; }
.page-tabs { position: static; background: none; padding: 0 0 12px; margin-bottom: 16px; }
.admin-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.admin-form h3 { margin: 0; }
.admin-form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.admin-form-row label { flex: 1 1 180px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.admin-form-row label:first-child { flex-basis: 260px; }
.admin-form-row .btn { flex: 0 0 auto; }
.admin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.urow, .arow { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; }
.urow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.urow.inactive { opacity: .6; }
.urow .uname { font-weight: 600; overflow-wrap: anywhere; }
.urow .umail { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.urow label { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.urow .uactive { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.urow .uactive input { width: auto; }
.arow { display: flex; align-items: center; gap: 12px; }
.arow .aname { flex: 1; font-weight: 600; }
@media (max-width: 760px) {
  .role-badge, .user-name { display: none; }
  .urow { grid-template-columns: 1fr 1fr; }
  .urow .uinfo, .urow .uactive { grid-column: 1 / -1; }
}

/* ---------- Diseño editorial (opción 2): menú lateral oscuro, títulos Space Grotesk, códigos en monoespaciada ---------- */
.topbar { left: var(--side-w); height: var(--top-h); background: #fff; box-shadow: none; padding: 0 28px; }
.topbar .brand { display: none; }
.crumb { font: 500 13px var(--font-head); color: #8a8478; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: #2f2f2f; font-weight: 600; }
.topbar .btn.ghost-light { font-family: var(--font-head); font-weight: 600; letter-spacing: .04em; }
.area-sel { font-family: var(--font-head); border-radius: 0; }
.main { margin: var(--top-h) 0 0 var(--side-w); padding: 28px 30px 60px; }

.sidebar { top: 0; width: var(--side-w); background: var(--side); border-right: none; color: var(--side-text); padding: 0 0 24px; z-index: 22; }
.side-brand { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; }
.side-brand img { width: 168px; height: auto; display: block; }
.side-brand .app-name { font: 600 11px var(--font-head); letter-spacing: .22em; text-transform: uppercase; color: var(--brand); }
.sidebar .btn { width: calc(100% - 44px); margin: 0 22px; border-radius: 0; }
.sidebar .btn.outline-brand { background: var(--brand); border-color: var(--brand); color: #1f1c18; }
.sidebar .btn.outline-brand:hover { background: #d1a668; filter: none; }
.sidebar .btn.primary { background: transparent; border-color: rgba(193,146,83,.6); color: var(--brand); }
.sidebar .btn.primary:hover { background: rgba(193,146,83,.14); color: #e2bf8c; }
.sidebar .nav-title { font: 600 11px var(--font-head); letter-spacing: .16em; color: var(--side-muted); margin: 22px 22px 6px; }
.sidebar .nav-item { padding: 9px 22px 9px 19px; color: var(--side-text); font-weight: 500; font-size: 14px; border-left: 3px solid transparent; box-shadow: none; }
.sidebar .nav-item:hover, .sidebar .folder-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar .nav-item.active, .sidebar .folder-item.active { background: rgba(193,146,83,.14); color: #fff; font-weight: 600; border-left-color: var(--brand); box-shadow: none; }
.sidebar .sep { border-top: 1px solid rgba(255,255,255,.08); margin: 18px 22px 0; }
.sidebar #folderList { margin-top: 10px; }
.sidebar .folder-item { padding: 7px 10px 7px 19px; color: var(--side-text); border-left: 3px solid transparent; }
.sidebar .folder-item .count { font-family: var(--font-mono); color: var(--side-muted); }
.sidebar .icon-btn { color: var(--side-muted); }
.sidebar .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.page-head { border-bottom: 2px solid #2f2f2f; padding-bottom: 14px; margin-bottom: 22px; }
.page-head p { margin: 10px 0 0; }
h2, h3, .qname, .modal-head h2, .modal-head h3, .tab { font-family: var(--font-head); }
.toolbar input, .toolbar select, .search input { border-radius: 0; }
.btn.blue { border-radius: 0; font-family: var(--font-head); }

.grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card { flex-direction: column; border-radius: 0; box-shadow: none; transition: border-color .15s; }
.card:hover { border-color: #c9c1b2; }
.card-qr { position: relative; padding: 24px 40px 20px; background: #fdfcf9; border-bottom: 1px solid #ebe6dc; display: grid; place-items: center; }
.card-qr .thumb { width: 100%; max-width: 170px; height: auto; aspect-ratio: 1 / 1.1; }
.scan-badge { position: absolute; top: 10px; right: 10px; font: 500 11px var(--font-mono); background: #fff; border: 1px solid var(--line); padding: 3px 8px; cursor: pointer; color: #4b4b4b; }
.scan-badge:hover { border-color: var(--brand); color: var(--brand-h); }
.card-info { padding: 14px 16px 12px; flex: 1; min-width: 0; }
.card-info .type { font: 600 10.5px var(--font-head); letter-spacing: .16em; color: var(--brand-h); }
.card-info .qname { font-size: 18px; font-weight: 700; margin: 2px 0 4px; letter-spacing: -.01em; }
.card-info .meta { margin-top: 4px; font-size: 13px; }
.code { font: 12px var(--font-mono); color: var(--brand-h); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-date { margin-top: 8px; }
.card-row { display: flex; border-top: 1px solid #ebe6dc; }
.card-row button { flex: 1; background: none; border: 0; padding: 11px 6px; font: 600 12px var(--font-head); letter-spacing: .03em; color: #4b4b4b; cursor: pointer; white-space: nowrap; }
.card-row button + button { border-left: 1px solid #ebe6dc; }
.card-row button:hover { background: var(--tint); color: #2f2f2f; }
.card-row button[data-act="menu"] { flex: 0 0 48px; font: 700 18px/1 Inter, sans-serif; }

.fcard { border-radius: 0; box-shadow: none; }
.fcard .ficon { border-radius: 0; font-family: var(--font-mono); }
.empty { border-radius: 0; }
.panel { border-radius: 0; box-shadow: none; }
.urow, .arow { border-radius: 0; box-shadow: none; }
.modal-card { border-radius: 0; }
.login-card .app-name { font-family: var(--font-head); font-weight: 600; letter-spacing: .22em; }

@media (max-width: 900px) {
  .topbar { left: 0; padding: 0 14px; }
  .topbar .brand { display: flex; }
  .crumb { display: none; }
  .topbar { gap: 8px; }
  .topbar .brand { flex-shrink: 0; }
  .topbar-logo { height: 30px; }
  .area-sel { min-width: 0; max-width: 120px; font-size: 13px; padding: 5px 6px; }
  .topbar .btn.ghost-light { padding: 6px 8px; font-size: 11px; flex-shrink: 0; }
  .sidebar { top: var(--top-h); }
  .side-brand { display: none; }
  .main { margin-left: 0; }
  h1 { font-size: 30px; }
}
