/* TechNova Compliance · Design Tokens */
:root {
  --nd-bg: #F5F6FA;
  --nd-surface: #FFFFFF;
  --nd-surface-2: #F2F3F7;
  --nd-border: #E5E7EB;
  --nd-border-strong: #C6C6CE;
  --nd-primary: #0F1B35;
  --nd-primary-2: #1A2747;
  --nd-on-primary: #FFFFFF;
  --nd-accent: #00C9A7;
  --nd-accent-2: #00B193;
  --nd-text: #191C1F;
  --nd-text-muted: #45464D;
  --nd-text-soft: #6B7280;
  --nd-success: #006B58;
  --nd-warning: #B07A00;
  --nd-danger: #BA1A1A;
  --nd-info: #2563EB;

  /* Dark mode tokens used in the help desk shell when needed */
  --nd-dark-bg: #0B1224;
  --nd-dark-surface: #0F1B35;
  --nd-dark-surface-2: #16244A;
  --nd-dark-border: #1F2D52;
  --nd-dark-text: #EFF1F5;
  --nd-dark-text-muted: #9CA3B8;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --shadow-none: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--nd-text);
  background: var(--nd-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 600;
  color: var(--nd-text);
  letter-spacing: -0.01em;
  margin: 0;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

/* Layout helpers */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--nd-accent); color: var(--nd-primary); }
.btn-primary:hover { background: var(--nd-accent-2); color: #fff; }
.btn-secondary { background: transparent; color: var(--nd-on-primary); border-color: rgba(255,255,255,.35); }
.btn-secondary:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.65); }
.btn-outline { background: transparent; color: var(--nd-primary); border-color: var(--nd-primary); }
.btn-outline:hover { background: var(--nd-primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--nd-text-muted); }
.btn-ghost:hover { background: var(--nd-surface-2); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Card */
.card {
  background: var(--nd-surface);
  border: 1px solid var(--nd-border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.card-pad-sm { padding: 16px; }

/* Inputs */
.field { display: block; margin-bottom: 14px; }
.field label, .label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--nd-text);
  letter-spacing: .02em;
  margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--nd-border);
  border-radius: var(--radius-sm);
  color: var(--nd-text);
  outline: none;
  font-family: inherit;
}
.textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 20px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--nd-accent); }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.chip-success { background: rgba(0,107,88,.10); color: var(--nd-success); }
.chip-warning { background: rgba(176,122,0,.10); color: var(--nd-warning); }
.chip-danger  { background: rgba(186,26,26,.10); color: var(--nd-danger); }
.chip-info    { background: rgba(37,99,235,.10); color: var(--nd-info); }
.chip-muted   { background: var(--nd-surface-2); color: var(--nd-text-muted); }
.chip-accent  { background: rgba(0,201,167,.12); color: #006B58; }

/* === MARKETING SITE ====================================================== */
.mkt-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--nd-border);
}
.mkt-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.mkt-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.mkt-brand img { width: 30px; height: 30px; object-fit: contain; }
.mkt-brand span { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 17px; letter-spacing: -.01em; }
.mkt-nav-links { display: flex; gap: 28px; align-items: center; }
.mkt-nav-links a {
  font-size: 14px; color: var(--nd-text-muted); font-weight: 500;
}
.mkt-nav-links a:hover { color: var(--nd-primary); }

.mkt-hero {
  background: var(--nd-primary);
  color: var(--nd-on-primary);
  padding: 96px 0 110px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mkt-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0,201,167,.10), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 30%);
  pointer-events: none;
}
.mkt-hero h1 {
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.1;
  color: #fff;
  max-width: 760px;
  margin: 0 auto 18px;
}
.mkt-hero p {
  color: rgba(239,241,245,.78);
  font-size: 16px;
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.mkt-hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.mkt-hero-chip {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 22px;
  padding: 6px 12px;
  background: rgba(0,201,167,.12);
  border: 1px solid rgba(0,201,167,.25);
  color: #5FFBD6;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  letter-spacing: .02em;
}

.mkt-section { padding: 80px 0; }
.mkt-section h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  text-align: center;
  margin-bottom: 8px;
}
.mkt-section .lead {
  color: var(--nd-text-muted);
  text-align: center;
  margin: 0 auto 44px;
  font-size: 15px;
  max-width: 580px;
}

.mkt-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.mkt-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .mkt-grid-3, .mkt-grid-2 { grid-template-columns: 1fr; }
  .mkt-nav-links { display: none; }
  .mkt-hero { padding: 72px 0 80px; }
  .mkt-section { padding: 56px 0; }
}

.service-card .ico {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--nd-surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--nd-primary);
  margin-bottom: 16px;
}
.service-card h3 { font-size: 16px; margin-bottom: 6px; }
.service-card p { color: var(--nd-text-muted); font-size: 14px; line-height: 1.55; margin: 0; }

.step-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  position: relative;
}
.step-row::before {
  content: '';
  position: absolute; left: 10%; right: 10%; top: 24px;
  border-top: 1px dashed var(--nd-border-strong);
  z-index: 0;
}
.step {
  text-align: center; position: relative; z-index: 1;
}
.step .num {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--nd-primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin: 0 auto 14px;
  border: 4px solid var(--nd-bg);
}
.step.last .num { background: var(--nd-accent); color: var(--nd-primary); }
.step h4 { font-size: 15px; margin-bottom: 4px; }
.step p { font-size: 13px; color: var(--nd-text-muted); margin: 0; }
@media (max-width: 900px) { .step-row { grid-template-columns: 1fr; } .step-row::before { display: none; } }

.plan-card { position: relative; }
.plan-tag {
  position: absolute; top: 0; right: 0;
  background: var(--nd-accent); color: var(--nd-primary);
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  padding: 6px 12px;
  border-bottom-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-md);
}
.plan-card .chip { margin-bottom: 12px; }
.plan-card.featured { background: var(--nd-primary); color: var(--nd-on-primary); border-color: var(--nd-primary); }
.plan-card.featured h3, .plan-card.featured ul li { color: #fff; }
.plan-card.featured p { color: rgba(255,255,255,.72); }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 20px; }
.plan-card ul li {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 14px; color: var(--nd-text-muted); margin-bottom: 8px;
}
.plan-card ul li svg { color: var(--nd-accent); flex-shrink: 0; margin-top: 2px; }
.plan-card.featured ul li { color: rgba(255,255,255,.85); }
.plan-card h3 { font-size: 17px; margin-bottom: 4px; }
.plan-card .plan-desc { font-size: 14px; line-height: 1.5; margin-bottom: 18px; }

/* Contact */
.contact-card { max-width: 720px; margin: 0 auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }
.contact-status {
  margin-top: 14px; font-size: 13px; padding: 10px 14px;
  border-radius: var(--radius-sm); display: none;
}
.contact-status.ok { background: rgba(0,107,88,.10); color: var(--nd-success); display: block; }
.contact-status.err { background: rgba(186,26,26,.10); color: var(--nd-danger); display: block; }

/* Footer */
.mkt-footer {
  background: #fff;
  border-top: 1px solid var(--nd-border);
  padding: 28px 0;
  font-size: 13px;
  color: var(--nd-text-muted);
}
.mkt-footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.mkt-footer .links { display: flex; gap: 22px; }

/* === AUTH (login.html) === */
.auth-shell {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--nd-primary);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--nd-border);
  padding: 32px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.auth-brand img { width: 32px; height: 32px; }
.auth-brand span { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 18px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { font-size: 13px; color: var(--nd-text-muted); margin-bottom: 22px; }
.auth-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: var(--nd-surface-2); padding: 4px; border-radius: var(--radius-sm);
}
.auth-tabs button {
  flex: 1; height: 34px; border: 0; background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--nd-text-muted);
}
.auth-tabs button.active { background: #fff; color: var(--nd-primary); }
.auth-error {
  font-size: 13px; padding: 10px 12px; margin-bottom: 12px;
  background: rgba(186,26,26,.08); color: var(--nd-danger);
  border-radius: var(--radius-sm); display: none;
}
.auth-error.visible { display: block; }
.auth-help { font-size: 12px; color: var(--nd-text-muted); text-align: center; margin-top: 18px; }

/* === DASHBOARD SHELL (helpdesk + admin) === */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; background: var(--nd-bg); }
.sidebar {
  background: var(--nd-primary); color: var(--nd-on-primary);
  padding: 22px 16px;
  display: flex; flex-direction: column;
}
.side-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; padding: 0 6px; }
.side-brand img { width: 30px; height: 30px; }
.side-brand span { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 16px; color: #fff; }
.side-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); padding: 14px 8px 6px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.78);
  font-size: 14px;
}
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: rgba(0,201,167,.12); color: #5FFBD6; }
.side-foot {
  margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.7); font-size: 13px;
}
.side-foot .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--nd-accent); color: var(--nd-primary); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.side-foot button { background: none; border: 0; color: rgba(255,255,255,.55); font-size: 12px; cursor: pointer; margin-left: auto; }
.side-foot button:hover { color: #fff; }

.shell-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  background: #fff; border-bottom: 1px solid var(--nd-border);
}
.topbar h1 { font-size: 20px; }
.topbar .top-actions { display: flex; gap: 10px; align-items: center; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--nd-surface-2); border: 1px solid transparent;
  padding: 0 12px; height: 36px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--nd-text-muted); width: 260px;
}
.search-box:focus-within { border-color: var(--nd-accent); background: #fff; }
.search-box input { border: 0; background: transparent; outline: none; flex: 1; font-size: 13px; color: var(--nd-text); font-family: inherit; }

.content { padding: 28px 32px 56px; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1100px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card { padding: 18px; }
.stat-card .lbl { font-size: 12px; color: var(--nd-text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.stat-card .val { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: 26px; }
.stat-card .delta { font-size: 12px; color: var(--nd-text-muted); margin-top: 4px; }
.stat-card .delta.up { color: var(--nd-success); }
.stat-card .delta.down { color: var(--nd-danger); }

/* Table */
.tbl-card { padding: 0; overflow: hidden; }
.tbl-head-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--nd-border); }
.tbl-head-bar .filters { display: flex; gap: 8px; }
.tbl-head-bar select.input { height: 34px; width: auto; padding: 0 28px 0 10px; font-size: 13px; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl thead th {
  background: var(--nd-surface-2);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--nd-text-muted); text-align: left; padding: 10px 16px;
  border-bottom: 1px solid var(--nd-border);
}
table.tbl tbody td {
  padding: 14px 16px; border-bottom: 1px solid var(--nd-border);
  font-size: 14px; color: var(--nd-text);
}
table.tbl tbody tr { cursor: pointer; }
table.tbl tbody tr:hover { background: #EFF6FF; }
table.tbl .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
table.tbl .num { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--nd-text-muted); }
table.tbl .avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--nd-primary); color: #fff; font-weight: 600; font-size: 11px; }
.tbl-empty { padding: 40px; text-align: center; color: var(--nd-text-muted); font-size: 14px; }

/* Drawer */
.drawer-bg {
  position: fixed; inset: 0; background: rgba(15,27,53,.4);
  display: none; z-index: 60;
}
.drawer-bg.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(520px, 100%);
  background: #fff; border-left: 1px solid var(--nd-border);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease;
}
.drawer-bg.open .drawer { transform: translateX(0); }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--nd-border); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--nd-border); display: flex; gap: 8px; justify-content: flex-end; background: var(--nd-surface-2); }

.timeline-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--nd-border); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--nd-primary); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 11px; flex-shrink: 0; }
.timeline-item .meta { font-size: 12px; color: var(--nd-text-muted); margin-bottom: 4px; }
.timeline-item .body { font-size: 14px; line-height: 1.5; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,27,53,.5); display: none; z-index: 70; place-items: center; padding: 24px; }
.modal-bg.open { display: grid; }
.modal {
  width: 100%; max-width: 560px;
  background: #fff; border: 2px solid var(--nd-primary);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; max-height: 90vh;
}
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--nd-border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--nd-border); display: flex; gap: 8px; justify-content: flex-end; }
.icon-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--nd-text-muted); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--nd-surface-2); color: var(--nd-primary); }

/* Priority/status pill */
.pill-priority-alta   { background: rgba(186,26,26,.10); color: var(--nd-danger); }
.pill-priority-media  { background: rgba(176,122,0,.10); color: var(--nd-warning); }
.pill-priority-baja   { background: rgba(0,107,88,.10); color: var(--nd-success); }
.pill-status-abierto     { background: rgba(37,99,235,.10); color: var(--nd-info); }
.pill-status-en_proceso  { background: rgba(176,122,0,.10); color: var(--nd-warning); }
.pill-status-resuelto    { background: rgba(0,107,88,.10); color: var(--nd-success); }
.pill-status-cerrado     { background: var(--nd-surface-2); color: var(--nd-text-muted); }

/* Charts */
.chart { width: 100%; height: 220px; }
.bar { fill: var(--nd-primary); }
.bar-accent { fill: var(--nd-accent); }
.axis-text { font-size: 10px; fill: var(--nd-text-muted); font-family: 'Inter', sans-serif; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--nd-primary); color: #fff;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13px; box-shadow: 0 0 0 1px rgba(0,0,0,.05);
  display: none; z-index: 90;
}
.toast.show { display: block; }
.toast.ok { background: var(--nd-success); }
.toast.err { background: var(--nd-danger); }

/* Tickets sidebar collapse for narrow */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
