/* ============================================================
   Gestor de Contratos – SISTEMA DE GESTIÓN DE CONTRATOS
   Design System & Styles
   ============================================================ */

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

/* ---- Variables ---- */
:root {
  --bg: #080c18;
  --bg2: #0d1117;
  --bg3: #111827;
  --card: rgba(255,255,255,0.04);
  --card-hover: rgba(255,255,255,0.07);
  --sidebar-bg: #0d1117;
  --sidebar-w: 240px;

  --blue: #4f8ef7;
  --blue-dark: #3a7ae4;
  --purple: #7c5ef7;
  --gradient: linear-gradient(135deg, #4f8ef7, #7c5ef7);
  --gradient-glow: linear-gradient(135deg, rgba(79,142,247,.15), rgba(124,94,247,.15));

  --green: #22c55e;
  --yellow: #eab308;
  --orange: #f97316;
  --red: #ef4444;
  --cyan: #06b6d4;
  --gray: #64748b;
  --indigo: #818cf8;

  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;

  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 48px rgba(0,0,0,.5);

  --transition: all .2s ease;
  --font: 'Inter', -apple-system, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
input, textarea, select, button { font-family: inherit; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent; }
*::-webkit-scrollbar { width: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 20% 50%, rgba(79,142,247,.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(124,94,247,.08) 0%, transparent 60%),
              var(--bg);
}
.login-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .12;
  animation: blobFloat 8s ease-in-out infinite;
}
.blob-1 { width: 500px; height: 500px; background: var(--blue); top: -100px; left: -100px; animation-delay: 0s; }
.blob-2 { width: 400px; height: 400px; background: var(--purple); bottom: -80px; right: -80px; animation-delay: -3s; }
.blob-3 { width: 300px; height: 300px; background: #06b6d4; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -6s; }
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(.95); }
}
.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: rgba(13,17,23,.8);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(79,142,247,.08);
  animation: fadeInUp .5s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.logo-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--gradient);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(79,142,247,.3);
}
.logo-text { display: flex; flex-direction: column; }
.logo-company { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.logo-subtitle { font-size: 11px; color: var(--text3); font-weight: 500; letter-spacing: .5px; text-transform: uppercase; }
.login-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.login-desc { font-size: 14px; color: var(--text2); margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 20px; }
.login-hint { margin-top: 24px; text-align: center; font-size: 12px; color: var(--text3); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  display: flex; flex-direction: column; gap: 6px;
}
.form-group label {
  font-size: 13px; font-weight: 500; color: var(--text2);
}
.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text3); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  background: rgba(79,142,247,.06);
  box-shadow: 0 0 0 3px rgba(79,142,247,.12);
}
.form-group select option { background: var(--bg3); color: var(--text); }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--text3); }
.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 44px; }
.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text3); cursor: pointer;
  transition: var(--transition);
}
.toggle-pass:hover { color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer; border: none;
  transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79,142,247,.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(79,142,247,.4);
}
.btn-outline {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-outline:hover { background: rgba(255,255,255,.06); color: var(--text); border-color: var(--border2); }
.btn-danger { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-success { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid rgba(34,197,94,.25); }
.btn-success:hover { background: rgba(34,197,94,.25); }
.btn-ghost { background: transparent; color: var(--text3); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; gap: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
}
.alert-danger { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.25); color: var(--red); }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.25); color: var(--green); }
.alert-warning { background: rgba(234,179,8,.12); border: 1px solid rgba(234,179,8,.25); color: var(--yellow); }
.alert-info { background: rgba(6,182,212,.12); border: 1px solid rgba(6,182,212,.25); color: var(--cyan); }

/* ============================================================
   MAIN APP LAYOUT
   ============================================================ */
.main-app {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
  transition: transform .25s ease;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.sidebar-logo svg { flex-shrink: 0; }
.sidebar-toggle {
  background: none; border: none; color: var(--text3);
  cursor: pointer; padding: 4px; border-radius: 6px;
  display: flex; align-items: center;
  transition: var(--transition);
}
.sidebar-toggle:hover { background: rgba(255,255,255,.08); color: var(--text); }
.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-area { font-size: 12px; color: var(--text3); }
.sidebar-nav {
  flex: 1; padding: 12px 12px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-section {
  font-size: 10px; font-weight: 600; color: var(--text3);
  letter-spacing: .8px; text-transform: uppercase;
  padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text2); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item svg { opacity: .7; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--text); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: rgba(79,142,247,.15); color: var(--blue); }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 99px; min-width: 18px; text-align: center;
}
.nav-badge.nav-badge-count {
  background: rgba(79,142,247,.12);
  border: 1px solid rgba(79,142,247,.25);
  color: var(--blue);
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.btn-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--text3);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover { background: rgba(239,68,68,.1); color: var(--red); }

/* ---- Content wrapper ---- */
.content-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}

/* ---- Header ---- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: rgba(8,12,24,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.page-title { font-size: 18px; font-weight: 700; color: var(--text); }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-date { font-size: 13px; color: var(--text3); }
.notification-bell {
  position: relative; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  transition: var(--transition); color: var(--text2);
}
.notification-bell:hover { background: rgba(255,255,255,.1); color: var(--text); }
.bell-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 99px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* ---- View area ---- */
.view-area {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}
.view { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: var(--transition);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--color, var(--blue));
}
.stat-card:hover { background: var(--card-hover); border-color: var(--border2); }
.stat-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--color, var(--blue)) 15%, transparent);
  color: var(--color, var(--blue)); margin-bottom: 12px; font-size: 18px;
}
.stat-value {
  font-size: 28px; font-weight: 800; color: var(--text);
  letter-spacing: -1px; line-height: 1;
}
.stat-label {
  font-size: 12px; color: var(--text3); margin-top: 4px; font-weight: 500;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }
.table-empty {
  padding: 48px; text-align: center;
  color: var(--text3); font-size: 14px;
}
.table-empty span { display: block; font-size: 36px; margin-bottom: 8px; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
thead tr { border-bottom: 1px solid var(--border2); }
thead th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--text3);
  letter-spacing: .5px; text-transform: uppercase;
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.03); }
tbody td {
  padding: 12px 16px; color: var(--text2);
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
tbody td:first-child { color: var(--text); font-weight: 500; }
.table-actions { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-green { background: rgba(34,197,94,.15); color: var(--green); }
.badge-yellow { background: rgba(234,179,8,.15); color: var(--yellow); }
.badge-orange { background: rgba(249,115,22,.15); color: var(--orange); }
.badge-red { background: rgba(239,68,68,.15); color: var(--red); }
.badge-cyan { background: rgba(6,182,212,.15); color: var(--cyan); }
.badge-gray { background: rgba(100,116,139,.15); color: var(--gray); }
.badge-indigo { background: rgba(129,140,248,.15); color: var(--indigo); }
.badge-blue { background: rgba(79,142,247,.15); color: var(--blue); }
.badge-warning { background: rgba(249,115,22,.15); color: var(--orange); }

/* urgency dot */
.urgency-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.urgency-dot.green { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,.5); }
.urgency-dot.yellow { background: var(--yellow); box-shadow: 0 0 6px rgba(234,179,8,.5); }
.urgency-dot.orange { background: var(--orange); box-shadow: 0 0 6px rgba(249,115,22,.5); }
.urgency-dot.red { background: var(--red); box-shadow: 0 0 6px rgba(239,68,68,.5); animation: pulse 1.5s infinite; }
.urgency-dot.gray { background: var(--gray); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.view-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 8px 14px; min-width: 260px;
  transition: var(--transition);
}
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,142,247,.1); }
.search-box svg { color: var(--text3); flex-shrink: 0; }
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; width: 100%;
}
.search-box input::placeholder { color: var(--text3); }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select-sm {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text2);
  font-size: 13px; padding: 7px 12px; outline: none; cursor: pointer;
  transition: var(--transition);
}
.select-sm:focus { border-color: var(--blue); }
.select-sm option { background: var(--bg3); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}
.modal {
  background: #111827;
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(79,142,247,.1);
  animation: slideUp .2s ease;
}
.modal-lg { max-width: 860px; }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none; color: var(--text3);
  cursor: pointer; padding: 4px; border-radius: 6px;
  transition: var(--transition); display: flex;
}
.modal-close:hover { background: rgba(255,255,255,.08); color: var(--text); }
.modal-body {
  padding: 24px;
  overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border2);
  box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 360px;
  pointer-events: all;
  animation: toastIn .3s ease;
  font-size: 14px;
}
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--yellow); }
.toast-info { border-left: 3px solid var(--blue); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; color: var(--text); font-weight: 500; }
.toast-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px; padding: 0; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

/* ============================================================
   NOTIFICATIONS VIEW
   ============================================================ */
.notif-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,.03); }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.notif-info { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.notif-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* History item */
.hist-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.hist-item:last-child { border-bottom: none; }
.hist-date { color: var(--text3); white-space: nowrap; font-size: 12px; flex-shrink: 0; }
.hist-msg { color: var(--text2); flex: 1; }

/* Anniversaries */
.anniv-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.anniv-item:last-child { border-bottom: none; }
.anniv-item:hover { background: rgba(255,255,255,.03); }
.anniv-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.anniv-info { flex: 1; }
.anniv-name { font-size: 14px; font-weight: 600; color: var(--text); }
.anniv-sub { font-size: 12px; color: var(--text3); }
.anniv-years { font-size: 20px; font-weight: 800; color: var(--blue); text-align: right; }
.anniv-label { font-size: 11px; color: var(--text3); text-align: right; }

/* Contract card upcoming */
.upcoming-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition); cursor: pointer;
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-item:hover { background: rgba(255,255,255,.03); }
.upcoming-info { flex: 1; min-width: 0; }
.upcoming-title { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-sub { font-size: 12px; color: var(--text3); }
.upcoming-days { text-align: right; flex-shrink: 0; }
.days-num { font-size: 20px; font-weight: 800; }
.days-label { font-size: 11px; color: var(--text3); display: block; }

/* Recent activity */
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex-shrink: 0; margin-top: 5px; }
.activity-text { color: var(--text2); flex: 1; }
.activity-time { color: var(--text3); font-size: 12px; white-space: nowrap; }

/* Contract detail */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.detail-value { font-size: 14px; color: var(--text); font-weight: 500; }

/* History table in detail */
.hist-table { width: 100%; font-size: 12px; }
.hist-table th { color: var(--text3); font-weight: 600; padding: 6px 8px; text-align: left; }
.hist-table td { padding: 6px 8px; color: var(--text2); border-top: 1px solid var(--border); }

/* ============================================================
   USER MANAGEMENT
   ============================================================ */
.user-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.user-list-item:last-child { border-bottom: none; }
.user-list-info { flex: 1; }
.user-list-name { font-size: 14px; font-weight: 600; color: var(--text); }
.user-list-sub { font-size: 12px; color: var(--text3); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .notif-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .content-wrapper { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .view-area { padding: 16px; }
}
@media (max-width: 480px) {
  .login-card { padding: 32px 24px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MISC
   ============================================================ */
.divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.text-muted { color: var(--text3); font-size: 13px; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }
.fw-600 { font-weight: 600; }
.color-red { color: var(--red); }
.color-green { color: var(--green); }
.color-yellow { color: var(--yellow); }

/* Solicitudes: ficha y checklist de Responsable */
.sol-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:14px 0; }
.sol-table { width:100%; border-collapse:collapse; font-size:13px; }
.sol-table th,.sol-table td { text-align:left; vertical-align:top; padding:12px; border-bottom:1px solid var(--border); }
.sol-table th { color:var(--text3); }
.sol-check { display:flex; align-items:center; gap:8px; font-size:13px; }
.sol-section { padding:12px; border:1px solid var(--border); border-radius:8px; margin:14px 0; }
.sol-section summary { cursor:pointer; font-weight:600; }
.sol-pre { white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:650px) { .sol-grid { grid-template-columns:1fr; } }


/* Mail status comes from persisted provider confirmations. */
.mail-progress,.mesa-conversation-controls{padding:16px;background:var(--bg-secondary,#f3f6fb);border:1px solid var(--border,#d8e1ee);border-radius:12px;margin:12px 0;display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.mail-progress strong,.mail-progress p,.mail-progress progress{width:100%;margin:0}
.mail-progress progress,.mesa-conversation-controls progress{accent-color:#2459b5;height:10px;width:100%}
.mesa-conversation-controls select{max-width:100%;flex:1;min-width:200px}
#mailHistoryStatus,#mesaRefreshStatus{font-size:.85rem;color:var(--text-secondary,#53627a)}
.mesa-message-notice{font-size:.85rem}

/* Individual notice workspace */
.mesa-notice-original{padding:20px 24px;margin:0 0 24px;background:var(--bg-card,#fff);border:1px solid var(--border,#e1e7ef);border-left:4px solid var(--primary,#2858b9);border-radius:12px}
.mesa-notice-original h2{margin:8px 0}.mesa-notice-original details{margin-top:12px}.mesa-notice-original summary{cursor:pointer;font-weight:600}.mesa-notice-original .sol-pre{max-height:260px;overflow:auto}
