/* ==========================
   RESET / BASE
   ========================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: #f5f6f8;
  font-family: 'Segoe UI', sans-serif;
  color: #111827;
}

/* ==========================
   LAYOUT
   ========================== */
.layout {
  display: flex;
  min-height: 100vh;
  background: #f5f6f8;
}

.main-content {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: #f5f6f8;
  transition: margin-left 0.3s ease;
}

/* Header */
.header {
  height: 60px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Main */
main {
  flex-grow: 1;
  padding: 2rem;
  background: transparent;
}

/* ==========================
   HEADER SEARCH
   ========================== */
.search-box {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  width: 300px;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-button {
  background: #fff;
  padding: 8px;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,0,0,0.08);
  cursor: pointer;
}

.avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* ==========================
   SIDEBAR
   ========================== */
.sidebar {
  width: 55px;
  height: 100vh;
  background-color: #380818;
  color: white;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.3s ease;
  overflow: hidden;
}

.sidebar:hover { width: 180px; }

.sidebar .logo{
  width: 100%;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.sidebar .sidebar-logo{
  height: 52px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.sidebar .logo img{
  max-width: 100%;
  height: 52px;
  width: auto;
  object-fit: contain;
}

.menu, .bottom-menu { list-style: none; padding: 0; margin: 0; }

.sidebar .menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 0.5rem;
}

.sidebar:not(:hover) .menu { overflow-y: hidden; }
.sidebar:hover .menu { overflow-y: auto; }

.sidebar .menu::-webkit-scrollbar { width: 6px; }
.sidebar .menu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
}

.menu li, .bottom-menu li {
  display: flex;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.menu li:hover, .bottom-menu li:hover { background: #6b0f2a; }

.menu .menu-option, .bottom-menu a {
  color: #fff;
  text-decoration: none;
}

.sidebar .icon { font-size: 1.2rem; }

.menu li a span, .bottom-menu li span { display: none; }
.sidebar:hover li a { display: flex; }
.sidebar:hover li a span { display: inline; padding-left: 12px; }

/* ==========================
   SUBMENUS (ACORDEÓN)
   ========================== */
.menu > li.has-submenu { display: block; padding: 0; }

.menu > li.has-submenu > .menu-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.menu > li.has-submenu .chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.menu > li.has-submenu .submenu {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding: 0;
  margin: 0;
}

.menu > li.has-submenu.open .submenu { max-height: 900px; }
.menu > li.has-submenu.open .chevron { transform: rotate(180deg); }

.menu > li.has-submenu .submenu li { display: block; padding: 0; }

.menu > li.has-submenu .submenu a.menu-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  text-decoration: none;
}

.sidebar:not(:hover) .has-submenu .submenu { max-height: 0 !important; }

.sidebar:not(:hover) .submenu-toggle span { display: none; }
.sidebar:not(:hover) .submenu-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar:not(:hover) .submenu-toggle .chevron { display: none; }

.submenu-title{
  padding: 0.4rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  cursor: default;
}

/* ==========================
   TABLES (Lista Maestra)
   ========================== */
.table-wrapper {
  background: #fafafa;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  margin-top: 20px;
  border: 1px solid #e3e3e3;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.table-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #222;
}

.table-search {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  min-width: 260px;
  font-size: 0.9rem;
  transition: 0.2s;
}

.table-search:focus {
  outline: none;
  border-color: #a81840;
  box-shadow: 0 0 3px rgba(168, 24, 64, 0.3);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.9rem;
  border: 1px solid #ddd;
}

.docs-table thead {
  background: #380818;
  color: #ffffff;
  font-weight: bold;
}

.docs-table thead th {
  padding: 0.75rem 0.85rem;
  text-align: left;
  white-space: nowrap;
}

.docs-table tbody td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid #e6e6e6;
}

.docs-table tbody tr:nth-child(even) { background: #f6f6f6; }
.docs-table tbody tr:hover { background: #f7eef1; cursor: pointer; }

/* ==========================
   BUTTONS (compat)
   ========================== */
.btn-primary {
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  border: none;
  background: #a81840;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover { background: #6b0f2a; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  padding: 0.7rem 1.2rem;
  background: #e0e0e0;
  color: #222;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover { background: #c6c6c6; }

.btn-danger {
  padding: 0.35rem 0.7rem;
  background: #fff;
  color: #b91c1c;
  border: 1px solid #f3b4b4;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-danger:hover { background: #b91c1c; color: #fff; border-color: #b91c1c; }

/* ==========================
   FORMS (genéricos)
   ========================== */
.form-wrapper { padding: 1rem 1rem; }

.form-wrapper h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.form-description { color: #555; margin-bottom: 1rem; }

.form-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  max-width: 980px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group.full { grid-column: span 2; }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  color: #222;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  background: #fafafa;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #a81840;
  background: #fff;
}

.form-buttons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

.help-text { font-size: 0.8rem; color: #666; margin-top: 4px; }

/* ==========================
   PROFILE
   ========================== */
.profile-container {
  padding: 2rem;
  border-radius: 10px;
  width: 100%;
  max-width: 800px;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.profile-picture {
  flex: 1 1 200px;
  text-align: center;
}

.profile-picture img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #380818;
}

.profile-form {
  flex: 2 1 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group { display: flex; flex-direction: column; }
.input-row { display: flex; gap: 1rem; }
.input-row .input-group { flex: 1; }

.submit-btn {
  background-color: #6b0f2a;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
  align-self: flex-start;
}

.submit-btn:hover { background-color: #a81840; }

/* ==========================
   STATUS / BADGES
   ========================== */
.status-danger { color: #b91c1c; font-weight: 600; }
.status-ok { color: #15803d; font-weight: 600; }
.status-warning{ color: #b45309; font-weight: 700; }

.badge-warning{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  border:1px solid #f59e0b;
  background:#fff7ed;
}

.docs-table tbody tr.row-warning,
.docs-table tbody tr.row-warning td { background: #fff7ed !important; }

.docs-table tbody tr.row-warning:hover,
.docs-table tbody tr.row-warning:hover td { background: #ffedd5 !important; }

.docs-table tbody tr.row-danger,
.docs-table tbody tr.row-danger td { background: #fee2e2 !important; }

.docs-table tbody tr.row-danger:hover,
.docs-table tbody tr.row-danger:hover td { background: #fecaca !important; }

/* counters */
.status-counters{
  margin-top: 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status-counters .counter{
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .1s ease;
}

.status-counters .counter:hover{
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.counter.total{
  border-color: #a81840;
  background: #f7eef1;
  color: #6b0f2a;
}

.counter.warning{
  border-color: #f59e0b;
  background: #fff7ed;
  color: #b45309;
}

.counter.danger{
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
}

.status-counters .counter.active{
  outline: 2px solid rgba(0,0,0,.15);
}

.table-header .input{ min-width: 180px; }

.search-form{
  display:flex;
  gap:10px;
  align-items:center;
}
.search-form .input{ min-width: 280px; }

/* ==========================
   ALERTS (genéricos)
   ========================== */
.alerts { margin: 10px 0 14px; }
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
}
.alert.success { background: #dcfce7; border: 1px solid #22c55e; }
.alert.error   { background: #fee2e2; border: 1px solid #ef4444; }

.errorlist {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: #b91c1c;
  font-size: 13px;
}

/* ==========================
   MOLEX PAGE (polish)
   ========================== */
.page{
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 22px 34px;
}

.page-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom: 14px;
}

.page-title{
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
  letter-spacing: .2px;
}

.page-subtitle{
  margin: 6px 0 0;
  color: rgba(0,0,0,.62);
  font-size: 14px;
}

/* Cards */
.card{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
  margin-top: 14px;
  overflow: hidden;
  width: 100%;
}

.card-header{
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: linear-gradient(to bottom, rgba(0,0,0,.02), rgba(0,0,0,0));
}

.card-header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.card-title{
  margin: 0;
  font-size: 16px;
  letter-spacing: .2px;
}

.card-hint{
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(0,0,0,.62);
}

.card-body{ padding: 16px; }

/* Form */
.form{ display:block; }

.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-span-2{ grid-column: 1 / -1; }

@media (max-width: 800px){
  .form-grid{ grid-template-columns: 1fr; }
  .field-span-2{ grid-column: auto; }
}

.field-label{
  display:block;
  font-size: 13px;
  color: rgba(0,0,0,.75);
  margin-bottom: 6px;
}

.field-control input,
.field-control select,
.field-control textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.field-control input:focus,
.field-control select:focus,
.field-control textarea:focus{
  border-color: rgba(168, 24, 64, 0.45);
  box-shadow: 0 0 0 4px rgba(168, 24, 64, 0.12);
}

.field-error{
  margin-top: 6px;
  font-size: 12px;
  color: #b00020;
}

/* New button system for Molex */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.btn-small{ padding: 8px 12px; border-radius: 10px; font-size: 13px; }

.btn.btn-primary{
  background: #a81840;
  color: #fff;
}

.btn.btn-primary:hover{ filter: brightness(0.92); }

.btn.btn-secondary{
  background: #f3f4f6;
  color: #111827;
  border-color: rgba(0,0,0,.08);
}

.btn.btn-secondary:hover{ filter: brightness(0.98); }

.is-disabled{
  opacity: .55;
  pointer-events: none;
}

.form-actions{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* Table */
.table-wrap{
  width: 100%;
  overflow: auto;
}

.table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 0;
}

.table thead th{
  text-align:left;
  font-size: 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: rgba(0,0,0,.55);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.02);
}

.table tbody td{
  padding: 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  vertical-align: middle;
}

.table tbody tr:hover{
  background: rgba(168, 24, 64, 0.04);
}

.th-actions, .td-actions{ text-align:right; width: 160px; }
.td-muted{ color: rgba(0,0,0,.65); }

.link{
  font-weight: 700;
  color: #6b0f2a;
  text-decoration: none;
}

.link:hover{ text-decoration: underline; }

.table-empty{
  padding: 18px 12px;
  color: rgba(0,0,0,.65);
  text-align: center;
}

/* Pills */
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.06);
  color: rgba(0,0,0,.75);
  font-size: 13px;
}

/* Pagination */
.pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,.06);
}

.pagination-meta{
  color: rgba(0,0,0,.62);
  font-size: 13px;
}

.pagination-right{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.page-dot{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  color: rgba(0,0,0,.85);
  text-decoration:none;
  font-weight: 700;
  font-size: 13px;
}

.page-dot:hover{ background: rgba(0,0,0,.03); }

.page-dot.is-active{
  background: rgba(168, 24, 64, 0.10);
  border-color: rgba(168, 24, 64, 0.25);
  color: #6b0f2a;
}

/* inputs usados en forms.py */
.input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.14);
  background:#fff;
  outline:none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.input:focus{
  border-color: rgba(168, 24, 64, 0.45);
  box-shadow: 0 0 0 4px rgba(168, 24, 64, 0.12);
}

.checkbox{
  width: 18px;
  height: 18px;
}

/* ==========================
   RESPONSIVE
   ========================== */
@media (max-width: 768px) {
  .layout { flex-direction: column; }

  .sidebar {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 220px;
    height: calc(100%);
    background: #380818;
    z-index: 1000;
    transition: left 0.3s ease;
  }

  .sidebar.open { left: 0; top: 0; }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .table-search { width: 100%; }

  .docs-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: span 1; }

  main { padding: 1rem; }
}


/* ===== Molex Detalle extras ===== */

.header-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Grid de metadatos */
.meta-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 1100px){
  .meta-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px){
  .meta-grid{ grid-template-columns: 1fr; }
}

.meta-item{
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(0,0,0,.02);
  border-radius: 12px;
  padding: 12px;
}

.meta-label{
  font-size: 12px;
  color: rgba(0,0,0,.62);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}

.meta-value{
  font-size: 14px;
  color: rgba(0,0,0,.88);
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* Botones de descarga */
.actions-grid{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Textarea tipo editor */
.preview-textarea{
  width: 100%;
  height: 320px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: #0b1220;
  color: #e5e7eb;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

.preview-textarea:focus{
  border-color: rgba(168, 24, 64, 0.45);
  box-shadow: 0 0 0 4px rgba(168, 24, 64, 0.12);
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}


/* ============================================================
   MONITOR DE CORREOS — clases complementarias
   ============================================================ */

/* —— Stats grid ——————————————————————————————————————————— */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 4px;
}

.stat-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(0,0,0,.55);
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.stat-card--blue  { border-left: 4px solid #a81840; }
.stat-card--green { border-left: 4px solid #16a34a; }
.stat-card--red   { border-left: 4px solid #dc2626; }
.stat-card--gray  { border-left: 4px solid #9ca3af; }

.stat-card--blue  .stat-value { color: #a81840; }
.stat-card--green .stat-value { color: #16a34a; }
.stat-card--red   .stat-value { color: #dc2626; }
.stat-card--gray  .stat-value { color: #9ca3af; }

/* —— Pills con color ———————————————————————————————————— */
.pill--blue  { background: #f7eef1; color: #6b0f2a; border-color: rgba(168, 24, 64, 0.2); }
.pill--green { background: #dcfce7; color: #15803d; border-color: rgba(22,163,74,.2); }
.pill--red   { background: #fee2e2; color: #b91c1c; border-color: rgba(220,38,38,.2); }
.pill--gray  { background: #f3f4f6; color: #4b5563; border-color: rgba(0,0,0,.08); }

/* —— Alert warning ————————————————————————————————————— */
.alert.alert-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
}

/* —— page-header-actions ————————————————————————————————— */
.page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
}

/* —— Timeline —————————————————————————————————————————————— */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: rgba(0,0,0,.08);
}

.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid;
}

.timeline-dot--blue  { background: #f7eef1; border-color: #a81840; }
.timeline-dot--green { background: #dcfce7; border-color: #16a34a; }
.timeline-dot--red   { background: #fee2e2; border-color: #dc2626; }

.timeline-content {
  flex: 1;
  padding-bottom: 4px;
}

.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.timeline-item--alerta .timeline-content {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 8px 12px;
}

/* —— Correo items ————————————————————————————————————————— */
.correo-item {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.03);
  transition: box-shadow .15s ease;
}

.correo-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.07);
}

.correo-item--alerta {
  border-color: #fca5a5;
  background: #fff7f7;
}

.correo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.correo-asunto {
  font-weight: 600;
  font-size: .9rem;
  color: #111827;
  margin-bottom: 4px;
}

.correo-cuerpo {
  font-size: .82rem;
  color: rgba(0,0,0,.62);
  line-height: 1.55;
  white-space: pre-wrap;
  border-left: 3px solid rgba(0,0,0,.08);
  padding-left: 10px;
  margin-top: 6px;
  max-height: 120px;
  overflow: hidden;
  position: relative;
}

.correo-cuerpo::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: linear-gradient(to bottom, transparent, #fff);
  pointer-events: none;
}

.correo-item--alerta .correo-cuerpo::after {
  background: linear-gradient(to bottom, transparent, #fff7f7);
}

/* —— Responsive ————————————————————————————————————————— */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline-header { flex-direction: column; gap: 2px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.4rem; }
}
