/* Xcitione M365 Backup - consola de administracion */
:root {
  --nav: #1e293b;
  --nav-2: #0f172a;
  --nav-text: #cbd5e1;
  --nav-muted: #64748b;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --ok: #16a34a;     --ok-soft: #dcfce7;
  --warn: #d97706;   --warn-soft: #fef3c7;
  --err: #dc2626;    --err-soft: #fee2e2;
  --info: #0891b2;   --info-soft: #cffafe;
  --run: #7c3aed;    --run-soft: #ede9fe;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; }
.brand-name { font-weight: 700; color: #fff; font-size: 15px; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--nav-muted); letter-spacing: .06em; text-transform: uppercase; }
.tenant-switch { margin: 14px 14px 6px; padding: 9px 12px; border-radius: 8px; background: var(--nav-2); border: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.tenant-switch .t-name { color: #fff; font-weight: 600; font-size: 13px; }
.tenant-switch .t-dom { font-size: 11.5px; color: var(--nav-muted); }
.tenant-switch select { all: unset; position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.nav { padding: 8px 10px; overflow-y: auto; flex: 1; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--nav-muted); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 7px; color: var(--nav-text); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: rgba(255,255,255,.05); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(37,99,235,.14); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav a.active svg { color: var(--brand); }
.nav .count { margin-left: auto; font-size: 11px; background: var(--brand); color: #fff; border-radius: 10px; padding: 1px 7px; font-weight: 600; }
.side-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11.5px; color: var(--nav-muted); }
.side-foot b { color: var(--nav-text); font-weight: 600; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.crumbs { font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.crumbs b { color: var(--text); font-weight: 600; }
.search { margin-left: auto; position: relative; }
.search input { width: 300px; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font: inherit; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.top-btn { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); cursor: pointer; position: relative; border: 1px solid transparent; background: none; }
.top-btn:hover { background: var(--bg); border-color: var(--border); }
.top-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; background: var(--brand); border-radius: 50%; border: 2px solid #fff; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 20px; border: 1px solid var(--border); cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--nav); color: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }
.avatar.c { background: var(--brand); }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.dark { background: var(--nav); border-color: var(--nav); color: #fff; }
.btn.danger { color: var(--err); border-color: #fecaca; }
.btn.danger:hover { background: var(--err-soft); }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 7px; border: none; background: none; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* ---------- Cards / grid ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 14.5px; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.mt { margin-top: 18px; }
.mt-s { margin-top: 10px; }
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2,1fr); } .g-main { grid-template-columns: 1fr; } }

/* KPI */
.kpi { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .k-top { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 500; font-size: 13px; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); color: var(--text-2); }
.kpi .k-ico.prim { background: var(--brand-soft); color: var(--brand); }
.kpi .k-ico.ok { background: var(--ok-soft); color: var(--ok); }
.kpi .k-ico.info { background: var(--info-soft); color: var(--info); }
.kpi .k-ico.run { background: var(--run-soft); color: var(--run); }
.kpi .k-val { font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.kpi .k-foot { font-size: 12.5px; color: var(--muted); }
.kpi .k-foot .up { color: var(--ok); font-weight: 600; }
.kpi .k-foot .down { color: var(--err); font-weight: 600; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: #15803d; border-color: #bbf7d0; }
.badge.warn { background: var(--warn-soft); color: #b45309; border-color: #fde68a; }
.badge.err { background: var(--err-soft); color: #b91c1c; border-color: #fecaca; }
.badge.info { background: var(--info-soft); color: #0e7490; border-color: #a5f3fc; }
.badge.run { background: var(--run-soft); color: #6d28d9; border-color: #ddd6fe; }
.badge.run::before { animation: pulse 1.2s infinite; }
.badge.off { color: var(--muted); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); margin-right: 4px; }
.tag.ex { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tag.od { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.tag.sp { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.tag.gr { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--border); background: #f8fafc; white-space: nowrap; }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.sel { background: var(--brand-soft) !important; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--muted); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .n { font-weight: 600; }
.cell-user .e { font-size: 12.5px; color: var(--muted); }
.tbl-foot { display: flex; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; gap: 10px; }
.tbl-foot .pg { margin-left: auto; display: flex; gap: 4px; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.input, select.input, textarea.input { padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; background: #fff; color: var(--text); min-width: 0; }
.input:focus { outline: 2px solid rgba(37,99,235,.25); border-color: var(--brand); }
.input.search-in { padding-left: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center; width: 260px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 7px 13px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--nav); color: #fff; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 10px 16px; color: var(--text-2); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-color: var(--brand); }

/* Forms */
.form { display: grid; gap: 16px; }
.form .row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.field label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 6px; color: var(--text-2); }
.field .input { width: 100%; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); }
.check .d { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 20px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(16px); }

/* Callouts */
.callout { display: flex; gap: 12px; padding: 13px 16px; border-radius: var(--radius); border: 1px solid; align-items: flex-start; }
.callout .c-t { font-weight: 700; margin-bottom: 2px; }
.callout .c-b { color: var(--text-2); font-size: 13px; }
.callout .c-act { margin-left: auto; align-self: center; }
.callout.err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.callout.warn { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.callout.info { background: #ecfeff; border-color: #a5f3fc; color: #0e7490; }
.callout.ok { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: none; }
.list .l-main { flex: 1; min-width: 0; }
.list .l-t { font-weight: 600; }
.list .l-s { font-size: 12.5px; color: var(--muted); }
.dot-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--bg); color: var(--text-2); }
.dot-ico.ok { background: var(--ok-soft); color: var(--ok); }
.dot-ico.err { background: var(--err-soft); color: var(--err); }
.dot-ico.warn { background: var(--warn-soft); color: var(--warn); }
.dot-ico.run { background: var(--run-soft); color: var(--run); }
.dot-ico.info { background: var(--info-soft); color: var(--info); }

/* Progress / meters */
.bar { height: 8px; background: var(--bg); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 8px; }
.bar.ok > i { background: var(--ok); }
.bar.run > i { background: var(--run); }
.stat-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.stat-row b { color: var(--text); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-all; }

/* Charts */
.chart { width: 100%; height: 220px; display: block; }
.chart .gl { stroke: var(--border); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.heat { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; }
.heat span { aspect-ratio: 1; border-radius: 3px; background: var(--ok); }
.heat span.w { background: #fbbf24; }
.heat span.e { background: var(--err); }
.heat span.n { background: var(--border); }

/* Drawer / modal */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50; display: flex; justify-content: flex-end; animation: fade .15s; }
.overlay.center { justify-content: center; align-items: center; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: 620px; max-width: 95vw; height: 100%; background: var(--surface); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s; }
@keyframes slide { from { transform: translateX(40px); opacity: .5; } }
.modal { width: 640px; max-width: 95vw; max-height: 90vh; background: var(--surface); border-radius: 12px; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal.wide { width: 880px; }
.d-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.d-head h2 { font-size: 17px; }
.d-head .sub { color: var(--muted); font-size: 12.5px; }
.d-head .icon-btn { margin-left: auto; }
.d-body { padding: 22px; overflow-y: auto; flex: 1; }
.d-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: #f8fafc; border-radius: 0 0 12px 12px; }
.logbox { background: var(--nav-2); color: #cbd5e1; font-family: var(--mono); font-size: 12px; border-radius: 8px; padding: 14px; line-height: 1.6; max-height: 320px; overflow: auto; white-space: pre-wrap; }
.logbox .lw { color: #fbbf24; } .logbox .le { color: #f87171; } .logbox .li { color: #7dd3fc; } .logbox .lt { color: #64748b; }

/* Stepper */
.stepper { display: flex; gap: 0; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.step { flex: 1; display: flex; align-items: center; gap: 11px; padding: 14px 18px; border-right: 1px solid var(--border); color: var(--muted); }
.step:last-child { border-right: none; }
.step .n { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.step .st { font-weight: 600; font-size: 13px; }
.step .ss { font-size: 11.5px; }
.step.on { color: var(--text); background: var(--brand-soft); }
.step.on .n { border-color: var(--brand); background: var(--brand); color: #fff; }
.step.done { color: var(--text-2); }
.step.done .n { border-color: var(--ok); background: var(--ok); color: #fff; }

/* Tree / browser */
.browser { display: grid; grid-template-columns: 280px 1fr; min-height: 440px; }
.tree { border-right: 1px solid var(--border); padding: 10px 6px; overflow-y: auto; max-height: 560px; }
.tree .node { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.tree .node:hover { background: var(--bg); }
.tree .node.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.tree .node .c { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.tree .node input { accent-color: var(--brand); margin: 0; }
.items { overflow-y: auto; max-height: 560px; }

/* Choice cards */
.choices { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.choice { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; background: #fff; display: flex; gap: 12px; align-items: flex-start; }
.choice:hover { border-color: var(--border-strong); }
.choice.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.choice .ct { font-weight: 700; }
.choice .cd { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }

/* Timeline of points */
.points { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; }
.point { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 9px; cursor: pointer; background: #fff; }
.point:hover { border-color: var(--border-strong); }
.point.on { border-color: var(--brand); background: var(--brand-soft); }
.point .pd { font-weight: 700; min-width: 140px; }

/* Toast */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: var(--nav); color: #fff; padding: 12px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-weight: 500; min-width: 280px; animation: slide .2s; }
.toast.ok svg { color: #4ade80; } .toast.err svg { color: #f87171; }

/* Empty */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin-bottom: 10px; }
.empty .et { color: var(--text); font-weight: 600; font-size: 15px; margin-bottom: 4px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--nav); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(37,99,235,.12); right: -180px; bottom: -180px; }
.login-art h2 { font-size: 34px; line-height: 1.15; max-width: 460px; font-weight: 700; }
.login-art p { color: var(--nav-text); max-width: 440px; line-height: 1.6; }
.login-feats { display: grid; gap: 14px; margin-top: 28px; }
.login-feats div { display: flex; gap: 12px; align-items: center; color: var(--nav-text); }
.login-feats svg { color: var(--brand); }
.login-form { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-form form { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login-form h1 { font-size: 24px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.right-al { margin-left: auto; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.field label.check { display: flex; font-weight: 500; font-size: 13px; color: var(--text); margin-bottom: 0; }
.field label.check.small { font-size: 12.5px; color: var(--text-2); }
.tbl .num { white-space: nowrap; }
.kpi .k-ico.warn { background: var(--warn-soft); color: var(--warn); }

/* Buzon respaldado */
.mb-pick { display: flex; flex-direction: column; gap: 4px; }
.mb-pick select { min-width: 300px; }
.mb-grid { display: grid; grid-template-columns: 250px minmax(300px, 1fr) minmax(380px, 1.25fr); height: calc(100vh - 250px); min-height: 480px; overflow: hidden; }
.mb-folders { border-right: 1px solid var(--border); overflow-y: auto; padding: 6px 6px 12px; background: #f8fafc; }
.mb-fhead { font-weight: 700; padding: 10px 12px 8px; font-size: 13px; }
.mb-folder { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.mb-folder:hover { background: #eef2f7; }
.mb-folder.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.mb-folder .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-folder .c { font-size: 11.5px; color: var(--muted); }
.mb-list { display: flex; flex-direction: column; border-right: 1px solid var(--border); min-width: 0; }
.mb-listhead { padding: 11px 14px; border-bottom: 1px solid var(--border); min-height: 50px; display: flex; align-items: center; }
.mb-listhead > .flex { width: 100%; }
.mb-rows { overflow-y: auto; flex: 1; }
.mb-row { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.mb-row:hover { background: #f8fafc; }
.mb-row.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.mb-row.sel { background: #eef4ff; }
.mb-row input { margin-top: 3px; accent-color: var(--brand); }
.mb-main { flex: 1; min-width: 0; }
.mb-top { display: flex; gap: 8px; }
.mb-from { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mb-subj { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.mb-fold { font-size: 11.5px; color: var(--muted); display: flex; gap: 4px; align-items: center; margin-top: 2px; }
.mb-read { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.mb-rhead { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.mb-rhead h2 { font-size: 17px; line-height: 1.3; }
.mb-meta { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.mb-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mb-att { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; color: var(--text); background: #f8fafc; max-width: 100%; }
.mb-att span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.mb-att:hover { border-color: var(--brand); text-decoration: none; }
.mb-body { flex: 1; width: 100%; border: none; background: #fff; }
@media (max-width: 1250px) { .mb-grid { grid-template-columns: 210px 1fr; } .mb-read { display: none; } }

/* ================= Responsive ================= */
.menu-btn { display: none; }
.nav-backdrop { display: none; }
.mb-back { display: none; }
html, body { overflow-x: hidden; }
.content { min-width: 0; }
.card { min-width: 0; }

@media (max-width: 1280px) {
  .search input { width: 220px; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .mb-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .mb-read { display: none; }
  .mb-grid.reading .mb-read { display: flex; position: fixed; inset: 0 0 0 auto; width: min(760px, 100vw); z-index: 45; background: var(--surface); box-shadow: var(--shadow-lg); animation: slide .2s; }
  .mb-grid.reading::after { content: ""; position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 44; }
  .mb-back { display: inline-flex; }
}

@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 55; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .content { padding: 22px 20px 50px; }
  .user-chip .uc-text { display: none; }
  .user-chip { padding: 4px; }
  .choices { grid-template-columns: 1fr; }
  .browser { grid-template-columns: 1fr; }
  .tree { border-right: none; border-bottom: 1px solid var(--border); max-height: 220px; }
}

@media (max-width: 820px) {
  .search { display: none; }
  .crumbs span, .crumbs svg { display: none; }
  .crumbs b { font-size: 15px; }
  .stepper .ss { display: none; }
  .step { padding: 12px; gap: 8px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .card { overflow-x: auto; }
}

@media (max-width: 640px) {
  .content { padding: 16px 16px 40px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 20px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn { flex: 1; justify-content: center; }
  .g-4, .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .form .row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .tabs a { padding: 10px 12px; }
  .toolbar > .input, .toolbar > select.input, .input.search-in { width: 100%; }
  .toolbar .grow { display: none; }
  .card-h { flex-wrap: wrap; }
  .card-h .right { margin-left: 0; }
  .stepper { overflow-x: auto; }
  .step .st { white-space: nowrap; }
  .modal, .modal.wide { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .overlay.center { align-items: stretch; }
  .d-foot { border-radius: 0; flex-wrap: wrap; }
  .drawer { width: 100vw; }
  .callout { flex-wrap: wrap; }
  .callout .c-act { margin-left: 0; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; }
  .mb-pick, .mb-pick select { width: 100%; min-width: 0; }
  .mb-toolbar .toolbar > input { width: 100% !important; }
  .mb-grid { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; min-height: 0; }
  .mb-folders { border-right: none; border-bottom: 1px solid var(--border); height: 190px; max-height: 190px; }
  .mb-list { border-right: none; }
  .mb-rows { max-height: 65dvh; }
  .mb-grid.reading .mb-read { width: 100vw; }
  .points .point { flex-wrap: wrap; }
  .card-b .flex, .d-body .flex { flex-wrap: wrap; }
  .point .pd { min-width: 0; }
}

/* Buzon sin lectura de contenido (privacidad) */
.mb-grid.mb-noread { grid-template-columns: 250px minmax(0, 1fr); }
.mb-row { align-items: center; }
.mb-r1 { flex: none; opacity: .75; }
.mb-row:hover .mb-r1 { opacity: 1; border-color: var(--brand); color: var(--brand-dark); }
@media (max-width: 1280px) { .mb-grid.mb-noread { grid-template-columns: 220px minmax(0, 1fr); } }
@media (max-width: 640px) { .mb-grid.mb-noread { grid-template-columns: 1fr; } .mb-r1 span { display: none; } }
