/* ============================================
   Client Chat Platform — Professional Stylesheet
   Design goals: trustworthy, clean, modern
   ============================================ */

:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;

  --accent: #059669;
  --accent-light: #10b981;
  --accent-50: #ecfdf5;

  --danger: #dc2626;
  --danger-50: #fef2f2;

  --warning: #f59e0b;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --white: #ffffff;
  --bg: #f1f5f9;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.05), 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.1), 0 4px 6px rgba(15, 23, 42, 0.05);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--slate-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
}

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

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

/* ============================================
   Auth Screens (Login, Setup, Install)
   ============================================ */

.auth-body {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(30, 64, 175, 0.3);
}

.brand-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 4px;
}

/* ============================================
   Form Elements
   ============================================ */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field input[type="url"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 14px;
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--slate-900);
  transition: all 0.15s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.field textarea { resize: vertical; min-height: 60px; }

.field small { display: block; margin-top: 4px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-800);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-200);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }

.btn-secondary {
  background: var(--white);
  color: var(--slate-700);
  border-color: var(--slate-300);
}
.btn-secondary:hover { background: var(--slate-50); }

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-whatsapp {
  background: #25D366;
  color: white;
}
.btn-whatsapp:hover { background: #1ea952; text-decoration: none; color: white; }

.btn-block {
  width: 100%;
  padding: 12px 20px;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.link-btn {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  color: var(--slate-600);
  transition: all 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--slate-100); color: var(--slate-900); }

.sidebar-header .icon-btn { color: rgba(255,255,255,0.9); }
.sidebar-header .icon-btn:hover { background: rgba(255,255,255,0.15); color: white; }

.chat-header .icon-btn { color: rgba(255,255,255,0.9); }
.chat-header .icon-btn:hover { background: rgba(255,255,255,0.15); color: white; }

/* ============================================
   Alerts
   ============================================ */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-error {
  background: var(--danger-50);
  color: var(--danger);
  border-color: #fecaca;
}
.alert-success {
  background: var(--accent-50);
  color: var(--accent);
  border-color: #a7f3d0;
}

.info-box {
  padding: 12px 14px;
  background: var(--primary-50);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--slate-700);
}

/* ============================================
   App Shell (Dashboard)
   ============================================ */

.app-body {
  overflow: hidden;
}

.app-shell {
  display: flex;
  height: 100vh;
  background: var(--white);
}

/* --- Sidebar --- */

.sidebar {
  width: 340px;
  min-width: 340px;
  border-right: 1px solid var(--slate-200);
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.brand-role {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  padding: 10px 12px;
  border-bottom: 1px solid var(--slate-100);
}

.search-box svg {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--slate-100);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.15s;
}

.search-box input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--slate-300);
}

.filter-tabs {
  display: flex;
  padding: 0 8px;
  border-bottom: 1px solid var(--slate-100);
  gap: 2px;
}

.filter-tab {
  flex: 1;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-500);
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.15s;
}

.filter-tab:hover { color: var(--slate-700); }

.filter-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.client-list {
  flex: 1;
  overflow-y: auto;
}

.client-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-100);
  cursor: pointer;
  transition: background 0.1s;
  width: 100%;
  text-align: left;
}

.client-item:hover { background: var(--slate-50); }

.client-item.active {
  background: var(--primary-50);
  border-left: 3px solid var(--primary);
  padding-left: 13px;
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

/* Deterministic avatar colors */
.client-avatar[data-c="0"] { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.client-avatar[data-c="1"] { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.client-avatar[data-c="2"] { background: linear-gradient(135deg, #059669, #10b981); }
.client-avatar[data-c="3"] { background: linear-gradient(135deg, #d97706, #f59e0b); }
.client-avatar[data-c="4"] { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.client-avatar[data-c="5"] { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.client-avatar[data-c="6"] { background: linear-gradient(135deg, #db2777, #ec4899); }
.client-avatar[data-c="7"] { background: linear-gradient(135deg, #ea580c, #f97316); }

.client-info {
  flex: 1;
  min-width: 0;
}

.client-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.client-name {
  font-weight: 600;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14.5px;
}

.client-time {
  font-size: 11.5px;
  color: var(--slate-400);
  flex-shrink: 0;
}

.client-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.client-preview {
  font-size: 13px;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.unread-badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* --- Chat Area --- */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--slate-50);
  min-width: 0;
}

.chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-window.full-height { height: 100vh; }

.chat-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  z-index: 5;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}

.chat-avatar.large {
  width: 46px;
  height: 46px;
  font-size: 20px;
}

.chat-title {
  flex: 1;
  min-width: 0;
}

.chat-title .name {
  font-weight: 600;
  font-size: 15.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-title .meta {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #0ea5e9;
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.chat-actions {
  display: flex;
  gap: 4px;
}

/* --- Welcome banner (client view) --- */

.welcome-banner {
  background: linear-gradient(180deg, var(--primary-50) 0%, transparent 100%);
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-200);
}

.welcome-content {
  font-size: 13.5px;
  color: var(--slate-700);
  line-height: 1.6;
}

.welcome-content strong {
  color: var(--slate-900);
  display: block;
  margin-bottom: 2px;
}

.trust-badges {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.trust-badges .badge {
  font-size: 11px;
  padding: 3px 10px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 20px;
  color: var(--slate-600);
  font-weight: 500;
}

/* --- Messages --- */

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: #f0f2f5;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(30, 64, 175, 0.02) 2px, transparent 2px),
    radial-gradient(circle at 75% 75%, rgba(30, 64, 175, 0.02) 2px, transparent 2px);
  background-size: 40px 40px;
}

.date-separator {
  display: flex;
  justify-content: center;
  margin: 12px 0 8px;
}

.date-separator span {
  background: var(--white);
  color: var(--slate-500);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.message-row {
  display: flex;
  max-width: 100%;
}

.message-row.mine { justify-content: flex-end; }

.message-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 14px;
  position: relative;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .message-bubble { max-width: 85%; }
}

.message-row.mine .message-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-row.theirs .message-bubble {
  background: var(--white);
  color: var(--slate-900);
  border-bottom-left-radius: 4px;
}

.message-text {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.45;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.7;
}

.message-row.theirs .message-meta { color: var(--slate-500); }

.copy-btn {
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px;
  border-radius: 4px;
  display: inline-flex;
  color: inherit;
}

.message-bubble:hover .copy-btn { opacity: 0.8; }
.copy-btn:hover { opacity: 1 !important; }

.tick {
  display: inline-flex;
  align-items: center;
}

/* Image message */

.message-image {
  padding: 4px;
}

.message-image img {
  max-width: 280px;
  max-height: 320px;
  border-radius: 10px;
  display: block;
  cursor: pointer;
}

@media (max-width: 640px) {
  .message-image img { max-width: 220px; }
}

.message-image .message-meta { padding: 4px 6px 0; }

/* File message */

.message-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.message-file .file-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-row.theirs .message-file .file-icon {
  background: var(--slate-100);
  color: var(--primary);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.file-meta {
  font-size: 11.5px;
  opacity: 0.8;
  margin-top: 2px;
}

.file-download {
  color: inherit;
  padding: 6px;
  border-radius: 6px;
}
.file-download:hover { background: rgba(255,255,255,0.15); }
.message-row.theirs .file-download:hover { background: var(--slate-100); }

/* Payment message */

.message-payment {
  min-width: 240px;
  padding: 4px 0;
}

.payment-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.payment-amount {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.payment-amount .rupee { font-size: 20px; }

.payment-note {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
  margin-bottom: 10px;
}

.payment-btn-cta {
  display: block;
  padding: 8px 12px;
  background: var(--white);
  color: var(--primary);
  text-align: center;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
}

.message-row.theirs .payment-btn-cta {
  background: var(--primary);
  color: white;
}

.payment-btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

/* --- Composer --- */

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 12px;
  background: var(--white);
  border-top: 1px solid var(--slate-200);
}

.attach-btn { cursor: pointer; }

.payment-btn { color: var(--accent) !important; }
.payment-btn:hover { background: var(--accent-50) !important; }

.chat-composer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 14px;
  background: var(--slate-100);
  border: 1.5px solid transparent;
  border-radius: 22px;
  font-size: 14.5px;
  resize: none;
  line-height: 1.4;
  transition: all 0.15s;
  overflow-y: auto;
}

.chat-composer textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--primary);
}

.btn-send {
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-send:hover { background: var(--primary-dark); }
.btn-send:disabled { background: var(--slate-300); cursor: not-allowed; }

/* Client footer */

.chat-footer-strip {
  padding: 6px 16px;
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  font-size: 10.5px;
  color: var(--slate-500);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state h3 {
  margin-top: 16px;
  color: var(--slate-700);
  font-size: 17px;
  font-weight: 600;
}

.empty-state p {
  color: var(--slate-500);
  margin-top: 6px;
  font-size: 14px;
}

.empty-state.small { padding: 30px 15px; }

/* ============================================
   Modals
   ============================================ */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal.open { display: flex; }

.modal-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-900);
}

.modal-close {
  font-size: 24px;
  line-height: 1;
  color: var(--slate-400);
}

.share-link-box {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.share-link-box input {
  flex: 1;
  padding: 10px 12px;
  background: var(--slate-100);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 12.5px;
  color: var(--slate-700);
}

/* ============================================
   Dropdown
   ============================================ */

.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 6px;
  z-index: 100;
}

.dropdown-menu.open { display: block; }

.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  font-size: 14px;
  transition: background 0.1s;
}

.dropdown-item:hover { background: var(--slate-100); }

.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-50); }

.dropdown-divider {
  height: 1px;
  background: var(--slate-200);
  margin: 4px 0;
}

/* ============================================
   Image Viewer
   ============================================ */

.image-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-viewer.open { display: flex; }

.image-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-close, .viewer-download {
  position: absolute;
  top: 16px;
  background: rgba(255,255,255,0.15);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-size: 24px;
}
.viewer-close { right: 16px; }
.viewer-download { right: 68px; }
.viewer-close:hover, .viewer-download:hover { background: rgba(255,255,255,0.25); }

/* ============================================
   Toast
   ============================================ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--slate-900);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  transition: transform 0.25s ease;
  max-width: 90vw;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ============================================
   Client-specific
   ============================================ */

.client-body {
  background: var(--slate-100);
}

.client-chat-container {
  max-width: 640px;
  margin: 0 auto;
  height: 100vh;
  background: var(--white);
  box-shadow: 0 0 60px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .client-chat-container {
    max-width: none;
    box-shadow: none;
  }
}

.client-header .chat-actions { display: none; }

/* ============================================
   Utilities
   ============================================ */

.muted { color: var(--slate-500); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

code {
  background: var(--slate-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 12.5px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.sending-indicator {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--slate-500);
  text-align: center;
  font-style: italic;
}

/* ============================================
   Responsive (Mobile)
   ============================================ */

.mobile-only { display: none; }

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    min-width: 100%;
  }

  .chat-area {
    display: none;
  }

  .app-shell.chat-open .sidebar { display: none; }
  .app-shell.chat-open .chat-area { display: flex; }

  .mobile-only { display: inline-flex; }

  .form-row { grid-template-columns: 1fr; }

  .auth-card { padding: 28px 20px; }

  .brand-name { max-width: 130px; }
}
