/* Panel ND — Estilos principales */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --nd-dark: #0D1B3E;
  --nd-dark2: #1a2d5a;
  --nd-green: #A8D400;
  --nd-green-soft: #f0f7e0;
  --nd-green-text: #3B6D11;
  --white: #ffffff;
  --bg: #f4f6fb;
  --bg2: #eef1f8;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text2: #64748b;
  --text3: #94a3b8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text); font-size: 14px; line-height: 1.5; }

/* LOGIN */
.login-body { background: var(--bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-wrap { display: flex; width: 100%; max-width: 820px; min-height: 480px; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 40px rgba(13,27,62,0.15); }
.login-left { background: var(--nd-dark); width: 44%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 2.5rem 2rem; }
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-logo { width: 64px; height: 64px; background: var(--nd-dark2); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; color: #fff; letter-spacing: -1px; }
.login-logo-dot { width: 8px; height: 8px; background: var(--nd-green); border-radius: 50%; margin: 6px auto 0; }
.login-title { color: #fff; font-size: 20px; font-weight: 600; margin-top: 12px; letter-spacing: 1px; }
.login-subtitle { color: #7a9acc; font-size: 12px; margin-top: 2px; }
.login-divider { width: 36px; height: 2px; background: var(--nd-green); border-radius: 2px; margin: 16px auto; }
.login-tagline { color: #a0b8d8; font-size: 12px; line-height: 1.6; max-width: 180px; }
.login-roles { display: flex; gap: 8px; width: 100%; }
.role-pill { flex: 1; padding: 7px 4px; border-radius: var(--radius-sm); text-align: center; font-size: 11px; font-weight: 500; }
.role-admin { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.role-lider { background: rgba(168,212,0,0.15); color: var(--nd-green); border: 1px solid rgba(168,212,0,0.3); }
.role-dis { background: rgba(255,255,255,0.05); color: #a0b8d8; border: 1px solid rgba(255,255,255,0.1); }

.login-right { background: var(--white); flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 2.5rem 2rem; }
.login-form-title { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.login-form-sub { font-size: 13px; color: var(--text2); margin-bottom: 28px; }

/* APP */
.app-body { background: var(--bg); min-height: 100vh; }
.app-container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

/* NAVBAR */
.navbar { background: var(--nd-dark); padding: 0 24px; height: 52px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.nav-brand { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 0.8px; display: flex; align-items: center; gap: 8px; }
.nav-dot { width: 7px; height: 7px; background: var(--nd-green); border-radius: 50%; }
.nav-links { display: flex; gap: 4px; }
.nav-links { overflow-x:auto; scrollbar-width:none; }
.nav-links::-webkit-scrollbar { display:none; }
.nav-link { color: #7a9acc; font-size: 13px; text-decoration: none; padding: 6px 12px; border-radius: var(--radius-sm); transition: all 0.15s; }
.nav-link { white-space:nowrap; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link.active { color: var(--nd-green); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--nd-green); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--nd-dark); }
.nav-name { color: #a0b8d8; font-size: 12px; }
.nav-logout { color: #7a9acc; font-size: 12px; text-decoration: none; padding: 4px 10px; border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-sm); }
.nav-logout:hover { color: #fff; border-color: rgba(255,255,255,0.3); }

/* PAGE HEADER */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 600; color: var(--text); }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-num { font-size: 28px; font-weight: 600; color: var(--text); }
.stat-green { color: var(--nd-green-text); }

/* KANBAN */
.kanban-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kanban-col { background: var(--bg2); border-radius: var(--radius); padding: 14px; border: 1px solid var(--border); min-height: 300px; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kanban-col-title { font-size: 13px; font-weight: 600; color: var(--text); }

/* BADGES */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.badge-pend { background: #faeeda; color: #854F0B; }
.badge-prog { background: #e0edf9; color: #185FA5; }
.badge-done { background: var(--nd-green-soft); color: var(--nd-green-text); }

/* TASK CARDS */
.task-card { background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.task-card.task-done { opacity: 0.75; }
.task-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; line-height: 1.4; }
.task-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.task-user { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text2); }
.task-date { font-size: 11px; color: var(--text3); }
.task-actions { display: flex; gap: 10px; margin-top: 8px; }
.task-link { font-size: 11px; color: var(--nd-dark2); text-decoration: none; }
.task-link:hover { text-decoration: underline; }
.task-link-btn { background: none; border: none; font-size: 11px; color: var(--nd-dark2); cursor: pointer; padding: 0; font-family: inherit; }
.date-done { color: var(--nd-green-text) !important; }

/* TAGS */
.tag { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; margin-bottom: 2px; }
.tag-est { background: #e0edf9; color: #185FA5; }
.tag-land { background: #fbeaf0; color: #993556; }
.tag-cre { background: var(--nd-green-soft); color: var(--nd-green-text); }
.tag-esp { background: #faeeda; color: #854F0B; }

/* MINI AVATAR */
.mini-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--nd-dark2); color: #fff; font-size: 8px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* BUTTONS */
.btn-primary { background: var(--nd-dark); color: #fff; border: none; padding: 9px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block; transition: background 0.15s; }
.btn-primary:hover { background: var(--nd-dark2); }
.btn-full { width: 100%; text-align: center; padding: 11px; font-size: 14px; }
.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); padding: 9px 20px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-add-task { display: block; text-align: center; padding: 10px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); color: var(--text3); font-size: 12px; text-decoration: none; margin-top: 8px; }
.btn-add-task:hover { border-color: var(--nd-dark); color: var(--nd-dark); }
.btn-deliver { width: 100%; background: var(--nd-green); color: var(--nd-dark); border: none; padding: 7px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-deliver:hover { background: #92b800; }

/* FORMS */
.form-card { background: var(--card); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); box-shadow: var(--shadow); max-width: 700px; }
.form-card-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; color: var(--text); }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.form-input { width: 100%; padding: 9px 12px; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); color: var(--text); font-family: inherit; outline: none; transition: border-color 0.15s; }
.form-input:focus { border-color: var(--nd-dark); }
.form-textarea { min-height: 90px; resize: vertical; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* ALERTS */
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: var(--nd-green-soft); color: var(--nd-green-text); border: 1px solid #c3e88d; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }

/* USERS TABLE */
.users-table { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { background: var(--bg2); font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg); }
.row-inactive td { opacity: 0.5; }
.role-badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.role-badge.role-admin { background: #e0edf9; color: #185FA5; }
.role-badge.role-lider { background: var(--nd-green-soft); color: var(--nd-green-text); }
.role-badge.role-disenadora { background: #fbeaf0; color: #993556; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-active { background: var(--nd-green); }
.dot-inactive { background: var(--text3); }

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ═══════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .25s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Drawer overlay ── */
.nav-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7,26,68,.5);
  z-index: 998;
  backdrop-filter: blur(2px);
}
.nav-drawer-overlay.open { display: block; }

/* ── Slide-out drawer ── */
.nav-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 272px;
  height: 100vh;
  background: #0D1B3E;
  z-index: 999;
  transition: left .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,.3);
}
.nav-drawer.open { left: 0; }

/* Drawer header */
.drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.drawer-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}
.drawer-brand { color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.drawer-dot { width: 6px; height: 6px; background: #A8D400; border-radius: 50%; margin-top: 1px; }
.drawer-close {
  margin-left: auto;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Drawer user badge */
.drawer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.drawer-user-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #A8D400;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #0D1B3E;
  flex-shrink: 0;
}
.drawer-user-name { color: #fff; font-size: 13px; font-weight: 600; }
.drawer-user-role { color: #7a9acc; font-size: 11px; margin-top: 1px; }

/* Drawer nav links */
.drawer-nav { padding: 10px 0; flex: 1; }
.drawer-section-label {
  font-size: 10px;
  font-weight: 700;
  color: #4a6080;
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 14px 18px 6px;
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  color: #93B8E8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.drawer-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.drawer-link.active { color: #A8D400; border-left-color: #A8D400; background: rgba(168,212,0,.06); }
.drawer-link-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

/* Drawer footer */
.drawer-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.drawer-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #7a9acc;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 0;
}
.drawer-logout:hover { color: #fff; }

@media (max-width: 768px) {
  /* Navbar mobile */
  .navbar { padding: 0 14px; height: 52px; }
  .nav-hamburger { display: flex; }
  .nav-links { display: none !important; }
  .nav-name { display: none; }
  .nav-logout { display: none; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-num { font-size: 22px; }

  /* Kanban — horizontal scroll instead of stacking */
  .kanban-board {
    grid-template-columns: repeat(4, 80vw);
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .kanban-col { min-width: 0; }

  /* Task cards */
  .task-card { touch-action: pan-y; }

  /* Modals */
  .modal-box { border-radius: 12px 12px 0 0; max-height: 92vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-main { border-right: none; border-bottom: 1px solid #F1F5F9; }

  /* Brief / clients popups */
  .brief-box { border-radius: 12px 12px 0 0; max-height: 92vh; }
  .brief-overlay { align-items: flex-end; padding: 0; }
  .clients-box { border-radius: 12px 12px 0 0; max-height: 92vh; }
  .clients-overlay { align-items: flex-end; padding: 0; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }
  .login-wrap { flex-direction: column; }
  .login-left { width: 100%; padding: 1.5rem; }
  .login-right { padding: 1.5rem; }
  .app-container { padding: 16px 12px; }

  /* Filter toolbar */
  .filter-toolbar { padding: 12px; gap: 8px; }
  .ft-field { min-width: calc(50% - 4px); }

  /* Page header */
  .page-header { flex-wrap: wrap; gap: 10px; }
  .page-title { font-size: 18px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: repeat(4, 88vw); }
  .ft-field { min-width: 100%; }
}


/* Logo fixes */
.nav-logo { height: 24px; width: auto; border-radius: 3px; object-fit: contain; }
.reports-logo { display: none; }

/* ── Espaciado del formulario de login ── */
.login-right form .form-input { margin-bottom: 20px; }
.login-right form .form-label { margin-top: 6px; }
.login-right form .btn-full { margin-top: 16px; }

/* ═══════════════════════════════════════
   MODERN UI — superficies, brillo y estados
   ═══════════════════════════════════════ */
:root {
  --nd-glow: rgba(168,212,0,.22);
  --surface-shadow: 0 8px 28px rgba(13,27,62,.07);
  --surface-shadow-hover: 0 16px 38px rgba(13,27,62,.12);
}

.app-body {
  background:
    radial-gradient(circle at 7% 0%, rgba(168,212,0,.08), transparent 24rem),
    radial-gradient(circle at 92% 8%, rgba(37,99,235,.06), transparent 28rem),
    var(--bg);
  background-attachment: fixed;
}

.navbar {
  background: linear-gradient(110deg, #091631 0%, #0D1B3E 55%, #142b5b 100%);
  box-shadow: 0 8px 28px rgba(6,17,40,.2);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav-link {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.nav-link:hover { transform: translateY(-1px); }
.nav-link.active {
  color: #D7FF42;
  background: linear-gradient(135deg, rgba(168,212,0,.17), rgba(168,212,0,.07));
  border-color: rgba(196,244,23,.24);
  box-shadow: inset 0 0 18px rgba(168,212,0,.08), 0 0 16px rgba(168,212,0,.08);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 16%; right: 16%; bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #B6E600;
  box-shadow: 0 0 9px #B6E600;
}

.nav-avatar { box-shadow: 0 0 0 3px rgba(168,212,0,.14), 0 0 18px rgba(168,212,0,.22); }
.page-title { letter-spacing: -.35px; }

.stat-card,
.form-card,
.users-table,
.corr-list-card,
.metric-card,
.del-total-card {
  position: relative;
  overflow: hidden;
  box-shadow: var(--surface-shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.stat-card:hover,
.form-card:hover,
.users-table:hover,
.corr-list-card:hover,
.metric-card:hover,
.del-total-card:hover {
  transform: translateY(-3px);
  border-color: #CBD5E1;
  box-shadow: var(--surface-shadow-hover);
}
.stat-card::after,
.form-card::after,
.metric-card::after,
.del-total-card::after {
  content: '';
  position: absolute;
  top: -70%; left: -55%;
  width: 35%; height: 240%;
  pointer-events: none;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  transition: left .65s ease;
}
.stat-card:hover::after,
.form-card:hover::after,
.metric-card:hover::after,
.del-total-card:hover::after { left: 125%; }

.btn-primary {
  background: linear-gradient(135deg, #0D1B3E, #18366f);
  box-shadow: 0 6px 16px rgba(13,27,62,.16);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(13,27,62,.24); }

.form-input { transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.form-input:focus { border-color: #2563EB; box-shadow: 0 0 0 4px rgba(37,99,235,.09); }

.drawer-link { transition: color .2s ease, background .2s ease, transform .2s ease, border-color .2s ease; }
.drawer-link:hover { transform: translateX(3px); }
.drawer-link.active {
  color: #D7FF42;
  background: linear-gradient(90deg, rgba(168,212,0,.16), rgba(168,212,0,.03));
  box-shadow: inset 12px 0 24px rgba(168,212,0,.04);
}

.duplicate-notice {
  display:flex; align-items:flex-start; gap:12px;
  padding:14px 16px; margin-bottom:20px;
  border:1px solid #BFDBFE; border-radius:12px;
  background:linear-gradient(135deg,#EFF6FF,#F8FBFF);
  color:#1E3A8A; font-size:13px; line-height:1.55;
  box-shadow:0 8px 24px rgba(37,99,235,.08);
}
.duplicate-notice-icon {
  display:grid; place-items:center; flex:0 0 32px; height:32px;
  border-radius:9px; background:#DBEAFE; color:#1D4ED8; font-size:17px; font-weight:700;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}
