/* Atlas Platform - Application Styles */
/* Cream/Green theme matching reference design */

/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ==============================
   BASE STYLES
   ============================== */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Atlas Background */
.atlas-bg {
  background: var(--atlas-bg, #FAF7F2);
  color: var(--atlas-text, #1F2937);
  min-height: 100vh;
}

/* ==============================
   SIDEBAR
   ============================== */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 16rem;
  background: var(--atlas-sidebar, #1B4D3E);
  border-right: none;
  overflow-y: auto;
  z-index: 30;
}

.sidebar-section {
  padding: 1rem 0.75rem;
}

.sidebar-heading {
  padding: 0 0.75rem;
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 600;
  color: var(--atlas-sidebar-muted, rgba(255,255,255,0.6));
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ==============================
   NAVIGATION ITEMS
   ============================== */
.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.25rem;
  font-weight: 500;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  color: var(--atlas-muted, #6B7280);
  text-decoration: none;
  gap: 0.625rem;
}

.nav-item:hover {
  color: var(--atlas-text, #1F2937);
  background: var(--atlas-accent-light, #FAF7F2);
}

.nav-item-active {
  color: var(--atlas-text, #1F2937);
  background: var(--atlas-accent-light, #FAF7F2);
  font-weight: 600;
}

.nav-item-inactive {
  color: var(--atlas-muted, #6B7280);
}

.nav-item-inactive:hover {
  color: var(--atlas-text, #1F2937);
  background: var(--atlas-accent-light, #FAF7F2);
}

/* Sidebar-specific nav overrides */
.sidebar .nav-item {
  color: var(--atlas-sidebar-muted, rgba(255,255,255,0.6));
}

.sidebar .nav-item:hover {
  color: white;
  background: var(--atlas-sidebar-active, rgba(255,255,255,0.15));
}

.sidebar .nav-item-active {
  color: white;
  background: var(--atlas-sidebar-active, rgba(255,255,255,0.15));
  border-left: none;
  font-weight: 600;
}

.sidebar .nav-item-inactive {
  color: var(--atlas-sidebar-muted, rgba(255,255,255,0.6));
}

.sidebar .nav-item-inactive:hover {
  color: white;
  background: var(--atlas-sidebar-active, rgba(255,255,255,0.15));
}

/* ==============================
   MOBILE NAVIGATION
   ============================== */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--atlas-cream, #FFFDF9);
  border-top: 1px solid var(--atlas-accent-medium, #F0EBE3);
  z-index: 40;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
  font-size: 0.6875rem;
  line-height: 1rem;
  color: var(--atlas-muted, #6B7280);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-nav-item:hover {
  color: var(--atlas-text, #1F2937);
}

@media (min-width: 1024px) {
  .mobile-nav {
    display: none;
  }
}

/* ==============================
   CARDS
   ============================== */
.card {
  background: var(--atlas-cream, #FFFDF9);
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--atlas-accent-medium, #F0EBE3);
}

.card-body {
  padding: 1.25rem 1.5rem;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--atlas-accent-medium, #F0EBE3);
}

/* ==============================
   ALERT COMPONENTS
   ============================== */
.alert {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: var(--atlas-cream, #FFFDF9);
  color: var(--atlas-text, #1F2937);
}

.alert-success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #059669;
}

.alert-warning {
  background: #FEF3C7;
  border-color: #FCD34D;
  color: #D97706;
}

.alert-danger {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

.alert-info {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #2563EB;
}

/* ==============================
   BUTTONS
   ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: var(--atlas-cream, #FFFDF9);
  color: var(--atlas-text, #1F2937);
  text-decoration: none;
}

.btn:hover {
  border-color: rgba(27,77,62,.3);
}

.btn-primary {
  background: var(--atlas-primary, #1B4D3E);
  border-color: var(--atlas-primary, #1B4D3E);
  color: white;
}

.btn-primary:hover {
  background: var(--atlas-primary-light, #2D6A4F);
}

.btn-secondary {
  background: var(--atlas-accent-light, #FAF7F2);
  border-color: var(--atlas-accent-medium, #F0EBE3);
  color: var(--atlas-text, #1F2937);
}

.btn-secondary:hover {
  border-color: rgba(27,77,62,.3);
  color: var(--atlas-primary, #1B4D3E);
}

.btn-danger {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

.btn-danger:hover {
  background: #FEE2E2;
}

.btn-success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #059669;
}

.btn-success:hover {
  background: #DCFCE7;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* ==============================
   BADGES
   ============================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.badge-success {
  background: #E8F5E9;
  color: #059669;
}

.badge-warning {
  background: #FEF3C7;
  color: #D97706;
}

.badge-danger {
  background: #FEF2F2;
  color: #DC2626;
}

.badge-info {
  background: #EFF6FF;
  color: #2563EB;
}

/* ==============================
   STATUS COLOR UTILITIES
   ============================== */
.bg-success {
  background-color: #059669;
}

.bg-danger {
  background-color: #DC2626;
}

.bg-warning {
  background-color: #D97706;
}

.bg-info {
  background-color: #2563EB;
}

.text-success {
  color: #059669;
}

.text-danger {
  color: #DC2626;
}

.text-warning {
  color: #D97706;
}

.text-info {
  color: #2563EB;
}

/* ==============================
   FORM INPUTS
   ============================== */
.form-input,
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="url"],
.field textarea,
.field select {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: white;
  color: var(--atlas-text, #1F2937);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--atlas-muted, #6B7280);
}

.form-input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--atlas-primary, #1B4D3E);
  box-shadow: 0 0 0 4px rgba(27,77,62,.1);
}

.form-label,
.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--atlas-text, #1F2937);
  margin-bottom: 0.375rem;
}

.form-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #DC2626;
}

/* ==============================
   DATA TABLES
   ============================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  border-bottom: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: var(--atlas-accent-light, #FAF7F2);
}

.data-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--atlas-muted, #6B7280);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--atlas-text, #1F2937);
  border-bottom: 1px solid var(--atlas-accent-medium, #F0EBE3);
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background: var(--atlas-accent-light, #FAF7F2);
}

/* ==============================
   WEALTH SCORE RING
   ============================== */
.wealth-score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wealth-score-ring svg {
  transform: rotate(-90deg);
}

/* ==============================
   CHART CONTAINER
   ============================== */
.chart-container {
  position: relative;
  height: 16rem;
}

@media (min-width: 768px) {
  .chart-container {
    height: 20rem;
  }
}

@media (min-width: 1024px) {
  .chart-container {
    height: 24rem;
  }
}

/* ==============================
   PROGRESS BARS
   ============================== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--atlas-accent-medium, #F0EBE3);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--atlas-primary, #1B4D3E), var(--atlas-primary-muted, #40916C));
  border-radius: 999px;
  transition: width 0.5s ease-in-out;
}

/* ==============================
   MODALS
   ============================== */
.modal-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
}

.modal-container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 51;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  background: var(--atlas-cream, #FFFDF9);
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  max-width: 32rem;
  width: 100%;
  margin: 2rem;
}

/* ==============================
   SKELETON / LOADING STATES
   ============================== */
.skeleton {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  background: var(--atlas-accent-medium, #F0EBE3);
  border-radius: 0.5rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==============================
   SCROLLBAR
   ============================== */
.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: var(--atlas-accent-medium, #F0EBE3);
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: rgba(27,77,62,.2);
}

/* ==============================
   DEVISE / AUTH FORMS
   ============================== */
.devise-form {
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem;
}

.devise-form .atlas-card {
  padding: 2rem;
}

.devise-form h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--atlas-text, #1F2937);
  margin-bottom: 0.5rem;
}

.devise-form .field {
  margin-bottom: 1.25rem;
}

.devise-form .actions {
  margin-top: 1.5rem;
}

.devise-form .actions input[type="submit"],
.devise-form .actions button[type="submit"] {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  background: var(--atlas-primary, #1B4D3E);
  border: none;
  color: white;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.devise-form .actions input[type="submit"]:hover,
.devise-form .actions button[type="submit"]:hover {
  background: var(--atlas-primary-light, #2D6A4F);
}

.devise-links {
  margin-top: 1.5rem;
  text-align: center;
}

.devise-links a {
  color: var(--atlas-primary, #1B4D3E);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}

.devise-links a:hover {
  color: var(--atlas-primary-light, #2D6A4F);
}

/* ==============================
   UTILITY: TEXT BALANCE
   ============================== */
.text-balance {
  text-wrap: balance;
}

/* ==============================
   HIGHLIGHT BOXES
   ============================== */
.highlight-box {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
}

.highlight-box.green {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.highlight-box.amber {
  background: #FEF3C7;
  border-color: #FCD34D;
}

.highlight-box.red {
  background: #FEF2F2;
  border-color: #FECACA;
}

.highlight-box.blue {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

/* ==============================
   LINKS
   ============================== */
a {
  color: var(--atlas-primary, #1B4D3E);
  text-decoration: none;
}

a:hover {
  color: var(--atlas-primary-light, #2D6A4F);
}

/* Reset link colors in nav items */
.nav-item,
.mobile-nav-item {
  color: inherit;
}

/* ==============================
   STAT CARDS
   ============================== */
.stat-card {
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: var(--atlas-cream, #FFFDF9);
}

.stat-card:hover {
  border-color: rgba(27,77,62,.2);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--atlas-muted, #6B7280);
  font-weight: 500;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--atlas-text, #1F2937);
  margin-top: 0.5rem;
}

.stat-change {
  display: flex;
  align-items: center;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

/* ==============================
   LOGO & BRAND UTILITY CLASSES
   ============================== */
.bg-logo-gradient {
  background: var(--atlas-accent, #E8DFD0);
}

.text-navy-950 {
  color: var(--atlas-primary, #1B4D3E);
}

.tracking-atlas-brand {
  letter-spacing: 0.2px;
}

.tracking-atlas-label {
  letter-spacing: 0.12em;
}

/* ==============================
   THEME COLOR UTILITIES
   ============================== */
.text-primary {
  color: var(--atlas-primary, #1B4D3E);
}

.bg-primary {
  background-color: var(--atlas-primary, #1B4D3E);
}

.bg-emerald-400 {
  background-color: #059669;
}

/* ==============================
   AI EXPLAINER COMPONENT
   ============================== */
.shadow-atlas-dark {
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
}

.rounded-atlas-md {
  border-radius: 20px;
}

.rounded-atlas-sm {
  border-radius: 12px;
}

.backdrop-blur-atlas {
  backdrop-filter: blur(14px);
}

.ai-explainer-toggle {
  position: fixed;
  z-index: 60;
}

.ai-explainer-panel {
  position: relative;
}

/* ==============================
   ATLAS CARD FOOTER
   ============================== */
.atlas-card-footer {
  padding: 1rem;
  border-top: 1px solid var(--atlas-accent-medium, #F0EBE3);
}

/* ==============================
   STATUS BADGES
   ============================== */
.status-active,
.status-success {
  background: #E8F5E9;
  color: #059669;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.status-pending,
.status-processing {
  background: #FEF3C7;
  color: #D97706;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.status-inactive,
.status-error {
  background: #FEF2F2;
  color: #DC2626;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

/* ==============================
   HELPER CLASS OVERRIDES
   ============================== */
.atlas-dark-theme .bg-green-100 {
  background: #E8F5E9;
}
.atlas-dark-theme .text-green-800 {
  color: #059669;
}
.atlas-dark-theme .bg-yellow-100 {
  background: #FEF3C7;
}
.atlas-dark-theme .text-yellow-800 {
  color: #D97706;
}
.atlas-dark-theme .bg-red-100 {
  background: #FEF2F2;
}
.atlas-dark-theme .text-red-800 {
  color: #DC2626;
}
.atlas-dark-theme .bg-blue-100 {
  background: #EFF6FF;
}
.atlas-dark-theme .text-blue-800 {
  color: #2563EB;
}
.atlas-dark-theme .bg-gray-100 {
  background: var(--atlas-accent-light, #FAF7F2);
}
.atlas-dark-theme .text-gray-800 {
  color: var(--atlas-text, #1F2937);
}
.atlas-dark-theme .border-red-300 {
  border-color: #FECACA;
}
.atlas-dark-theme .border-yellow-300 {
  border-color: #FCD34D;
}
.atlas-dark-theme .border-blue-300 {
  border-color: #BFDBFE;
}
.atlas-dark-theme .border-gray-300 {
  border-color: var(--atlas-accent-medium, #F0EBE3);
}

/* Gray text variants */
.atlas-dark-theme .text-gray-400 {
  color: var(--atlas-muted, #6B7280);
}
.atlas-dark-theme .text-gray-500 {
  color: var(--atlas-muted, #6B7280);
}
.atlas-dark-theme .text-gray-600 {
  color: #4B5563;
}
.atlas-dark-theme .text-gray-700 {
  color: #374151;
}
.atlas-dark-theme .text-gray-900 {
  color: var(--atlas-text, #1F2937);
}

/* ==============================
   DOMAIN BREAKDOWN (Wealth Score)
   ============================== */
.domain-card {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: var(--atlas-cream, #FFFDF9);
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.domain-card:hover {
  border-color: rgba(27,77,62,.3);
  background: var(--atlas-accent-light, #FAF7F2);
}

/* ==============================
   TABLE STYLES (general)
   ============================== */
table {
  width: 100%;
  border-collapse: collapse;
}

.atlas-dark-theme table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--atlas-muted, #6B7280);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: var(--atlas-accent-light, #FAF7F2);
}

.atlas-dark-theme table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--atlas-text, #1F2937);
  border-bottom: 1px solid var(--atlas-accent-medium, #F0EBE3);
}

.atlas-dark-theme table tbody tr:hover {
  background: var(--atlas-accent-light, #FAF7F2);
}

/* ==============================
   SEARCH / FILTER BARS
   ============================== */
.search-input {
  flex: 1 1 auto;
  padding: 0.625rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: white;
  color: var(--atlas-text, #1F2937);
  outline: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: var(--atlas-muted, #6B7280);
}

.search-input:focus {
  border-color: var(--atlas-primary, #1B4D3E);
  box-shadow: 0 0 0 4px rgba(27,77,62,.1);
}

/* ==============================
   SR-ONLY (Accessibility)
   ============================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==============================
   TABS
   ============================== */
.tab-group {
  display: flex;
  gap: 0.25rem;
  border-radius: 12px;
  padding: 0.25rem;
  background: var(--atlas-accent-light, #FAF7F2);
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
}

.tab-item {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  color: var(--atlas-muted, #6B7280);
  transition: all 0.2s ease;
}

.tab-item:hover {
  color: var(--atlas-text, #1F2937);
}

.tab-item.active {
  background: var(--atlas-primary, #1B4D3E);
  color: white;
}

/* ==============================
   EMPTY STATE
   ============================== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  background: var(--atlas-accent-light, #FAF7F2);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--atlas-text, #1F2937);
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--atlas-muted, #6B7280);
  margin-top: 0.5rem;
}

/* ==============================
   DRAWER (Full-size slide-over)
   ============================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 90%;
  max-width: 90%;
  background: var(--atlas-bg, #FAF7F2);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 61;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-panel.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: var(--atlas-cream, #FFFDF9);
  flex-shrink: 0;
}

.drawer-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--atlas-text, #1F2937);
  margin: 0;
}

.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: transparent;
  color: var(--atlas-muted, #6B7280);
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-close:hover {
  background: var(--atlas-accent-light, #FAF7F2);
  color: var(--atlas-text, #1F2937);
}

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

.drawer-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--atlas-accent-medium, #F0EBE3);
  background: var(--atlas-cream, #FFFDF9);
  flex-shrink: 0;
}

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

/* ==============================
   PDF VIEWER
   ============================== */
.pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--atlas-cream, #FFFDF9);
  border-bottom: 1px solid var(--atlas-accent-medium, #F0EBE3);
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
}

.pdf-toolbar .toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pdf-toolbar .toolbar-separator {
  width: 1px;
  height: 1.5rem;
  background: var(--atlas-accent-medium, #F0EBE3);
  margin: 0 0.25rem;
}

.pdf-toolbar .toolbar-info {
  font-size: 0.8125rem;
  color: var(--atlas-muted, #6B7280);
  font-weight: 500;
}

.pdf-page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
}

.pdf-page-wrapper canvas {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.pdf-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.pdf-overlay.sign-mode {
  pointer-events: auto;
  cursor: crosshair;
}

.pdf-signature-marker {
  position: absolute;
  border: 2px dashed var(--atlas-primary, #1B4D3E);
  background: rgba(27, 77, 62, 0.08);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--atlas-primary, #1B4D3E);
  font-weight: 600;
}

/* ==============================
   FILE UPLOAD DROPZONE
   ============================== */
.upload-dropzone {
  border: 2px dashed var(--atlas-accent-medium, #F0EBE3);
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--atlas-cream, #FFFDF9);
}

.upload-dropzone:hover {
  border-color: rgba(27, 77, 62, 0.3);
  background: rgba(27, 77, 62, 0.02);
}

.upload-dropzone.drag-active {
  border-color: var(--atlas-primary, #1B4D3E);
  background: rgba(27, 77, 62, 0.05);
  box-shadow: 0 0 0 4px rgba(27, 77, 62, 0.1);
}

.upload-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 14px;
  background: var(--atlas-accent-light, #FAF7F2);
  color: var(--atlas-primary, #1B4D3E);
  margin-bottom: 0.75rem;
}

.upload-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  border-radius: 10px;
  background: var(--atlas-cream, #FFFDF9);
  margin-top: 0.5rem;
}

.upload-file-item .file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.upload-file-item .file-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--atlas-text, #1F2937);
}

.upload-file-item .file-size {
  font-size: 0.75rem;
  color: var(--atlas-muted, #6B7280);
}

.upload-file-item .file-remove {
  color: var(--atlas-muted, #6B7280);
  cursor: pointer;
  transition: color 0.2s;
}

.upload-file-item .file-remove:hover {
  color: #E53E3E;
}

/* ==============================
   SIGNATURE PAD
   ============================== */
.signature-pad {
  border: 2px solid var(--atlas-accent-medium, #F0EBE3);
  border-radius: 12px;
  background: white;
  cursor: crosshair;
  touch-action: none;
}

.signature-pad.active {
  border-color: var(--atlas-primary, #1B4D3E);
  box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.1);
}

.signature-preview {
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  border-radius: 8px;
  padding: 1rem;
  background: white;
  text-align: center;
  min-height: 4rem;
}

.signature-preview img {
  max-width: 100%;
  max-height: 80px;
}

.signature-mode-selector {
  display: flex;
  gap: 0.5rem;
}

.signature-mode-selector button {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  border-radius: 8px;
  background: transparent;
  color: var(--atlas-muted, #6B7280);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.signature-mode-selector button:hover {
  border-color: rgba(27, 77, 62, 0.3);
  color: var(--atlas-text, #1F2937);
}

.signature-mode-selector button.active {
  background: var(--atlas-primary, #1B4D3E);
  border-color: var(--atlas-primary, #1B4D3E);
  color: white;
}

/* ==============================
   OTP INPUT
   ============================== */
.otp-input-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.otp-digit {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--atlas-text, #1F2937);
  border: 2px solid var(--atlas-accent-medium, #F0EBE3);
  border-radius: 10px;
  background: white;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  caret-color: var(--atlas-primary, #1B4D3E);
}

.otp-digit:focus {
  border-color: var(--atlas-primary, #1B4D3E);
  box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.15);
}

.otp-digit.filled {
  border-color: var(--atlas-primary, #1B4D3E);
  background: rgba(27, 77, 62, 0.03);
}

/* ==============================
   STEP INDICATOR
   ============================== */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.step-indicator-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-indicator-item .step-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid var(--atlas-accent-medium, #F0EBE3);
  background: transparent;
  color: var(--atlas-muted, #6B7280);
  transition: all 0.3s ease;
}

.step-indicator-item .step-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--atlas-muted, #6B7280);
  transition: color 0.3s ease;
}

.step-indicator-item .step-line {
  width: 3rem;
  height: 2px;
  background: var(--atlas-accent-medium, #F0EBE3);
  margin: 0 0.5rem;
  transition: background 0.3s ease;
}

.step-indicator-item.active .step-circle {
  border-color: var(--atlas-primary, #1B4D3E);
  color: var(--atlas-primary, #1B4D3E);
}

.step-indicator-item.active .step-label {
  color: var(--atlas-primary, #1B4D3E);
  font-weight: 600;
}

.step-indicator-item.completed .step-circle {
  background: var(--atlas-primary, #1B4D3E);
  border-color: var(--atlas-primary, #1B4D3E);
  color: white;
}

.step-indicator-item.completed .step-label {
  color: var(--atlas-text, #1F2937);
}

.step-indicator-item.completed .step-line {
  background: var(--atlas-primary, #1B4D3E);
}

/* ==============================
   DOCUMENT GRID
   ============================== */
.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.document-card {
  border: 1px solid var(--atlas-accent-medium, #F0EBE3);
  border-radius: 14px;
  background: var(--atlas-cream, #FFFDF9);
  padding: 1.25rem;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.document-card:hover {
  border-color: rgba(27, 77, 62, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
  color: inherit;
}

.document-card .doc-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.document-card .doc-icon.pdf {
  background: #FEF2F2;
  color: #DC2626;
}

.document-card .doc-icon.word {
  background: #EFF6FF;
  color: #2563EB;
}

.document-card .doc-icon.excel {
  background: #F0FDF4;
  color: #16A34A;
}

.document-card .doc-icon.image {
  background: #FAF5FF;
  color: #9333EA;
}

.document-card .doc-icon.default {
  background: var(--atlas-accent-light, #FAF7F2);
  color: var(--atlas-muted, #6B7280);
}

.document-card .doc-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--atlas-text, #1F2937);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card .doc-meta {
  font-size: 0.75rem;
  color: var(--atlas-muted, #6B7280);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ==============================
   ATLAS ANIMATE-IN
   ============================== */
@keyframes atlas-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.atlas-animate-in {
  animation: atlas-fade-in 0.3s ease-out forwards;
}
