/*
 * styles.css — Estilos unificados para todo el sistema
 * Proyecto: Control de Proyectos
 * Tema: Claro / Profesional
 *
 * Incluir en TODOS los archivos con:
 *   <link rel="stylesheet" href="assets/styles.css">
 *
 * Google Fonts (agregar antes de este link):
 *   <link href="https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Mono:wght@400;500&display=swap" rel="stylesheet">
 */

/* ═══════════════════════════════════════════════════════════════
   TOKENS DE DISEÑO — TEMA CLARO PROFESIONAL
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Fondos: Escala de blancos y grises muy suaves */
  --bg:          #f0f2f7;   /* Fondo principal */
  --bg2:         #ffffff;   /* Sidebar, Topbar, Cards */
  --bg3:         #f5f6fa;   /* Elementos secundarios, headers de tabla */
  --surface:     #ffffff;   /* Tarjetas y paneles */
  --surface2:    #eef0f6;   /* Hover en listas */

  /* Bordes: Sutiles, grises claros */
  --border:      #dde1ec;
  --border2:     #c8cde0;

  /* Acento principal: Azul corporativo */
  --accent:      #2563eb;
  --accent-dim:  #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.10);

  /* Estados */
  --success:     #059669;   /* Verde para terminados/activos */
  --warn:        #d97706;   /* Ámbar para detenidos */
  --danger:      #dc2626;   /* Rojo */
  --info:        #0891b2;   /* Cian info */
  --mejora:      #7c3aed;   /* Violeta mejoras */

  /* Tipografía */
  --text:        #1e2433;   /* Texto principal (casi negro) */
  --text2:       #4b5672;   /* Texto secundario */
  --text3:       #8a93b0;   /* Texto muted/desactivado */
  --muted:       #8a93b0;

  /* Fuentes y geometría */
  --font-head:   'Syne', sans-serif;
  --font-mono:   'DM Mono', monospace;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 2px 12px rgba(30, 36, 51, 0.08);
  --shadow-lg:   0 8px 32px rgba(30, 36, 51, 0.12);
}

/* ═══════════════════════════════════════════════════════════════
   RESET / BASE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg3); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

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

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  padding: 28px 0 20px;
  box-shadow: 2px 0 8px rgba(30, 36, 51, 0.05);
}
.sidebar-logo {
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .brand {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .brand-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-logo .brand-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 24px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 24px;
  color: var(--text2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all .15s ease;
  cursor: pointer;
  background: none;
  border-right: none;
  border-top: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover {
  color: var(--text);
  background: var(--surface2);
  border-left-color: var(--border2);
}
.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-left-color: var(--accent);
  font-weight: 500;
}
.sidebar-link .s-icon {
  width: 16px;
  text-align: center;
  font-size: 13px;
  opacity: .6;
  flex-shrink: 0;
}
.sidebar-link.active .s-icon { opacity: 1; }
.sidebar-link .s-badge {
  margin-left: auto;
  background: var(--bg3);
  color: var(--text3);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 20px;
  font-family: var(--font-mono);
}
.sidebar-link.active .s-badge {
  background: var(--accent-glow);
  color: var(--accent);
}
.sidebar-footer {
  padding: 20px 24px 0;
  border-top: 1px solid var(--border);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}
.user-info .u-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.user-info .u-role {
  font-size: 10px;
  color: var(--muted);
}
.logout-btn {
  margin-left: auto;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color .15s;
}
.logout-btn:hover { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════
   MAIN / TOPBAR
   ═══════════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 36px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(30, 36, 51, 0.06);
}
.topbar-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}
.topbar-title span { color: var(--accent); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ═══════════════════════════════════════════════════════════════
   BOTONES
   ═══════════════════════════════════════════════════════════════ */
.btn-primary-custom, .dk-btn.primary {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
.btn-primary-custom:hover, .dk-btn.primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}
.btn-primary-custom:disabled, .dk-btn.primary:disabled {
  opacity: .5; cursor: not-allowed; transform: none; box-shadow: none;
}

.btn-ghost, .dk-btn.ghost {
  background: transparent;
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 18px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
.btn-ghost:hover, .dk-btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.dk-btn {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  padding: 9px 22px;
  border-radius: var(--radius);
  cursor: pointer; border: none;
  transition: all .15s ease;
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none;
}
.dk-btn.danger { background: var(--danger); color: #fff; }
.dk-btn.danger:hover { background: #b91c1c; box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25); }
.dk-btn-row { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }

/* ═══════════════════════════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════════════════════════ */
.content { padding: 32px 36px; flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   KPI STRIP
   ═══════════════════════════════════════════════════════════════ */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  box-shadow: var(--shadow);
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--kpi-color, var(--border));
}
.kpi-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.kpi-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.kpi-value {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 800;
  color: var(--kpi-color, var(--text));
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-sub { font-size: 10px; color: var(--text3); }
.kpi-icon {
  position: absolute;
  right: 16px; top: 16px;
  font-size: 18px;
  color: var(--kpi-color, var(--border2));
  opacity: .2;
}

/* ═══════════════════════════════════════════════════════════════
   PANEL PRINCIPAL
   ═══════════════════════════════════════════════════════════════ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg3);
}

/* ── TAB NAV ──────────────────────────────────────────────── */
.tab-nav { display: flex; gap: 2px; flex: 1; }
.tab-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .15s ease;
  white-space: nowrap;
}
.tab-btn:hover { background: var(--surface2); color: var(--text2); }
.tab-btn.active { background: var(--bg2); color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tab-btn .t-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.tab-btn .t-count {
  background: var(--surface2);
  color: var(--text3);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 20px;
  margin-left: 2px;
}
.tab-btn.active .t-count { background: var(--accent-glow); color: var(--accent); }

/* ── TAB PANES ────────────────────────────────────────────── */
.tab-pane-content { display: none; }
.tab-pane-content.active { display: block; }

/* ── TABS (dk-tabs, usado en proyecto_view) ────────────────── */
.dk-tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.dk-tab-btn {
  padding: 10px 15px; cursor: pointer; border: none; background: none;
  color: var(--text3); font-size: 13px; font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.dk-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.dk-tab-content { display: none; }
.dk-tab-content.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   TABLA DE DATOS
   ═══════════════════════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { border-bottom: 1px solid var(--border); }
.data-table th {
  padding: 12px 24px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  font-weight: 600;
  font-family: var(--font-mono);
  text-align: left;
  background: var(--bg3);
}
.data-table td {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text2);
  font-size: 12.5px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--surface2); }

/* ── NOMBRE PROYECTO ──────────────────────────────────────── */
.proj-name {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.proj-id { font-size: 10px; color: var(--text3); margin-top: 1px; }

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════════════════════════════════ */
.prog-wrap { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.prog-track { flex: 1; height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.prog-fill { height: 100%; border-radius: 3px; transition: width .6s ease; }
.prog-fill.high   { background: var(--success); }
.prog-fill.medium { background: var(--accent); }
.prog-fill.low    { background: var(--warn); }
.prog-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* dk- variantes de progress */
.dk-prog-track { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin-top: 8px; border: 1px solid var(--border); }
.dk-prog-fill  { height: 100%; border-radius: 3px; transition: width .6s ease; }
.dk-act-prog-track { height: 3px; background: var(--bg3); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.dk-act-prog-fill  { height: 100%; border-radius: 2px; transition: width .4s ease, background .3s ease; }

/* ═══════════════════════════════════════════════════════════════
   STATUS PILLS / BADGES
   ═══════════════════════════════════════════════════════════════ */
.status-pill, .dk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3px;
  font-family: var(--font-mono);
  border: 1px solid;
}
.dk-pill .pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.status-pill.activo,  .dk-pill.activo    { color: var(--success);  border-color: rgba(5,150,105,.25);  background: rgba(5,150,105,.08);  }
.status-pill.detenido,.dk-pill.detenido  { color: var(--warn);     border-color: rgba(217,119,6,.25);  background: rgba(217,119,6,.08);  }
.status-pill.proximo, .dk-pill.proximo   { color: var(--text3);    border-color: var(--border);        background: var(--bg3);           }
.status-pill.mejora,  .dk-pill.mejora    { color: var(--mejora);   border-color: rgba(124,58,237,.25); background: rgba(124,58,237,.08); }
.status-pill.terminado                   { color: var(--accent);   border-color: rgba(37,99,235,.25);  background: rgba(37,99,235,.08);  }

/* Activity status */
.dk-act-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 500;
  padding: 2px 9px; border-radius: 20px;
}
.dk-act-status.pendiente  { color: var(--text3);   background: var(--bg3); }
.dk-act-status.en_proceso { color: var(--warn);    background: rgba(217,119,6,.08); }
.dk-act-status.completada { color: var(--success);  background: rgba(5,150,105,.08); }

/* ═══════════════════════════════════════════════════════════════
   FECHAS / CAMPOS MONO
   ═══════════════════════════════════════════════════════════════ */
.date-mono { font-family: var(--font-mono); font-size: 11px; color: var(--text3); }
.comment-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text3); font-size: 11.5px; }

/* ═══════════════════════════════════════════════════════════════
   BOTONES DE ACCIÓN EN TABLA
   ═══════════════════════════════════════════════════════════════ */
.action-btns { display: flex; gap: 6px; align-items: center; }
.act-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
}
.act-btn:hover.view   { border-color: var(--info);   color: var(--info);   background: rgba(8,145,178,.08); }
.act-btn:hover.edit   { border-color: var(--accent);  color: var(--accent); background: var(--accent-glow); }
.act-btn:hover.delete { border-color: var(--danger);  color: var(--danger); background: rgba(220,38,38,.08); }

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.empty-state, .dk-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text3);
}
.empty-state i, .dk-empty i { font-size: 28px; margin-bottom: 12px; display: block; opacity: .3; }
.empty-state p, .dk-empty   { font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   PAGINACIÓN
   ═══════════════════════════════════════════════════════════════ */
.pagination-row {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 14px 24px;
  border-top: 1px solid var(--border);
}
.pg-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-info { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }

/* ═══════════════════════════════════════════════════════════════
   ACTIVIDADES LIST (index.php)
   ═══════════════════════════════════════════════════════════════ */
.act-row {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.act-row:hover { background: var(--surface2); }
.act-row:last-child { border-bottom: none; }
.act-row .act-icon {
  width: 34px; height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}
.act-row .act-main { flex: 1; min-width: 0; }
.act-row .act-title {
  font-family: var(--font-head);
  font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 3px;
}
.act-row .act-meta { font-size: 11px; color: var(--text3); display: flex; gap: 14px; flex-wrap: wrap; }
.act-row .act-meta span { display: flex; align-items: center; gap: 5px; }
.act-row .act-actions { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   FORMULARIOS (dk-form, modal)
   ═══════════════════════════════════════════════════════════════ */
.dk-form, .view-font { font-family: var(--font-mono); color: var(--text); }

.dk-label {
  display: block;
  font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3); margin-bottom: 6px;
}

.dk-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.dk-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #fff;
}
.dk-input::placeholder { color: var(--muted); }
.dk-input option { background: #fff; color: var(--text); }
textarea.dk-input { resize: vertical; min-height: 86px; }

/* ── SELECT con flecha custom ─────────────────────────────── */
.dk-select-wrap { position: relative; }
.dk-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  pointer-events: none;
}

/* ── Range ────────────────────────────────────────────────── */
.dk-range-wrap { display: flex; align-items: center; gap: 12px; }
.dk-range-wrap input[type=range] {
  flex: 1; -webkit-appearance: none;
  height: 4px; background: var(--bg3);
  border-radius: 2px; outline: none; cursor: pointer;
}
.dk-range-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.dk-range-val {
  font-family: var(--font-head);
  font-size: 18px; font-weight: 700;
  color: var(--accent);
  min-width: 48px; text-align: right;
}

/* ── Status radios ────────────────────────────────────────── */
.status-opts { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.status-opt  { position: relative; }
.status-opt input[type=radio] { position: absolute; opacity: 0; width: 0; }
.status-opt label {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer; transition: all .15s;
  font-size: 10px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px;
  background: var(--bg3);
}
.status-opt label .s-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-opt input:checked + label {
  border-color: var(--s-color);
  color: var(--s-color);
  background: rgba(0,0,0,.02);
}

/* ── Grid helpers ─────────────────────────────────────────── */
.dk-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dk-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.dk-field  { display: flex; flex-direction: column; margin-bottom: 14px; }

/* ── Error/Alert boxes ────────────────────────────────────── */
.dk-error {
  background: rgba(220,38,38,.06);
  border: 1px solid rgba(220,38,38,.2);
  color: #b91c1c;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 16px;
  display: none;
}
.dk-alert-danger {
  font-family: var(--font-mono);
  background: rgba(220,38,38,.06);
  border: 1px solid rgba(220,38,38,.2);
  color: #b91c1c;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   META GRID / ACT CARDS (proyecto_view)
   ═══════════════════════════════════════════════════════════════ */
.dk-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px; margin-bottom: 20px;
}
.dk-meta-label { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); margin-bottom: 6px; }
.dk-meta-val   { font-size: 13px; color: var(--text); }

.dk-act-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.dk-act-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(37,99,235,.08); }
.dk-act-card:last-child { margin-bottom: 0; }
.dk-act-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.dk-act-meta  { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--text3); }
.dk-act-meta span { display: flex; align-items: center; gap: 5px; }
.dk-act-obs {
  font-size: 11px; color: var(--text2);
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

/* ── Section header ───────────────────────────────────────── */
.dk-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dk-section-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--text); }
.dk-section-count { font-size: 12px; font-weight: 400; color: var(--text3); margin-left: 6px; }

/* ── Comment box ──────────────────────────────────────────── */
.dk-comment-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12px; color: var(--text2);
  line-height: 1.7; margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   MODALES
   ═══════════════════════════════════════════════════════════════ */
.modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-lg) !important;
}
.modal-header {
  background: var(--bg3) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 18px 24px !important;
}
.modal-title {
  font-family: var(--font-head) !important;
  font-size: 15px !important; font-weight: 700 !important;
  color: var(--text) !important;
}
.modal-body { padding: 24px !important; background: var(--surface) !important; }
.modal-footer {
  background: var(--bg3) !important;
  border-top: 1px solid var(--border) !important;
  padding: 14px 24px !important;
}
.btn-close { opacity: .5 !important; }
.btn-close:hover { opacity: 1 !important; }

/* Form controls en modal */
.modal-body .form-label {
  font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 6px; display: block;
}
.modal-body .form-control,
.modal-body .form-select {
  background: var(--bg3) !important;
  border: 1px solid var(--border2) !important;
  color: var(--text) !important;
  border-radius: var(--radius) !important;
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  padding: 9px 14px !important;
  transition: border-color .15s !important;
}
.modal-body .form-control:focus,
.modal-body .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  outline: none !important;
  background: #fff !important;
  color: var(--text) !important;
}
.modal-body .form-control::placeholder { color: var(--muted) !important; }
.modal-body select option { background: #fff; color: var(--text); }
.modal-body textarea { min-height: 90px; resize: vertical; }
.modal-body .prog-wrap { min-width: auto; }

/* ═══════════════════════════════════════════════════════════════
   SPINNER / LOADING
   ═══════════════════════════════════════════════════════════════ */
.loading-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px; gap: 16px; color: var(--text3);
}
.spin-ring {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   MODAL CONFIRM
   ═══════════════════════════════════════════════════════════════ */
.confirm-modal .modal-content { max-width: 340px; }
.confirm-icon {
  width: 52px; height: 52px;
  background: rgba(220,38,38,.08);
  border: 1px solid rgba(220,38,38,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--danger); font-size: 20px;
  margin: 0 auto 16px;
}
.confirm-name { font-family: var(--font-head); font-weight: 700; color: var(--text); font-size: 14px; margin-bottom: 6px; }
.confirm-sub  { font-size: 12px; color: var(--text3); }

/* ═══════════════════════════════════════════════════════════════
   HISTORIAL INLINE (proyecto_view)
   ═══════════════════════════════════════════════════════════════ */
.pv-hst-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--text3); cursor: pointer;
  background: none; border: none; padding: 0;
  font-family: var(--font-mono); transition: color .15s;
}
.pv-hst-toggle:hover { color: var(--text2); }
.pv-hst-toggle .toggle-arrow { transition: transform .2s; font-size: 9px; }
.pv-hst-toggle.open .toggle-arrow { transform: rotate(90deg); }

.pv-hst-body { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.pv-hst-body.visible { display: block; }

.pv-hst-item { display: flex; gap: 10px; position: relative; padding-bottom: 10px; }
.pv-hst-item:last-child { padding-bottom: 0; }
.pv-hst-item::before {
  content: ''; position: absolute;
  left: 11px; top: 24px; width: 1px; bottom: 0;
  background: var(--border);
}
.pv-hst-item:last-child::before { display: none; }
.pv-hst-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; font-family: var(--font-mono);
  border: 1px solid; position: relative; z-index: 1;
}
.pv-hst-right { flex: 1; min-width: 0; }
.pv-hst-meta  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.pv-hst-av    { font-size: 10px; font-family: var(--font-mono); }
.pv-hst-txt   { font-size: 11px; color: var(--text2); line-height: 1.55; }
.pv-hst-who   { font-size: 10px; color: var(--text3); }
.pv-hst-ts    { font-size: 10px; color: var(--text3); margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════ */
body.login-page {
  background: var(--bg);
  font-family: var(--font-mono);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
body.login-page::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .5;
  pointer-events: none;
}
body.login-page::after {
  content: '';
  position: fixed;
  top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,.05) 0%, transparent 70%);
  pointer-events: none;
}
.login-card {
  position: relative; z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .4s ease;
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.login-logo-dot {
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.login-logo-text { font-family: var(--font-head); font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: .3px; }
.login-logo-sub  { font-size: 10px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }
.login-card h1 { font-family: var(--font-head); font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.login-card .sub { font-size: 12px; color: var(--muted); margin-bottom: 28px; }

.login-card label { display: block; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.login-card input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 11px 16px;
  margin-bottom: 18px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: #fff; }
.login-card input::placeholder { color: var(--muted); }

.login-card .error-box {
  background: rgba(220,38,38,.06);
  border: 1px solid rgba(220,38,38,.2);
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.login-card button[type="submit"] {
  width: 100%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 500;
  padding: 13px; border: none;
  border-radius: 10px; cursor: pointer;
  transition: all .15s ease;
  margin-top: 4px; letter-spacing: .3px;
}
.login-card button[type="submit"]:hover {
  background: var(--accent-dim);
  box-shadow: 0 6px 20px rgba(37,99,235,.25);
  transform: translateY(-1px);
}
.login-footer { text-align: center; font-size: 10px; color: var(--muted); margin-top: 24px; letter-spacing: .5px; }

/* ═══════════════════════════════════════════════════════════════
   REPORTE (reporte_general.php)
   ═══════════════════════════════════════════════════════════════ */
.report-body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 10px;
}
.page-wrap { max-width: 900px; margin: 0 auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 25px; border: 1px solid var(--border); }
.toolbar { max-width: 900px; margin: 0 auto 10px; display: flex; gap: 10px; align-items: center; }
.btn-print { background: var(--accent); color: #fff; border: none; padding: 8px 15px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 13px; }
.btn-back  { background: #fff; color: var(--text2); border: 1px solid var(--border); padding: 8px 15px; border-radius: 6px; text-decoration: none; font-size: 13px; }

.report-header { display: flex; justify-content: space-between; border-bottom: 2px solid var(--accent); padding-bottom: 8px; margin-bottom: 15px; }
.report-title  { font-size: 18pt; font-weight: 700; color: var(--text); }

.kpi-box { background: var(--bg3); border-radius: 6px; padding: 8px; border-left: 3px solid var(--accent); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.kpi-label { font-size: 7pt; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.kpi-val   { font-size: 14pt; font-weight: 700; color: var(--text); line-height: 1; }

.acts-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; table-layout: fixed; }
.acts-table th { background: var(--bg3); padding: 5px 8px; text-align: left; color: var(--text3); text-transform: uppercase; font-size: 6.5pt; border-bottom: 2px solid var(--border); }
.acts-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; word-wrap: break-word; }

.act-status { padding: 1px 6px; border-radius: 8px; font-size: 6.5pt; font-weight: 700; display: inline-block; }
.act-status.pendiente  { background: var(--bg3); color: var(--text3); }
.act-status.en_proceso { background: rgba(217,119,6,.1); color: #92400e; }
.act-status.completada { background: rgba(5,150,105,.1); color: #065f46; }

.hist-wrap { margin-top: 3px; padding: 5px; background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; }
.priority-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; vertical-align: middle; }

@media print {
  .report-body { background: none; padding: 0; }
  .page-wrap { box-shadow: none; max-width: 100%; width: 100%; padding: 0; border-radius: 0; }
  .toolbar { display: none !important; }
  .act-block { page-break-inside: avoid; }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMACIONES
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel    { animation: fadeUp .3s ease; }
.kpi-card { animation: fadeUp .3s ease both; }
.kpi-card:nth-child(1) { animation-delay: .04s; }
.kpi-card:nth-child(2) { animation-delay: .08s; }
.kpi-card:nth-child(3) { animation-delay: .12s; }
.kpi-card:nth-child(4) { animation-delay: .16s; }
.kpi-card:nth-child(5) { animation-delay: .20s; }
.login-card { animation: fadeUp .4s ease; }
