  :root {
    --bg:      #0b0e1a;
    --bg2:     #111827;
    --bg3:     #1c2333;
    --border:  #1f2d45;
    --text:    #e8edf5;
    --muted:   #6b7a99;
    --green:   #10b981;
    --red:     #f43f5e;
    --blue:    #3b82f6;
    --indigo:  #6366f1;
    --purple:  #a855f7;
    --yellow:  #f59e0b;
    --cyan:    #06b6d4;
    --radius:  14px;
    --shadow:  0 4px 24px rgba(0,0,0,.45);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  }

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

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    min-height: 100vh;
    line-height: 1.5;
  }

  /* ══ SCROLLBAR ══════════════════════════════════════════ */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: var(--bg2); }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--muted); }

  /* ══ HEADER ═════════════════════════════════════════════ */
  header {
    background: rgba(17,24,39,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  header .logo {
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    letter-spacing: -.3px;
  }
  header nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
  header nav::-webkit-scrollbar { display: none; }
  header nav button {
    background: none;
    border: none;
    color: var(--muted);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all .18s;
    letter-spacing: .01em;
  }
  header nav button:hover { color: var(--text); background: rgba(255,255,255,.06); }
  header nav button.active {
    color: #93c5fd;
    background: rgba(59,130,246,.12);
    font-weight: 600;
  }
  .wa-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
  .wa-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
  .wa-dot.online { background: var(--green); box-shadow: 0 0 8px rgba(16,185,129,.6); }
  .user-info { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
  .btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    transition: all .18s;
  }
  .btn-logout:hover { color: var(--red); border-color: var(--red); background: rgba(244,63,94,.06); }

  /* ══ MÊS NAV ════════════════════════════════════════════ */
  #month-nav {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
  }
  #month-nav button {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 16px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    transition: all .18s;
  }
  #month-nav button:hover { background: var(--border); color: #fff; }
  #month-nav button#btn-hoje { color: #93c5fd; border-color: rgba(59,130,246,.4); background: rgba(59,130,246,.08); }
  #month-label { font-size: 15px; font-weight: 700; min-width: 170px; text-align: center; letter-spacing: -.2px; }

  /* ══ MAIN ═══════════════════════════════════════════════ */
  main { max-width: 1140px; margin: 0 auto; padding: 24px; }
  .tab { display: none; }
  .tab.active { display: block; }

  /* ══ CARDS ══════════════════════════════════════════════ */
  .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
  .card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    position: relative;
    overflow: hidden;
    transition: transform .18s, box-shadow .18s;
  }
  .card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--indigo));
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .card-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; margin-bottom: 10px; }
  .card-value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
  .card-value.green { color: var(--green); }
  .card-value.red { color: var(--red); }
  .card-value.blue { color: #60a5fa; }

  /* ══ SECTION ════════════════════════════════════════════ */
  .section {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
  }
  .section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
  .section-title { font-size: 15px; font-weight: 700; letter-spacing: -.1px; }

  /* ══ FORMS ══════════════════════════════════════════════ */
  .form-row { display: flex; gap: 12px; flex-wrap: wrap; }
  .form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 120px; }
  .form-group label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }
  input, select, textarea {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
  }
  input:focus, select:focus, textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  }
  select option { background: var(--bg3); }
  textarea { resize: vertical; min-height: 70px; }

  /* ══ BUTTONS ════════════════════════════════════════════ */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    transition: all .18s;
    white-space: nowrap;
    letter-spacing: .01em;
  }
  .btn:active { transform: scale(.97); }
  .btn-primary { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; box-shadow: 0 2px 12px rgba(59,130,246,.35); }
  .btn-primary:hover { box-shadow: 0 4px 20px rgba(59,130,246,.5); filter: brightness(1.1); }
  .btn-green { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 2px 10px rgba(16,185,129,.3); }
  .btn-green:hover { filter: brightness(1.1); }
  .btn-red { background: transparent; color: var(--red); border: 1px solid rgba(244,63,94,.4); }
  .btn-red:hover { background: rgba(244,63,94,.1); border-color: var(--red); }
  .btn-ghost { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
  .btn-ghost:hover { background: var(--border); }
  .btn-purple { background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; box-shadow: 0 2px 10px rgba(168,85,247,.3); }
  .btn-purple:hover { filter: brightness(1.1); }
  .btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

  /* ══ TABLE ══════════════════════════════════════════════ */
  .table-wrap { overflow-x: auto; border-radius: 10px; }
  table { width: 100%; border-collapse: collapse; }
  thead { background: rgba(255,255,255,.02); }
  th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  td { padding: 12px 14px; border-bottom: 1px solid rgba(31,45,69,.6); font-size: 13px; }
  tr:last-child td { border-bottom: none; }
  tbody tr { transition: background .12s; }
  tbody tr:hover td { background: rgba(59,130,246,.04); }
  .badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
  }
  .badge-green { background: rgba(16,185,129,.12); color: #34d399; }
  .badge-red { background: rgba(244,63,94,.12); color: #fb7185; }
  .badge-blue { background: rgba(59,130,246,.12); color: #93c5fd; }
  .badge-yellow { background: rgba(245,158,11,.12); color: #fcd34d; }
  .badge-purple { background: rgba(168,85,247,.12); color: #c084fc; }

  /* ══ PROGRESS ═══════════════════════════════════════════ */
  .progress { background: var(--bg3); border-radius: 100px; height: 6px; overflow: hidden; margin-top: 10px; }
  .progress-bar { height: 100%; border-radius: 100px; transition: width .6s ease; }

  /* ══ FILTERS ════════════════════════════════════════════ */
  .filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
  .filters input, .filters select { min-width: 0; flex: 1; }

  /* ══ RELATÓRIO ══════════════════════════════════════════ */
  .rel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
  .cat-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(31,45,69,.6); }
  .cat-item:last-child { border-bottom: none; }
  .cat-bar { flex: 1; }
  .cat-name { font-size: 13px; margin-bottom: 6px; display: flex; justify-content: space-between; font-weight: 500; }
  .rel-periodo-wrap { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
  .rel-periodo-btn {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 7px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    transition: all .18s;
    white-space: nowrap;
  }
  .rel-periodo-btn:hover { color: var(--text); border-color: rgba(59,130,246,.5); }
  .rel-periodo-btn.active { background: rgba(59,130,246,.15); color: #93c5fd; border-color: rgba(59,130,246,.5); font-weight: 600; }
  .rel-periodo-label { font-size: 12px; color: var(--muted); margin-bottom: 18px; }

  /* ══ ALERTAS ════════════════════════════════════════════ */
  .alerta-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: border-color .18s;
  }
  .alerta-item:hover { border-color: rgba(59,130,246,.3); }

  /* ══ CHAT ═══════════════════════════════════════════════ */
  .chat-box {
    height: 360px;
    overflow-y: auto;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
  }
  .chat-msg { max-width: 78%; padding: 10px 16px; border-radius: 16px; font-size: 13px; line-height: 1.55; }
  .chat-msg.user { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; box-shadow: 0 2px 10px rgba(59,130,246,.3); }
  .chat-msg.ai { background: var(--bg2); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
  .chat-msg.loading { color: var(--muted); font-style: italic; }
  .chat-input-row { display: flex; gap: 10px; }
  .chat-input-row input { flex: 1; }

  /* ══ QR / WHATSAPP ══════════════════════════════════════ */
  #qr-container { text-align: center; padding: 30px; }
  #qr-img { width: 220px; height: 220px; border-radius: 16px; border: 3px solid var(--border); background: #fff; box-shadow: var(--shadow); }
  .status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 20px; border-radius: 20px; font-size: 13px; font-weight: 700; margin: 16px 0; letter-spacing: .2px; }
  .status-badge.connected { background: rgba(16,185,129,.12); color: #34d399; }
  .status-badge.waiting { background: rgba(245,158,11,.12); color: #fcd34d; }
  .status-badge.disconnected { background: rgba(244,63,94,.12); color: #fb7185; }

  /* ══ UPLOAD ═════════════════════════════════════════════ */
  .upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    color: var(--muted);
  }
  .upload-area:hover, .upload-area.drag { border-color: var(--blue); background: rgba(59,130,246,.04); color: var(--text); }
  .upload-area input { display: none; }

  /* ══ INTEL CARDS ════════════════════════════════════════ */
  .intel-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
  .intel-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform .18s, box-shadow .18s;
  }
  .intel-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .intel-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: var(--radius) var(--radius) 0 0; }
  .intel-card.positivo::before { background: linear-gradient(90deg, var(--green), #34d399); }
  .intel-card.negativo::before { background: linear-gradient(90deg, var(--red), #fb7185); }
  .intel-card.alerta::before { background: linear-gradient(90deg, var(--yellow), #fcd34d); }
  .intel-card.info::before { background: linear-gradient(90deg, var(--blue), var(--indigo)); }
  .intel-card-icon { font-size: 24px; margin-bottom: 10px; }
  .intel-card-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; font-weight: 700; margin-bottom: 6px; }
  .intel-card-value { font-size: 24px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.4px; }
  .intel-card-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }
  .sugestao-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; border-left: 3px solid var(--border); transition: border-color .18s; }
  .sugestao-item.alta { border-left-color: var(--red); }
  .sugestao-item.media { border-left-color: var(--yellow); }
  .sugestao-item.info { border-left-color: var(--blue); }
  .sugestao-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
  .sugestao-titulo { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
  .sugestao-msg { font-size: 12px; color: var(--muted); line-height: 1.5; }

  /* ══ CHART ══════════════════════════════════════════════ */
  .chart-wrap { overflow-x: auto; padding-bottom: 8px; }
  .chart-bars { display: flex; align-items: flex-end; gap: 8px; min-height: 160px; padding: 0 4px; }
  .chart-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 48px; }
  .chart-col-bars { display: flex; gap: 3px; align-items: flex-end; height: 140px; }
  .chart-bar { border-radius: 5px 5px 0 0; transition: height .5s ease; min-height: 2px; cursor: default; position: relative; width: 18px; }
  .chart-bar:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--bg); border: 1px solid var(--border); padding: 4px 10px; border-radius: 8px; font-size: 11px; white-space: nowrap; pointer-events: none; z-index: 10; box-shadow: var(--shadow-sm); }
  .chart-bar.entrada { background: linear-gradient(180deg, #10b981, #059669); }
  .chart-bar.saida { background: linear-gradient(180deg, #f43f5e, #be123c); }
  .chart-mes { font-size: 10px; color: var(--muted); text-align: center; font-weight: 500; }
  .chart-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; font-weight: 500; }
  .chart-legend span { display: flex; align-items: center; gap: 6px; }
  .chart-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

  /* ══ MODAL ══════════════════════════════════════════════ */
  .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); z-index: 300; display: none; align-items: center; justify-content: center; padding: 16px; }
  .modal-overlay.open { display: flex; }
  .modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 32px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
  .modal-title { font-size: 17px; font-weight: 700; margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; letter-spacing: -.2px; }
  .modal .form-group { margin-bottom: 16px; }
  .modal-section { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); }

  /* ══ EMPTY ══════════════════════════════════════════════ */
  .empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 13px; }
  .empty::before { content: '📭'; display: block; font-size: 32px; margin-bottom: 12px; }

  /* ══ TOAST ══════════════════════════════════════════════ */
  #toast { position: fixed; bottom: 24px; right: 24px; z-index: 9100; display: flex; flex-direction: column; gap: 10px; }
  .toast-msg {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 20px;
    font-size: 13px;
    font-weight: 500;
    animation: slideIn .3s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,.5);
    min-width: 220px;
  }
  .toast-msg.success { border-color: rgba(16,185,129,.5); color: #34d399; background: rgba(16,185,129,.07); }
  .toast-msg.error { border-color: rgba(244,63,94,.5); color: #fb7185; background: rgba(244,63,94,.07); }
  @keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

  /* ══ LOGIN ══════════════════════════════════════════════ */
  #login-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 60% 0%, rgba(99,102,241,.15) 0%, transparent 60%),
                radial-gradient(ellipse at 10% 80%, rgba(59,130,246,.1) 0%, transparent 50%),
                var(--bg);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .login-box {
    background: rgba(17,24,39,.9);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 60px rgba(0,0,0,.6);
    backdrop-filter: blur(8px);
  }
  .login-logo { font-size: 36px; margin-bottom: 4px; }
  .login-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -.5px;
  }
  .login-sub { font-size: 14px; color: var(--muted); margin-bottom: 32px; }
  .login-box .form-group { margin-bottom: 18px; }
  .login-box input { font-size: 15px; padding: 13px 16px; border-radius: 12px; }
  .login-btn { width: 100%; padding: 14px; font-size: 15px; margin-top: 6px; justify-content: center; border-radius: 12px; }
  .login-error { color: #fb7185; font-size: 13px; margin-top: 14px; text-align: center; min-height: 20px; font-weight: 500; }

  /* ══ HAMBURGUER ═════════════════════════════════════════ */
  .mobile-menu-btn {
    display: none;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background .18s;
  }
  .mobile-menu-btn:active { background: rgba(255,255,255,.12); }

  /* ══ MENU MOBILE ════════════════════════════════════════ */
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.6);
    z-index: 8000;
    backdrop-filter: blur(3px);
  }
  .mobile-sidebar {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg2);
    z-index: 8001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    border-top: 2px solid rgba(99,102,241,.5);
  }
  .mobile-sidebar-header { display: none; }
  .mobile-sidebar nav { display: flex; flex-direction: column; padding: 8px 12px; gap: 4px; }
  .mobile-sidebar nav button {
    background: none;
    border: none;
    border-radius: 12px;
    color: var(--muted);
    padding: 14px 18px;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background .15s, color .15s;
  }
  .mobile-sidebar nav button:active { background: var(--bg3); }
  .mobile-sidebar nav button.active { color: #93c5fd; background: rgba(59,130,246,.12); font-weight: 600; }
  .mobile-sidebar nav .nav-icon { font-size: 20px; width: 28px; text-align: center; }
  .mobile-sidebar nav .nav-sep { height: 1px; background: var(--border); margin: 6px 4px; }

  /* ══ RESPONSIVO ═════════════════════════════════════════ */
  @media (max-width: 1024px) {
    main { max-width: 100%; }
    .cards { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 768px) {
    header { padding: 0 16px; height: 60px; }
    header nav { display: none; }
    .mobile-menu-btn { display: inline-flex; }
    .wa-status { display: none; }
    main { padding: 14px; }
    .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .card { padding: 16px; }
    .card-value { font-size: 22px; }
    .section { padding: 16px; }
    .form-row { flex-direction: column; }
    .rel-grid { grid-template-columns: 1fr; }
    table { font-size: 12px; }
    td, th { padding: 10px 8px; }
    .btn { padding: 8px 14px; font-size: 12px; }
    .filters { flex-direction: column; }
    .filters input, .filters select { width: 100%; }
    .chat-box { height: 280px; }
    #month-nav { gap: 8px; padding: 8px 12px; }
    #month-label { min-width: 130px; font-size: 14px; }
  }
  @media (max-width: 480px) {
    header { padding: 0 12px; gap: 10px; }
    .logo { font-size: 15px; }
    .user-info span#user-name { display: none; }
    .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card { padding: 14px 12px; }
    .card-value { font-size: 18px; }
    .card-label { font-size: 10px; }
    .modal { padding: 24px 20px; border-radius: 16px; }
    .login-box { padding: 32px 24px; }
    .login-title { font-size: 22px; }
    td, th { padding: 8px 6px; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .btn-sm { padding: 5px 10px; }
    .intel-cards { grid-template-columns: 1fr; }
    .wa-grid { grid-template-columns: 1fr !important; }
    #toast { bottom: 16px; right: 12px; left: 12px; }
    .toast-msg { min-width: unset; width: 100%; }
  }
