:root {
  /* Primary Brand Colors */
  --blue-700: #1A56DB;
  --blue-600: #1C64F2;
  --blue-500: #3F83F8;
  --blue-100: #E1EFFE;
  --blue-5:   #EBF5FF;

  /* Accent: Teal / Success */
  --teal-600: #0E9F6E;
  --teal-500: #0DB07D;
  --teal-100: #DEF7EC;
  --teal-50:  #F3FAF7;

  /* Accent: AI Purple */
  --purple-600: #7E3AF2;
  --purple-100: #EDEBFE;
  --purple-50:  #F5F3FF;

  /* Secondary: Warning / Error */
  --amber-500: #F59E0B;
  --amber-100: #FEF3C7;
  --amber-50:  #FFFBEB;
  --red-500:   #EF4444;
  --red-100:   #FEE2E2;

  /* Neutral Scale */
  --gray-900: #111827;
  --gray-800: #1F2937;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white:    #FFFFFF;

  /* Typography */
  --font-primary: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.14);

  /* Global Transition */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--gray-800);
  background-color: var(--gray-50);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Accessibility Keyboard Focus */
*:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* Typography elements */
h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--gray-900);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--gray-900);
}

p {
  color: var(--gray-800);
}

small, .copy-supporting {
  font-size: 14px;
  color: var(--gray-600);
}

.label-meta {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* Keyframes */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* Animation utilities */
.animated {
  opacity: 0;
  transform: translateY(20px);
}

.in-view {
  animation: fadeSlideUp 0.5s var(--transition) forwards;
}

.floating {
  animation: float 4s ease-in-out infinite;
}

/* Layout - Auth Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  animation: fadeSlideUp 0.6s var(--transition) forwards;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header .logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 32px;
  font-weight: 900;
  color: var(--blue-600);
}

.auth-header .tagline {
  color: var(--gray-500);
  font-size: 14px;
  margin-top: 8px;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  background: none;
  border: none;
  padding: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.auth-tab:hover {
  color: var(--gray-800);
}

.auth-tab--active {
  color: var(--blue-600);
  border-bottom-color: var(--blue-600);
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--gray-800);
  font-family: inherit;
  transition: var(--transition);
  background-color: var(--white);
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
  background-color: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
  border-color: var(--gray-200);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--gray-400);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.12);
  outline: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  gap: 8px;
  text-decoration: none;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background-color: var(--blue-600);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--blue-700);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--white);
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background-color: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.btn-ghost:hover {
  background-color: var(--gray-100);
}

.btn-teal-ghost {
  background-color: var(--white);
  border-color: var(--teal-500);
  color: var(--teal-600);
}

.btn-teal-ghost:hover {
  background-color: var(--teal-50);
}

.btn-danger-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--gray-500);
}

.btn-danger-ghost:hover {
  background-color: var(--red-100);
  color: var(--red-500);
  border-color: var(--red-500);
}

.btn-google {
  background-color: var(--white);
  border-color: var(--gray-300);
  color: var(--gray-800);
}

.btn-google:hover {
  background-color: var(--gray-50);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--gray-400);
  font-size: 12px;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--gray-200);
}

.auth-divider span {
  padding: 0 10px;
}

/* Layout - App Shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-shell.hidden {
  display: none !important;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background-color: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 10px;
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-brand .brand-icon {
  font-size: 24px;
  color: var(--blue-600);
}

.sidebar-brand .brand-text {
  font-size: 20px;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border-left: 3px solid transparent;
  transition: var(--transition);
  gap: 12px;
}

.nav-item:hover {
  background-color: var(--gray-100);
  color: var(--gray-900);
}

.nav-item--active {
  background-color: var(--blue-55);
  color: var(--blue-600);
  font-weight: 600;
  border-left-color: var(--blue-600);
}

.nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  width: 100%;
  padding: 8px 0;
  color: var(--gray-500);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.btn-logout:hover {
  color: var(--red-500);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.topbar {
  height: 64px;
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-email {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--blue-100);
  color: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Views Section */
#app-root {
  flex: 1;
  padding: 32px;
}

.view {
  display: none;
  animation: fadeSlideUp 0.4s var(--transition) forwards;
}

.view--active {
  display: block;
}

.view-header {
  margin-bottom: 24px;
}

.view-header h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.view-header p {
  color: var(--gray-500);
  font-size: 15px;
}

/* Card layout */
.card {
  background-color: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

/* Upload View */
.dropzone {
  border: 2px dashed var(--gray-300);
  background-color: var(--gray-50);
  border-radius: var(--radius-xl);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.dropzone:hover {
  background-color: var(--gray-100);
  border-color: var(--gray-400);
}

.dropzone.drop-active {
  border-color: var(--blue-500);
  background-color: var(--blue-5);
}

.dropzone.drop-active .dropzone-icon {
  color: var(--blue-600);
}

.dropzone-icon {
  font-size: 48px;
  color: var(--blue-500);
  transition: var(--transition);
}

.dropzone h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.dropzone p {
  font-size: 14px;
  color: var(--gray-500);
}

.upload-queue-container {
  margin-top: 32px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.upload-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.upload-card-icon {
  font-size: 20px;
  color: var(--blue-500);
}

.upload-card-filename {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-card-size {
  font-size: 12px;
  color: var(--gray-500);
  margin-left: 8px;
}

.progress-track {
  height: 6px;
  background-color: var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-600));
  transition: width 0.4s ease, background-color 0.4s ease;
}

.progress-fill.extracting {
  background: var(--blue-600);
}

.progress-fill.completed {
  background: var(--teal-500);
}

.progress-fill.processing {
  animation: progressPulse 1.5s ease-in-out infinite;
}

.upload-status-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
}

/* Documents Grid View */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 500px;
}

.search-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}

.search-wrapper input,
.filter-select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  padding: 10px 16px;
  font-size: 14px;
  color: var(--gray-800);
  font-family: inherit;
  transition: var(--transition);
  background-color: var(--white);
}

.search-wrapper input::placeholder {
  color: var(--gray-400);
}

.search-wrapper input:focus,
.filter-select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.12);
  outline: none;
}

.search-wrapper input {
  padding-left: 40px !important;
}

.filter-select {
  width: 160px !important;
}

/* Table styling */
.table-wrapper {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  margin-bottom: 24px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.doc-table th {
  background-color: var(--gray-5);
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.doc-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.doc-table tbody tr {
  cursor: pointer;
  transition: var(--transition);
}

.doc-table tbody tr:hover {
  background-color: var(--gray-50);
}

.doc-table tbody tr:last-child td {
  border-bottom: none;
}

.doc-filename-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--gray-900);
}

.doc-filename-cell i {
  color: var(--blue-500);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.badge--completed {
  background-color: var(--teal-100);
  color: var(--teal-600);
}

.badge--needs_review {
  background-color: var(--amber-100);
  color: var(--amber-500);
}

.badge--processing {
  background-color: var(--blue-5);
  color: var(--blue-600);
}

.badge--failed {
  background-color: var(--red-100);
  color: var(--red-500);
}

.badge--pending {
  background-color: var(--gray-100);
  color: var(--gray-500);
}

.badge--unknown {
  background-color: var(--amber-100);
  color: var(--amber-500);
}

.badge-connected {
  background-color: var(--teal-50);
  color: var(--teal-600);
  border: 1px solid var(--teal-100);
}

.badge-disconnected {
  background-color: var(--red-100);
  color: var(--red-500);
  border: 1px solid var(--red-200);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination-info {
  font-size: 14px;
  color: var(--gray-500);
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

/* Slide-Over Detail Panel */
.detail-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.detail-overlay.active {
  opacity: 1;
  visibility: visible;
}

.detail-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 520px;
  background-color: var(--white);
  box-shadow: var(--shadow-xl);
  z-index: 201;
  transform: translateX(100%);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.detail-panel.active {
  transform: translateX(0);
}

.detail-panel-header {
  padding: 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.detail-header-left h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-close {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  padding: 4px;
}

.btn-close:hover {
  color: var(--gray-700);
}

.detail-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-class-card {
  background-color: var(--purple-50);
  border: 1px solid var(--purple-100);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-class-card.unknown {
  background-color: var(--amber-50);
  border-color: var(--amber-100);
}

.detail-class-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--purple-600);
}

.detail-class-card.unknown .detail-class-header {
  color: var(--amber-500);
}

.class-robot-icon {
  font-size: 18px;
}

.detail-class-title {
  font-size: 15px;
}

.detail-class-reason {
  font-size: 13.5px;
  color: var(--gray-600);
  font-style: italic;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-section h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
}

.detail-indexes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-index-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.detail-index-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-index-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
}

.detail-index-value {
  background-color: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: monospace, Courier, sans-serif;
  font-size: 13px;
  color: var(--gray-800);
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--gray-200);
}

.info-tooltip-trigger {
  color: var(--gray-400);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  position: relative;
}

.info-tooltip-trigger:hover {
  color: var(--gray-700);
}

/* Tooltip implementation */
.info-tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  right: 0;
  width: 220px;
  background-color: var(--gray-900);
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  line-height: 1.4;
  font-weight: 400;
  font-family: var(--font-primary);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 10;
  white-space: normal;
  text-transform: none;
}

.info-tooltip-trigger:hover::after {
  opacity: 1;
}

.required-warn-icon {
  color: var(--amber-500);
  font-size: 13px;
}

/* Preview Box */
.preview-container {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  height: 320px;
  overflow: hidden;
  background-color: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--gray-500);
  text-align: center;
  padding: 24px;
}

.preview-placeholder i {
  font-size: 36px;
  color: var(--gray-400);
}

/* Classifications View */
.classifications-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.class-list-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.class-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.class-card {
  background-color: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.class-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.class-card--active {
  border-left: 3px solid var(--blue-600) !important;
  background-color: var(--blue-5) !important;
  border-color: var(--blue-100);
}

.class-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

.class-card p {
  font-size: 13px;
  color: var(--gray-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.class-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.editor-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  gap: 12px;
}

.placeholder-icon {
  font-size: 48px;
  color: var(--gray-300);
}

.editor-placeholder h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-700);
}

.editor-placeholder p {
  font-size: 14px;
  color: var(--gray-500);
  max-width: 400px;
}

.indexes-section {
  border-top: 1px solid var(--gray-200);
  margin-top: 24px;
  padding-top: 24px;
}

.indexes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.indexes-header h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gray-500);
}

.indexes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.index-editor-card {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.index-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.index-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-600);
}

.btn-remove-index {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
}

.btn-remove-index:hover {
  color: var(--red-500);
}

.index-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.index-inputs-grid .form-group:nth-child(3),
.index-inputs-grid .form-group:nth-child(4) {
  align-self: end;
}

/* Custom Toggle Switch */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-input {
  display: none;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background-color: var(--gray-300);
  border-radius: 12px;
  position: relative;
  transition: var(--transition);
}

.toggle-thumb {
  width: 20px;
  height: 20px;
  background-color: var(--white);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.toggle-input:checked + .toggle-track {
  background-color: var(--blue-600);
}

.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

.editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--gray-200);
  margin-top: 24px;
  padding-top: 24px;
}

/* Global Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: fadeIn 0.25s ease-out forwards;
}

.modal-card {
  background-color: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  padding: 32px;
  animation: fadeSlideUp 0.3s var(--transition) forwards;
}

.modal-header {
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
}

.modal-body {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Responsive Rules */
@media (max-width: 1023px) {
  .sidebar {
    width: 64px;
  }
  .sidebar-brand .brand-text,
  .sidebar-nav .nav-label,
  .sidebar-footer .nav-label {
    display: none;
  }
  .sidebar-brand {
    justify-content: center;
    padding: 0;
  }
  .nav-item {
    justify-content: center;
    padding: 12px 0;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .nav-item--active {
    border-bottom-color: var(--blue-600);
  }
  .sidebar-footer {
    padding: 16px 0;
    display: flex;
    justify-content: center;
  }
  .main-content {
    margin-left: 64px;
  }
}

@media (max-width: 767px) {
  .classifications-layout {
    grid-template-columns: 1fr;
  }
  .index-inputs-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0 16px;
  }
  #app-root {
    padding: 16px;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-left {
    max-width: none;
  }
}

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

/* Alert Warning Banners */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--amber-50);
  border: 1px solid var(--amber-100);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: var(--amber-500);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  animation: fadeSlideUp 0.3s var(--transition) forwards;
}

.alert-banner i {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-banner .alert-text {
  color: var(--gray-700);
}

.alert-banner .alert-link {
  color: var(--blue-600);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}

/* Dropzone chips styling */
.dropzone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  width: 100%;
  max-width: 500px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--blue-100);
  color: var(--blue-700);
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--blue-100);
  animation: fadeIn 0.2s ease-out forwards;
}

.file-chip i {
  font-size: 14px;
}

/* Profile Layout Styles */
.profile-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
  width: 100%;
}

.profile-card {
  width: 100%;
  max-width: 960px;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.profile-header-accent {
  background: linear-gradient(135deg, var(--blue-600), var(--purple-600));
  height: 120px;
  position: relative;
  margin-bottom: 50px;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  background-color: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid var(--white);
}

.profile-avatar i {
  font-size: 36px;
  color: var(--gray-400);
}

.profile-form-body {
  padding: 0 40px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
  /* Sidebar to Bottom Nav Conversion */
  .sidebar {
    width: 100% !important;
    height: 60px !important;
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    flex-direction: row !important;
    border-right: none !important;
    border-top: 1px solid var(--gray-200) !important;
    z-index: 1000 !important;
  }
  
  .sidebar-brand {
    display: none !important;
  }
  
  .sidebar-nav {
    flex-direction: row !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    gap: 0 !important;
  }
  
  .nav-item {
    flex-direction: column !important;
    padding: 8px 0 !important;
    font-size: 10px !important;
    gap: 2px !important;
    border-left: none !important;
    border-bottom: 3px solid transparent !important;
    flex: 1 !important;
    justify-content: center !important;
    height: 100% !important;
  }
  
  .nav-item--active {
    border-bottom-color: var(--blue-600) !important;
    background-color: var(--blue-5) !important;
  }
  
  .nav-label {
    font-size: 10px !important;
  }

  .sidebar-footer {
    display: none !important;
  }

  /* Main Area Adjustments */
  .main-content {
    margin-left: 0 !important;
    padding-bottom: 70px !important; /* Avoid bottom nav overlap */
  }

  .topbar {
    padding: 0 16px !important;
  }

  .topbar-title {
    font-size: 16px !important;
  }

  .user-email {
    display: none !important; /* Hide long email address on mobile */
  }

  /* Dashboard View */
  .dashboard-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .dashboard-details-row {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Classifications View */
  .classifications-layout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .class-list {
    max-height: 200px !important;
  }

  /* Documents View detail slider */
  .detail-panel {
    width: 100% !important;
  }

  .detail-body {
    grid-template-columns: 1fr !important; /* Stack preview and metadata */
  }

  .preview-container {
    height: 240px !important;
  }

  /* Account Profile */
  .profile-layout {
    grid-template-columns: 1fr !important;
  }

  .profile-form-body {
    padding: 20px !important;
  }

  /* General elements responsiveness */
  .view {
    padding: 16px !important;
  }

  .table-responsive {
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* Styled Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: 0.3s;
  border-radius: 24px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.switch input:checked + .slider {
  background-color: var(--blue-600);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}




