/* Axiom Service · sistema de diseño v2 (sobrio, moderno, sin efectos de brillo) */
:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --ink: #0a0a0a;
  --ink-2: #525252;
  --ink-3: #a3a3a3;
  --line: #e5e5e5;
  --line-2: #efefef;
  --nav: #0a0a0a;
  --nav-2: #1a1a1a;
  --nav-ink: #a3a3a3;
  --accent: var(--brand, #111111); /* color de marca de la empresa (negro por defecto) */
  --accent-hover: color-mix(in srgb, var(--accent) 88%, black);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--surface));
  --accent-ink: #ffffff;
  --ok: #17794a;   --ok-soft: #e7f5ee;
  --warn: #8f5c05; --warn-soft: #fbf2de;
  --bad: #b02a30;  --bad-soft: #fbeaeb;
  --info: #404040; --info-soft: #efefef;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow: none;
  --shadow-pop: 0 2px 0.375rem rgba(0, 0, 0, .10); /* sombra corta y nítida, sin halo */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #101010;
  --ink: #f5f5f5;
  --ink-2: #a3a3a3;
  --ink-3: #737373;
  --line: #262626;
  --line-2: #1c1c1c;
  --nav: #000000;
  --nav-2: #171717;
  --accent: #f5f5f5; --accent-ink: #0a0a0a; /* en modo oscuro el acento se invierte */
  --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--surface));
  --ok: #4cc08a;   --ok-soft: #12302a;
  --warn: #e3b25a; --warn-soft: #33290f;
  --bad: #ef7b80;  --bad-soft: #35161a;
  --info: #d4d4d4; --info-soft: #1f1f1f;
  --shadow: none;
  --shadow-pop: 0 2px 0.375rem rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Todo el diseño usa rem: cambiar este tamaño base (desde Apariencia) agranda o achica la interfaz completa */
html { font-size: 14.5px; -webkit-text-size-adjust: 100%; }
html[data-size='s'] { font-size: 13px; } html[data-size='c'] { font-size: 14.5px; } html[data-size='n'] { font-size: 16px; } html[data-size='g'] { font-size: 17.5px; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 0.9375rem; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; transition: background .2s; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
a { color: var(--accent); text-decoration: none; }
[data-theme='dark'] a:not(.btn):not(.nav-link) { color: var(--info); }
button { font-family: inherit; }
::selection { background: var(--accent-soft); }
.muted { color: var(--ink-2); }
.small { font-size: 0.75rem; }
.right { text-align: right; }
.hidden { display: none !important; }
.ico svg { width: 1.0625rem; height: 1.0625rem; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4375rem; height: 2.125rem; padding: 0 0.875rem; border-radius: 0.5rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 0.8125rem; font-weight: 500; cursor: pointer; transition: background .12s, border-color .12s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, .input:focus-visible, .icon-btn:focus-visible, .nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 1.875rem; padding: 0 0.6875rem; font-size: 0.75rem; border-radius: 0.4375rem; }
.btn .ico svg { width: 0.9375rem; height: 0.9375rem; }
.icon-btn { width: 2.125rem; height: 2.125rem; border-radius: 0.5rem; border: 1px solid transparent; background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }

/* ---------- formularios ---------- */
.field { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.field > label { font-size: 0.75rem; font-weight: 500; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; height: 2.25rem; padding: 0 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--surface); font: inherit; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
select.input { padding-right: 0.5rem; }
textarea.input { height: auto; min-height: 5.5rem; padding: 0.625rem 0.75rem; resize: vertical; line-height: 1.5; }
.input:hover { border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); }
.input:focus { outline: 1px solid var(--accent); outline-offset: 0; border-color: var(--accent); box-shadow: none; }
.input::placeholder { color: var(--ink-3); }
input[type='color'].input { padding: 0.25rem; cursor: pointer; }
.check { display: flex; align-items: center; gap: 0.5625rem; height: 2.5rem; font-size: 0.8125rem; cursor: pointer; }
.check input { width: 1rem; height: 1rem; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.span-1 { grid-column: span 1; } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; }
.form-section { grid-column: span 6; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); padding-top: 0.625rem; border-top: 1px solid var(--line-2); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.error-box { background: var(--bad-soft); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); border-radius: 0.5625rem; padding: 0.625rem 0.75rem; font-size: 0.8125rem; margin-bottom: 0.875rem; }

/* ---------- tarjetas / tablas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 1.125rem; }
.card-title { font-size: 0.8125rem; font-weight: 600; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding: 0.5rem 0.875rem; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--ink); }
.table th .arrow { margin-left: 0.25rem; opacity: .8; }
.table td { padding: 0.5625rem 0.875rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 3.5rem 1.25rem; text-align: center; color: var(--ink-2); }
.mono { font-variant-numeric: tabular-nums; }
.plate { display: inline-block; font-weight: 600; letter-spacing: .08em; font-size: 0.75rem; padding: 2px 0.5rem; border: 1.5px solid var(--ink); border-radius: 0.3125rem; background: var(--surface); }
.avatar { width: 1.875rem; height: 1.875rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 600; font-size: 0.75rem; flex: none; }
[data-theme='dark'] .avatar { color: var(--ink); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 3px 0.625rem; border-radius: 62.4375rem; font-size: 0.7188rem; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }

/* ---------- modal / toast / popover ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem; overflow-y: auto; z-index: 60; }
.modal { background: var(--surface); border-radius: 1rem; width: 100%; max-width: 42.5rem; border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.modal.lg { max-width: 53.75rem; } .modal.xl { max-width: 66.25rem; } .modal.sm { max-width: 28.75rem; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 1.125rem; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 1.0625rem; }
.modal-body { padding: 1.125rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.625rem; padding: 0.75rem 1.125rem; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 1rem 1rem; }
.x { border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--ink-2); cursor: pointer; border-radius: 0.375rem; width: 1.875rem; height: 1.875rem; }
.x:hover { background: var(--line-2); }
#toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 120; }
.toast { background: var(--ink); color: var(--bg); padding: 0.75rem 1rem; border-radius: 0.625rem; font-size: 0.8125rem; max-width: 22.5rem; box-shadow: var(--shadow-pop); }
.toast.err { background: var(--bad); color: #fff; }
.popover { position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--line); border-radius: 0.75rem; box-shadow: var(--shadow-pop); min-width: 12.5rem; max-width: calc(100vw - 1.5rem); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 0.625rem; width: 100%; padding: 0.625rem 0.875rem; border: 0; background: none; color: var(--ink); font-size: 0.8125rem; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-item .ico { color: var(--ink-2); }
.menu-sep { height: 1px; background: var(--line-2); margin: 0.25rem 0; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; }
.tab { padding: 0.6875rem 1rem; border: 0; background: none; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
[data-theme='dark'] .tab.active { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 0.6875rem; }
.logo-mark { width: 2rem; height: 2rem; border-radius: 0.5625rem; background: #fff; color: #0a0a0a; display: grid; place-items: center; font-weight: 700; font-size: 1.0625rem; flex: none; overflow: hidden; }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; }
.logo-text { font-weight: 600; letter-spacing: .15em; font-size: 0.875rem; color: #fff; line-height: 1.1; white-space: nowrap; }
.logo-text small { display: block; font-weight: 400; letter-spacing: .09em; font-size: 0.5938rem; color: var(--nav-ink); text-transform: uppercase; margin-top: 2px; }
