:root {
  --primary: #231942;
  --primary-light: #F2E8F2;
  --accent: #7ED4C8;
  --beige: #C4B2AC;
  --lavender: #F2E8F2;
  --peach: #FCEEE6;
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #7ED4C8;
  --info-light: #d5f2ee;
  --bg: #F7F3F7;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --sidebar-bg: #231942;
  --sidebar-text: #C4B2AC;
  --sidebar-active: #7ED4C8;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ── LOGIN ── */
.login-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #150E28 0%, #231942 50%, #2D1F5E 100%);
}
.login-card {
  background: var(--surface); border-radius: 16px; padding: 48px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-md);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 24px; margin-top: 8px; }
.login-logo p { color: var(--text-muted); font-size: 14px; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border: none; border-radius: var(--radius); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1a1233; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #047857; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-icon { background: transparent; border: none; padding: 8px; border-radius: 50%; cursor: pointer; color: var(--text-muted); }
.btn-icon:hover { background: var(--bg); }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── LAYOUT ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 260px;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; z-index: 100;
  transition: transform 0.3s;
}
.sidebar.collapsed { transform: translateX(-260px); }
.sidebar-header {
  display: flex; align-items: center; gap: 12px; padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header span:first-child { font-size: 28px; color: var(--accent); }
.sidebar-title { font-size: 18px; font-weight: 700; color: white; font-family: 'Inconsolata', monospace; text-transform: lowercase; letter-spacing: 1px; }
.sidebar-menu { list-style: none; flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-menu li {
  display: flex; align-items: center; gap: 12px; padding: 10px 24px;
  cursor: pointer; transition: all 0.2s; font-size: 14px; color: var(--sidebar-text);
}
.sidebar-menu li.sidebar-section {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,0.55); padding: 14px 24px 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  -webkit-user-select: none; user-select: none;
}
.sidebar-menu li.sidebar-section:hover { color: white; }
.sidebar-menu li.sidebar-section .chevron {
  font-size: 16px; transition: transform 0.2s; opacity: 0.7;
}
.sidebar-menu li.sidebar-section.collapsed .chevron { transform: rotate(-90deg); }
.sidebar-menu li.sidebar-hidden { display: none !important; }
.sidebar-menu li.sidebar-hidden-perm { display: none !important; }
.sidebar-menu li:hover:not(.sidebar-section) { background: rgba(255,255,255,0.05); color: white; }
.sidebar-menu li.active { background: var(--sidebar-active); color: var(--primary); font-weight: 600; border-radius: 0; }
.sidebar-menu li .material-icons-round { font-size: 20px; }

/* Submenú anidado (Clientes > Propietarios / Inquilinos) */
.sidebar-menu li.has-submenu .submenu-chevron {
  font-size: 18px; opacity: 0.6; transition: transform 0.2s; margin-left: auto;
}
.sidebar-menu li.has-submenu.open .submenu-chevron { transform: rotate(180deg); opacity: 1; }
.sidebar-menu li.submenu-item {
  padding-left: 56px; font-size: 13px; color: rgba(255,255,255,0.75);
  display: none;
}
.sidebar-menu li.submenu-item .material-icons-round { font-size: 16px; opacity: 0.75; }
.sidebar-menu li.submenu-item.submenu-visible { display: flex; }
.sidebar-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer .btn { width: 100%; justify-content: flex-start; }

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: calc(100% - 260px);
  max-width: calc(100% - 260px);
  transition: margin-left 0.3s, width 0.3s, max-width 0.3s;
}
.sidebar.collapsed + .main-content {
  margin-left: 0;
  width: 100%;
  max-width: 100%;
}

.topbar {
  display: flex; align-items: center; gap: 16px; padding: 16px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 18px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.admin-name { font-size: 13px; color: var(--text-muted); }

/* ── Isotipo de marca SeguRent (reemplaza el ícono shield) ── */
.sr-logo {
  display: inline-block;
  background-color: #7ED4C8;
  -webkit-mask: url('../img/segurent-mark.png') no-repeat center / contain;
  mask: url('../img/segurent-mark.png') no-repeat center / contain;
}

.content {
  padding: 24px;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
}

/* ── STATS CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); padding: 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center;
}
.stat-icon .material-icons-round { font-size: 24px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.cyan { background: var(--info-light); color: var(--info); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── CARDS / PANELS ── */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 24px;
  overflow: hidden;
  max-width: 100%;
}
.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; }
.card-body { padding: 20px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ── TABLE ── */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
thead th {
  text-align: left; padding: 10px 16px; background: var(--bg);
  font-weight: 600; color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
  position: sticky; top: 0;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-green { background: var(--success-light); color: var(--success); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-gray { background: #f1f5f9; color: var(--text-muted); }
.badge-cyan { background: var(--info-light); color: var(--info); }

/* ── TOOLBAR ── */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; max-width: 100%; }
.toolbar .search-input {
  flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; font-family: inherit;
}
.toolbar .search-input:focus { outline: none; border-color: var(--primary); }
.toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--surface); border-radius: 12px; width: 90%; max-width: 600px;
  max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-md);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .material-icons-round { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ── ACTIVITY TIMELINE ── */
.activity-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
}
.activity-text { font-size: 13px; }
.activity-time { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ── RESPONSIVE ── */

/* Tablet landscape / small desktop */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .stat-value { font-size: 24px; }
  .content { padding: 20px; }
}

/* Tablet portrait */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; width: calc(100% - 220px); max-width: calc(100% - 220px); }
  .sidebar-header { padding: 16px 18px; }
  .sidebar-menu li { padding: 9px 18px; font-size: 13px; }
  .sidebar-footer { padding: 12px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* Mobile landscape / small tablet */
@media (max-width: 768px) {
  .sidebar { 
    transform: translateX(-260px); width: 260px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; width: 100% !important; max-width: 100% !important; }

  .topbar { padding: 12px 16px; gap: 12px; }
  .topbar h2 { font-size: 16px; }
  .admin-name { display: none; }

  .content { padding: 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 14px; gap: 12px; }
  .stat-icon { width: 40px; height: 40px; border-radius: 10px; }
  .stat-icon .material-icons-round { font-size: 20px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }

  .grid-2 { grid-template-columns: 1fr; gap: 16px; }

  .card-header { padding: 12px 16px; }
  .card-header h3 { font-size: 14px; }
  .card-body { padding: 12px 16px; }

  .form-row { grid-template-columns: 1fr; }

  .toolbar { gap: 8px; }
  .toolbar .search-input { min-width: 100%; }
  .toolbar select { flex: 1; min-width: 0; }
  .toolbar .btn { width: 100%; justify-content: center; }

  thead th { padding: 8px 10px; font-size: 11px; }
  tbody td { padding: 10px; font-size: 12px; }

  .modal { width: 95%; max-width: none; margin: 8px; border-radius: 10px; max-height: 90vh; }
  .modal-header { padding: 12px 16px; }
  .modal-body { padding: 16px; }

  .badge { font-size: 10px; padding: 2px 8px; }

  .empty-state { padding: 40px 16px; }
  .empty-state .material-icons-round { font-size: 36px; }

  .activity-item { padding: 10px 0; gap: 10px; }
  .activity-text { font-size: 12px; }
  .activity-time { font-size: 10px; }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .login-card { padding: 28px 20px; margin: 16px; border-radius: 12px; }
  .login-logo h1 { font-size: 20px; }
  .login-logo .material-icons-round { font-size: 36px !important; }

  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { flex-direction: row; padding: 12px 14px; }

  .content { padding: 12px; }
  .topbar { padding: 10px 12px; }
  .topbar h2 { font-size: 15px; }

  .card { margin-bottom: 16px; border-radius: 6px; }
  .card-header { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .card-header .btn { font-size: 11px; padding: 3px 8px; }
  .card-body { padding: 10px 12px; }

  thead th { padding: 6px 8px; font-size: 10px; letter-spacing: 0; }
  tbody td { padding: 8px; font-size: 11px; }

  .form-group label { font-size: 12px; }
  .form-group input, .form-group select, .form-group textarea { 
    padding: 8px 10px; font-size: 13px; 
  }
}

/* ── PLANIFICACIÓN v2: Nuevos componentes ── */

/* Global Search */
.global-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 12px;
  gap: 6px;
  min-width: 260px;
}
.global-search-wrapper .material-icons-round { font-size: 18px; color: var(--text-muted); }
.global-search-wrapper input {
  border: none; background: transparent; color: var(--text);
  font-size: 13px; outline: none; width: 100%; padding: 4px 0;
}
.global-search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 0 0 8px 8px; max-height: 320px; overflow-y: auto;
  z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.gsr-section { padding: 8px 14px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); border-top: 1px solid var(--border); }
.gsr-item { padding: 8px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.gsr-item:hover { background: rgba(126,212,200,0.08); }
.gsr-item .material-icons-round { font-size: 16px; color: var(--primary); }

/* Kanban Pipeline */
.pipeline-kanban {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px;
}
.kanban-column {
  min-width: 220px; max-width: 260px; flex-shrink: 0;
  background: var(--bg-card); border-radius: 12px;
  border: 1px solid var(--border);
}
.kanban-header {
  padding: 12px 14px; font-weight: 600; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.kanban-cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  padding: 12px; background: var(--bg-hover); border-radius: 8px;
  cursor: pointer; border: 1px solid transparent; transition: border-color 0.2s;
}
.kanban-card:hover { border-color: var(--primary); }
.kanban-card-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }

/* Reports Grid */
.reports-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.report-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  display: flex; flex-direction: column; gap: 8px;
}
.report-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.report-card h3 { margin: 0; font-size: 16px; }
.report-card p { color: var(--text-muted); font-size: 13px; margin: 0; flex: 1; }
.report-card .btn { margin-top: 8px; align-self: flex-start; }

/* Evita recorte de menús desplegables de descarga dentro de tarjetas de reportes */
.report-export-card {
  overflow: visible;
}
.report-export-card .card-body {
  overflow: visible;
}

/* Detail Grid */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 16px;
}
.detail-grid > div { padding: 4px 0; font-size: 13px; }
.detail-grid strong { color: var(--text-muted); font-weight: 500; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }

/* Progress Bar */
.progress-bar {
  width: 80px; height: 6px; background: var(--bg-hover);
  border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px;
}
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }
.progress-fill.warning { background: #FF9800; }
.progress-fill.danger { background: #f44336; }

/* Text colors */
.text-red { color: #f44336 !important; }
.text-green { color: #4CAF50 !important; }

/* Btn danger */
.btn-danger { background: #f44336; color: #fff; }
.btn-danger:hover { background: #d32f2f; }

/* Small buttons */
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-sm .material-icons-round { font-size: 16px; }

@media (max-width: 768px) {
  .global-search-wrapper { display: none; }
  .pipeline-kanban { flex-direction: column; }
  .kanban-column { min-width: 100%; max-width: 100%; }
  .reports-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

  .btn { padding: 7px 12px; font-size: 12px; }
  .btn-block { padding: 10px; font-size: 14px; }
  .btn-sm { padding: 3px 8px; font-size: 11px; }

  .modal { margin: 4px; border-radius: 8px; }
  .modal-header h3 { font-size: 14px; }

  .toast-container { top: 8px; right: 8px; left: 8px; }
  .toast { padding: 10px 14px; font-size: 12px; }
}

/* Sidebar overlay backdrop for mobile */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 99; opacity: 0; transition: opacity 0.3s;
}
.sidebar-backdrop.visible { display: block; opacity: 1; }

/* Touch-friendly targets for mobile */
@media (hover: none) and (pointer: coarse) {
  .sidebar-menu li { padding: 14px 24px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 32px; padding: 6px 12px; }
  tbody td { padding: 14px 10px; }
  .form-group input, .form-group select, .form-group textarea { min-height: 44px; }
}

/* ── LOADING ── */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 300; }
.toast {
  background: var(--surface); padding: 12px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow-md); margin-bottom: 8px; font-size: 13px;
  display: flex; align-items: center; gap: 8px; animation: slideIn 0.3s;
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Email Messaging: selector destinatarios ── */
.email-msg-body { padding: 20px; }
.email-msg-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.email-recipient-select-wrap { margin-bottom: 12px; }
.email-recipient-select-wrap .email-input {
  background: var(--surface);
  cursor: pointer;
}

.recipient-list-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
  background: var(--surface);
}
.recipient-list-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.recipient-list-toolbar input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.recipient-list-items {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.recipient-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  margin: 0;
}
.recipient-row:last-child { border-bottom: none; }
.recipient-row:hover { background: var(--lavender); }
.recipient-row input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}
.recipient-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.recipient-main strong {
  font-size: 13px;
  color: var(--text);
  line-height: 1.2;
}
.recipient-main small {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipient-qualified {
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-light);
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.email-input,
.email-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.email-textarea { resize: vertical; }
.email-help {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.email-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.email-status {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .email-msg-body { padding: 14px; }
  .recipient-list-toolbar { grid-template-columns: 1fr; }
  .email-actions { flex-direction: column; align-items: stretch; }
  .email-actions .btn { width: 100%; justify-content: center; }
}
