:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Light Theme */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.7);
  --bg-input: #0f172a;
  --border-color: rgba(148, 163, 184, 0.15);
  --border-focus: #0038A8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #0038A8;
  --primary-hover: #002c86;
  --primary-light: rgba(0, 56, 168, 0.15);
  --brand-orange: #FF5B00;
  --brand-blue: #0038A8;
  
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-violet: #8b5cf6;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.35);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f8fafc;
  --border-color: #cbd5e1;
  --border-focus: #0038A8;
  
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;
  
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.12);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Surfaces and Cards (Clean, GPU-efficient without sluggish backdrop blurs) */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.top-header {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  padding-top: max(0.5rem, env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  cursor: pointer;
  padding: 0 0.5rem;
  margin-left: 1.5rem;
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.header-icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.header-icon-btn:active {
  transform: scale(0.92);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

[data-theme="light"] .brand-name {
  background: linear-gradient(135deg, #1e293b 0%, #4338ca 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.header-refer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(236, 72, 153, 0.35);
  color: #f472b6;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.header-refer-pill:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(139, 92, 246, 0.25));
  transform: translateY(-1px);
}

.header-user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.25rem 0.75rem 0.25rem 0.3rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.header-user-pill:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.header-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.header-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Nav Tabs */
.nav-tabs-wrapper {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-main);
}

.nav-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 700;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Tab Views */
.tab-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-view.active {
  display: block;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: white;
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: var(--accent-emerald);
  color: white;
}

.btn-icon {
  padding: 0.55rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

/* PIN Input Box */
.pin-input-group {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.pin-digit {
  width: 48px;
  height: 56px;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  transition: var(--transition);
}

.pin-digit:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  transform: scale(1.05);
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-info h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ================= SECTION HEADERS & FILTER CONTROLS ================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.section-header-text {
  flex: 1;
  min-width: 220px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.section-action-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.filter-controls-card {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.filter-top-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-clear-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.35rem;
  font-size: 0.9rem;
  transition: var(--transition);
}

.search-clear-btn:hover {
  color: var(--text-main);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1rem;
}

.search-input {
  padding-left: 2.4rem;
  padding-right: 2rem;
}

.filter-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.filter-select-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-select {
  width: auto;
  min-width: 180px;
  max-width: 100%;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Category Quick Chips Bar (Horizontal swipeable on mobile) */
.category-chips-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.65rem 0 0.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-chips-scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.cat-chip:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.cat-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Category Filter Pills (Legacy support) */
.category-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.cat-pill {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.cat-pill:hover, .cat-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* Document Card */
.doc-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.doc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.3);
}

.doc-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.doc-type-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
}

.doc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
  line-height: 1.3;
}

.doc-category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  margin-top: 0.3rem;
}

.doc-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0.5rem 0;
  display: flex;
  gap: 0.85rem;
}

.doc-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

/* Secrets Card */
.secret-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.secret-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.3);
}

.secret-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
}

.secret-masked-box {
  background: var(--bg-input);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin: 0.85rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.masked-value {
  font-family: monospace;
  font-size: 1.15rem;
  letter-spacing: 3px;
  color: var(--text-muted);
}

.revealed-value {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-emerald);
  word-break: break-all;
}

/* To-Do Items */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.todo-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

.todo-item:hover {
  background: var(--bg-card-hover);
}

.todo-item.completed {
  opacity: 0.65;
}

.todo-item.completed .todo-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin-top: 2px;
  touch-action: manipulation;
}

.todo-checkbox.checked {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: white;
}

.todo-content {
  flex: 1;
  min-width: 0;
}

.todo-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  word-break: break-word;
}

.todo-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.35;
  word-break: break-word;
}

.todo-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  flex-wrap: wrap;
  line-height: 1;
}

.todo-meta > * {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.priority-badge {
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
}

.priority-high {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.priority-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.priority-low {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.badge-overdue {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-due-today {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Profile Cards Grid */
.profile-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content.modal-lg {
  max-width: 800px;
}

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

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
}

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

/* Auth Screens */
.auth-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1rem 0;
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  padding: 2.25rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin: auto auto 2.5rem auto;
}

.auth-toggle-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 1.5rem;
}

.auth-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* 6-Digit PIN Individual Boxes & Proceed Button */
.pin-boxes-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 1.15rem 0 0.5rem 0;
  width: 100%;
}

.pin-digit-box {
  width: 44px;
  height: 52px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
}

.pin-digit-box:focus {
  border-color: #c8102e;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.25);
  background: var(--bg-card);
}

[data-theme="light"] .pin-digit-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .pin-digit-box:focus {
  background: #ffffff;
  border-color: #c8102e;
}

@media (max-width: 360px) {
  .pin-digit-box {
    width: 38px;
    height: 46px;
    font-size: 1.3rem;
    gap: 5px;
  }
}

.btn-proceed {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

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

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.empty-icon {
  font-size: 3.5rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* Alerts & Toasts */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideInRight 0.3s ease;
}

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

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .top-header {
    height: auto;
    min-height: 56px;
    padding: 0.4rem 0.75rem;
    padding-top: max(0.4rem, env(safe-area-inset-top));
  }
  .header-center {
    margin-left: 1.25rem;
  }
  .brand-tagline {
    display: none !important;
  }
  .header-user-name {
    display: none !important;
  }
  .header-user-pill {
    padding: 3px;
    border-radius: 50%;
  }
  .header-refer-label {
    display: none;
  }
  .header-refer-pill {
    padding: 0.4rem;
    width: 36px;
    height: 36px;
    justify-content: center;
    border-radius: 50%;
  }
  .desktop-only {
    display: none !important;
  }
  /* Remove horizontal scrolling nav on mobile / Android */
  .nav-tabs-wrapper {
    display: none !important;
  }
  /* Show Native Android Bottom Navigation (5-slot layout) */
  .android-bottom-nav {
    display: flex !important;
  }
  /* Hide floating action button: '+' is now docked in bottom nav center slot */
  .android-fab-wrapper {
    display: none !important;
  }
  .main-content {
    padding: 0.85rem 0.85rem calc(80px + env(safe-area-inset-bottom)) 0.85rem !important;
  }
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .doc-card, .secret-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 1.1rem 1rem !important;
  }
  .doc-actions {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.45rem !important;
    width: 100% !important;
  }
  .doc-actions .btn-sm {
    padding: 0.45rem 0.25rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    justify-content: center !important;
    width: 100% !important;
  }
  .auth-card {
    padding: 1.5rem;
  }
  .profile-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100% !important;
  }
  .profile-cards-grid > .glass {
    padding: 1.25rem 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .footer-links {
    flex-direction: column;
    gap: 0.6rem;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .section-action-btn {
    width: 100%;
    justify-content: center;
  }
  .section-header-actions {
    width: 100%;
  }
  .section-header-actions .section-action-btn {
    flex: 1;
  }

  .filter-controls-card {
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
  }
  .filter-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .search-input-wrapper {
    width: 100%;
    min-width: 0;
  }
  .filter-select-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .filter-select {
    flex: 1;
    min-width: 0;
    width: 100%;
  }

  /* Android Bottom Sheet Modals */
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    height: 88vh !important;
    min-height: 85vh !important;
    max-height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: hidden !important;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom)) !important;
    animation: slideUpBottomNav 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  #modal-pin-prompt .modal-content,
  #modal-confirm .modal-content {
    height: auto !important;
    min-height: auto !important;
    overflow-y: auto !important;
  }
  @keyframes slideUpBottomNav {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}

/* ================= MODERN SECTION HEADERS ================= */
.section-header-modern {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  padding: 0.25rem 0;
  width: 100%;
}

.section-header-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.section-header-content {
  flex: 1;
  min-width: 0;
}

.section-title-modern {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-main);
  line-height: 1.25;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-subtitle-modern {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Active Page Title Badge in Top App Bar */
.header-page-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-left: 0.65rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  white-space: nowrap;
}

[data-theme="light"] .header-page-title-badge {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  border-color: rgba(99, 102, 241, 0.28);
}

@media (max-width: 480px) {
  .header-page-title-badge {
    font-size: 0.74rem;
    padding: 0.22rem 0.55rem;
    margin-left: 0.35rem;
    gap: 0.35rem;
  }
  .section-title-modern {
    font-size: 1.3rem;
  }
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin-left: auto;
}

.section-action-pill {
  padding: 0.38rem 0.75rem !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  white-space: nowrap !important;
}

/* ================= UNIFIED SEARCH & FILTER CONTROLS ================= */
.search-filter-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  width: 100%;
}

.search-bar-unified {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-bar-unified .search-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-input-unified {
  width: 100%;
  padding: 0.75rem 2.4rem 0.75rem 2.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}

.search-input-unified:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

.filter-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.filter-icon-btn:active {
  transform: scale(0.94);
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
}

.filter-active-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.active-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.active-category-chip button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
}

.active-category-chip button:hover {
  color: var(--accent-rose);
}

/* ================= ANDROID BOTTOM NAVIGATION BAR (5 SLOTS) ================= */
.android-bottom-nav {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.4rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .android-bottom-nav {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
  position: relative;
  transition: color 0.15s ease;
  border-radius: var(--radius-md);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

[data-theme="light"] .bottom-nav-item {
  color: #64748b;
}

.bottom-nav-icon-box {
  position: relative;
  width: 38px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: transform 0.15s ease;
}

.bottom-nav-item.active .bottom-nav-icon-box {
  color: var(--primary) !important;
  transform: translateY(-2px);
}

.bottom-nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
  transition: color 0.15s ease;
}

.bottom-nav-item.active .bottom-nav-label {
  color: var(--primary) !important;
  font-weight: 700;
}

/* Center Bottom Nav Slot & Elevated Plus Button */
.bnav-center-slot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.bnav-center-plus-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  border: 3px solid var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
  cursor: pointer;
  transform: translateY(-10px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}

[data-theme="light"] .bnav-center-plus-btn {
  border-color: #ffffff !important;
}

.bnav-center-plus-btn:active {
  transform: translateY(-6px) scale(0.94);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.7);
}

/* ================= QUICK CREATE SHEET (MODAL-QUICK-ADD) ================= */
.quick-add-sheet {
  border-top-left-radius: 24px !important;
  border-top-right-radius: 24px !important;
}

.modal-drag-handle {
  width: 42px;
  height: 4px;
  background: rgba(148, 163, 184, 0.35);
  border-radius: 9999px;
  margin: 0.5rem auto 0.25rem;
}

.quick-add-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.quick-add-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
}

.quick-add-card:active {
  transform: scale(0.98);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.quick-add-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.quick-add-text {
  flex: 1;
  min-width: 0;
}

.quick-add-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text-main);
}

.quick-add-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.quick-add-chevron {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ================= FILTER BOTTOM SHEET ================= */
.filter-sheet {
  border-top-left-radius: 22px !important;
  border-top-right-radius: 22px !important;
}

.filter-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-option-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
  touch-action: manipulation;
}

.filter-option-row:hover,
.filter-option-row:active {
  background: rgba(255, 255, 255, 0.05);
}

.filter-option-row.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--primary);
  font-weight: 700;
}

.filter-opt-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.filter-opt-icon {
  width: 22px;
  font-size: 1.05rem;
  text-align: center;
}

.filter-opt-check {
  font-size: 0.95rem;
  color: var(--primary);
  display: none;
}

.filter-option-row.active .filter-opt-check {
  display: block;
}

/* ================= DOCUMENT VIEWER MODAL ================= */
.doc-viewer-modal {
  max-width: 95vw !important;
  width: 640px !important;
  height: 88vh !important;
  min-height: 85vh !important;
  max-height: 92vh !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.view-doc-display-box {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 !important;
  height: 100% !important;
  min-height: 60vh !important;
  max-height: calc(88vh - 120px) !important;
  overflow: auto !important;
  background: rgba(0, 0, 0, 0.4) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.5rem !important;
}

.view-doc-display-box img {
  max-width: 100% !important;
  max-height: 70vh !important;
  object-fit: contain !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
}

.view-doc-display-box iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 68vh !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
}
  height: 48vh !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
}

/* ================= COLLAPSIBLE LEFT NAVIGATION DRAWER ================= */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 86vw;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 1060;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  visibility: hidden;
  pointer-events: none;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.app-drawer.open {
  transform: translateX(0);
  box-shadow: 12px 0 35px rgba(0, 0, 0, 0.45);
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  padding: 1.25rem 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.08) 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.drawer-user-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.drawer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.drawer-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.drawer-user-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-user-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-badge-row {
  margin-top: 2px;
}

.drawer-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 1px 7px;
  border-radius: 9999px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.drawer-close-btn:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.drawer-group-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.85rem 0.75rem 0.35rem;
}

.drawer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.drawer-nav-btn:hover {
  background: var(--bg-card);
  color: var(--primary);
}

.drawer-nav-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.drawer-nav-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.drawer-nav-text {
  flex: 1;
}

.drawer-nav-text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.drawer-nav-subtext {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
}

.drawer-nav-badge {
  background: var(--accent-rose);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
}

.drawer-nav-highlight-chip {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 9999px;
}

.drawer-chevron {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.drawer-refer-item {
  background: rgba(236, 72, 153, 0.08);
  border: 1px dashed rgba(236, 72, 153, 0.35);
}

.drawer-refer-item:hover {
  background: rgba(236, 72, 153, 0.15);
}

.drawer-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.drawer-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.drawer-logout-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-rose);
}

.drawer-app-meta {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  line-height: 1.4;
}

/* ================= LEGAL & ABOUT CARD (PHONEPE / AIRTEL STYLE) ================= */
.legal-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legal-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
}

.legal-menu-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateX(2px);
}

.legal-menu-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.legal-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.legal-menu-title {
  font-size: 0.92rem;
  font-weight: 600;
}

.legal-menu-chevron {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.legal-company-note {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

/* ================= REFER MODAL STYLES ================= */
.refer-hero-badge {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 0.85rem auto;
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.45);
}

.share-app-btn {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
}

/* ================= PASSWORD & FIELD TOGGLE ================= */
.field-toggle-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.field-toggle-wrapper .form-control {
  padding-right: 2.75rem !important;
}

.field-toggle-btn {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.45rem;
  z-index: 3;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

.field-toggle-btn:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

/* ================= TOGGLE SWITCH ================= */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

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

/* Informative Info Box */
.alert-info-box {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-left: 4px solid var(--accent-cyan);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.45;
  margin-top: 0.5rem;
}

.badge-unlock {
  background: rgba(16, 185, 129, 0.15) !important;
  color: var(--accent-emerald) !important;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ================= WEBSITE FOOTER ================= */
.site-footer {
  display: none !important;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-divider {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.footer-copy {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.6;
  max-width: 900px;
}

.footer-copy strong {
  color: var(--text-main);
  font-weight: 600;
}

/* ================= BRAND LOGO & THEME STYLING ================= */
.brand-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 0.55rem !important;
  cursor: pointer !important;
}

.brand-logo-img {
  height: 32px !important;
  width: auto !important;
  max-width: 120px !important;
  object-fit: contain !important;
  background: #ffffff !important;
  padding: 2px 8px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
  display: inline-block !important;
}

.brand-name-header {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.3px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.auth-logo-img {
  height: 48px !important;
  width: auto !important;
  max-width: 170px !important;
  object-fit: contain !important;
  background: #ffffff !important;
  padding: 6px 14px !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0, 56, 168, 0.18) !important;
  display: inline-block !important;
  margin: 0 auto !important;
}

.btn-proceed {
  background: #0038A8 !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 14px rgba(0, 56, 168, 0.35) !important;
}

.btn-proceed:hover {
  background: #FF5B00 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(255, 91, 0, 0.45) !important;
}

.btn-proceed:active {
  transform: translateY(1px) !important;
}

.doc-card-delete-btn {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  margin-left: auto;
}

.doc-card-delete-btn:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
}

/* ================= PAGE HEADER ROW (Heading on left, action on right in same row) ================= */
.page-header-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  margin-bottom: 1rem !important;
  padding: 0.25rem 0 !important;
  gap: 0.75rem !important;
  flex-wrap: nowrap !important;
}

.page-header-title-wrap {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
}

.page-header-title {
  font-size: 1.55rem !important;
  font-weight: 800 !important;
  color: var(--text-main) !important;
  letter-spacing: -0.4px !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.page-header-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.45rem !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

.page-header-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  padding: 0.45rem 0.9rem !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

@media (max-width: 640px) {
  .page-header-title {
    font-size: 1.35rem !important;
  }
  .page-header-btn {
    padding: 0.38rem 0.75rem !important;
    font-size: 0.8rem !important;
  }
}

/* ================= COMPACT MODAL BODY (No scrolling needed) ================= */
.compact-modal-body {
  padding: 0.75rem 1.15rem !important;
  max-height: calc(85vh - 105px) !important;
  overflow-y: auto !important;
}

.compact-modal-body .form-group {
  margin-bottom: 0.55rem !important;
}

.compact-modal-body .form-label {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  margin-bottom: 0.25rem !important;
}

.compact-modal-body .form-control {
  padding: 0.45rem 0.65rem !important;
  font-size: 0.86rem !important;
}

/* ================= TALL MODAL / WINDOW HEIGHT (No half-page cutoffs) ================= */
.tall-modal-content {
  height: 88vh !important;
  min-height: 85vh !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
}

@media (min-width: 769px) {
  .tall-modal-content {
    height: auto !important;
    min-height: 520px !important;
    max-height: 88vh !important;
  }
}

@media (max-width: 768px) {
  .modal-content.tall-modal-content,
  .modal-content.doc-viewer-modal,
  #modal-view-doc .modal-content,
  #modal-secret-form .modal-content,
  #modal-todo-form .modal-content,
  #modal-upload-doc .modal-content {
    height: 88vh !important;
    min-height: 85vh !important;
    max-height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
  }
}




