/* ============================================================
   OBRA · Gestión — hoja de estilos única
   Design tokens tomados del preview de diseño (COT-2026-018)
   ============================================================ */

:root {
  /* Texto */
  --ink: #1b1b18;
  --soft: #5c5a52;
  --muted: #7c7970;
  --faint: #9a978e;
  --ghost: #b8b4ab;

  /* Fondos */
  --paper: #fbfaf7;
  --cream: #f6f4ef;
  --sand: #f2efe8;
  --sand-2: #f1eee7;
  --sand-3: #f5f3ee;

  /* Bordes */
  --line: #eae6dd;
  --line-2: #ece8df;

  /* Oscuro (sidebar) */
  --dark: #1b1c19;
  --dark-2: #33342e;

  /* Acento */
  --accent: #c47a2c;
  --accent-dark: #ac6a24;
  --accent-soft: #fbf2e4;
  --accent-line: #f0e2c6;
  --accent-text: #9c6a24;
  --gold: #e9c79a;

  /* Semánticos */
  --green: #2e7d5b;
  --green-soft: #e7f1ea;
  --red: #c24a3c;
  --red-soft: #fbeeea;
  --red-line: #f2d9d2;
  --red-text: #9c3b2f;
  --blue: #3e6e8c;
  --blue-soft: #eaf0f4;

  /* Tipografías */
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-display: "Archivo", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 12px;
  --shadow-card: 0 20px 50px -24px rgba(28, 28, 24, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::selection { background: var(--accent); color: #fff; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; }
p { margin: 0; }

.icon { flex-shrink: 0; }
.icon.flip { transform: scaleX(-1); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Layout general (panel admin) ---------- */

.app { display: flex; min-height: 100vh; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.content {
  padding: 24px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 234px;
  flex-shrink: 0;
  background: var(--dark);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 6px 18px;
  color: inherit;
}
.side-brand .logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: var(--dark);
  display: flex; align-items: center; justify-content: center;
}
.side-brand .name {
  font-family: var(--font-display); font-weight: 800;
  font-size: 15px; color: #f5f2eb; letter-spacing: 0.02em; line-height: 1.1;
}
.side-brand .tag {
  font-size: 10px; color: #8a887f; font-family: var(--font-mono); letter-spacing: 0.06em;
}

.side-label {
  font-size: 10px; color: #6e6c64; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 14px 8px 8px;
}

.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 8px;
  color: #a7a69c; font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px; transition: background 0.15s, color 0.15s;
}
.side-link:hover { background: rgba(255, 255, 255, 0.05); color: #f0ede6; }
.side-link.active { background: var(--accent); color: #1a1a17; font-weight: 600; }
.side-link.disabled {
  color: #5f5e56; cursor: default;
}
.side-link.disabled:hover { background: transparent; color: #5f5e56; }
.side-link .side-tag {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; background: rgba(255, 255, 255, 0.05);
  color: #6e6c64; padding: 2px 6px; border-radius: 4px;
}

.side-user {
  margin-top: auto;
  padding: 12px 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex; align-items: center; gap: 10px;
}
.side-user .who { line-height: 1.2; min-width: 0; flex: 1; }
.side-user .who .n {
  color: #f0ede6; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-user .who .r { color: #7e7c73; font-size: 11px; }
.side-user .out {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #7e7c73; background: transparent; border: none; cursor: pointer;
}
.side-user .out:hover { color: #f0ede6; background: rgba(255, 255, 255, 0.05); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--dark-2); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}

/* ---------- Topbar ---------- */

.topbar {
  height: 58px; flex-shrink: 0;
  border-bottom: 1px solid var(--line-2);
  background: var(--paper);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #8a877f; }
.crumbs .sep { color: #cfc9bc; }
.crumbs .here { color: var(--ink); font-weight: 600; }
.crumbs a { color: #8a877f; }
.crumbs a:hover { color: var(--ink); }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.searchbox {
  width: 230px; height: 34px;
  background: var(--sand); border: 1px solid var(--line-2); border-radius: 8px;
  display: flex; align-items: center; gap: 8px; padding: 0 11px;
  color: var(--faint); font-size: 13px;
}
.bell {
  position: relative; width: 34px; height: 34px; border-radius: 8px;
  background: var(--sand); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; color: var(--soft);
}
.bell .ping {
  position: absolute; top: 6px; right: 7px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent); border: 1.5px solid var(--paper);
}

/* ---------- Encabezado de página ---------- */

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-title { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.page-sub { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Tarjetas ---------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-pad { padding: 20px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

/* ---------- KPIs ---------- */

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.kpi .k-top { display: flex; justify-content: space-between; align-items: center; }
.kpi .k-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .k-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--sand-2); color: var(--soft);
  display: flex; align-items: center; justify-content: center;
}
.kpi .k-value {
  font-family: var(--font-mono); font-size: 23px; font-weight: 600;
  margin-top: 12px; letter-spacing: -0.02em;
}
.kpi .k-sub { font-size: 12px; color: var(--faint); margin-top: 4px; }
.kpi.kpi-dark { background: var(--dark); border-color: var(--dark); }
.kpi.kpi-dark .k-label { color: #a7a69c; }
.kpi.kpi-dark .k-icon { background: rgba(255, 255, 255, 0.08); color: var(--gold); }
.kpi.kpi-dark .k-value { color: #f5f2eb; }
.kpi.kpi-dark .k-sub { color: #7fb89a; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 600;
  padding: 9px 15px; border-radius: 9px;
  border: none; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.2;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px -4px rgba(196, 122, 44, 0.6);
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: var(--dark-2); color: #fff; }
.btn-outline { background: #fff; color: var(--soft); border: 1.5px solid var(--line); }
.btn-outline:hover { background: var(--sand-3); color: var(--soft); }
.btn-danger { background: #fff; color: var(--red); border: 1.5px solid #ead3ce; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-green {
  background: var(--green); color: #fff;
  box-shadow: 0 4px 12px -4px rgba(46, 125, 91, 0.55);
}
.btn-green:hover { background: #256b4d; color: #fff; }
.btn-sm { font-size: 12px; padding: 6px 11px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* ---------- Formularios ---------- */

.label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--soft); margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%; background: #fff;
  border: 1px solid #dad6cc; border-radius: 8px;
  padding: 8px 12px; font-size: 13.5px;
  font-family: var(--font-sans); color: var(--ink);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 122, 44, 0.15);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input[readonly], .input[disabled] { background: var(--sand-3); color: var(--muted); }
.textarea { resize: vertical; min-height: 74px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237c7970' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 32px;
}

.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--soft); cursor: pointer;
}
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* Selector de color de categoría */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { position: relative; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches .sw {
  display: block; width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid transparent;
}
.swatches input:checked + .sw {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px #fff inset;
}

.swatch { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

/* ---------- Tablas ---------- */

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 12px 18px;
  background: var(--sand-3); border-bottom: 1px solid var(--line);
  font-size: 11px; color: #8a877f; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.table td {
  padding: 13px 18px; border-bottom: 1px solid var(--sand-2);
  font-size: 13.5px; vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table .num { font-family: var(--font-mono); font-size: 13px; text-align: right; white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions form { display: inline-block; margin-left: 4px; }
.row-inactive td { opacity: 0.55; }

.total-row {
  display: grid; align-items: center;
  background: var(--dark); color: #f5f2eb;
  padding: 15px 18px; gap: 12px;
}
.total-row .t-label { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; }
.total-row .t-value { font-family: var(--font-mono); font-weight: 600; font-size: 15px; color: var(--gold); text-align: right; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 20px; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--accent-soft); color: var(--accent-text); }
.badge-red { background: var(--red-soft); color: var(--red-text); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-gray { background: var(--sand-2); color: var(--faint); }

.pill {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 5px;
  background: var(--sand-2); color: var(--muted);
}

/* ---------- Avisos y enlaces generados ---------- */

.notice {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px; border-radius: 9px; font-size: 12.5px;
  margin-bottom: 14px;
}
.notice .icon { margin-top: 1px; }
.notice-ok { background: var(--green-soft); border: 1px solid #d3e5da; color: var(--green); }
.notice-error { background: var(--red-soft); border: 1px solid var(--red-line); color: var(--red-text); }
.notice-info { background: var(--sand-3); border: 1px solid var(--line); color: var(--muted); }
.notice-warn { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-text); }

.linkbox {
  background: var(--accent-soft); border: 1.5px solid var(--accent-line);
  border-radius: 10px; padding: 13px 15px; margin-bottom: 16px;
}
.linkbox .lb-label { font-size: 12px; font-weight: 600; color: var(--accent-text); margin-bottom: 7px; }
.linkbox .lb-row { display: flex; gap: 8px; }
.linkbox input {
  flex: 1; font-family: var(--font-mono); font-size: 12px;
  background: #fff; border: 1px solid var(--accent-line); border-radius: 7px;
  padding: 7px 10px; color: var(--ink); min-width: 0;
}

/* ---------- Progreso y comparativos ---------- */

.progress { height: 10px; border-radius: 6px; background: var(--sand); overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), #d9973f);
}
.progress.slim { height: 8px; }

.bar-row { margin-bottom: 16px; }
.bar-row .b-head { display: flex; justify-content: space-between; margin-bottom: 7px; }
.bar-row .b-label { font-size: 13px; color: var(--soft); }
.bar-row .b-value { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.bar-row .b-track { height: 10px; border-radius: 6px; background: var(--sand); overflow: hidden; }
.bar-row .b-fill { height: 100%; border-radius: 6px; }

/* ---------- Actividad ---------- */

.feed { display: flex; flex-direction: column; }
.feed-item {
  display: flex; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--sand-2);
}
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--faint); }
.feed-item .f-text { font-size: 13px; line-height: 1.35; }
.feed-item .f-when { font-size: 11.5px; color: var(--faint); margin-top: 2px; font-family: var(--font-mono); }

/* ---------- Alertas laterales ---------- */

.alert-item { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 12px; }
.alert-item:last-child { margin-bottom: 0; }
.alert-item .a-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.alert-item .a-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.alert-item .a-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ---------- Tabs de proyecto ---------- */

.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--line);
  margin-bottom: 22px; flex-wrap: wrap;
}
.tabs a {
  padding: 9px 14px; font-size: 13.5px; font-weight: 500;
  color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- Estados vacíos ---------- */

.empty { text-align: center; padding: 44px 24px; }
.empty .e-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--sand-2); color: var(--faint);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.empty .e-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.empty .e-hint { font-size: 13px; color: var(--faint); margin: 6px auto 0; max-width: 380px; }
.empty .e-action { margin-top: 16px; }

/* ---------- Login / auth ---------- */

.auth-body { background: var(--cream); }
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 16px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 30px; }
.auth-brand .logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent); color: var(--dark);
  display: flex; align-items: center; justify-content: center;
}
.auth-brand .name { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: 0.02em; }
.auth-brand .tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--faint); }
.auth-card {
  width: 100%; max-width: 400px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; box-shadow: var(--shadow-card);
}
.auth-card h1 { font-size: 20px; font-weight: 700; }
.auth-card .sub { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.auth-card form { margin-top: 20px; }
.auth-foot {
  text-align: center; font-size: 12px; color: var(--faint);
  margin-top: 24px; font-family: var(--font-mono);
}
.demo-box {
  margin-top: 18px; padding: 12px 14px;
  background: var(--sand-3); border: 1px solid var(--line); border-radius: 9px;
  font-size: 12px; color: var(--muted);
}
.demo-box .d-title { font-weight: 600; color: var(--soft); margin-bottom: 5px; }
.demo-box .mono { font-size: 11.5px; display: block; margin-top: 2px; }

/* ---------- Acceso rápido de prueba (login) ---------- */

.quick-login-wrap { margin-top: 18px; }
.quick-login-wrap .d-title {
  font-size: 12px; font-weight: 600; color: var(--soft); margin-bottom: 9px;
}
.quick-login { display: flex; flex-direction: column; gap: 8px; }
.quick-card {
  all: unset;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; width: 100%;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.quick-card:hover { border-color: var(--accent); background: var(--sand-3); }
.quick-card:active { transform: scale(0.99); }
.quick-card .qc-avatar {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
}
.quick-admin .qc-avatar { background: var(--dark); color: var(--gold); }
.quick-equipo .qc-avatar { background: var(--sand-2); color: var(--soft); }
.quick-cliente .qc-avatar { background: var(--accent-soft); color: var(--accent-text); }
.quick-card .qc-text { display: flex; flex-direction: column; gap: 1px; text-align: left; min-width: 0; }
.quick-card .qc-role { font-size: 13px; font-weight: 600; color: var(--ink); }
.quick-card .qc-email {
  font-size: 11px; color: var(--faint); font-family: var(--font-mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quick-card .qc-arrow { margin-left: auto; color: var(--faint); flex-shrink: 0; }
.quick-card:hover .qc-arrow { color: var(--accent); }
.quick-login-hint { font-size: 11.5px; color: var(--faint); margin-top: 10px; text-align: center; }

/* ---------- Portal de cliente ---------- */

.portal-body { background: var(--cream); }
.portal-top {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.portal-top .p-brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.portal-top .p-logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--dark);
  display: flex; align-items: center; justify-content: center; color: var(--gold);
}
.portal-top .p-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.15; }
.portal-top .p-sub { font-size: 11px; color: var(--faint); }
.portal-top nav { display: flex; align-items: center; gap: 22px; }
.portal-top nav a { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.portal-top nav a.active, .portal-top nav a:hover { color: var(--accent); font-weight: 600; }
.portal-top .avatar { background: #e7edea; color: var(--green); }
.portal-top .out {
  border: none; background: transparent; color: var(--faint);
  cursor: pointer; display: flex; align-items: center;
}
.portal-top .out:hover { color: var(--ink); }

.portal-wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }
.portal-hero { margin-bottom: 22px; }
.portal-hero h1 { font-size: 23px; font-weight: 800; }
.portal-hero p { color: var(--muted); font-size: 14px; margin-top: 7px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.split { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; align-items: start; }
.split-wide { display: grid; grid-template-columns: 1.9fr 1fr; gap: 16px; align-items: start; }

/* ---------- Documentos ---------- */

.doc-row { display: flex; align-items: center; gap: 12px; }
.doc-ico {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--sand-2); color: var(--soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- Utilidades ---------- */

.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-14 { margin-bottom: 14px; }
.mb-22 { margin-bottom: 22px; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-22 { margin-top: 22px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }

/* ---------- Responsive básico ---------- */

@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .split-wide { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .searchbox { display: none; }
}

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; position: static; max-height: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px; padding: 12px; }
  .side-label { display: none; }
  .side-user { margin-top: 0; margin-left: auto; border-top: none; padding: 0; }
  .side-brand { padding-bottom: 0; margin-right: 8px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .portal-top { padding: 0 16px; }
  .portal-top nav { gap: 14px; }
}

/* ---------- Impresión ---------- */

@media print {
  .sidebar, .topbar, .page-actions, .tabs { display: none !important; }
  body { background: #fff; }
}
