/* ===== AMR RFA MOCKUP — SHARED STYLES ===== */

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; }

/* Theme colors */
:root {
  --teal: #006F6A;
  --teal-dark: #004a46;
  --teal-light: #E6F2F1;
  --yellow: #f3c416;
  --yellow-dark: #d4a916;
  --yellow-light: #fef9e7;
}

/* Scrollbar */
.thin-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.thin-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.thin-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.thin-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Sidebar */
.sidebar {
  width: 256px;
  transition: all 0.3s ease;
  background: white;
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  z-index: 40;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
  overflow-y: auto;
}
.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .notif-badge-text { display: none; }
.sidebar.collapsed nav a { justify-content: center; }
.main-content {
  margin-left: 256px;
  transition: margin-left 0.3s ease;
  min-height: 100vh;
}
.main-content.sidebar-collapsed { margin-left: 70px; }

/* Sidebar nav links */
.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 8px;
  color: #4b5563;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
}
.nav-link:hover { background: var(--teal-light); color: var(--teal); }
.nav-link.active { background: var(--teal-light); color: var(--teal); font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--teal); border-radius: 0 3px 3px 0; }
.nav-link i { width: 20px; margin-right: 12px; text-align: center; color: #9ca3af; }
.nav-link.active i, .nav-link:hover i { color: var(--teal); }

/* Client sidebar variant */
.nav-link-client:hover { background: var(--yellow-light); color: var(--yellow-dark); }
.nav-link-client.active { background: var(--yellow-light); color: var(--yellow-dark); }
.nav-link-client.active::before { background: var(--yellow); }
.nav-link-client.active i, .nav-link-client:hover i { color: var(--yellow-dark); }

/* Buttons */
.btn-primary {
  background: var(--teal);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,111,106,0.3); }
.btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-danger {
  background: #ef4444; color: white; padding: 8px 16px; border-radius: 8px; font-weight: 600;
  font-size: 14px; display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer;
}
.btn-danger:hover { background: #dc2626; }
.btn-yellow {
  background: var(--yellow); color: #1f2937; padding: 8px 16px; border-radius: 8px; font-weight: 600;
  font-size: 14px; display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer;
  transition: all 0.15s;
}
.btn-yellow:hover { background: var(--yellow-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(243,196,22,0.4); }

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* Status pulse */
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.online-dot { animation: pulse-ring 2s infinite; }

/* Chat bubble */
.chat-area {
  background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
  background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0);
  background-size: 20px 20px;
}

.bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.bubble-sent {
  background: var(--teal);
  color: white;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.bubble-sent-yellow {
  background: var(--yellow);
  color: #1f2937;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.bubble-received {
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
.bubble-note {
  background: #fef3c7;
  color: #78350f;
  border: 1px dashed #f59e0b;
  border-bottom-left-radius: 4px;
}
.bubble-dispute {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #ef4444;
  border-bottom-left-radius: 4px;
}
.bubble-meta {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Date separator */
.date-sep {
  display: flex;
  align-items: center;
  margin: 16px 0;
  gap: 12px;
}
.date-sep::before, .date-sep::after {
  content: "";
  flex: 1;
  border-top: 1px dashed #d1d5db;
}
.date-sep span {
  font-size: 12px;
  color: #6b7280;
  background: white;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-weight: 500;
}

/* New messages line */
.new-msg-line {
  display: flex;
  align-items: center;
  margin: 12px 0;
  gap: 8px;
}
.new-msg-line::before, .new-msg-line::after {
  content: "";
  flex: 1;
  border-top: 2px dashed var(--teal);
  opacity: 0.4;
}
.new-msg-line.client::before, .new-msg-line.client::after { border-color: var(--yellow); }
.new-msg-line span { font-size: 11px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.5px; }
.new-msg-line.client span { color: var(--yellow-dark); }

/* Typing indicator */
.typing-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Read receipt */
.tick { font-size: 11px; }
.tick-read { color: #06b6d4; }
.tick-sent { color: #9ca3af; }

/* Cards */
.card { background: white; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.card-hover { transition: all 0.2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); border-color: #d1d5db; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50; display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-backdrop.show { display: flex; animation: fadeIn 0.2s ease-out; }
.modal { background: white; border-radius: 16px; max-width: 540px; width: 100%; max-height: 90vh; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.25); animation: scaleIn 0.2s ease-out; display: flex; flex-direction: column; }
.modal-lg { max-width: 720px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Toast */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 100;
  background: white; border-left: 4px solid var(--teal); padding: 12px 20px; border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.3s ease-out;
  min-width: 280px;
}
.toast.success { border-color: #22c55e; }
.toast.error { border-color: #ef4444; }
.toast.warning { border-color: #f59e0b; }
@keyframes slideIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* File card in chat */
.file-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; background: rgba(255,255,255,0.15); border-radius: 10px;
  margin-top: 6px; min-width: 220px;
}
.bubble-received .file-card { background: #f9fafb; border: 1px solid #e5e7eb; }

/* Image attachment */
.img-attach {
  max-width: 200px; max-height: 200px; border-radius: 12px; margin-top: 6px;
  cursor: pointer; transition: transform 0.2s; display: block;
}
.img-attach:hover { transform: scale(1.02); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 200; display: none; align-items: center; justify-content: center; }
.lightbox.show { display: flex; animation: fadeIn 0.2s; }
.lightbox img { max-width: 90%; max-height: 90%; border-radius: 8px; }
.lightbox-close { position: absolute; top: 20px; right: 20px; background: white; color: black; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; }

/* Tabs */
.tab-nav { border-bottom: 1px solid #e5e7eb; display: flex; gap: 2px; padding: 0 16px; background: white; }
.tab { padding: 12px 16px; font-size: 14px; font-weight: 500; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; display: flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--teal); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.tab-yellow:hover { color: var(--yellow-dark); }
.tab-yellow.active { color: var(--yellow-dark); border-bottom-color: var(--yellow); }

/* Filter pills */
.filter-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: var(--teal-light); color: var(--teal);
  border-radius: 16px; font-size: 12px; font-weight: 500;
}
.filter-pill button { background: none; border: none; color: var(--teal); cursor: pointer; padding: 0 0 0 4px; }

/* Image hover zoom (matches catalog pattern) */
.image-zoom-popup {
  position: fixed; display: none; z-index: 100;
  background: white; padding: 8px; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); border: 1px solid #e5e7eb;
  pointer-events: none; width: 280px;
}
.image-zoom-popup img { width: 100%; border-radius: 8px; display: block; }
.image-zoom-popup .label { font-size: 11px; color: #6b7280; margin-top: 6px; text-align: center; font-weight: 500; }

/* Composer */
.composer {
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px;
}
.composer textarea {
  resize: none; min-height: 44px; max-height: 120px;
  outline: none; font-family: inherit; font-size: 14px;
}

/* Toggle */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #d1d5db; border-radius: 24px; transition: 0.2s; }
.toggle-slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
input:checked + .toggle-slider { background: var(--teal); }
input:checked + .toggle-slider::before { transform: translateX(20px); }
input:checked + .toggle-slider.yellow { background: var(--yellow); }

/* Status badge mini */
.dot-status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-open { background: #eab308; }
.dot-in_progress { background: #3b82f6; }
.dot-resolved { background: #22c55e; }
.dot-closed { background: #6b7280; }

/* Banner */
.banner {
  padding: 12px 16px; border-radius: 12px;
  display: flex; align-items: center; gap: 12px; font-size: 14px;
  border: 1px solid;
}
.banner-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.banner-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.banner-warning { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.banner-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon {
  width: 80px; height: 80px; margin: 0 auto 16px;
  background: #f3f4f6; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 32px;
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* Animation utilities */
@keyframes slideUp { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.slide-up { animation: slideUp 0.3s ease-out; }
