/* ============================================================
   ProtegeVeicular - CSS Principal
   ============================================================ */

:root {
  --primary: #1a56db;
  --primary-dark: #1342a8;
  --primary-light: #e8f0fe;
  --success: #057a55;
  --success-light: #def7ec;
  --warning: #ff8800;
  --warning-light: #fff3cd;
  --danger: #e02424;
  --danger-light: #fde8e8;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --header-h: 64px;
  --sidebar-w: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
       background: var(--gray-100); color: var(--gray-900); line-height: 1.5; }

/* ===== LOGIN ===== */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f2c5c 0%, #1a56db 50%, #0f2c5c 100%);
}
.login-container {
  background: var(--white); border-radius: var(--radius-lg); padding: 40px;
  width: 100%; max-width: 460px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 30px; }
.logo-icon { font-size: 3rem; display: block; }
.login-logo h1 { color: var(--primary); font-size: 1.8rem; font-weight: 700; }
.login-logo p { color: var(--gray-500); font-size: 0.9rem; }
.login-form { margin-bottom: 20px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--gray-700); }
.login-form input {
  width: 100%; padding: 12px 14px; border: 2px solid var(--gray-200);
  border-radius: var(--radius); font-size: 1rem; transition: border-color .2s;
}
.login-form input:focus { outline: none; border-color: var(--primary); }
.login-error { background: var(--danger-light); color: var(--danger); padding: 10px 14px;
               border-radius: var(--radius); margin-bottom: 14px; font-size: 0.9rem; }
.btn-login {
  width: 100%; padding: 14px; background: var(--primary); color: var(--white);
  border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.btn-login:hover { background: var(--primary-dark); }
.login-demo { background: var(--gray-50); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.login-demo p { margin-bottom: 10px; font-size: 0.85rem; color: var(--gray-700); }
.demo-users { display: flex; flex-direction: column; gap: 6px; }
.demo-user {
  padding: 8px 12px; background: var(--white); border-radius: 6px; font-size: 0.8rem;
  cursor: pointer; border: 1px solid var(--gray-200); transition: background .2s;
  display: flex; align-items: center; gap: 8px;
}
.demo-user:hover { background: var(--primary-light); }
.badge { padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge-admin { background: #7c3aed; color: white; }
.badge-fin { background: var(--success); color: white; }
.badge-ate { background: var(--warning); color: white; }
.login-footer { text-align: center; font-size: 0.8rem; color: var(--gray-500); }

/* ===== HEADER ===== */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--primary); color: white; display: flex; align-items: center;
  justify-content: space-between; padding: 0 16px; z-index: 1000;
  box-shadow: var(--shadow-md);
}
.header-left { display: flex; align-items: center; gap: 14px; }
.sidebar-toggle {
  background: none; border: none; color: white; font-size: 1.3rem; cursor: pointer;
  padding: 6px 10px; border-radius: 6px; transition: background .2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.15); }
.header-logo { display: flex; align-items: center; gap: 8px; }
.logo-icon-sm { font-size: 1.5rem; }
.logo-text { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.5px; }

.header-center { flex: 1; max-width: 500px; margin: 0 20px; position: relative; }
.global-search { position: relative; }
.global-search input {
  width: 100%; padding: 8px 14px; border-radius: 20px; border: none;
  background: rgba(255,255,255,0.2); color: white; font-size: 0.9rem;
  outline: none; transition: background .2s;
}
.global-search input::placeholder { color: rgba(255,255,255,0.7); }
.global-search input:focus { background: rgba(255,255,255,0.3); }
.search-results {
  position: absolute; top: 110%; left: 0; right: 0; background: white;
  border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 100;
  max-height: 300px; overflow-y: auto; color: var(--gray-900);
}
.search-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--gray-100); font-size: 0.9rem; }
.search-item:hover { background: var(--primary-light); }

.header-right { display: flex; align-items: center; gap: 12px; position: relative; }
.notification-bell {
  cursor: pointer; padding: 8px 10px; border-radius: 8px;
  transition: background .2s; position: relative; font-size: 1.1rem;
}
.notification-bell:hover { background: rgba(255,255,255,0.15); }
.notif-badge {
  position: absolute; top: 2px; right: 2px; background: var(--danger);
  color: white; font-size: 0.65rem; padding: 1px 5px; border-radius: 10px; font-weight: bold;
}
.notif-dropdown {
  position: absolute; top: 110%; right: 40px; background: white; color: var(--gray-900);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 320px; z-index: 200;
}
.notif-dropdown h4 { padding: 12px 16px; border-bottom: 1px solid var(--gray-200); font-size: 0.95rem; }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: 0.85rem; }
.notif-item:hover { background: var(--gray-50); }

.user-info { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 10px; border-radius: 8px; transition: background .2s; }
.user-info:hover { background: rgba(255,255,255,0.15); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary); font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.user-details { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; opacity: 0.85; }
.user-menu {
  position: absolute; top: 110%; right: 0; background: white; color: var(--gray-900);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 200px; z-index: 200;
  padding: 6px 0;
}
.user-menu-item { padding: 10px 16px; cursor: pointer; font-size: 0.9rem; transition: background .2s; }
.user-menu-item:hover { background: var(--gray-50); }
.user-menu-item.logout { color: var(--danger); }
.user-menu hr { border: none; border-top: 1px solid var(--gray-200); margin: 4px 0; }

/* ===== LAYOUT ===== */
.main-app { display: flex; flex-direction: column; min-height: 100vh; }
.app-layout { display: flex; margin-top: var(--header-h); min-height: calc(100vh - var(--header-h)); }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w); background: #1e2a3a; color: #cbd5e1;
  position: fixed; top: var(--header-h); left: 0; bottom: 0;
  overflow-y: auto; transition: transform .3s; z-index: 900;
}
.sidebar.hidden { transform: translateX(-100%); }
.sidebar-nav { padding: 16px 0; }
.nav-section { margin-bottom: 8px; }
.nav-section-title {
  padding: 8px 16px; font-size: 0.7rem; font-weight: 700; letter-spacing: 1px;
  color: #64748b; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  text-decoration: none; color: #94a3b8; font-size: 0.9rem; font-weight: 500;
  transition: background .2s, color .2s; position: relative; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active { background: var(--primary); color: white; border-right: 3px solid #60a5fa; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: white;
  font-size: 0.7rem; padding: 1px 6px; border-radius: 10px; font-weight: bold;
}
.sidebar-footer { padding: 16px; text-align: center; color: #475569; font-size: 0.75rem; border-top: 1px solid #334155; }

/* ===== CONTEÚDO ===== */
.main-content {
  flex: 1; margin-left: var(--sidebar-w); padding: 24px;
  min-height: calc(100vh - var(--header-h)); transition: margin .3s;
}
.main-content.expanded { margin-left: 0; }
.module-content { display: none; }
.module-content.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== ENTREGA & REVENDA ===== */
.pro-card { border: 1px solid #e2e8f0; background: #ffffff; box-shadow: var(--shadow); }
.pro-card.danger { border-color: #fecaca; background: #fff7f7; }
.muted { color: #64748b; font-size: 0.82rem; }
.delivery-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.delivery-links { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.delivery-link { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.delivery-link small { color: #94a3b8; font-size: 0.75rem; display: block; }
.delivery-value { font-weight: 600; color: #1e293b; font-size: 0.85rem; word-break: break-all; }
.delivery-checklist { margin-top: 12px; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 10px; padding: 12px; }
.delivery-checklist h4 { font-size: 0.9rem; margin-bottom: 6px; }
.delivery-checklist ul { padding-left: 18px; font-size: 0.82rem; color: #475569; display: grid; gap: 6px; }
.checklist-grid { display: grid; gap: 6px; font-size: 0.82rem; color: #475569; }
.checklist-grid label { display: flex; align-items: center; gap: 8px; }

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

/* ===== MODULE HEADER ===== */
.module-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.module-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.module-subtitle { color: var(--gray-500); font-size: 0.9rem; }

/* ===== CARDS GRID ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
  border-left: 4px solid var(--primary);
}
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.purple { border-left-color: #7c3aed; }
.stat-icon { font-size: 2rem; }
.stat-info { flex: 1; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: 0.8rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-change { font-size: 0.8rem; margin-top: 2px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===== CHARTS ===== */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-card { background: var(--white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.chart-card h3 { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin-bottom: 16px; }

/* ===== DASH BOTTOM ===== */
.dash-bottom { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dash-list-card { background: var(--white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.dash-list-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; color: var(--gray-700); }
.dash-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 0.85rem; }
.dash-item:last-child { border-bottom: none; }
.dash-alert { padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; font-size: 0.85rem; }
.dash-alert.warning { background: var(--warning-light); color: #92400e; }
.dash-alert.danger { background: var(--danger-light); color: var(--danger); }
.dash-alert.info { background: var(--primary-light); color: var(--primary-dark); }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select {
  padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: 0.9rem; background: var(--white); outline: none; transition: border-color .2s;
}
.filter-bar input { flex: 1; min-width: 200px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }

/* ===== TABELAS ===== */
.table-container { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--gray-50); }
.data-table th { padding: 12px 14px; text-align: left; font-size: 0.8rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; border-bottom: 2px solid var(--gray-200); }
.data-table td { padding: 12px 14px; font-size: 0.9rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== STATUS BADGES ===== */
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.status-ativo, .status-pago, .status-aprovado, .status-finalizado { background: var(--success-light); color: var(--success); }
.status-cancelado, .status-negado { background: var(--danger-light); color: var(--danger); }
.status-inadimplente, .status-atrasado { background: var(--warning-light); color: #b45309; }
.status-pendente { background: #e0f2fe; color: #0369a1; }
.status-aberto { background: var(--danger-light); color: var(--danger); }
.status-analise { background: var(--warning-light); color: #92400e; }
.cat-carro { background: #dbeafe; color: #1e40af; }
.cat-moto { background: #fce7f3; color: #9d174d; }
.cat-caminhao { background: #f3e8ff; color: #6b21a8; }

/* ===== BOTÕES ===== */
.btn-primary { padding: 8px 16px; background: var(--primary); color: white; border: none; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: background .2s, transform .1s; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-success { padding: 8px 16px; background: var(--success); color: white; border: none; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: background .2s; }
.btn-success:hover { background: #046042; }
.btn-secondary { padding: 8px 16px; background: var(--gray-200); color: var(--gray-700); border: none; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: background .2s; }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { padding: 8px 16px; background: var(--danger); color: white; border: none; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.btn-warning { padding: 8px 16px; background: var(--warning); color: white; border: none; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.btn-whatsapp { padding: 10px 20px; background: #25d366; color: white; border: none; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; cursor: pointer; flex: 1; }
.btn-email { padding: 10px 20px; background: var(--primary); color: white; border: none; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; cursor: pointer; flex: 1; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.action-btns { display: flex; gap: 4px; flex-wrap: wrap; }

/* ===== PAGINAÇÃO ===== */
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.pagination-info { font-size: 0.85rem; color: var(--gray-500); }
.pagination-btns { display: flex; gap: 4px; }
.page-btn { padding: 6px 12px; border: 1px solid var(--gray-200); background: white; border-radius: 6px; cursor: pointer; font-size: 0.85rem; transition: all .2s; }
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 5px; color: var(--gray-700); font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius); font-size: 0.9rem; transition: border-color .2s;
  background: var(--white); font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* ===== INADIMPLÊNCIA ===== */
.alert-amarelo { color: #b45309; }
.alert-laranja { color: #c2410c; }
.alert-vermelho { color: var(--danger); font-weight: 700; }
.dias-badge { padding: 3px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }
.dias-5 { background: var(--warning-light); color: #92400e; }
.dias-15 { background: #fef3c7; color: #92400e; }
.dias-30 { background: var(--danger-light); color: var(--danger); }

/* ===== DOCUMENTOS ===== */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.doc-card { background: var(--white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); text-align: center; cursor: pointer; transition: transform .2s, box-shadow .2s; border: 2px solid transparent; }
.doc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.doc-card-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.doc-card h4 { font-size: 0.95rem; font-weight: 600; color: var(--gray-900); margin-bottom: 6px; }
.doc-card p { font-size: 0.8rem; color: var(--gray-500); }
.doc-preview { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 0; overflow: hidden; }
.doc-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.doc-content { padding: 24px; min-height: 400px; font-family: 'Times New Roman', serif; line-height: 1.8; }

/* ===== SEGURANÇA ===== */
.security-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; }
.security-card { background: var(--white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.security-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; color: var(--gray-700); }
.log-list { max-height: 400px; overflow-y: auto; }
.log-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 0.83rem; }
.log-item:last-child { border-bottom: none; }
.log-time { color: var(--gray-500); white-space: nowrap; }
.log-action { color: var(--gray-700); flex: 1; }
.log-user { color: var(--primary); font-weight: 500; white-space: nowrap; }
.backup-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 0.9rem; }

/* ===== RELATÓRIOS ===== */
.report-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.report-tab { padding: 8px 16px; background: var(--gray-200); border: none; border-radius: 6px; cursor: pointer; font-size: 0.9rem; transition: all .2s; }
.report-tab.active { background: var(--primary); color: white; }
.report-filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.report-filters input { padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 0.9rem; }
.report-content { background: var(--white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.report-header { text-align: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--primary); }
.report-header h2 { color: var(--primary); font-size: 1.4rem; }
.report-header p { color: var(--gray-500); font-size: 0.9rem; }
.report-summary { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.report-sum-item { background: var(--primary-light); padding: 12px 20px; border-radius: var(--radius); flex: 1; min-width: 150px; }
.report-sum-item span { display: block; font-size: 0.8rem; color: var(--primary); font-weight: 600; }
.report-sum-item strong { font-size: 1.3rem; color: var(--primary-dark); }

/* ===== MINI CHARTS ===== */
.mini-chart{display:grid;grid-template-columns:repeat(12,1fr);gap:6px;align-items:end;height:140px;background:#f8fafc;padding:10px;border-radius:10px;border:1px solid #e5e7eb}
.mini-bar{background:var(--primary);border-radius:6px 6px 0 0;display:block;min-height:6px;position:relative}
.mini-bar span{position:absolute;bottom:-20px;left:50%;transform:translateX(-50%);font-size:.7rem;color:#64748b;white-space:nowrap}
.bar-list{display:grid;gap:6px}
.bar-row{display:grid;grid-template-columns:140px 1fr 90px;gap:8px;align-items:center}
.bar-track{height:12px;background:#e2e8f0;border-radius:999px;overflow:hidden}
.bar-fill{height:100%;background:var(--primary)}

/* ===== COMUNICAÇÃO ===== */
.comm-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-bottom: 24px; }
.comm-templates { background: var(--white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.comm-templates h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; color: var(--gray-700); }
.template-item { padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: all .2s; font-size: 0.85rem; }
.template-item:hover { border-color: var(--primary); background: var(--primary-light); }
.template-item h5 { font-size: 0.85rem; margin-bottom: 4px; }
.template-item p { font-size: 0.78rem; color: var(--gray-500); }
.comm-send { background: var(--white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.comm-send h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; color: var(--gray-700); }
.comm-buttons { display: flex; gap: 10px; margin-top: 10px; }
.comm-history { background: var(--white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.comm-history h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; color: var(--gray-700); }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 14px 20px; border-radius: var(--radius); color: white; font-size: 0.9rem; font-weight: 500; box-shadow: var(--shadow-lg); min-width: 260px; max-width: 380px; animation: slideIn .3s ease; display: flex; align-items: center; gap: 10px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--primary); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .charts-grid { grid-template-columns: 1fr; }
  .dash-bottom { grid-template-columns: 1fr 1fr; }
  .security-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .dash-bottom { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .span-3 { grid-column: span 2; }
  .comm-grid { grid-template-columns: 1fr; }
  .security-grid { grid-template-columns: 1fr; }
  .logo-text { display: none; }
}
@media (max-width: 600px) {
  .main-content { padding: 16px; }
  .module-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { flex-direction: column; }
  .filter-bar input { min-width: unset; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .header-center { display: none; }
  .charts-grid { display: none; }
  .action-btns .btn-primary:not(:first-child) { display: none; }
}
