/* =====================================================
   SISTEMA JPRD — Estilos Globales
   Paleta: #062D4D · #404041 · #A6936F · #963130 · #F2F2F2
   ===================================================== */

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

/* ── Variables ── */
:root {
  --navy:   #062D4D;
  --dark:   #404041;
  --sand:   #A6936F;
  --red:    #963130;
  --light:  #F2F2F2;
  --white:  #FFFFFF;
  --navy-l: #0a4272;
  --navy-xl:#1a5c9a;
  --sand-l: #c4af92;
  --red-l:  #b84644;
  --shadow: 0 2px 12px rgba(6,45,77,.13);
  --shadow-lg: 0 6px 28px rgba(6,45,77,.18);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: all .22s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Source Sans Pro', sans-serif;
  background: #eef1f5;
  color: var(--dark);
}

/* ── Navbar ── */
.main-header.navbar {
  background: var(--navy) !important;
  border-bottom: 3px solid var(--red);
  box-shadow: var(--shadow);
}
.main-header .navbar-brand,
.main-header .nav-link,
.main-header .navbar-text {
  color: var(--light) !important;
}
.main-header .nav-link:hover { color: var(--sand) !important; }
.jprd-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .5px;
  color: var(--light) !important;
}
.jprd-brand span { color: var(--sand); }

/* ── Sidebar Logo Centering (Mini) ── */
.sidebar-collapse .main-sidebar .brand-link .brand-image {
  margin-left: 0 !important;
  margin-right: 0 !important;
  float: none !important;
  display: block !important;
  margin: 0 auto !important;
}

/* Badge no leídos en navbar */
.badge-unread {
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%,100% { opacity:1; } 50% { opacity:.6; }
}

/* ── Sidebar ── */
.main-sidebar {
  background: var(--dark) !important;
  box-shadow: 3px 0 15px rgba(0,0,0,.25);
}
.main-sidebar .brand-link {
  background: transparent;
  border-bottom: 1px solid rgba(166,147,111,.3);
}
.main-sidebar .brand-text {
  font-weight: 700;
  color: var(--light) !important;
  font-size: .92rem;
}
.main-sidebar .brand-text small { color: var(--sand); font-size: .72rem; }

/* Nav links sidebar */
.nav-sidebar .nav-link {
  color: rgba(242,242,242,.82) !important;
  border-radius: var(--radius-sm);
  margin: 1px 8px;
  padding: 8px 12px;
  transition: var(--transition);
  font-size: .875rem;
}
.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link.active {
  background: var(--navy) !important;
  color: var(--light) !important;
}
.nav-sidebar .nav-link.active {
  border-left: 3px solid var(--sand);
}
.nav-sidebar .nav-link i {
  color: var(--sand) !important;
  width: 18px;
  text-align: center;
}
.nav-sidebar .nav-header {
  color: rgba(166,147,111,.6);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 16px 4px;
}

/* Contador de no leídos sidebar */
.sidebar-badge {
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  padding: 1px 6px;
  border-radius: 10px;
  float: right;
  margin-top: 2px;
}

/* ── Content Wrapper ── */
.content-wrapper { background: #eef1f5; }

/* ── Page Header ── */
.jprd-page-header {
  background: var(--red);
  color: var(--light);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 4px solid var(--sand);
}
.jprd-page-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: .3px;
}
.jprd-page-header .header-icon {
  width: 40px; height: 40px;
  background: rgba(166,147,111,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--sand);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.jprd-breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
  font-size: .78rem;
}
.jprd-breadcrumb .breadcrumb-item a { color: var(--sand-l); }
.jprd-breadcrumb .breadcrumb-item.active { color: rgba(242,242,242,.7); }
.jprd-breadcrumb .breadcrumb-item+.breadcrumb-item::before { color: rgba(242,242,242,.4); }

/* ── Cards ── */
.jprd-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}
.jprd-card:hover { box-shadow: var(--shadow-lg); }

.jprd-card-header {
  background: var(--dark);
  color: var(--light);
  border-top: 3px solid var(--red);
  padding: 14px 20px;
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.jprd-card-header i { color: var(--sand); }

.jprd-card-header-sand {
  background: var(--sand);
  color: var(--navy);
}
.jprd-card-header-red {
  background: var(--red);
  color: var(--white);
}

/* ── Botones ── */
.btn-jprd-primary {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-weight: 600;
  font-size: .875rem;
  transition: var(--transition);
}
.btn-jprd-primary:hover { background: var(--navy-l); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-jprd-sand {
  background: var(--sand);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-weight: 600;
  font-size: .875rem;
  transition: var(--transition);
}
.btn-jprd-sand:hover { background: var(--sand-l); color: var(--navy); transform: translateY(-1px); }

.btn-jprd-red {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-weight: 600;
  font-size: .875rem;
  transition: var(--transition);
}
.btn-jprd-red:hover { background: var(--red-l); color: var(--white); transform: translateY(-1px); }

.btn-jprd-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-weight: 600;
  font-size: .875rem;
  transition: var(--transition);
}
.btn-jprd-outline:hover { background: var(--navy); color: var(--white); }

/* ── Stat Boxes ── */
.stat-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  cursor: default;
}
.stat-box:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-box .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-box .stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}
.stat-box .stat-label {
  font-size: .75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.stat-navy  .stat-icon { background: rgba(6,45,77,.1);   color: var(--navy); }
.stat-sand  .stat-icon { background: rgba(166,147,111,.15); color: var(--sand); }
.stat-red   .stat-icon { background: rgba(150,49,48,.12); color: var(--red); }
.stat-navy  .stat-number { color: var(--navy); }
.stat-sand  .stat-number { color: #7a6b52; }
.stat-red   .stat-number { color: var(--red); }

/* ── Bandeja de entrada ── */
.inbox-row {
  border-bottom: 1px solid #eee;
  padding: 12px 16px;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--dark);
}
.inbox-row:hover { background: rgba(6,45,77,.04); color: var(--dark); }
.inbox-row.unread {
  background: rgba(6,45,77,.03);
  border-left: 3px solid var(--navy);
}
.inbox-row.unread .inbox-subject { font-weight: 700; color: var(--navy); }
.inbox-row.read { border-left: 3px solid transparent; }
.inbox-row.read .inbox-subject { color: #666; }

.inbox-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.inbox-icon-center { background: rgba(6,45,77,.1); color: var(--navy); }
.inbox-icon-parte  { background: rgba(166,147,111,.15); color: #7a6b52; }

.inbox-meta {
  font-size: .72rem;
  color: #999;
}
.inbox-exp-badge {
  font-size: .68rem;
  background: rgba(6,45,77,.08);
  color: var(--navy);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.inbox-dot-unread {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Carpetas Sidebar ── */
.folder-item {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--dark);
  text-decoration: none;
  font-size: .875rem;
}
.folder-item:hover { background: rgba(6,45,77,.06); color: var(--navy); text-decoration: none; }
.folder-item.active { background: rgba(6,45,77,.1); color: var(--navy); font-weight: 600; }
.folder-item i { color: var(--sand); width: 20px; margin-right: 8px; }
.folder-count { margin-left: auto; font-size: .72rem; background: #eee; padding: 1px 8px; border-radius: 10px; }
.folder-count.has-unread { background: var(--red); color: var(--white); }

/* ── Documento (ver notificación) ── */
.doc-info-table td { padding: 6px 10px; vertical-align: top; }
.doc-info-table td:first-child { color: #666; font-size: .82rem; white-space: nowrap; }
.doc-info-table td:last-child { font-weight: 600; color: var(--dark); font-size: .88rem; }

.pdf-embed-wrapper {
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.pdf-embed-wrapper embed { display: block; }
.pdf-fallback {
  padding: 16px;
  background: #fafafa;
  text-align: center;
  font-size: .85rem;
  color: #666;
}

.anexo-card {
  border: 1px solid #e0d9cf;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffdf9;
  transition: var(--transition);
}
.anexo-card:hover { border-color: var(--sand); background: #fdf8f1; }
.anexo-card .anexo-icon { color: var(--red); font-size: 1.3rem; flex-shrink: 0; }
.anexo-card .anexo-name { font-size: .82rem; font-weight: 600; flex: 1; color: var(--dark); }
.anexo-card .anexo-size { font-size: .72rem; color: #999; }

/* ── Formulario subir documento ── */
.form-section {
  border: none;
  border-top: 2px solid #eee;
  padding-top: 20px;
  margin-top: 20px;
}
.form-section-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--navy);
  margin-bottom: 14px;
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(6,45,77,.12);
}
.custom-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(6,45,77,.12);
}

/* Upload zone */
.upload-zone {
  border: 2px dashed #c0d0de;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  background: #f8fbff;
  transition: var(--transition);
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--navy);
  background: rgba(6,45,77,.04);
}
.upload-zone i { font-size: 2.5rem; color: #aac0d4; margin-bottom: 8px; display: block; }
.upload-zone .upload-label { font-size: .88rem; color: #888; }
.upload-zone .upload-label strong { color: var(--navy); }

/* Anexo chips */
.anexo-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f4f7fa;
  border: 1px solid #dde5ec;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
  font-size: .83rem;
}
.anexo-chip i { color: var(--red); }
.anexo-chip .chip-size { color: #999; font-size: .72rem; }
.anexo-chip .chip-remove {
  margin-left: auto;
  color: #bbb;
  cursor: pointer;
  transition: var(--transition);
}
.anexo-chip .chip-remove:hover { color: var(--red); }

.horario-notice {
  background: rgba(6,45,77,.05);
  border: 1px solid rgba(6,45,77,.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .82rem;
  color: var(--navy);
}
.horario-notice i { color: var(--sand); margin-right: 6px; }

/* ── Confirmación / Cargo ── */
.cargo-header {
  text-align: center;
  padding: 30px 20px 20px;
  border-bottom: 2px solid #f0e8dc;
}
.cargo-header .cargo-seal {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--navy), var(--navy-l));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  color: var(--sand);
  font-size: 1.8rem;
  box-shadow: 0 4px 15px rgba(6,45,77,.3);
}
.cargo-code {
  font-family: 'Courier New', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--light);
  border: 2px dashed var(--navy);
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  display: inline-block;
  letter-spacing: 2px;
}
.cargo-table td { padding: 8px 12px; font-size: .88rem; }
.cargo-table td:first-child { color: #666; font-weight: 500; }
.cargo-table td:last-child { font-weight: 700; color: var(--dark); }
.success-stamp {
  background: rgba(25,135,84,.08);
  border: 2px solid #198754;
  border-radius: var(--radius);
  padding: 12px 20px;
  color: #198754;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ── Timeline expediente ── */
.timeline-jprd { position: relative; padding-left: 36px; }
.timeline-jprd::before {
  content: '';
  position: absolute;
  left: 14px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--navy), var(--sand));
  opacity: .3;
}
.timeline-item {
  position: relative;
  margin-bottom: 18px;
}
.timeline-dot {
  position: absolute;
  left: -30px;
  top: 14px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--navy);
}
.timeline-dot.unread { background: var(--red); box-shadow: 0 0 0 2px var(--red); }
.timeline-dot.read   { background: var(--sand); }
.timeline-dot.mine   { background: var(--navy-xl); box-shadow: 0 0 0 2px var(--navy-xl); }

.timeline-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  transition: var(--transition);
}
.timeline-card:hover { box-shadow: var(--shadow-lg); transform: translateX(2px); }
.timeline-card.unread { border-left: 3px solid var(--red); }
.timeline-card.read   { border-left: 3px solid var(--sand); }
.timeline-date-sep {
  text-align: center;
  margin: 16px 0 10px;
  position: relative;
}
.timeline-date-sep span {
  background: #e8edf2;
  color: #888;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* ── Alertas JPRD ── */
.alert-jprd-success {
  background: rgba(25,135,84,.08);
  border: 1px solid rgba(25,135,84,.25);
  color: #155724;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .88rem;
}
.alert-jprd-error {
  background: rgba(150,49,48,.08);
  border: 1px solid rgba(150,49,48,.25);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .88rem;
}

/* ── Tablas ── */
.table-jprd thead th {
  background: var(--navy);
  color: var(--light);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  border: none;
  padding: 10px 14px;
}
.table-jprd tbody tr { transition: var(--transition); }
.table-jprd tbody tr:hover { background: rgba(6,45,77,.04); }
.table-jprd tbody td { padding: 10px 14px; vertical-align: middle; font-size: .875rem; border-color: #eee; }

/* ── Footer ── */
.main-footer {
  background: var(--navy);
  color: rgba(242,242,242,.6);
  font-size: .78rem;
  border-top: 1px solid var(--sand) !important;
  padding: 12px 20px;
  margin-top: 40px !important;
}
.main-footer a { color: var(--sand); }

/* Espaciado de seguridad para el contenedor principal */
.content-wrapper { padding-bottom: 20px; }

/* ── Login Page Redesign ── */
.login-page { 
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.2); /* Sutil aclarado para que no compita con el logo */
  display: block;
}
.login-box { width: 360px !important; position: relative; z-index: 1; }
.card.login-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.06);
  background: #fff;
  overflow: hidden;
  border-top: 4px solid var(--sand);
}
.login-card .card-body { padding: 32px; }
.login-card .login-box-msg { color: #999; font-size: .9rem; margin-bottom: 20px; }
.login-card .form-control {
  border-radius: var(--radius-sm);
  border: 1.5px solid #ddd;
  padding: 10px 14px;
  font-size: .9rem;
}
.login-card .form-control:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(6,45,77,.1); }
.login-card .btn-login {
  background: var(--red);
  color: var(--white);
  border: none;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
  transition: all .25s ease;
  letter-spacing: .5px;
  box-shadow: 0 4px 12px rgba(150,49,48,0.25);
}
.login-card .btn-login:hover {
  background: #b84644;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(150,49,48,0.3);
  color: #fff;
}
.login-footer { color: rgba(242,242,242,.5); font-size: .75rem; text-align: center; margin-top: 16px; }

/* ── Mis expedientes ── */
.exp-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  border-left: 4px solid var(--sand);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--dark);
}
.exp-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: var(--dark); text-decoration: none; border-left-color: var(--navy); }
.exp-card .exp-icon { width: 44px; height: 44px; border-radius: 10px; background: rgba(6,45,77,.08); color: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.exp-card .exp-nro { font-weight: 700; font-size: .95rem; color: var(--navy); }
.exp-card .exp-meta { font-size: .78rem; color: #888; margin-top: 2px; }
.exp-card .exp-arrow { margin-left: auto; color: var(--sand); font-size: .9rem; opacity: .6; }

/* ── Utilidades ── */
.text-navy { color: var(--navy) !important; }
.text-sand  { color: var(--sand) !important; }
.text-red   { color: var(--red) !important; }
.bg-navy    { background: var(--navy) !important; }
.bg-sand    { background: var(--sand) !important; }
.bg-red     { background: var(--red) !important; }
.border-navy { border-color: var(--navy) !important; }
.border-sand { border-color: var(--sand) !important; }

.rounded-jprd { border-radius: var(--radius) !important; }
.shadow-jprd  { box-shadow: var(--shadow) !important; }

/* Scroll suave en sidebar */
.sidebar { overflow-y: auto; overflow-x: hidden; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(166,147,111,.3); border-radius: 2px; }

/* Animación entrada de elementos */
.fade-in { animation: fadeIn .35s ease forwards; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* @print — cargo electrónico */
@media print {
  .main-sidebar, .main-header, .main-footer, .btn, .no-print { display: none !important; }
  .content-wrapper { margin: 0 !important; background: white !important; }
  .jprd-card { box-shadow: none !important; border: 1px solid #ddd; }
}
