/* =========================================================
   PromesApp – Sistema de diseño (style.css)
   Modo claro/oscuro, variables CSS, componentes, animaciones
   ========================================================= */

/* ─── Google Fonts ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* ─── Variables – Modo oscuro (Cyber Navy & Electric Cyan - Matching Icon) ── */
:root {
  --bg-primary:        #060913;
  --bg-secondary:      #0b1120;
  --bg-card:           #0f172a;
  --bg-input:          #090e1a;
  --bg-hover:          #1e293b;

  --text-primary:      #f8fafc;
  --text-secondary:    #94a3b8;
  --text-muted:        #64748b;

  --accent-primary:    #00d2ff;
  --accent-hover:      #00b4d8;
  --accent-light:      rgba(0, 210, 255, 0.12);
  --accent-gradient:   linear-gradient(135deg, #00d2ff 0%, #0066ff 100%);

  --success:           #10b981;
  --success-bg:        rgba(16, 185, 129, 0.12);
  --warning:           #f59e0b;
  --warning-bg:        rgba(245, 158, 11, 0.12);
  --danger:            #f43f5e;
  --danger-bg:         rgba(244, 63, 94, 0.12);
  --info:              #00d2ff;
  --info-bg:           rgba(0, 210, 255, 0.12);

  --border:            rgba(255, 255, 255, 0.08);
  --border-accent:     rgba(0, 210, 255, 0.35);

  --shadow-sm:         0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:         0 6px 24px rgba(0,0,0,0.6);
  --shadow-lg:         0 12px 48px rgba(0,0,0,0.7);
  --shadow-glow:       0 0 25px rgba(0, 210, 255, 0.28);

  --radius-sm:         6px;
  --radius-md:         12px;
  --radius-lg:         18px;
  --radius-xl:         24px;
  --radius-full:       9999px;

  --transition:        0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow:   0.35s cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-width:     260px;
  --header-height:     60px;
  --bottom-nav-height: 64px;
}

/* ─── Modo Claro ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg-primary:        #f8fafc;
  --bg-secondary:      #ffffff;
  --bg-card:           #ffffff;
  --bg-input:          #f1f5f9;
  --bg-hover:          #f1f5f9;

  --text-primary:      #0f172a;
  --text-secondary:    #475569;
  --text-muted:        #94a3b8;

  --accent-primary:    #0284c7;
  --accent-hover:      #0369a1;
  --accent-light:      rgba(2, 132, 199, 0.08);
  --accent-gradient:   linear-gradient(135deg, #0284c7 0%, #2563eb 100%);

  --border:            rgba(0,0,0,0.08);
  --border-accent:     rgba(2, 132, 199, 0.25);

  --shadow-sm:         0 2px 8px rgba(0,0,0,0.04);
  --shadow-md:         0 6px 20px rgba(0,0,0,0.06);
  --shadow-lg:         0 12px 40px rgba(0,0,0,0.08);
  --shadow-glow:       0 0 20px rgba(2, 132, 199, 0.15);
}

/* ─── Safe Area Variables ─────────────────────────────────── */
:root {
  --safe-top:          env(safe-area-inset-top, 0px);
  --safe-bottom:       env(safe-area-inset-bottom, 0px);
  --safe-left:         env(safe-area-inset-left, 0px);
  --safe-right:        env(safe-area-inset-right, 0px);
}

/* ─── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  position: relative;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  transition: background var(--transition-slow), color var(--transition-slow);
}

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

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

/* ─── Scrollbar personalizada ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
}

.sidebar {
  width: min(var(--sidebar-width), 85vw);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  z-index: 1000;
  transition: transform var(--transition-slow);
  box-sizing: border-box;
}

.sidebar-close-btn {
  display: none;
  margin-left: auto;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
  width: calc(100% - var(--sidebar-width));
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  padding-bottom: 2rem;
}

.main-content-inner {
  padding: 1.25rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.top-bar {
  min-height: calc(var(--header-height) + var(--safe-top));
  padding-top: max(0.5rem, var(--safe-top));
  padding-bottom: 0.5rem;
  padding-left: max(1rem, var(--safe-left));
  padding-right: max(1rem, var(--safe-right));
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 500;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

#menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}
#menu-toggle:active {
  background: var(--bg-hover);
  transform: scale(0.94);
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo .logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent-primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--accent-primary);
  border-radius: 0 2px 2px 0;
}

.nav-item .material-icons {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-user {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Agreement Cards ────────────────────────────────────── */
.agreement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.agreement-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--card-color, var(--accent-primary));
}

.agreement-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-PENDING      { background: var(--warning-bg); color: var(--warning); }
.status-ACCEPTED     { background: var(--info-bg); color: var(--info); }
.status-FULFILLED    { background: var(--success-bg); color: var(--success); }
.status-UNFULFILLED  { background: var(--danger-bg); color: var(--danger); }
.status-IN_DISPUTE   { background: rgba(239,68,68,0.2); color: #fca5a5; }
.status-CANCELLED    { background: rgba(100,116,139,0.2); color: var(--text-muted); }
.status-ARCHIVED     { background: rgba(100,116,139,0.1); color: var(--text-muted); }
.status-REJECTED     { background: var(--danger-bg); color: var(--danger); }

/* ─── Chat UI ─────────────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - 2rem);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message-bubble {
  max-width: 70%;
  padding: 0.6rem 1rem;
  border-radius: 18px;
  position: relative;
  word-break: break-word;
  animation: fadeInUp 0.2s ease;
}

.message-bubble.sent {
  background: var(--accent-primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.message-bubble.received {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.message-bubble.deleted {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-style: italic;
}

.message-time {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-top: 2px;
  text-align: right;
}

.message-ticks {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  background: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-6px); }
}

.chat-input-bar {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.6rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
  resize: none;
  max-height: 120px;
}

.chat-input:focus {
  border-color: var(--accent-primary);
}

/* ─── Formularios ─────────────────────────────────────────── */
.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  display: block;
}

/* ─── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  color: white;
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--accent-primary);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-icon:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--border-accent);
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }

/* ─── Avatar ─────────────────────────────────────────────── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }

.avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.online-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  position: absolute;
  bottom: 0;
  right: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* ─── Bottom Navigation (móvil) ──────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  padding-left: max(0.5rem, var(--safe-left));
  padding-right: max(0.5rem, var(--safe-right));
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  z-index: 500;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
  padding: 8px 0;
}

.bottom-nav-item.active { color: var(--accent-primary); }

.bottom-nav-item .material-icons { font-size: 1.3rem; }

.bottom-nav-fab {
  width: 48px;
  height: 48px;
  background: var(--accent-gradient);
  border-radius: 50%;
  box-shadow: var(--shadow-glow);
  display: grid;
  place-items: center;
  color: white;
  margin-top: -12px;
}

/* ─── Alertas ─────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: rgba(16,185,129,0.2); }
.alert-danger   { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(239,68,68,0.2); }
.alert-warning  { background: var(--warning-bg); color: var(--warning); border-color: rgba(245,158,11,0.2); }
.alert-info     { background: var(--info-bg);    color: var(--info);    border-color: rgba(6,182,212,0.2); }

/* ─── Timeline ────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding: 0.5rem 0 1rem;
  animation: fadeInLeft 0.3s ease;
}

.timeline-dot {
  position: absolute;
  left: -1.55rem;
  top: 0.6rem;
  width: 10px;
  height: 10px;
  background: var(--accent-primary);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.timeline-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.timeline-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 90vw;
  width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

/* ─── Animaciones ─────────────────────────────────────────── */
@keyframes fadeIn      { from { opacity: 0; }                    to { opacity: 1; } }
@keyframes fadeInUp    { from { opacity: 0; transform: translateY(10px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInLeft  { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideUp     { from { opacity: 0; transform: translateY(30px); }  to { opacity: 1; transform: translateY(0); } }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; }

/* ─── Utilities ───────────────────────────────────────────── */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent-primary); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-warning   { color: var(--warning); }

.bg-card     { background: var(--bg-card); }
.bg-hover    { background: var(--bg-hover); }

.border-1    { border: 1px solid var(--border); }
.rounded-full { border-radius: var(--radius-full); }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  #menu-toggle {
    display: inline-flex !important;
  }

  .sidebar-close-btn {
    display: inline-flex !important;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1.25rem);
  }

  .main-content-inner {
    padding: 1rem 0.85rem;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .bottom-nav {
    display: flex;
    align-items: stretch;
  }

  .stat-grid, .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .card {
    max-width: 100% !important;
    border-radius: var(--radius-md) !important;
  }

  .message-bubble { max-width: 88%; }
}

@media (max-width: 480px) {
  .stat-card { padding: 0.85rem; }
  .stat-value { font-size: 1.2rem; }
  .modal-box { padding: 1.25rem; }
  .main-content-inner { padding: 0.75rem 0.65rem; }
  .top-bar { padding-left: 0.75rem; padding-right: 0.75rem; }
}
