/* ==========================================================================
   PC Link · Soluciones Informáticas — estilos base compartidos
   ========================================================================== */
:root {
  /* Identidad Soluciones Informáticas: azul marino + verde lima */
  --navy: #071a3d;
  --navy-2: #0e2a5c;
  --blue: #12398a;
  --blue-2: #1d4fb3;
  --blue-soft: #e8eefa;
  --accent: #6cc417;
  --accent-2: #a6ec3c;
  --accent-dark: #3f8f0a;
  --accent-soft: #effbe2;
  --orange: #ff8a00;
  --orange-2: #ffb020;
  --orange-soft: #fff3e3;
  --lime: #8fd926;
  --green: #16a34a;
  --green-soft: #e7f8ee;
  --red: #e5383b;
  --red-soft: #fdecec;
  --amber: #f59e0b;
  --amber-soft: #fff6e0;
  --violet: #7c3aed;
  --violet-soft: #f1eaff;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #14213d;
  --muted: #6b7a99;
  --border: #e3e9f3;
  --ring: rgba(18, 57, 138, .22);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 36, 80, .06), 0 2px 8px rgba(16, 36, 80, .05);
  --shadow: 0 6px 24px rgba(16, 36, 80, .10);
  --shadow-lg: 0 24px 60px rgba(11, 31, 75, .22);
  --grad-brand: linear-gradient(125deg, #040f26 0%, #071a3d 45%, #0e2a5c 80%, #12398a 100%);
  --grad-cta: linear-gradient(135deg, #8fd926 0%, #4fa80c 100%);
  --grad-accent-text: linear-gradient(90deg, #c4f56b, #6cc417);
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-brand: 'Barlow Condensed', 'Arial Narrow', 'Plus Jakarta Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: 1 / -1; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .col-span-2, .col-span-3 { grid-column: auto; } }

[data-lucide], svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

/* ---------- Botones ---------- */
.btn {
  --b: var(--blue);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font-weight: 700; font-size: 14px; line-height: 1.2; text-decoration: none !important;
  background: var(--b); color: #fff; transition: transform .12s, box-shadow .2s, background .2s, opacity .2s;
  white-space: nowrap;
}
.btn:hover { box-shadow: 0 6px 18px rgba(18, 57, 138, .28); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-cta { background: var(--grad-cta); color: #fff; text-shadow: 0 1px 1px rgba(30, 70, 0, .35); }
.btn-cta:hover { box-shadow: 0 8px 22px rgba(92, 184, 17, .38); }
.btn-dark { background: var(--navy); }
.btn-green { background: var(--green); }
.btn-green:hover { box-shadow: 0 6px 18px rgba(22, 163, 74, .3); }
.btn-red { background: var(--red); }
.btn-red:hover { box-shadow: 0 6px 18px rgba(229, 56, 59, .3); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #fff; box-shadow: var(--shadow-sm); }
.btn-soft { background: var(--blue-soft); color: var(--blue); }
.btn-soft:hover { box-shadow: none; background: #dce8ff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: 10px; background: transparent; color: var(--muted); border: 1px solid transparent; }
.btn-icon:hover { background: var(--blue-soft); color: var(--blue); box-shadow: none; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 700; color: #33415e; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--red); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff;
  font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--ring); }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(229, 56, 59, .12); }
.input.valid { border-color: var(--green); }
.input[readonly] { background: #f6f8fc; }
.input-icon { position: relative; }
.input-icon > [data-lucide], .input-icon > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 40px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge [data-lucide], .badge svg { width: 13px; height: 13px; }
.b-blue { background: var(--blue-soft); color: var(--blue); }
.b-green { background: var(--green-soft); color: var(--green); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-amber { background: var(--amber-soft); color: #b45309; }
.b-orange { background: var(--orange-soft); color: #c2410c; }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.b-gray { background: #eef1f6; color: #4b5874; }
.b-navy { background: var(--navy); color: #fff; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-h h3 { margin: 0; font-size: 16px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #fafbfe; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: #f8faff; }
.table tfoot td { font-weight: 800; background: #fafbfe; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.clickable { cursor: pointer; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #f1f4f9; border: 1px solid var(--border); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(9, 20, 45, .55); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 3vh 16px; z-index: 1000; overflow-y: auto; animation: fade .18s ease; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); position: relative; display: flex; flex-direction: column; max-height: calc(100vh - 6vh); }
.modal.lg { max-width: 860px; }
.modal.xl { max-width: 1180px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-h h3 { margin: 0; font-size: 18px; flex: 1; }
.modal-b { padding: 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-h, .modal-f { flex-shrink: 0; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--border); background: #fafbfe; border-radius: 0 0 20px 20px; }
.modal-x { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255, 255, 255, .9); }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 13px 16px; border-radius: 14px; background: var(--navy); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: slidein .25s ease; }
.toast.ok { background: #0f7a3a; }
.toast.err { background: #c52a2d; }
.toast.out { animation: slideout .25s ease forwards; }

/* ---------- Varios ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.empty .ico svg { width: 30px; height: 30px; }
.skeleton { background: linear-gradient(90deg, #eef2f8 25%, #f7f9fc 50%, #eef2f8 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--blue-soft); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.alert.info { background: var(--blue-soft); color: #0b3aa8; }
.alert.ok { background: var(--green-soft); color: #0f6b33; }
.alert.warn { background: var(--amber-soft); color: #92400e; }
.alert.err { background: var(--red-soft); color: #a61b1e; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } }
@keyframes slideout { to { opacity: 0; transform: translateX(30px); } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: none; }
}
