/* --- Theme Variables --- */
:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Light Theme */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;

  --accent-green: #10b981;
  --accent-green-bg: #ecfdf5;
  --accent-red: #ef4444;
  --accent-red-bg: #fef2f2;
  --accent-amber: #f59e0b;
  --accent-amber-bg: #fffbeb;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

body.dark-theme {
  --bg-app: #090d16;
  --bg-card: #111827;
  --bg-elevated: #1f2937;
  --border: #1f2937;
  --border-focus: #60a5fa;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-light: #6b7280;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);

  --accent-green-bg: rgba(16, 185, 129, 0.15);
  --accent-red-bg: rgba(239, 68, 68, 0.15);
  --accent-amber-bg: rgba(245, 158, 11, 0.15);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

button, input, select {
  font-family: inherit;
}

/* --- Navbar --- */
.navbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.clean-badge {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* --- Hero Section --- */
.hero-section {
  padding: 44px 20px 32px;
  text-align: center;
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  color: var(--text-main);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* --- Search Box --- */
.search-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), var(--shadow-lg);
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-type-wrapper {
  position: relative;
  flex-shrink: 0;
}

.search-type-select {
  appearance: none;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
}

.search-type-select:hover {
  border-color: var(--text-light);
}

.search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 36px 12px 8px;
  font-size: 1.05rem;
  color: var(--text-main);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-light);
}

.btn-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

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

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

/* Quick Chips */
.quick-chips {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 0.85rem;
}

.chip-label {
  color: var(--text-muted);
  font-weight: 500;
}

.chip {
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* --- Features Grid (Welcome state) --- */
.welcome-section {
  max-width: 1100px;
  margin: 32px auto 60px;
  padding: 0 20px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.feature-emerald { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.feature-purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.feature-amber { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Results Section --- */
.results-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px 60px;
  width: 100%;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.results-heading {
  font-size: 1.4rem;
  font-weight: 700;
}

.results-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Company Card Accordion */
.company-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.company-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.company-card.is-expanded {
  border-color: var(--primary);
  box-shadow: 0 8px 25px -4px rgba(37, 99, 235, 0.12), var(--shadow-md);
  ring: 2px solid var(--primary);
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
}

.company-title-link {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.company-card:hover .company-title-link,
.company-card.is-expanded .company-title-link {
  color: var(--primary);
}

.card-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.btn-toggle-expand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.btn-toggle-expand:hover {
  background: var(--primary);
  color: #fff;
}

.btn-toggle-expand .arrow-icon {
  display: inline-block;
  transition: transform 0.25s ease;
}

.company-card.is-expanded .btn-toggle-expand .arrow-icon {
  transform: rotate(180deg);
}

.badge-mst {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.badge-mst:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.card-info-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (min-width: 768px) {
  .card-info-rows {
    grid-template-columns: 320px 1fr;
  }
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-muted);
}

.info-item strong {
  color: var(--text-main);
}

/* Accordion Body ("Sổ thông tin") */
.card-accordion-body {
  display: none;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 4px;
  animation: accordionFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.company-card.is-expanded .card-accordion-body {
  display: block;
}

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

.inline-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.btn-card-detail {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-card-detail:hover {
  background: var(--primary);
  color: #fff;
}

.btn-card-save {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-card-save:hover {
  color: var(--text-main);
  border-color: var(--text-light);
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.btn-page {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-page:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-numbers-list {
  display: flex;
  gap: 4px;
}

.page-num {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.page-num.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Detail Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.modal-company-name {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.3;
  margin-top: 6px;
  color: var(--text-main);
}

.modal-subnames {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-status-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-active {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-danger {
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.type-badge {
  background: var(--bg-app);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--bg-app);
  color: var(--text-main);
}

.modal-toolbar {
  padding: 10px 24px;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-tool:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* MST Card Highlight */
.mst-highlight-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(79, 70, 229, 0.04));
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.mst-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.mst-value-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.mst-code {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-main);
}

.btn-copy-mst {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-copy-mst:hover {
  background: var(--primary-hover);
}

.mst-updated {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

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

@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-card {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  position: relative;
}

.detail-card.full-width {
  grid-column: 1 / -1;
}

.card-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  padding-top: 2px;
}

.card-content {
  flex: 1;
}

.card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.card-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
}

.font-highlight {
  font-weight: 700;
  color: var(--primary);
}

.font-mono {
  font-family: var(--font-mono);
}

.sub-address {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sub-label {
  font-weight: 600;
  margin-right: 4px;
}

.rep-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  background: var(--bg-card);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.btn-copy-small {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-copy-small:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

/* Industries Section */
.industries-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

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

.industries-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.filter-industries-input {
  background: var(--bg-app);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
  min-width: 240px;
  outline: none;
}

.filter-industries-input:focus {
  border-color: var(--border-focus);
}

.industries-table-wrapper {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

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

.industries-table th {
  background: var(--bg-app);
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
}

.industries-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.industries-table tr:hover {
  background: var(--bg-app);
}

/* --- Drawers (History & Bookmarks) --- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 110;
  display: flex;
  justify-content: flex-end;
}

.drawer {
  background: var(--bg-card);
  width: 100%;
  max-width: 420px;
  height: 100%;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  animation: drawerSlide 0.2s ease-out;
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-actions {
  padding: 8px 20px;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--accent-red);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.drawer-list {
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.drawer-item {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

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

.drawer-item-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.drawer-item-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* --- State Containers (Loading, Error) --- */
.state-container {
  max-width: 500px;
  margin: 60px auto;
  text-align: center;
  padding: 30px;
}

.spinner-large {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

.state-icon-error {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.state-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.state-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Footer --- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 24px 20px;
  text-align: center;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-sub {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Utility */
.hidden {
  display: none !important;
}
