/* ============================================================
   OCA Portal — Estilos Globales
   Paleta: Crimson #C41E5B | Oscuro #1A1A2E | Acento #E8F0FE
   Tipografía: Cormorant Garamond (display) + DM Sans (cuerpo)
   ============================================================ */

:root {
  --crimson:      #C41E5B;
  --crimson-dark: #9E1748;
  --crimson-light:#F3E6EC;
  --dark:         #1A1A2E;
  --dark-2:       #16213E;
  --dark-3:       #0F3460;
  --mid:          #4A4A6A;
  --muted:        #8888A8;
  --border:       #E2E2F0;
  --surface:      #F8F8FC;
  --white:        #FFFFFF;
  --success:      #0D7A5F;
  --success-bg:   #E6F7F3;
  --error:        #C0392B;
  --error-bg:     #FDECEA;
  --warning:      #B7791F;
  --warning-bg:   #FEF3CD;
  --sidebar-w:    240px;
  --radius:       10px;
  --shadow:       0 2px 12px rgba(26,26,46,0.08);
  --shadow-md:    0 4px 24px rgba(26,26,46,0.13);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--dark);
  line-height: 1.6;
}

a { color: var(--crimson); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   BRANDING
   ============================================================ */
.brand-logo {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}
.brand-oca {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--crimson);
  letter-spacing: 2px;
}
.brand-portal {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--white);
  letter-spacing: 1px;
}
.brand-logo.small .brand-oca { font-size: 1.8rem; }
.brand-logo.small .brand-portal { font-size: 1rem; color: var(--muted); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  background: var(--dark);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.login-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.login-brand {
  width: 42%;
  background: linear-gradient(145deg, var(--dark) 0%, var(--dark-3) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 48px;
  position: relative;
  overflow: hidden;
}
.login-brand::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(196,30,91,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.login-brand::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(196,30,91,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.login-brand-inner { position: relative; z-index: 1; }
.brand-tagline { color: rgba(255,255,255,0.4); font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 32px; }
.brand-divider { width: 40px; height: 2px; background: var(--crimson); margin-bottom: 24px; }
.brand-desc { color: rgba(255,255,255,0.6); font-size: 0.95rem; line-height: 1.7; margin-bottom: 32px; }
.brand-features { display: flex; flex-direction: column; gap: 12px; }
.brand-feature { color: rgba(255,255,255,0.55); font-size: 0.88rem; display: flex; align-items: center; gap: 10px; }
.brand-feature span { font-size: 1rem; }
.brand-footer { color: rgba(255,255,255,0.25); font-size: 0.78rem; position: relative; z-index: 1; }

.login-form-panel {
  flex: 1;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.login-form-inner { width: 100%; max-width: 400px; }
.login-header { margin-bottom: 32px; }
.login-header h1 { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 600; color: var(--dark); margin-bottom: 6px; }
.login-header p { color: var(--muted); font-size: 0.9rem; }
.login-links { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--muted); }
.login-links a { color: var(--crimson); }

/* Simple form wrap (recuperar, reset) */
.simple-form-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.simple-form-card { background: var(--white); border-radius: 16px; padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-md); }
.simple-form-card h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; margin: 16px 0 8px; }
.simple-form-card .subtitle { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }
.back-link { color: var(--muted); font-size: 0.85rem; display: inline-block; margin-bottom: 16px; }
.back-link:hover { color: var(--crimson); }

/* ============================================================
   FORMS
   ============================================================ */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.82rem; font-weight: 500; color: var(--mid); letter-spacing: 0.3px; text-transform: uppercase; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group-btn { display: flex; align-items: flex-end; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.93rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px rgba(196,30,91,0.08);
}

.input-password { position: relative; }
.input-password input { padding-right: 44px; }
.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px;
}
.toggle-pass:hover { color: var(--dark); }

.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.88rem; color: var(--mid); }
.check-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--crimson); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  padding: 11px 22px;
  background: var(--crimson);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { background: var(--crimson-dark); text-decoration: none; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  padding: 10px 20px;
  background: var(--white);
  color: var(--dark);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-secondary:hover { border-color: var(--crimson); color: var(--crimson); background: var(--crimson-light); }

.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  font-size: 1rem; border-radius: 6px; transition: background 0.15s;
  color: var(--muted);
}
.btn-icon:hover { background: var(--surface); }
.btn-danger-sm { opacity: 0.6; }
.btn-danger-sm:hover { opacity: 1; background: var(--error-bg); }

.btn-download {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface); color: var(--crimson);
  transition: background 0.15s; font-size: 0.9rem; text-decoration: none;
  border: 1px solid var(--border);
}
.btn-download:hover { background: var(--crimson-light); text-decoration: none; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  border-left: 3px solid;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-error   { background: var(--error-bg);   color: var(--error);   border-color: var(--error);   }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.m-alert { margin: 16px 24px 0; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-page { display: flex; min-height: 100vh; background: var(--surface); }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex; align-items: baseline; gap: 4px;
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-brand .brand-oca { font-size: 1.6rem; }
.sidebar-brand .brand-portal { font-size: 0.9rem; color: rgba(255,255,255,0.4); }

.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--crimson);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.95rem; color: white;
  flex-shrink: 0;
}
.admin-avatar  { background: linear-gradient(135deg, var(--crimson), #8B0D3B); }
.gestor-avatar { background: linear-gradient(135deg, #2563EB, #1D4ED8); }
.sidebar-user-name { font-size: 0.88rem; font-weight: 500; color: var(--white); line-height: 1.2; }
.sidebar-user-role { font-size: 0.75rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-nav { flex: 1; padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  color: rgba(255,255,255,0.55); font-size: 0.88rem; font-weight: 400;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-item:hover, .nav-item.active {
  background: rgba(196,30,91,0.15);
  color: var(--white);
  text-decoration: none;
}
.nav-item.active { color: var(--crimson); font-weight: 500; }

.sidebar-space { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.07); }
.space-label { font-size: 0.75rem; color: rgba(255,255,255,0.35); margin-bottom: 8px; }
.space-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.space-fill { height: 100%; background: var(--crimson); border-radius: 2px; transition: width 0.5s; }
.space-info { font-size: 0.75rem; color: rgba(255,255,255,0.4); }

.sidebar-logout {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 24px;
  color: rgba(255,255,255,0.3); font-size: 0.83rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  transition: color 0.15s;
  text-decoration: none;
}
.sidebar-logout:hover { color: var(--crimson); text-decoration: none; }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--crimson); }
.breadcrumb span { color: var(--border); }
.bc-current { color: var(--dark); font-weight: 500; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; font-weight: 600; }
.page-header p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.badge-count { background: var(--crimson-light); color: var(--crimson); border-radius: 20px; padding: 4px 12px; font-size: 0.82rem; font-weight: 500; }

/* ============================================================
   STATS
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 20px 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat-icon { font-size: 1.5rem; margin-bottom: 10px; }
.stat-value { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 600; color: var(--dark); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================================
   PANELS
   ============================================================ */
.panel { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.panel-header h2 { font-size: 0.95rem; font-weight: 600; }
.link-sm { font-size: 0.82rem; color: var(--crimson); }

.dashboard-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-simple, .table-full {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.table-simple th, .table-full th {
  padding: 12px 24px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.table-simple td, .table-full td {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table-full tbody tr:last-child td { border-bottom: none; }
.table-full tbody tr:hover { background: var(--surface); }

.cell-name { font-weight: 500; color: var(--dark); }
.cell-sub  { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.actions-cell { white-space: nowrap; }
.td-nowrap { white-space: nowrap; }
.td-mono { font-family: monospace; font-size: 0.82rem; color: var(--muted); }
.td-detail { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.82rem; }
.td-empty { text-align: center; color: var(--muted); padding: 32px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 500;
}
.badge-active   { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--error-bg);   color: var(--error);   }
.badge-rol-superadmin { background: #FEF3CD; color: #8B6914; }
.badge-rol-gestor     { background: #EFF6FF; color: #2563EB; }
.badge-rol-cliente    { background: var(--surface); color: var(--mid); border: 1px solid var(--border); }
.badge-resultado-ok       { background: var(--success-bg); color: var(--success); }
.badge-resultado-error    { background: var(--error-bg);   color: var(--error);   }
.badge-resultado-bloqueado{ background: var(--warning-bg); color: var(--warning); }

/* ============================================================
   FILES GRID
   ============================================================ */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.file-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: flex-start; gap: 12px;
  position: relative;
  transition: box-shadow 0.18s, border-color 0.18s;
  text-decoration: none; color: inherit;
}
.file-card:hover { box-shadow: var(--shadow-md); border-color: rgba(196,30,91,0.2); text-decoration: none; }
.folder-card { cursor: pointer; }
.folder-card:hover { background: #FEF9FC; }

.file-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 0.88rem; font-weight: 500; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.file-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }

.empty-state { grid-column: 1/-1; text-align: center; padding: 60px 24px; }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { color: var(--mid); font-size: 0.95rem; }
.empty-state small { color: var(--muted); font-size: 0.82rem; }

/* ============================================================
   CLIENT CARDS
   ============================================================ */
.clients-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.client-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow 0.18s, border-color 0.18s;
  text-decoration: none; color: inherit;
}
.client-card:hover { box-shadow: var(--shadow-md); border-color: rgba(196,30,91,0.2); text-decoration: none; }
.client-avatar {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--crimson); color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 600;
  flex-shrink: 0;
}
.client-info { flex: 1; min-width: 0; }
.client-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-email { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.client-stats { display: flex; gap: 12px; font-size: 0.78rem; color: var(--mid); }
.client-arrow { color: var(--muted); font-size: 1.1rem; }

/* Client banner (vista documentos) */
.client-banner {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.client-banner-avatar {
  width: 44px; height: 44px; border-radius: 10px; background: var(--crimson);
  color: white; display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-weight: 600;
}
.client-banner-info { flex: 1; }
.client-banner-name { font-weight: 600; }
.client-banner-email { font-size: 0.82rem; color: var(--muted); }
.client-banner-space { min-width: 200px; }

/* ============================================================
   LOGS
   ============================================================ */
.log-list { padding: 8px 0; }
.log-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.log-item:last-child { border-bottom: none; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--border); }
.log-ok .log-dot      { background: var(--success); }
.log-error .log-dot   { background: var(--error); }
.log-bloqueado .log-dot { background: var(--warning); }
.log-content { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.log-accion { font-weight: 500; text-transform: capitalize; color: var(--dark); }
.log-user { color: var(--muted); font-size: 0.82rem; }
.log-time { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.log-code { background: var(--surface); padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; border: 1px solid var(--border); }
.log-row-error td { background: #FFF9F9; }
.log-row-bloqueado td { background: #FFFBF0; }

/* ============================================================
   FILTERS
   ============================================================ */
.filter-bar { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 0.82rem;
  background: var(--white); border: 1px solid var(--border); color: var(--mid);
  transition: all 0.15s; cursor: pointer; text-decoration: none;
}
.filter-btn:hover, .filter-btn.active { background: var(--crimson); color: white; border-color: var(--crimson); text-decoration: none; }

.filter-form { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }
.filter-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.filter-row .form-group { flex: 1; min-width: 150px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(26,26,46,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--white); border-radius: 14px;
  width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(26,26,46,0.25);
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); padding: 4px; }
.modal-close:hover { color: var(--dark); }
.modal form { padding: 24px; }
.modal-footer { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   UPLOAD
   ============================================================ */
.upload-drop {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-drop.drag-over { border-color: var(--crimson); background: var(--crimson-light); }
.upload-icon { font-size: 2.5rem; margin-bottom: 10px; }
.upload-drop p { color: var(--mid); font-size: 0.9rem; }
.link-label { color: var(--crimson); cursor: pointer; font-weight: 500; }
.file-selected-name { margin-top: 10px; font-size: 0.85rem; font-weight: 500; color: var(--dark); }

.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin: 12px 0 6px; }
.progress-fill { height: 100%; background: var(--crimson); border-radius: 3px; transition: width 0.3s; width: 0%; }
#upload-status { font-size: 0.82rem; color: var(--muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-cols { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .login-brand { display: none; }
  .login-form-panel { padding: 32px 24px; }
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; }
}

/* ============================================================
   WHATSAPP FLOTANTE
   ============================================================ */
.whatsapp-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 54px;
  height: 54px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.whatsapp-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37,211,102,0.55);
  text-decoration: none;
}
.whatsapp-btn svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

/* ============================================================
   BANNER DE INACTIVIDAD
   ============================================================ */
#inactividad-banner {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: var(--white);
  padding: 14px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.88rem;
  z-index: 99999;
  transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.1);
}
#inactividad-banner.visible {
  bottom: 28px;
}
#inactividad-banner strong {
  color: var(--crimson);
  font-size: 1rem;
}
#btn-seguir-activo {
  background: var(--crimson);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
  white-space: nowrap;
}
#btn-seguir-activo:hover {
  background: var(--crimson-dark);
}

/* ============================================================
   MODAL NOTIFICACIÓN AL CLIENTE
   ============================================================ */
.modal-notificar { max-width: 560px; }

.notif-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.notif-preview-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.notif-icon { font-size: 1.4rem; }
.notif-dest  { font-size: 0.88rem; color: var(--dark); }
.notif-asunto{ font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.notif-archivos-hoy { padding: 14px 18px; min-height: 60px; }

.notif-loading {
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-loading::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--crimson);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.notif-empty {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
  text-align: center;
  padding: 8px 0;
}
.notif-empty small { display: block; font-size: 0.78rem; margin-top: 4px; }

.notif-count {
  font-size: 0.85rem;
  color: var(--mid);
  margin-bottom: 10px;
}

.notif-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notif-file-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  background: var(--white);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.notif-file-name {
  font-size: 0.85rem;
  color: var(--dark);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.notif-file-meta {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
