body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
  .nav-btn.active { background-color: #111827; color: white; }
  .nav-btn:not(.active):hover { background-color: #f3f4f6; }
  .tab-btn.active { border-bottom: 2px solid #111827; color: #111827; font-weight: 600; }
  .tab-btn:not(.active) { color: #6b7280; }
  .toast { animation: slideIn 0.2s ease-out; }
  @keyframes slideIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  table { font-variant-numeric: tabular-nums; }
  .pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
  .pill-green { background: #dcfce7; color: #166534; }
  .pill-red { background: #fee2e2; color: #991b1b; }
  .pill-yellow { background: #fef9c3; color: #854d0e; }
  .pill-blue { background: #dbeafe; color: #1e40af; }
  .pill-gray { background: #f3f4f6; color: #374151; }
  .pill-purple { background: #f3e8ff; color: #6b21a8; }
  .pill-amber { background: #fef3c7; color: #92400e; }
  .modal-bg { background: rgba(15, 23, 42, 0.6); }
  @keyframes newRowPulse {
    0%   { background-color: #fef3c7; box-shadow: inset 3px 0 0 #f59e0b; }
    70%  { background-color: #fef3c7; box-shadow: inset 3px 0 0 #f59e0b; }
    100% { background-color: transparent; box-shadow: inset 3px 0 0 transparent; }
  }
  tr.is-new { animation: newRowPulse 30s ease-out forwards; }
  tr.is-new td:first-child::before {
    content: 'NEW'; display: inline-block; margin-right: 6px; padding: 1px 5px;
    background: #f59e0b; color: white; font-size: 9px; font-weight: 700;
    border-radius: 3px; vertical-align: middle; letter-spacing: 0.5px;
  }
  .live-dot { display: inline-block; width: 6px; height: 6px; background: #10b981;
    border-radius: 50%; margin-right: 4px; animation: livePulse 2s ease-in-out infinite; }
  @keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
  .drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 95vw); background: white;
    box-shadow: -8px 0 24px rgba(15,23,42,.15); transform: translateX(100%); transition: transform .25s ease;
    z-index: 35; overflow-y: auto; }
  .drawer.open { transform: translateX(0); }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: #f9fafb; }
  ::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
  .msg-bubble { max-width: 75%; padding: 8px 12px; border-radius: 14px; word-wrap: break-word; line-height: 1.4; font-size: 13px; position: relative; }
  .msg-customer { background: #f3f4f6; color: #111827; align-self: flex-start; border-bottom-left-radius: 4px; }
  .msg-admin    { background: #111827; color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
  .msg-system   { background: #fef9c3; color: #854d0e; align-self: center; font-size: 11px; padding: 4px 10px; }
  .msg-sender-label { font-size: 10px; opacity: 0.7; margin-bottom: 3px; font-weight: 600; }
  .msg-deleted .msg-body { font-style: italic; opacity: 0.7; }
  .msg-deleted-meta { font-size: 10px; opacity: 0.7; margin-top: 4px; font-style: italic; }
  .msg-row { display: flex; align-items: flex-end; gap: 6px; }
  .msg-row.is-admin { justify-content: flex-end; }
  .msg-row.is-customer { justify-content: flex-start; }
  .msg-del-btn {
    opacity: 0; transition: opacity .15s ease; cursor: pointer; padding: 4px 6px;
    color: #ef4444; font-size: 14px; line-height: 1; border-radius: 4px; user-select: none;
    background: transparent; border: 1px solid transparent;
  }
  .msg-del-btn:hover { background: #fef2f2; border-color: #fecaca; }
  .msg-row:hover .msg-del-btn { opacity: 1; }
  .conv-item.active { background: #111827; color: white; }
  .conv-item.active .conv-meta { color: #d1d5db; }
  .field { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 14px; background: white; }
  .field:focus { outline: none; border-color: #111827; box-shadow: 0 0 0 2px rgba(17,24,39,.1); }
  .master-only.hidden-by-role { display: none !important; }