/* ============================================
   Reclaim Bharosa - Customer Portal
   Modern Design Matching Main Website
   ============================================ */

/* Import main website design system */
:root {
  /* Primary Colors - Purple/Lavender (matching main site) */
  --primary-50: #faf5ff;
  --primary-100: #f3e8ff;
  --primary-200: #e9d5ff;
  --primary-300: #ddd6fe;
  --primary-400: #c4b5fd;
  --primary-500: #a78bfa;
  --primary-600: #8b5cf6;
  --primary-700: #7c3aed;
  --primary-800: #6d28d9;
  --primary-900: #5b21b6;

  /* Accent Colors */
  --accent-50: #fdf4ff;
  --accent-100: #fae8ff;
  --accent-200: #f5d0fe;
  --accent-300: #f0abfc;
  --accent-400: #e879f9;
  --accent-500: #d946ef;
  --accent-600: #c026d3;

  /* Semantic Colors */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #ef4444;
  --error-light: #fee2e2;

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Transitions */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

.rb-body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 50%, var(--gray-50) 100%);
  color: var(--gray-900);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rb-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-8) var(--space-4);
}

/* ============================================
   Header - Modern Design
   ============================================ */

.rb-header {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--accent-500) 100%);
  border-radius: var(--radius-2xl);
  padding: var(--space-6) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  box-shadow: var(--shadow-xl);
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: visible;
  z-index: 100;
}

/* Removed ::before line - no longer needed */

.rb-logo-area {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.rb-logo-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform var(--duration-normal) var(--ease-bounce);
  padding: var(--space-2);
}

.rb-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rb-logo-mark:hover {
  transform: scale(1.05);
}

.rb-logo-text h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-body);
  line-height: 1.2;
}

.rb-logo-text p {
  margin: var(--space-1) 0 0 0;
  font-size: 0.875rem;
  opacity: 0.95;
  font-weight: 400;
}

.rb-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

/* ============================================
   Language Selector
   ============================================ */

.rb-lang-selector {
  position: relative;
  z-index: 1002;
}

.rb-lang-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  color: var(--white);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
}

.rb-lang-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.rb-lang-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rb-lang-selector.open .rb-lang-btn {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.rb-lang-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 180px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--duration-normal) var(--ease-out);
  z-index: 1000;
  overflow: hidden;
  pointer-events: none;
}

.rb-lang-selector.open .rb-lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.rb-lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: none;
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
  text-align: left;
  font-family: var(--font-body);
}

.rb-lang-option:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.rb-lang-option.active {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}

.rb-welcome {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: right;
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   User Menu - Modern Dropdown
   ============================================ */

.rb-user-menu {
  position: relative;
  z-index: 1001;
}

.rb-user-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  color: var(--white);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
}

.rb-user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.rb-user-menu-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.rb-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.rb-user-avatar svg {
  width: 18px;
  height: 18px;
  color: var(--white);
}

.rb-user-email {
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rb-user-menu-chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-normal) var(--ease-out);
  flex-shrink: 0;
}

.rb-user-menu-btn[aria-expanded="true"] .rb-user-menu-chevron {
  transform: rotate(180deg);
}

.rb-user-menu-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 240px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--duration-normal) var(--ease-out);
  z-index: 1000;
  overflow: hidden;
  pointer-events: none;
}

.rb-user-menu-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.rb-user-menu-header {
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--gray-200);
}

.rb-user-menu-email {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  word-break: break-all;
}

.rb-user-menu-divider {
  height: 1px;
  background: var(--gray-200);
  margin: var(--space-1) 0;
}

.rb-user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: none;
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
  text-align: left;
  font-family: var(--font-body);
}

.rb-user-menu-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.rb-user-menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--gray-500);
  transition: color var(--duration-fast);
}

.rb-user-menu-item:hover svg {
  color: var(--gray-700);
}

.rb-user-menu-item-danger {
  color: var(--error);
}

.rb-user-menu-item-danger:hover {
  background: var(--error-light);
  color: var(--error);
}

.rb-user-menu-item-danger svg {
  color: var(--error);
}

.rb-user-menu-item-danger:hover svg {
  color: var(--error);
}

/* ============================================
   Layout
   ============================================ */

.rb-main {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.rb-main-split {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: flex-start;
}

.rb-sidebar {
  min-width: 0;
}

.rb-sidebar-card {
  height: 100%;
  position: sticky;
  top: var(--space-6);
}

.rb-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* ============================================
   Cards - Modern Design
   ============================================ */

.rb-card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.rb-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-200);
}

.rb-card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.rb-card-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  font-family: var(--font-body);
}

.rb-card-body {
  padding: var(--space-6);
}

/* ============================================
   Claim Details
   ============================================ */

.rb-claim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5) var(--space-6);
}

.rb-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.rb-value {
  font-size: 0.9375rem;
  color: var(--gray-900);
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: break-word;
}

.rb-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-100);
  color: var(--primary-700);
  border: 1px solid var(--primary-200);
}

.rb-pill-warning {
  background: var(--warning-light);
  color: #92400e;
  border-color: var(--warning);
}

.rb-muted {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* ============================================
   Status Banner
   ============================================ */

.rb-banner {
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border: 1px solid;
}

.rb-banner-warning {
  background: var(--warning-light);
  border-color: var(--warning);
  color: #92400e;
}

.rb-banner-main {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.rb-banner-title {
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: inherit;
}

.rb-banner-text {
  font-size: 0.8125rem;
  opacity: 0.9;
}

/* ============================================
   Buttons - Modern Style
   ============================================ */

.rb-btn {
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  padding: var(--space-3) var(--space-6);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  background: var(--primary-600);
  color: var(--white);
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.rb-btn:hover {
  background: var(--primary-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.rb-btn:active {
  transform: translateY(0);
}

.rb-btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.rb-btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.9);
}

.rb-btn-secondary {
  background: var(--accent-500);
  color: var(--white);
}

.rb-btn-secondary:hover {
  background: var(--accent-600);
}

.rb-btn-small {
  padding: var(--space-2) var(--space-4);
  font-size: 0.8125rem;
}

.rb-btn:disabled,
.rb-btn.rb-btn-disabled,
.rb-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--gray-400);
  color: var(--gray-600);
  transform: none;
  box-shadow: none;
  position: relative;
}

.rb-btn:disabled:hover,
.rb-btn.rb-btn-disabled:hover,
.rb-btn[disabled]:hover {
  background: var(--gray-400);
  transform: none;
  box-shadow: none;
}

/* Tooltip for disabled submit button */
.rb-btn[data-pending-onboarding="true"] {
  position: relative;
}

.rb-btn[data-pending-onboarding="true"]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

/* Approve/Reject buttons */
.rb-btn-approve,
.rb-btn-reject {
  width: auto;
  min-width: 120px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
  padding: var(--space-2) var(--space-4);
}

.rb-btn-approve {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.rb-btn-approve:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.rb-btn-approve:active {
  transform: translateY(0);
}

.rb-btn-reject {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.rb-btn-reject:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.rb-btn-reject:active {
  transform: translateY(0);
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gray-900);
  z-index: 1000;
  pointer-events: none;
}

/* ============================================
   Actions Section
   ============================================ */

.rb-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
}

.rb-action-block h3 {
  margin: 0 0 var(--space-2) 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
}

.rb-upload-row {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.rb-file-input {
  font-size: 0.875rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--duration-fast);
}

.rb-file-input:hover {
  border-color: var(--primary-400);
}

.rb-file-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.rb-file-hint {
  margin-top: var(--space-2);
  margin-bottom: 0;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.rb-file-hint-list {
  margin: var(--space-2) 0 0 0;
  padding-left: var(--space-4);
  font-size: 0.8125rem;
  color: var(--gray-600);
  list-style-type: disc;
}

.rb-file-hint-list li {
  margin-bottom: var(--space-1);
}

.rb-file-hint-list li:last-child {
  margin-bottom: 0;
}

.rb-status-text {
  margin-top: var(--space-3);
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.rb-status-text.success {
  color: var(--success);
}

.rb-status-text.error {
  color: var(--error);
}

/* ============================================
   Documents List
   ============================================ */

.rb-doc-list {
  list-style: none;
  margin: var(--space-4) 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.rb-doc-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  transition: all var(--duration-fast);
}

.rb-doc-item:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.rb-doc-name {
  border: none;
  background: var(--primary-100);
  color: var(--primary-700);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 240px;
  text-overflow: ellipsis;
  overflow: hidden;
  transition: all var(--duration-fast);
  text-decoration: none;
  display: inline-block;
}

.rb-doc-name:hover {
  background: var(--primary-200);
  color: var(--primary-800);
  transform: translateY(-1px);
}

.rb-doc-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-left: auto;
  flex: 1;
  text-align: right;
}

.rb-icon-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rb-doc-delete {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--gray-500);
  background: var(--white);
  margin-left: var(--space-2);
  transition: all var(--duration-fast);
}

.rb-doc-delete:hover:not(:disabled) {
  background: var(--error-light);
  border-color: var(--error);
  color: var(--error);
  transform: scale(1.1);
}

.rb-doc-delete-disabled,
.rb-doc-delete:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-400);
}

.rb-doc-delete-disabled:hover,
.rb-doc-delete:disabled:hover {
  transform: none;
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-400);
}

/* ============================================
   Claims List (Sidebar)
   ============================================ */

.rb-claims-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.rb-claim-item {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 2px solid transparent;
  background: var(--gray-50);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all var(--duration-normal) var(--ease-out);
}

.rb-claim-item:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
  transform: translateX(4px);
}

.rb-claim-item--active {
  border-color: var(--primary-500);
  background: var(--primary-100);
  box-shadow: var(--shadow-md);
}

.rb-claim-id {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--gray-900);
}

.rb-claim-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: var(--space-1);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
  .rb-main-split {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .rb-page {
    padding: var(--space-4) var(--space-3) var(--space-6) var(--space-3);
  }

  .rb-header {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-5);
    gap: var(--space-4);
  }

  .rb-header-actions {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-3);
  }

  .rb-lang-btn {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8125rem;
  }

  .rb-lang-icon {
    width: 16px;
    height: 16px;
  }

  .rb-lang-dropdown {
    min-width: 160px;
  }

  .rb-user-email {
    max-width: 120px;
  }

  .rb-user-menu-dropdown {
    right: 0;
    left: auto;
    min-width: 220px;
  }

  .rb-main {
    margin-top: var(--space-4);
  }

  .rb-main-split {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .rb-sidebar-card {
    position: static;
  }

  .rb-content {
    margin-top: 0;
  }

  .rb-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }

  .rb-claim-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .rb-doc-meta {
    display: none;
  }
}

/* ============================================
   Onboarding Overlay
   ============================================ */

.rb-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000; /* Ensure overlay is above header (z-index: 100) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.rb-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.rb-overlay-shell {
  position: relative;
  width: min(100% - var(--space-8), 1200px);
  max-height: calc(100% - var(--space-8));
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.rb-overlay-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

.rb-overlay-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
}

.rb-overlay-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-500);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.rb-overlay-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.rb-overlay-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Profile Modal Specific Styles - Larger and Scrollable */
.rb-profile-modal-shell {
  width: min(95% - var(--space-8), 900px) !important;
  max-width: 900px !important;
  max-height: calc(95vh - var(--space-8)) !important;
  height: calc(95vh - var(--space-8)) !important;
}

.rb-profile-modal-shell .rb-overlay-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-6);
}

.rb-profile-modal-shell .rb-overlay-body::-webkit-scrollbar {
  width: 8px;
}

.rb-profile-modal-shell .rb-overlay-body::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: var(--radius-md);
}

.rb-profile-modal-shell .rb-overlay-body::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--radius-md);
}

.rb-profile-modal-shell .rb-overlay-body::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

.rb-overlay-frame {
  width: 100%;
  height: calc(100vh - 8rem);
  border: none;
}

/* Confirm Modal Specific Styles */
.rb-confirm-modal-shell {
  width: min(90% - var(--space-8), 480px) !important;
  max-width: 480px !important;
  max-height: fit-content !important;
  height: auto !important;
}

.rb-confirm-modal-shell .rb-overlay-body {
  padding: var(--space-6);
}

.rb-confirm-message {
  font-size: 1rem;
  color: var(--gray-700);
  line-height: 1.6;
  margin: 0;
}

.rb-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.rb-confirm-footer .rb-btn-secondary {
  background: linear-gradient(135deg, #e879f9 0%, #d946ef 100%);
  color: white;
  border: none;
}

.rb-confirm-footer .rb-btn-secondary:hover {
  background: linear-gradient(135deg, #d946ef 0%, #c026d3 100%);
}

.rb-confirm-footer .rb-btn-primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
}

/* ============================================
   Profile Modal Styles
   ============================================ */

.rb-profile-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  transition: all var(--duration-fast);
}

.rb-profile-card:hover {
  border-color: var(--primary-300);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rb-profile-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--gray-200);
}

.rb-profile-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border-radius: var(--radius-md);
  color: white;
  flex-shrink: 0;
}

.rb-profile-card-icon svg {
  width: 20px;
  height: 20px;
}

.rb-profile-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.rb-profile-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.rb-profile-field {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  transition: all var(--duration-fast);
}

.rb-profile-field:hover {
  border-color: var(--primary-300);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.rb-profile-field-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-50);
  border-radius: var(--radius-md);
  color: var(--primary-600);
  flex-shrink: 0;
}

.rb-profile-field-icon svg {
  width: 18px;
  height: 18px;
}

.rb-profile-field-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.rb-profile-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-1);
}

.rb-profile-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-900);
  line-height: 1.5;
  word-break: break-word;
}

.rb-profile-value:empty::before {
  content: "-";
  color: var(--gray-400);
  font-style: italic;
  font-weight: 400;
}

.rb-profile-actions {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 2px solid var(--gray-200);
}

.rb-btn-full {
  width: 100%;
  justify-content: center;
}

@media (max-width: 768px) {
  .rb-overlay {
    padding: 0;
  }

  .rb-overlay-shell {
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-height: 100%;
  }

  .rb-profile-modal-shell {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }

  .rb-profile-card {
    padding: var(--space-4);
  }

  .rb-profile-field {
    padding: var(--space-3);
  }

  .rb-profile-card-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
  }

  .rb-overlay-frame {
    height: calc(100vh - 4rem);
  }
}

/* ============================================
   Password Change Modal Form
   ============================================ */

.rb-form-group {
  margin-bottom: var(--space-5);
}

.rb-form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.rb-form-group input[type="password"],
.rb-form-group input[type="text"] {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast);
  background: var(--white);
  color: var(--gray-900);
}

.rb-form-group input[type="password"]:focus,
.rb-form-group input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.rb-form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: var(--space-1);
}

.rb-form-error {
  padding: var(--space-3);
  background: var(--error-light);
  color: var(--error);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: var(--space-4);
}

.rb-form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-6);
}

.rb-text-muted {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: var(--space-2);
}

.rb-text-bold {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: var(--space-4);
  word-break: break-all;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

.rb-text-center {
  text-align: center;
}

.rb-text-small {
  font-size: 0.875rem;
}

.rb-btn-link {
  background: none;
  border: none;
  color: var(--primary-600);
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
  padding: 0;
  margin-left: var(--space-2);
}

.rb-btn-link:hover {
  color: var(--primary-700);
}

/* OTP Inputs */
.rb-otp-inputs {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin: var(--space-4) 0;
}

.rb-otp-input {
  width: 48px;
  height: 48px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.rb-otp-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.rb-otp-input.error {
  border-color: var(--error);
  background: var(--error-light);
}

/* Notification Popup */
.rb-notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: rb-notification-fade-in 0.3s ease-out;
}

.rb-notification-content {
  background: var(--white);
  border-radius: 12px;
  padding: var(--space-6);
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  position: relative;
  animation: rb-notification-slide-up 0.3s ease-out;
}

.rb-notification-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--gray-500);
  cursor: pointer;
  padding: var(--space-1);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.rb-notification-close:hover {
  background-color: var(--gray-100);
  color: var(--gray-700);
}

.rb-notification-close:active {
  transform: scale(0.95);
}

.rb-notification-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--success-light);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.rb-notification-icon.error {
  background-color: var(--error-light);
  color: var(--error);
}

.rb-notification-icon.warning {
  background-color: var(--warning-light);
  color: var(--warning);
}

.rb-notification-icon svg {
  width: 24px;
  height: 24px;
}

.rb-notification-message {
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-900);
  line-height: 1.5;
}

@keyframes rb-notification-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rb-notification-slide-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.rb-notification.rb-notification-hiding {
  animation: rb-notification-fade-out 0.3s ease-in forwards;
}

.rb-notification.rb-notification-hiding .rb-notification-content {
  animation: rb-notification-slide-down 0.3s ease-in forwards;
}

@keyframes rb-notification-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes rb-notification-slide-down {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(20px);
    opacity: 0;
  }
}

/* ============================================
   Modal Styles
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal.open .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border: none;
  border-radius: 50%;
  color: var(--gray-500);
  transition: all 0.2s ease;
  z-index: 10;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

.modal-content--large {
  max-width: 900px;
  text-align: left;
  padding-top: calc(2rem + 40px);
}

.modal-content--large .modal-close {
  position: sticky;
  top: 1rem;
  float: right;
  margin-top: calc(-1 * 2rem);
  margin-bottom: 1rem;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--gray-200);
}

/* ============================================
   Legal Document Modal
   ============================================ */
.legal-doc-modal-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.legal-doc-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.legal-doc-modal-content {
  font-size: 1rem;
  color: var(--gray-700);
  line-height: 1.8;
}

.legal-doc-modal-content h1,
.legal-doc-modal-content h2,
.legal-doc-modal-content h3,
.legal-doc-modal-content h4 {
  color: var(--gray-900);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.legal-doc-modal-content h1 {
  font-size: 1.5rem;
}

.legal-doc-modal-content h2 {
  font-size: 1.25rem;
}

.legal-doc-modal-content h3 {
  font-size: 1.125rem;
}

.legal-doc-modal-content p {
  margin-bottom: 1rem;
}

.legal-doc-modal-content ul,
.legal-doc-modal-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-doc-modal-content li {
  margin-bottom: 0.5rem;
}

.legal-doc-modal-content a {
  color: var(--primary-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-doc-modal-content a:hover {
  color: var(--primary-700);
}

.legal-doc-meta {
  color: var(--gray-500);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.legal-doc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--gray-500);
}

.legal-doc-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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