@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════════
   KYDO CLOUD — Design System · Flat Edition
   #006595 · #034EA2 · #0095DA
═══════════════════════════════════════════════ */

:root {
  --c1:      #006595;   /* teal oscuro — sidebar */
  --c2:      #034EA2;   /* navy — headings */
  --c3:      #0095DA;   /* bright blue — primary action */
  --black:   #000000;
  --white:   #ffffff;

  --bg:      #f0f5fa;
  --surface: #ffffff;
  --surface2:#f4f8fc;
  --border:  #dce8f3;
  --border2: #c4d9ed;

  --green:   #0a7a52;
  --rose:    #c0283f;
  --amber:   #b06a00;
  --violet:  #4b38b3;
  --teal:    #007080;

  --t:       #0d1b27;
  --tm:      #3d5a73;
  --td:      #7a9bb8;

  /* texto sobre sidebar oscuro */
  --st:      #ffffff;
  --stm:     rgba(255,255,255,.65);
  --std:     rgba(255,255,255,.35);

  --radius:   10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow:    0 2px 8px rgba(0,0,0,.08), 0 6px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.1), 0 20px 48px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--t);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c3); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: 256px; flex-shrink: 0;
  background: var(--c1);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
  box-shadow: 3px 0 0 rgba(0,0,0,.12);
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 12px;
}
.logo-icon {
  width: 40px; height: 40px;
  background: var(--c3);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2; fill: none; }
.logo-text { font-size: 16px; font-weight: 800; letter-spacing: -.3px; color: var(--st); }
.logo-sub  { font-size: 10px; color: var(--stm); margin-top: 2px; font-weight: 500; }

.nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav::-webkit-scrollbar { width: 3px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); }

.nav-section {
  font-size: 9px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--std);
  padding: 14px 20px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  font-size: 13px; font-weight: 500;
  color: var(--stm);
  cursor: pointer;
  transition: background .12s, color .12s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: rgba(0,0,0,.15); color: var(--st); text-decoration: none; }
.nav-item.active {
  background: var(--c3);
  color: #fff;
  border-left-color: #fff;
  font-weight: 600;
}

.nav-item .nav-icon,
.nav-item [data-lucide] {
  width: 20px; height: 20px;
  stroke: currentColor; stroke-width: 1.75;
  fill: none; flex-shrink: 0;
}
.nav-item .ico { display: none; }

.nav-badge {
  margin-left: auto; background: var(--rose); color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
}

.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.2);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 600; color: #fff; line-height: 1.3; }
.user-rol  { font-size: 10px; color: var(--stm); }
.btn-logout {
  margin-left: auto;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  cursor: pointer; color: var(--stm);
  padding: 7px; border-radius: 7px;
  transition: all .15s; line-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.btn-logout svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }
.btn-logout:hover { background: rgba(192,40,63,.25); border-color: rgba(192,40,63,.4); color: #fca5a5; }

/* ══════════════════════════════════════
   MAIN
══════════════════════════════════════ */
.main { flex: 1; margin-left: 256px; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: 56px; padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 90;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.topbar-title { font-size: 15px; font-weight: 700; color: var(--c2); flex: 1; letter-spacing: -.2px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.content { padding: 26px 28px; flex: 1; }

/* ══════════════════════════════════════
   STAT CARDS
══════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 26px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-card.blue   { border-left: 4px solid var(--c3); }
.stat-card.green  { border-left: 4px solid var(--green); }
.stat-card.violet { border-left: 4px solid var(--violet); }
.stat-card.amber  { border-left: 4px solid var(--amber); }
.stat-card.teal   { border-left: 4px solid var(--teal); }
.stat-card.rose   { border-left: 4px solid var(--rose); }

.stat-ico {
  position: absolute; right: 16px; top: 16px;
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-ico svg, .stat-ico [data-lucide] { width: 24px; height: 24px; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stat-card.blue   .stat-ico { background: rgba(0,149,218,.1); }
.stat-card.blue   .stat-ico svg { stroke: var(--c3); }
.stat-card.green  .stat-ico { background: rgba(10,122,82,.1); }
.stat-card.green  .stat-ico svg { stroke: var(--green); }
.stat-card.violet .stat-ico { background: rgba(75,56,179,.1); }
.stat-card.violet .stat-ico svg { stroke: var(--violet); }
.stat-card.amber  .stat-ico { background: rgba(176,106,0,.1); }
.stat-card.amber  .stat-ico svg { stroke: var(--amber); }
.stat-card.teal   .stat-ico { background: rgba(0,112,128,.1); }
.stat-card.teal   .stat-ico svg { stroke: var(--teal); }
.stat-card.rose   .stat-ico { background: rgba(192,40,63,.1); }
.stat-card.rose   .stat-ico svg { stroke: var(--rose); }

.stat-label { font-size: 10px; font-weight: 700; color: var(--td); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 800; color: var(--c2); font-family: 'JetBrains Mono', monospace; line-height: 1; }
.stat-sub   { font-size: 11px; color: var(--tm); margin-top: 7px; }

/* ══════════════════════════════════════
   CARDS
══════════════════════════════════════ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2);
}
.card-header [data-lucide], .card-header > svg {
  width: 18px; height: 18px; stroke: var(--c1); stroke-width: 2; fill: none; flex-shrink: 0;
}
.card-title { font-size: 13px; font-weight: 700; color: var(--c2); }
.card-body  { padding: 18px 20px; }

/* ══════════════════════════════════════
   TABLES
══════════════════════════════════════ */
.tbl-wrap, .table-wrap { overflow-x: auto; }
table, .table { width: 100%; border-collapse: collapse; }

thead th, .table thead th {
  padding: 10px 16px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--tm);
  background: var(--surface2); text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody tr, .table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover, .table tbody tr:hover { background: #e8f3fc; }
tbody tr:last-child, .table tbody tr:last-child { border-bottom: none; }
tbody td, .table tbody td { padding: 11px 16px; font-size: 12.5px; color: var(--t); vertical-align: middle; }

/* ══════════════════════════════════════
   FORMS
══════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--c2); margin-bottom: 6px; }
.form-control {
  width: 100%; background: #fff; border: 1.5px solid var(--border2);
  color: var(--t); border-radius: var(--radius-sm);
  padding: 9px 13px; font-size: 13px;
  font-family: 'Inter', sans-serif; outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.form-control:focus { border-color: var(--c3); box-shadow: 0 0 0 3px rgba(0,149,218,.15); }
.form-control::placeholder { color: var(--td); }
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%233d5a73' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 34px;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600; border: none; cursor: pointer;
  transition: all .15s ease; text-decoration: none; line-height: 1.4; white-space: nowrap;
}
.btn svg, .btn [data-lucide] { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; }
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--c3); color: #fff; }
.btn-primary:hover { background: #007bbf; text-decoration: none; color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #085e3e; text-decoration: none; color: #fff; }
.btn-danger  { background: var(--rose); color: #fff; }
.btn-danger:hover  { background: #9c1f32; text-decoration: none; color: #fff; }
.btn-ghost   { background: #fff; color: var(--c2); border: 1.5px solid var(--border2); }
.btn-ghost:hover { background: var(--surface2); border-color: var(--c3); color: var(--c3); text-decoration: none; }
.btn-sm  { padding: 5px 12px; font-size: 11.5px; border-radius: 6px; }
.btn-sm svg { width: 13px; height: 13px; }

/* ══════════════════════════════════════
   BADGES
══════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 10px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; letter-spacing: .3px; line-height: 1.4;
}
.badge-green  { background: rgba(10,122,82,.08);  color: #075c3e; border: 1px solid rgba(10,122,82,.2); }
.badge-rose   { background: rgba(192,40,63,.08);  color: #9c1f32; border: 1px solid rgba(192,40,63,.2); }
.badge-amber  { background: rgba(176,106,0,.08);  color: #7a4a00; border: 1px solid rgba(176,106,0,.2); }
.badge-blue   { background: rgba(0,149,218,.08);  color: #005f8a; border: 1px solid rgba(0,149,218,.22); }
.badge-violet { background: rgba(75,56,179,.08);  color: #3a2b94; border: 1px solid rgba(75,56,179,.2); }
.badge-td     { background: var(--surface2); color: var(--tm); border: 1px solid var(--border); }
.badge-navy   { background: rgba(3,78,162,.08); color: var(--c2); border: 1px solid rgba(3,78,162,.18); }

/* ══════════════════════════════════════
   ALERTS
══════════════════════════════════════ */
.alert {
  padding: 12px 15px; border-radius: var(--radius-sm);
  font-size: 12.5px; display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px; font-weight: 500;
}
.alert-error   { background: rgba(192,40,63,.06);  border: 1.5px solid rgba(192,40,63,.2);  color: #9c1f32; }
.alert-success { background: rgba(10,122,82,.06);  border: 1.5px solid rgba(10,122,82,.2);  color: #075c3e; }
.alert-info    { background: rgba(0,149,218,.07);  border: 1.5px solid rgba(0,149,218,.22); color: #005f8a; }
.alert-warning { background: rgba(176,106,0,.07);  border: 1.5px solid rgba(176,106,0,.2);  color: #7a4a00; }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(18px) scale(.98);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); border-radius: 14px 14px 0 0;
}
.modal-title { font-size: 14px; font-weight: 700; color: var(--c2); }
.modal-close {
  background: #fff; border: 1px solid var(--border); color: var(--rose);
  cursor: pointer; width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
  font-size: 16px;
}
.modal-close:hover { background: rgba(192,40,63,.08); border-color: rgba(192,40,63,.3); color: var(--rose); }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--surface2); border-radius: 0 0 14px 14px;
}

/* ══════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════ */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); padding: 7px 13px;
  transition: border-color .15s, box-shadow .15s;
}
.search-bar:focus-within { border-color: var(--c3); box-shadow: 0 0 0 3px rgba(0,149,218,.12); }
.search-bar input { background: none; border: none; color: var(--t); font-size: 13px; outline: none; flex: 1; }
.search-bar input::placeholder { color: var(--td); }
.search-bar > span, .search-bar > svg, .search-bar [data-lucide] {
  color: var(--td); width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0;
}

/* ══════════════════════════════════════
   PAGINATION
══════════════════════════════════════ */
.pagination { display: flex; align-items: center; gap: 5px; justify-content: center; padding: 18px 0 0; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: #fff; color: var(--tm);
  cursor: pointer; font-size: 12px; font-weight: 500; transition: all .12s;
}
.page-btn:hover { border-color: var(--c3); color: var(--c3); }
.page-btn.active { background: var(--c3); color: #fff; border-color: var(--c3); }

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--c2);
  padding: 20px;
}
.login-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 40px 36px;
  width: 100%; max-width: 390px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon-lg {
  width: 64px; height: 64px; background: var(--c3);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.login-logo .logo-icon-lg svg { width: 32px; height: 32px; stroke: #fff; stroke-width: 1.75; fill: none; }
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--c2); letter-spacing: -.3px; }
.login-logo p  { font-size: 12px; color: var(--tm); margin-top: 4px; }

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 13px 17px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .22s ease; box-shadow: var(--shadow);
  border-left: 4px solid; min-width: 240px; max-width: 340px;
  background: #fff;
}
.toast svg { width: 16px; height: 16px; stroke-width: 2; fill: none; flex-shrink: 0; }
.toast.success { border-color: var(--green); color: var(--t); }
.toast.success svg { stroke: var(--green); }
.toast.error   { border-color: var(--rose);  color: var(--t); }
.toast.error   svg { stroke: var(--rose); }
.toast.info    { border-color: var(--c3);    color: var(--t); }
.toast.info    svg { stroke: var(--c3); }
@keyframes toastIn { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ══════════════════════════════════════
   QUICK ACTIONS (Dashboard)
══════════════════════════════════════ */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.qa-btn {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 18px 12px;
  text-align: center; cursor: pointer;
  transition: all .18s; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: var(--shadow-sm);
}
.qa-btn:hover { border-color: var(--c3); background: rgba(0,149,218,.04); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.qa-btn .ico { display: none; }
.qa-btn [data-lucide], .qa-btn svg { width: 28px; height: 28px; stroke: var(--c1); stroke-width: 1.5; fill: none; transition: stroke .18s; }
.qa-btn:hover [data-lucide], .qa-btn:hover svg { stroke: var(--c3); }
.qa-btn span { font-size: 11.5px; font-weight: 600; color: var(--tm); }
.qa-btn:hover span { color: var(--c3); }

/* ══════════════════════════════════════
   ACTIVITY
══════════════════════════════════════ */
.recent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.activity-item { display: flex; align-items: flex-start; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.activity-text { font-size: 12px; color: var(--tm); line-height: 1.45; }
.activity-text strong { color: var(--t); font-weight: 600; }
.activity-time { font-size: 10px; color: var(--td); margin-top: 2px; }
.alert-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  background: rgba(192,40,63,.04); border: 1px solid rgba(192,40,63,.12);
  margin-bottom: 8px; font-size: 12px; color: var(--t);
}
.alert-item:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════
   CHIP
══════════════════════════════════════ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(0,149,218,.1); color: var(--c1);
  border: 1px solid rgba(0,149,218,.2);
}

/* ══════════════════════════════════════
   SPINNER
══════════════════════════════════════ */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(0,149,218,.2); border-top-color: var(--c3);
  border-radius: 50%; animation: spin .55s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 24px; color: var(--td); }
.empty-state .ico { font-size: 40px; margin-bottom: 12px; opacity: .3; display: block; }
.empty-state [data-lucide], .empty-state > svg { width: 40px; height: 40px; stroke: var(--td); stroke-width: 1.25; fill: none; margin: 0 auto 12px; display: block; }
.empty-state p { font-size: 13px; color: var(--tm); }

/* ══════════════════════════════════════
   UTILITIES
══════════════════════════════════════ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 6px; }  .mt-2 { margin-top: 12px; }  .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.flex { display: flex; } .flex-1 { flex: 1; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.w-full { width: 100%; } .font-mono { font-family: 'JetBrains Mono', monospace; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .recent-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
}

/* ══════════════════════════════════════════════════════════
   MOTION — Capa de animación futurista (no cambia el diseño)
══════════════════════════════════════════════════════════ */

/* Keyframes base */
@keyframes kc-fadeUp   { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes kc-fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes kc-slideIn  { from { opacity:0; transform:translateX(-12px); } to { opacity:1; transform:none; } }
@keyframes kc-pop      { 0%{ transform:scale(.9); opacity:0; } 60%{ transform:scale(1.03); } 100%{ transform:scale(1); opacity:1; } }
@keyframes kc-railGlow { 0%,100%{ box-shadow:0 0 0 1px rgba(0,149,218,.4), 0 0 10px rgba(0,149,218,.25); } 50%{ box-shadow:0 0 0 1px rgba(0,149,218,.7), 0 0 20px rgba(0,149,218,.55); } }
@keyframes kc-scan     { 0%{ transform:translateY(-100%); } 100%{ transform:translateY(400%); } }
@keyframes kc-logoPulse{ 0%,100%{ box-shadow:0 4px 14px rgba(0,149,218,.35); } 50%{ box-shadow:0 4px 22px rgba(0,149,218,.7); } }
@keyframes kc-shine    { 0%{ left:-60%; } 100%{ left:140%; } }
@keyframes kc-spin     { to { transform:rotate(360deg); } }

/* ── Entrada del contenido de página ── */
.content { animation: kc-fadeIn .45s ease both; }
.content > * { animation: kc-fadeUp .5s cubic-bezier(.22,1,.36,1) both; }
.content > *:nth-child(1){ animation-delay:.02s; }
.content > *:nth-child(2){ animation-delay:.08s; }
.content > *:nth-child(3){ animation-delay:.14s; }
.content > *:nth-child(4){ animation-delay:.20s; }
.content > *:nth-child(5){ animation-delay:.26s; }
.content > *:nth-child(6){ animation-delay:.32s; }

/* ── Tarjetas con entrada escalonada ── */
.stats-grid .stat-card,
.kpi-grid .kpi,
.sec-grid .sec-card,
.quick-actions .qa-btn {
  animation: kc-pop .5s cubic-bezier(.34,1.4,.5,1) both;
}
.stats-grid .stat-card:nth-child(1),.kpi-grid .kpi:nth-child(1),.sec-grid .sec-card:nth-child(1),.quick-actions .qa-btn:nth-child(1){ animation-delay:.05s; }
.stats-grid .stat-card:nth-child(2),.kpi-grid .kpi:nth-child(2),.sec-grid .sec-card:nth-child(2),.quick-actions .qa-btn:nth-child(2){ animation-delay:.11s; }
.stats-grid .stat-card:nth-child(3),.kpi-grid .kpi:nth-child(3),.sec-grid .sec-card:nth-child(3),.quick-actions .qa-btn:nth-child(3){ animation-delay:.17s; }
.stats-grid .stat-card:nth-child(4),.kpi-grid .kpi:nth-child(4),.sec-grid .sec-card:nth-child(4),.quick-actions .qa-btn:nth-child(4){ animation-delay:.23s; }
.stats-grid .stat-card:nth-child(5),.kpi-grid .kpi:nth-child(5),.sec-grid .sec-card:nth-child(5),.quick-actions .qa-btn:nth-child(5){ animation-delay:.29s; }
.stats-grid .stat-card:nth-child(6),.kpi-grid .kpi:nth-child(6),.sec-grid .sec-card:nth-child(6),.quick-actions .qa-btn:nth-child(6){ animation-delay:.35s; }

/* ── Sidebar se ensambla al cargar ── */
.sidebar .nav-item { animation: kc-slideIn .4s ease both; }
.sidebar .nav-item:nth-child(2){ animation-delay:.04s; }
.sidebar .nav-item:nth-child(3){ animation-delay:.07s; }
.sidebar .nav-item:nth-child(4){ animation-delay:.10s; }
.sidebar .nav-item:nth-child(5){ animation-delay:.13s; }
.sidebar .nav-item:nth-child(6){ animation-delay:.16s; }
.sidebar .nav-item:nth-child(7){ animation-delay:.19s; }
.sidebar .nav-item:nth-child(8){ animation-delay:.22s; }
.sidebar .nav-item:nth-child(n+9){ animation-delay:.25s; }

/* Logo con latido de luz */
.logo-icon { animation: kc-logoPulse 3.5s ease-in-out infinite; }

/* ── Nav: icono reactivo + indicador activo con glow ── */
.nav-item [data-lucide], .nav-item .nav-icon { transition: transform .2s ease, filter .2s ease; }
.nav-item:hover [data-lucide], .nav-item:hover .nav-icon { transform: translateX(2px) scale(1.12); }
.nav-item.active [data-lucide], .nav-item.active .nav-icon { filter: drop-shadow(0 0 5px rgba(255,255,255,.6)); }
.nav-item.active {
  position: relative;
  animation: kc-railGlow 2.6s ease-in-out infinite;
}
/* Línea de barrido descendente en el borde activo */
.nav-item.active::after {
  content:''; position:absolute; left:0; top:0; width:3px; height:26%;
  background: linear-gradient(180deg, transparent, #fff, transparent);
  animation: kc-scan 2.4s ease-in-out infinite; opacity:.85;
}

/* ── Botón primario: destello que cruza al pasar el cursor ── */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content:''; position:absolute; top:0; left:-60%; width:45%; height:100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-18deg); pointer-events:none;
}
.btn-primary:hover::after { animation: kc-shine .7s ease; }

/* ── Cards y filas: micro-interacción ── */
.card { transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease; }
.card:hover { border-color: var(--border2); box-shadow: 0 6px 24px rgba(0,101,149,.10); }
tbody tr, .table tbody tr { transition: background .15s ease, box-shadow .15s ease; }
tbody tr:hover, .table tbody tr:hover { box-shadow: inset 3px 0 0 var(--c3); }

/* Realce sutil en cifras grandes */
.stat-value, .kpi-value { transition: text-shadow .3s ease; }
.stat-card:hover .stat-value, .kpi:hover .kpi-value { text-shadow: 0 0 14px rgba(0,149,218,.35); }

/* Badge "en vivo" con anillo expansivo */
.live-dot { position: relative; }
.live-dot::before {
  content:''; position:absolute; inset:-3px; border-radius:50%;
  border:1px solid var(--c3); opacity:.6;
  animation: kc-ping 1.8s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes kc-ping { 0%{ transform:scale(.6); opacity:.7; } 100%{ transform:scale(2.2); opacity:0; } }

/* Modal con entrada más viva (respeta el fade del overlay) */
.modal-overlay.open .modal { animation: kc-pop .34s cubic-bezier(.34,1.4,.5,1); }

/* Spinner ya existe; unificamos timing */
.spinner { animation: kc-spin .55s linear infinite; }

/* ── Accesibilidad: sin movimiento si el usuario lo pide ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* Iconos Lucide inline (reemplazo de emojis) */
.ic { width:15px; height:15px; stroke-width:2; fill:none; vertical-align:-2px; display:inline-block; flex-shrink:0; }
.config-section-title .ic, .modal-title .ic { width:16px; height:16px; vertical-align:-3px; margin-right:4px; }
.stat-ico .ic { width:24px; height:24px; }
.empty-state .ic { width:38px; height:38px; stroke-width:1.25; margin:0 auto 10px; display:block; }
