@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-light: #eff6ff;
  
  --badge-bg-neutral: #f1f5f9;
  --badge-text-neutral: #334155;
  --badge-border-neutral: #cbd5e1;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  --shadow-dropdown: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── SVG Icons ─── */
.icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon-xs {
  width: 13px;
  height: 13px;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

.icon-menu {
  width: 18px;
  height: 18px;
}

.icon-chevron {
  width: 14px;
  height: 14px;
}

/* ─── Header & Navbar (Screener.in style clean top bar) ─── */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-link {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  letter-spacing: -0.03em;
  font-size: 1.35rem;
}

.brand-name {
  font-weight: 800;
  color: #0f172a;
}

.brand-dot {
  font-weight: 800;
  color: #10b981; /* Screener-style green dot accent */
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── User Profile Menu (Screener.in style) ─── */
.user-menu-wrapper {
  position: relative;
}

.user-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-dropdown);
  min-width: 220px;
  padding: 0.4rem 0;
  display: none;
  z-index: 1000;
}

.user-dropdown-menu.open {
  display: block;
}

.user-dropdown-header {
  padding: 0.6rem 1rem;
}

.user-dropdown-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.user-dropdown-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.35rem 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.825rem;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background-color 0.1s;
}

.user-dropdown-item:hover {
  background-color: #f8fafc;
}

.user-dropdown-item.text-danger {
  color: #dc2626;
}

.user-dropdown-item.text-danger:hover {
  background-color: #fef2f2;
}

/* ─── Clean Minimal Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

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

.btn-outline {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

/* ─── Layout Container (Full Width, No wasted margins) ─── */
.main-container {
  width: 100%;
  max-width: 100%;
  padding: 1rem 1.5rem 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ─── Watchlist Section Header (Above the Table, Screener.in style) ─── */
.watchlist-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.wl-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wl-breadcrumb {
  font-size: 0.775rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.wl-breadcrumb .bc-sep {
  color: #cbd5e1;
}

.watchlist-dropdown-wrapper {
  position: relative;
}

.watchlist-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: transparent;
  border: none;
  padding: 0.2rem 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  letter-spacing: -0.015em;
  transition: color 0.15s;
}

.watchlist-title-btn:hover {
  color: var(--accent-blue);
}

.watchlist-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  max-width: 360px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-dropdown);
  z-index: 200;
  display: none;
  flex-direction: column;
  max-height: 420px;
  overflow: hidden;
}

.watchlist-dropdown.open {
  display: flex;
}

#watchlist-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.35rem 0;
}

.wl-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wl-item:hover {
  background: #f8fafc;
}

.wl-item.active {
  color: var(--accent-blue);
  background: var(--accent-blue-light);
  font-weight: 600;
}

.wl-item .wl-check {
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.wl-item .wl-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.watchlist-dropdown-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  background: #fcfcfd;
}

.wl-create-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.4rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.wl-create-btn:hover {
  background: var(--accent-blue-light);
}

.wl-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── KPI Strip (Clean, Horizontal Minimalist Strip) ─── */
.kpi-strip {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.65rem 1.25rem;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.kpi-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  white-space: nowrap;
}

.kpi-label {
  font-size: 0.775rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color);
  flex-shrink: 0;
}

/* ─── Search & Filter Card ─── */
.filter-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.search-primary-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

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

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.45rem 0.85rem 0.45rem 2.35rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* ─── Minimalist Clean Lease Checkbox (Request #10) ─── */
.lease-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.42rem 0.75rem;
  white-space: nowrap;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.lease-checkbox-label:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.lease-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-blue);
  cursor: pointer;
  width: 14px;
  height: 14px;
}

/* ─── Category Filter Pills ─── */
.category-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.775rem;
  font-weight: 500;
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.pill:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.pill-count {
  font-size: 0.725rem;
  opacity: 0.85;
}

/* ─── Advanced Filters Panel ─── */
.advanced-filters-panel {
  display: none;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.advanced-filters-panel.open {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  padding: 0.4rem 0.65rem;
  font-size: 0.825rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  outline: none;
  background: #ffffff;
  color: var(--text-primary);
}

.form-control:focus {
  border-color: var(--accent-blue);
}

/* ─── Results Section (Full Screen Width) ─── */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-count {
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.results-count strong {
  color: var(--text-primary);
}

/* ─── Main Records Table (Screener.in style) ─── */
.table-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.825rem;
}

thead th {
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.825rem;
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
  letter-spacing: 0.01em;
  user-select: none;
}

.table-head-row {
  background: #f1f5f9;
}

.table-head-row th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f1f5f9;
  box-shadow: 0 1px 0 #cbd5e1;
}

/* Repeated Table Header (Request #7 - Every 50 rows) */
.table-repeat-header th {
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.825rem;
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  border-top: 2px solid #cbd5e1;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
  letter-spacing: 0.01em;
  user-select: none;
}

tbody tr.table-repeat-header:hover {
  background-color: #f1f5f9;
}

tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.1s;
}

tbody tr:hover {
  background-color: #f8fafc;
}

tbody td {
  padding: 0.65rem 0.85rem;
  vertical-align: middle;
  color: var(--text-primary);
}

.docno-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #1e293b;
  font-size: 0.8rem;
}

/* Minimalist Category Tag */
.badge-tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--badge-bg-neutral);
  color: var(--badge-text-neutral);
  border: 1px solid var(--badge-border-neutral);
  white-space: nowrap;
}

.party-names {
  line-height: 1.4;
  color: var(--text-primary);
  font-weight: 400;
  max-width: 280px;
}

.property-desc-cell {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Action buttons inside table */
.actions-cell {
  text-align: center;
  white-space: nowrap;
}

.btn-table {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.725rem;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.1s;
}

.btn-table:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-table-primary {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.btn-table-primary:hover {
  background: #dbeafe;
}

/* ─── Table Footer Bar (Continuous loading) ─── */
.table-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ─── Modals (Clean, Minimalist White Overlay) ─── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 650px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

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

.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 4px;
}

.modal-close:hover {
  color: var(--text-primary);
  background: #f1f5f9;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

/* Detail Modal Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.detail-item .label {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.detail-item .val {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.2rem;
  color: var(--text-primary);
}

.detail-full-desc {
  grid-column: 1 / -1;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
}

/* Timeline in Chain Modal */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  position: relative;
  padding-left: 1.25rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 6px;
  width: 2px;
  background: var(--border-color);
}

.timeline-step {
  position: relative;
}

.timeline-bullet {
  position: absolute;
  left: -1.25rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid #ffffff;
}

.timeline-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.85rem 1rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-step-badge {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #475569;
}

.timeline-parties {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  flex-wrap: wrap;
}

.party-box {
  flex: 1;
  min-width: 160px;
}

.timeline-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.775rem;
  color: #64748b;
  flex-wrap: wrap;
}

/* ─── Import Dropzone ─── */
.import-breadcrumb {
  font-size: 0.78rem;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  background: #fafafa;
}

.dropzone.dragover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-light);
}

.dropzone-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 0.5rem auto;
  color: #94a3b8;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.dropzone-text {
  font-size: 0.825rem;
  color: #64748b;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.8rem;
}

.file-chip .fc-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip .fc-size {
  color: #94a3b8;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.file-chip .fc-status {
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.fc-status.ok { color: #059669; }
.fc-status.error { color: #e11d48; }
.fc-status.duplicate { color: #d97706; }
.fc-status.pending { color: #94a3b8; }

/* Manage file row */
.manage-file-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.manage-file-row .mfr-name {
  flex: 1;
  font-size: 0.825rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-file-row .mfr-count {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
}

.manage-file-row .mfr-delete {
  background: none;
  border: 1px solid #fca5a5;
  color: #e11d48;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.725rem;
  cursor: pointer;
  flex-shrink: 0;
}

.manage-file-row .mfr-delete:hover {
  background: #fff1f2;
}

/* Empty Watchlist State */
.empty-watchlist-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #94a3b8;
}

.empty-watchlist-state .empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem auto;
  color: #cbd5e1;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  display: block;
}

.empty-watchlist-state h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.4rem;
}

.empty-watchlist-state p {
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #0f172a;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  color: #ffffff;
  font-size: 0.825rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }

/* ─── Responsive View Mode Switcher ─── */
.view-toggle-group {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  color: var(--text-primary);
}

.view-toggle-btn.active {
  background: #ffffff;
  color: var(--accent-blue);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mobile-only-menu-item {
  display: none;
}

.mobile-index-chip {
  display: none;
}

/* ─── Floating Back to Top Button ─── */
.back-to-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:active {
  transform: scale(0.92);
  background: var(--accent-blue-hover);
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE & TABLET RESPONSIVENESS (<= 768px)
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* ── Header: Single Sleek Row ── */
  .header-container {
    padding: 0.65rem 1rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .brand-link {
    font-size: 1.25rem;
  }

  .header-right {
    gap: 0.4rem;
  }

  .desktop-only-btn {
    display: none !important;
  }

  .mobile-only-menu-item {
    display: flex !important;
  }

  #export-excel-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.775rem;
  }

  .user-profile-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.775rem;
  }

  .user-dropdown-menu {
    right: 0;
    left: auto;
    width: 240px;
    max-width: 90vw;
  }

  /* ── Main Container ── */
  .main-container {
    padding: 0.75rem 0.85rem 4rem 0.85rem;
    gap: 0.85rem;
  }

  /* ── Watchlist Header ── */
  .watchlist-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .wl-header-left {
    width: 100%;
  }

  .watchlist-title-btn {
    font-size: 1.2rem;
    max-width: 100%;
  }

  #active-watchlist-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 120px);
  }

  .watchlist-dropdown {
    width: 100%;
    max-width: calc(100vw - 1.7rem);
    left: 0;
  }

  .wl-header-actions {
    display: flex;
    justify-content: flex-end;
  }

  #open-manage-watchlist-btn {
    width: 100%;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.825rem;
  }

  /* ── KPI Strip: Modern Mobile 2-Column Dashboard Grid ── */
  .kpi-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.65rem;
    overflow-x: visible;
  }

  .kpi-divider {
    display: none;
  }

  .kpi-item {
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .kpi-item:first-child {
    grid-column: span 2;
    background: #eff6ff;
    border-color: #bfdbfe;
    border-left: 3px solid var(--accent-blue);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
  }

  .kpi-label {
    font-size: 0.725rem;
  }

  .kpi-value {
    font-size: 1.1rem;
  }

  /* ── Search & Filter Card ── */
  .filter-card {
    padding: 0.75rem;
    gap: 0.65rem;
  }

  .search-primary-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .search-input-wrapper {
    min-width: 100%;
  }

  .search-input {
    height: 42px;
    font-size: 0.9rem;
    padding-left: 2.35rem;
  }

  .search-icon {
    left: 0.75rem;
  }

  .lease-checkbox-label {
    width: 100%;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  #adv-filter-toggle, #reset-filters-btn {
    flex: 1;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.825rem;
  }

  /* Horizontal Scrollable Category Pills with Momentum */
  .category-pills {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
  }

  .category-pills::-webkit-scrollbar {
    display: none;
  }

  .pill {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.775rem;
    border-radius: 9999px;
  }

  /* Advanced Filters Drawer (Single column) */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .form-group label {
    font-size: 0.775rem;
  }

  .form-control {
    height: 40px;
    font-size: 0.9rem;
  }

  /* ── Results Bar ── */
  .results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.15rem;
  }

  /* ══════════════════════════════════════════════════════════════════════
     MOBILE CARD VIEW (Default on <= 768px, unless force-table-view)
     ══════════════════════════════════════════════════════════════════════ */
  #main-records-table:not(.force-table-view) {
    display: block;
    width: 100%;
    border: none;
  }

  #main-records-table:not(.force-table-view) thead,
  #main-records-table:not(.force-table-view) .table-repeat-header {
    display: none !important;
  }

  #main-records-table:not(.force-table-view) tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .table-card {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  /* Each record row turns into an elevated mobile card */
  #main-records-table:not(.force-table-view) tr.record-row {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    gap: 0.5rem;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  #main-records-table:not(.force-table-view) tr.record-row:active {
    transform: scale(0.99);
  }

  #main-records-table:not(.force-table-view) td {
    display: block;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
  }

  /* Card Top Row: Index Chip, Date, and Doc Number Badge */
  #main-records-table:not(.force-table-view) td.col-index {
    display: none;
  }

  .mobile-index-chip {
    display: inline-flex;
    align-items: center;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.675rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.4rem;
  }

  #main-records-table:not(.force-table-view) .mobile-index-chip {
    display: inline-block;
  }

  #main-records-table:not(.force-table-view) td.col-date {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.85rem;
  }

  #main-records-table:not(.force-table-view) .reg-date-val {
    font-weight: 700;
    color: var(--text-primary);
  }

  #main-records-table:not(.force-table-view) .reg-year-val {
    font-size: 0.725rem;
    color: #64748b;
  }

  #main-records-table:not(.force-table-view) td.col-docno {
    display: inline-block;
  }

  #main-records-table:not(.force-table-view) td.col-docname {
    padding-bottom: 0.4rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }

  #main-records-table:not(.force-table-view) .docname-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 0.25rem;
  }

  /* Parties (Seller & Buyer) cleanly styled as contrasting cards */
  #main-records-table:not(.force-table-view) td.col-seller {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    padding: 0.5rem 0.65rem !important;
  }

  #main-records-table:not(.force-table-view) td.col-seller::before {
    content: "विक्रेता / कर्जदार (Seller / Borrower)";
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #b91c1c;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
  }

  #main-records-table:not(.force-table-view) td.col-buyer {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    border-radius: 8px;
    padding: 0.5rem 0.65rem !important;
  }

  #main-records-table:not(.force-table-view) td.col-buyer::before {
    content: "खरेदीदार / बँक (Buyer / Bank)";
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
  }

  #main-records-table:not(.force-table-view) .party-names {
    font-size: 0.825rem;
    font-weight: 500;
    line-height: 1.4;
    max-width: 100%;
    white-space: normal;
  }

  /* Property Info Card */
  #main-records-table:not(.force-table-view) td.col-property {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 0.5rem 0.65rem !important;
  }

  #main-records-table:not(.force-table-view) td.col-property::before {
    content: "मिळकत ओळख (Property Info)";
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
  }

  #main-records-table:not(.force-table-view) .property-desc-cell {
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.4;
    max-width: 100%;
    white-space: normal;
  }

  /* Amount Cell */
  #main-records-table:not(.force-table-view) td.col-amount {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    padding: 0.4rem 0 !important;
    border-top: 1px dashed #e2e8f0 !important;
    margin-top: 0.2rem !important;
  }

  #main-records-table:not(.force-table-view) td.col-amount::before {
    content: "मोबदला (Amount):";
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
  }

  /* Action Buttons: Full Width Touch Targets */
  #main-records-table:not(.force-table-view) td.col-actions {
    display: flex !important;
    gap: 0.65rem !important;
    padding-top: 0.4rem !important;
    margin-top: 0.2rem !important;
  }

  #main-records-table:not(.force-table-view) td.col-actions .btn-table {
    flex: 1 !important;
    height: 42px !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 0.5rem !important;
  }

  /* Status and Empty Rows inside Card View */
  #main-records-table:not(.force-table-view) tr.table-status-row {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  #main-records-table:not(.force-table-view) tr.table-status-row td {
    display: block !important;
    width: 100% !important;
    padding: 1.5rem 1rem !important;
  }

  /* Continuous Pagination & Load More */
  .table-footer-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
  }

  #load-more-btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem;
    height: 44px;
    font-size: 0.85rem;
  }

  /* ── Modals on Mobile ── */
  .modal-overlay {
    padding: 0.5rem;
    align-items: flex-end; /* Bottom sheet appearance on phone */
  }

  .modal-content {
    max-height: 94vh;
    border-radius: 16px 16px 8px 8px;
    margin: 0;
    width: 100%;
  }

  .modal-header {
    padding: 0.85rem 1rem;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 5;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    padding: 6px;
  }

  .modal-body {
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .detail-item {
    background: #f8fafc;
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
  }

  /* Timeline on Mobile */
  .timeline {
    padding-left: 1rem;
  }

  .timeline-bullet {
    left: -1rem;
  }

  .timeline-parties {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .timeline-parties > div:nth-child(2) {
    text-align: center;
    transform: rotate(90deg);
    margin: -4px 0;
  }

  .party-box {
    min-width: 100%;
  }

  .timeline-meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  /* Manage Watchlist Modal */
  #manage-watchlist-modal .form-control {
    width: 100%;
  }

  #manage-watchlist-modal .modal-body > div:first-child > div:nth-child(2) {
    flex-direction: column;
    align-items: stretch;
  }

  #save-wl-name-btn {
    height: 42px;
    justify-content: center;
  }

  /* Toast Notification */
  .toast {
    bottom: 1.25rem;
    left: 1rem;
    right: 1rem;
    text-align: center;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   EXTRA SMALL SCREENS (<= 480px: iPhone SE, older Android)
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .brand-link {
    font-size: 1.15rem;
  }

  .export-btn-label {
    display: none;
  }

  #export-excel-btn::after {
    content: "Export";
  }

  .view-btn-text {
    display: none;
  }

  .view-toggle-btn {
    padding: 0.3rem 0.45rem;
  }
}
