:root{
  --pd-red: #C8102E;      /* rojo corporativo Pollo al Día */
  --pd-red-dark: #970B22;
  --pd-red-light: #FDECEE;
  --pd-white: #FFFFFF;
  --pd-gray-900: #212529;
  --pd-gray-600: #6c757d;
  --pd-gray-100: #F6F7F9;
  --sidebar-width: 260px;
}

*{box-sizing:border-box;}
html{ overflow-x:hidden; }
body{
  background: var(--pd-gray-100);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--pd-gray-900);
  overflow-x:hidden;
  max-width:100vw;
}

/* ---------- Layout ---------- */
.app-wrapper{ display:flex; min-height:100vh; }
.main-content{
  flex:1;
  min-width:0;
  margin-left: var(--sidebar-width);
  padding: 24px 28px 48px;
  transition: margin-left .25s ease;
}
@media (max-width: 991.98px){
  .main-content{ margin-left:0; padding-top:76px; }
}
@media (max-width: 575.98px){
  .main-content{ padding-left:14px; padding-right:14px; }
  .page-header h1{ font-size:1.25rem; }
  .card-app.p-4{ padding:1rem !important; }
}

/* ---------- Sidebar ---------- */
.sidebar{
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--pd-red) 0%, var(--pd-red-dark) 100%);
  color: var(--pd-white);
  position: fixed;
  top:0; left:0; bottom:0;
  display:flex; flex-direction:column;
  z-index: 1030;
  transition: transform .25s ease;
  box-shadow: 2px 0 12px rgba(0,0,0,.12);
}
@media (max-width: 991.98px){
  .sidebar{ transform: translateX(-100%); }
  .sidebar.show{ transform: translateX(0); }
}
.sidebar-brand{
  display:flex; align-items:center; gap:10px;
  padding: 20px 18px; font-weight:700; font-size:1.05rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.sidebar-brand img{ height:34px; width:auto; }
.sidebar-brand small{ display:block; font-weight:400; font-size:.7rem; opacity:.85; }

.sidebar-user{
  display:flex; align-items:center; gap:10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  font-size:.9rem;
}
.sidebar-user i{ font-size:1.8rem; opacity:.9; }
.sidebar-user .small{ font-size:.68rem; letter-spacing:.04em; opacity:.85; }

.sidebar-nav{ flex:1; padding: 10px 0; overflow-y:auto; }
.sidebar-nav .nav-link{
  color: rgba(255,255,255,.9);
  padding: 11px 20px;
  font-size:.92rem;
  display:flex; align-items:center; gap:12px;
  border-left: 3px solid transparent;
}
.sidebar-nav .nav-link i{ width:18px; text-align:center; }
.sidebar-nav .nav-link:hover{ background: rgba(255,255,255,.1); color:#fff; }
.sidebar-nav .nav-link.active{
  background: rgba(255,255,255,.16);
  border-left-color: #fff;
  font-weight:600;
}
.sidebar-heading{
  padding: 14px 20px 4px; font-size:.7rem; text-transform:uppercase;
  letter-spacing:.08em; opacity:.7; margin-top:6px;
}
.sidebar-nav .mt-auto{ margin-top:auto !important; }
.nav-link-logout{ color:#fff !important; font-weight:700; }
.nav-link-logout:hover{ background: rgba(255,255,255,.15); color:#fff !important; }

.sidebar-toggle{
  position:fixed; top:12px; left:12px; z-index:1040;
  background: var(--pd-red); color:#fff; border-radius:8px;
  width:42px; height:42px;
}

/* ---------- Topbar / page header ---------- */
.page-header{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom: 22px; flex-wrap:wrap; gap:10px;
}
.page-header h1{ font-size:1.5rem; font-weight:700; margin:0; }
.page-header .breadcrumb{ margin:0; font-size:.82rem; }

/* ---------- Cards / KPIs ---------- */
.kpi-card{
  background:#fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  border-top: 4px solid var(--pd-red);
  height:100%;
}
.kpi-card .kpi-value{ font-size:2rem; font-weight:800; color: var(--pd-red-dark); }
.kpi-card .kpi-label{ color: var(--pd-gray-600); font-size:.85rem; text-transform:uppercase; letter-spacing:.03em; }
.kpi-card i{ font-size:1.6rem; color: var(--pd-red); opacity:.85; }

.card-app{
  background:#fff; border-radius:14px; border:none;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.card-app .card-header{
  background:#fff; border-bottom:1px solid #eee;
  font-weight:700; border-radius:14px 14px 0 0 !important;
}

/* ---------- Forms / physical form replica ---------- */
.form-section-title{
  background: var(--pd-red-light);
  color: var(--pd-red-dark);
  font-weight:700; padding:8px 14px; border-radius:8px;
  margin: 20px 0 14px; font-size:.95rem;
  border-left: 4px solid var(--pd-red);
}
.form-check-inline .form-check-input:checked{ background-color: var(--pd-red); border-color: var(--pd-red); }
.btn-pd{ background: var(--pd-red); border-color: var(--pd-red); color:#fff; }
.btn-pd:hover{ background: var(--pd-red-dark); border-color: var(--pd-red-dark); color:#fff; }

.signature-canvas{
  border: 2px dashed #ccc; border-radius:10px; width:100%; max-width:500px; height:180px; touch-action:none; background:#fff;
}
.signature-canvas.signature-canvas-sm{
  height:130px; max-width:350px;
}

/* ---------- Timeline (seguimiento del PQRS) ---------- */
.timeline{ list-style:none; padding-left:0; margin:0; }
.timeline li{
  position:relative; padding: 0 0 22px 34px; border-left: 2px solid #eee;
}
.timeline li:last-child{ border-left-color: transparent; }
.timeline li::before{
  content:''; position:absolute; left:-7px; top:2px;
  width:12px; height:12px; border-radius:50%;
  background: var(--pd-red); box-shadow: 0 0 0 3px #fff;
}
.timeline .t-date{ font-size:.75rem; color: var(--pd-gray-600); }
.timeline .t-title{ font-weight:600; }

/* ---------- Badges por estado ---------- */
.badge{ font-weight:600; }

/* ---------- Document banner (encabezado estilo formato físico COC-T-F15) ---------- */
.document-banner{
  display:flex; align-items:center; gap:16px;
  border:1px solid #ccc; border-radius:8px; padding:10px 16px; margin-bottom:18px;
  background:#fff;
}
.document-banner img{ max-height:55px; max-width:110px; flex-shrink:0; }
.document-banner-title{ display:flex; flex-direction:column; text-align:center; flex:1; }
.document-banner-title strong{ color: var(--pd-red); font-size:.95rem; }
.document-banner-title span{ font-size:.78rem; color: var(--pd-gray-600); margin-top:2px; }

/* ---------- Evidencias / adjuntos (miniaturas) ---------- */
.adjunto-thumb{
  display:flex; flex-direction:column; align-items:center;
  width:92px; text-decoration:none; color:inherit;
}
.adjunto-thumb img{
  width:82px; height:82px; object-fit:cover; border-radius:8px;
  border:1px solid #ddd; background:#fff;
}
.adjunto-icon{
  width:82px; height:82px; display:flex; align-items:center; justify-content:center;
  border-radius:8px; border:1px solid #ddd; background:#f8f9fa; font-size:1.9rem; color:var(--pd-red);
}
.adjunto-nombre{
  font-size:.7rem; color:#555; margin-top:4px; text-align:center;
  word-break:break-word; line-height:1.2;
}
.adjunto-thumb:hover img, .adjunto-thumb:hover .adjunto-icon{ opacity:.8; }

/* ---------- Login ---------- */
.login-wrapper{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--pd-red) 0%, var(--pd-red-dark) 100%);
  position:relative; overflow:hidden;
}
.login-watermark{
  position:absolute; bottom:-8%; right:-6%;
  font-size:26rem; line-height:1; color:rgba(255,255,255,.16);
  user-select:none; pointer-events:none; z-index:0;
}
.login-watermark-2{
  position:absolute; top:-10%; left:-8%;
  font-size:16rem; line-height:1; color:rgba(255,255,255,.10);
  user-select:none; pointer-events:none; z-index:0;
}
.login-card{
  background:#fff; border-radius:16px; padding:36px 32px; width:100%; max-width:400px;
  box-shadow: 0 15px 40px rgba(0,0,0,.25);
  position:relative; z-index:1;
}
.login-card img{ height:60px; margin-bottom: 8px; }

/* Print styles for the PQRS physical-format replica */
@media print{
  .sidebar, .sidebar-toggle, .no-print{ display:none !important; }
  .main-content{ margin-left:0 !important; }
}
