/* HelpMe! PMR WIRA - Components & Views Stylesheet */

/* EMERGENCY SAFETY BANNER */
.emergency-banner {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.25), rgba(185, 28, 28, 0.35));
  border: 1px solid rgba(239, 68, 68, 0.6);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.2);
  animation: pulseBorder 2s infinite ease-in-out;
}

@keyframes pulseBorder {
  0%, 100% { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 4px 20px rgba(220, 38, 38, 0.2); }
  50% { border-color: rgba(239, 68, 68, 0.9); box-shadow: 0 4px 25px rgba(220, 38, 38, 0.4); }
}

.emergency-banner-icon {
  font-size: 1.6rem;
  color: #F87171;
  flex-shrink: 0; /* CRITICAL: Prevent banner icon distortion */
  line-height: 1;
}

.emergency-banner-content h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #FEE2E2;
  margin-bottom: 0.25rem;
  letter-spacing: 0.5px;
}

.emergency-banner-content p {
  font-size: 0.85rem;
  color: #FECDD3;
  line-height: 1.4;
}

/* SOURCE CONFLICT BANNER */
.conflict-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #FDE68A;
  font-size: 0.85rem;
}

/* CHAT INTERFACE */
.chat-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  min-height: 0;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .chat-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

.chat-sidebar {
  background: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  overflow-y: auto;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
}

.chat-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.chat-sidebar-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.chat-sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: var(--transition);
  padding: 0;
  flex-shrink: 0;
}

.chat-sidebar-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #FDA4AF;
  border-color: rgba(239, 68, 68, 0.4);
}

.chat-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  width: 100%;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  text-align: left;
  user-select: none;
  max-width: 100%;
  box-sizing: border-box;
}

.session-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #FFFFFF;
}

.session-item.active {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #FDA4AF;
}

.session-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.session-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  display: none;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.session-item:hover .session-delete-btn,
.session-item.active .session-delete-btn {
  display: inline-block;
}

.session-delete-btn:hover {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.15);
}

/* CHAT MAIN AREA */
.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  background: var(--bg-dark);
  position: relative;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  scroll-behavior: smooth;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbars for Chat */
.chat-messages::-webkit-scrollbar,
.chat-sidebar::-webkit-scrollbar,
.chat-sessions-list::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-sidebar::-webkit-scrollbar-thumb {
  background: rgba(220, 38, 38, 0.35);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(220, 38, 38, 0.7);
}

.chat-bubble {
  display: flex;
  gap: 1rem;
  max-width: min(860px, 100%);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 0.2s ease;
  min-width: 0;
  box-sizing: border-box;
}

.chat-bubble.user {
  flex-direction: row-reverse;
  justify-content: flex-start;
  max-width: min(860px, 100%);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.chat-bubble.user .chat-avatar {
  background: #3B82F6;
  color: #FFFFFF;
}

.chat-bubble.assistant .chat-avatar {
  background: linear-gradient(135deg, #DC2626, #991B1B);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-content {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  position: relative;
  min-width: 0;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
  box-sizing: border-box;
}

.chat-bubble.user .chat-content {
  background: #1E3A8A;
  border-color: #2563EB;
  border-top-right-radius: 4px;
  flex: 0 1 auto;
  max-width: 78%;
}

.chat-bubble.assistant .chat-content {
  border-top-left-radius: 4px;
}

/* AI Model Badge in Chat */
.ai-model-tag {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.28);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: #FCA5A5;
  margin-bottom: 0.85rem;
  max-width: 100%;
  line-height: 1.35;
}

.ai-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 8px #22C55E;
  animation: pulseGreen 2s infinite ease-in-out;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.ai-model-name {
  color: #FFFFFF;
}

.ai-model-divider {
  color: rgba(255, 255, 255, 0.3);
}

.ai-model-grounding {
  color: #94A3B8;
  font-size: 0.72rem;
}

/* Chat Markdown Formatting */
.chat-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FDA4AF;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-content h3:first-child {
  margin-top: 0;
}

.chat-content ul, .chat-content ol {
  padding-left: 1.4rem;
  margin-bottom: 0.75rem;
}

.chat-content li {
  margin-bottom: 0.35rem;
}

.chat-content p {
  margin-bottom: 0.75rem;
}

.chat-content p:last-child {
  margin-bottom: 0;
}

.chat-content pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.chat-content code {
  word-break: break-word;
  font-family: var(--font-mono);
}

.chat-content table {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin-bottom: 0.75rem;
}

/* SOURCE CITATION CHIPS */
.source-citations {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.source-citations-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.citation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 100%;
}

.citation-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  color: #E2E8F0;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.citation-chip:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.4);
  color: #FDA4AF;
}

/* CHAT ACTIONS & FEEDBACK */
.chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-subtle);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feedback-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feedback-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.feedback-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.feedback-btn.active-helpful {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10B981;
  color: #34D399;
}

.feedback-btn.active-unhelpful {
  background: rgba(239, 68, 68, 0.2);
  border-color: #EF4444;
  color: #F87171;
}

/* CHAT INPUT FORM */
.chat-input-container {
  padding: 1rem clamp(0.75rem, 3vw, 2.5rem) 1.5rem;
  background: rgba(11, 15, 25, 0.9);
  border-top: 1px solid var(--border-subtle);
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.prompt-suggestions {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.75rem;
  scrollbar-width: none;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.prompt-suggestions::-webkit-scrollbar {
  display: none;
}

.prompt-pill {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.prompt-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}

.chat-form {
  display: flex;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  box-sizing: border-box;
}

.chat-form:focus-within {
  border-color: var(--pmi-primary);
  box-shadow: 0 0 16px var(--pmi-primary-glow);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  padding: 0.5rem;
  min-width: 0;
}

.chat-input::placeholder {
  color: var(--text-subtle);
}

/* TYPING INDICATOR */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 0.75rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--pmi-primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* MODAL SYSTEM */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #FFFFFF;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* FORM CONTROLS */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--pmi-primary);
  box-shadow: 0 0 12px var(--pmi-primary-glow);
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

/* ADMIN DASHBOARD */
.admin-container {
  max-width: 1300px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
}

.admin-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-tab-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.04);
}

.admin-tab-btn.active {
  color: #FDA4AF;
  border-bottom: 3px solid var(--pmi-primary);
  background: rgba(220, 38, 38, 0.08);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* DATA TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* DIFF VIEWER */
.diff-container {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: #080C14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.diff-line {
  padding: 0.15rem 0.4rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.diff-line.added {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-left: 3px solid #10B981;
}

.diff-line.removed {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border-left: 3px solid #EF4444;
}

/* AUDIT LOG BADGES */
.audit-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

/* DRAWER / SLIDE-IN PANEL */
.drawer {
  position: fixed;
  top: 0;
  right: -520px;
  width: 480px;
  max-width: 90vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  z-index: 1060;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.drawer.open {
  right: 0;
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* ====================================================
   COMPONENTS RESPONSIVE STYLES
   ==================================================== */
@media (max-width: 768px) {
  .chat-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
  }

  .chat-main {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
  }

  /* Emergency banner */
  .emergency-banner {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }
  .emergency-banner-icon {
    font-size: 1.35rem;
  }
  .emergency-banner-content h4 {
    font-size: 0.88rem;
  }
  .emergency-banner-content p {
    font-size: 0.8rem;
  }

  /* Chat Bubbles */
  .chat-bubble {
    gap: 0.5rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .chat-bubble.user {
    max-width: 100%;
  }

  .chat-bubble.user .chat-content {
    max-width: 88%;
  }

  .chat-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  .chat-content {
    padding: 0.75rem 0.85rem;
    font-size: 0.88rem;
    border-radius: var(--radius-md);
    max-width: 100%;
    overflow-x: hidden;
  }

  .ai-model-tag {
    font-size: 0.68rem;
    padding: 0.2rem 0.45rem;
    gap: 0.3rem;
  }

  .ai-model-grounding {
    display: inline;
    font-size: 0.68rem;
  }

  .chat-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-top: 0.6rem;
  }

  .feedback-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
  }

  .feedback-btn {
    font-size: 0.72rem;
    padding: 0.2rem 0.45rem;
  }

  /* Modals */
  .modal-backdrop {
    padding: 0.75rem;
  }

  .modal-card {
    max-height: 94vh;
    max-height: 94dvh;
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 1rem 1.15rem;
  }

  .modal-title {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 1.15rem;
  }

  .modal-footer {
    padding: 0.85rem 1.15rem;
  }

  /* Drawer on Mobile */
  .drawer {
    width: 100%;
    max-width: 100vw;
    right: -100vw;
  }

  /* Admin Control Center */
  .admin-container {
    padding: 0 0.85rem;
    margin: 1.25rem auto;
  }

  .admin-nav-tabs {
    gap: 0.25rem;
    margin-bottom: 1.25rem;
  }

  .admin-tab-btn {
    font-size: 0.82rem;
    padding: 0.5rem 0.85rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-val {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .responsive-two-col {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Tables & Diff */
  .table-responsive {
    border-radius: var(--radius-md);
  }

  .data-table th, .data-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .diff-container {
    padding: 0.75rem;
    font-size: 0.75rem;
    max-height: 320px;
  }
}

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