:root {
  --bg-app: #ffffff;
  --bg-page: #fbfbfa;
  --border-subtle: #e5e7eb;
  --border-focus: #2563eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.05);
  --error: #ef4444;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --font-inter: 'Inter', system-ui, -apple-system, sans-serif;
  --popup-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hidden {
  display: none !important;
}

.status-badge {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1rem;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-connected {
  background: #ecfdf5;
  color: #10b981;
}

.status-disconnected {
  background: #fef2f2;
  color: #ef4444;
}

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

body {
  font-family: var(--font-inter);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-header {
  position: sticky;
  top: 0;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 2rem;
  z-index: 100;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

h1 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.content-area {
  padding: 2rem;
  flex: 1;
}

/* Form Sections */
.form-section {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-danger {
  background: var(--error);
  color: white;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

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

.btn-outline {
  background: white;
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Specific Filter Button Visibility */
#toggle-filter-btn {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
}

#toggle-filter-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

#toggle-filter-btn svg {
  color: var(--accent);
}

/* Active Filter State */
#toggle-filter-btn.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

#toggle-filter-btn.btn-primary svg {
  color: white;
}

.day-btn.selected {
  background: var(--text-main);
  color: white;
  border-color: var(--text-main);
}

/* Delivery Method Radio Tabs */
.delivery-methods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.radio-tab {
  position: relative;
  cursor: pointer;
}

.radio-tab input {
  position: absolute;
  opacity: 0;
}

.radio-tab span {
  display: block;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  background: white;
  transition: background 0.2s;
}

.radio-tab input:checked + span {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Order Rules Table */
.order-rules-table th {
  padding: 0.5rem 0.75rem;
  background: var(--bg-page);
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-subtle);
}

.order-rules-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.rule-select, .rule-input {
  width: 100% !important;
  font-size: 0.875rem !important;
  padding: 0.375rem 0.5rem !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important;
  background: white !important;
}

.remove-rule-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.remove-rule-btn:hover {
  background: #fee2e2;
}

/* Ad Hoc Inputs */
.adhoc-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.adhoc-input-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.qty-l-adhoc, .qty-ml-adhoc, .qty-input-adhoc {
  padding: 0.375rem !important;
  font-size: 0.8rem !important;
}

/* Day Selector for Bulk Edit */
.day-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.day-btn {
  display: block;
  padding: 0.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  background: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.day-btn:hover {
  border-color: var(--accent);
}

/* Order Details Grid */
.order-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-subtle);
  animation: slideDown 0.2s ease-out;
}

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

/* Removed standing-grid styles */


/* Data Table */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: white;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg-page);
  border-bottom: 2px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.data-table tr:hover {
  background: var(--bg-page);
}

.editable {
  cursor: pointer;
}

.editable:hover {
  background: rgba(37, 99, 235, 0.05);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.editable.changed {
  background: #fffbeb;
}

.inline-input {
  width: 100%;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.875rem !important;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.upload-text strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 0.25rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  box-shadow: var(--shadow-sm);
}

.no-shadow {
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

.modal-content h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.existing-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.existing-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ec-name { font-weight: 600; }
.ec-count { font-size: 0.75rem; color: var(--text-muted); }

.modal-content.bulk-modal-wide {
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

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

.modal-header h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.close-x {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.close-x:hover {
  color: var(--text-main);
}

.modal-subtitle {
  padding: 0.75rem 2rem;
  background: var(--bg-page);
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
}

.modal-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-section:last-child {
  border-bottom: none;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title-sm {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.toggle-control {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.section-content {
  transition: opacity 0.2s, filter 0.2s;
}

.section-content.disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(1);
}

.span-2 {
  grid-column: span 2;
}

.mb-4 { margin-bottom: 1rem; }

.modal-actions {
  padding: 1.5rem 2rem;
  background: var(--bg-page);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.detail-popup {
  position: fixed;
  background: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  min-width: 260px;
  max-width: 320px;
  z-index: 3000;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  animation: fadeInPopup 0.15s ease-out;
}

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

.detail-popup h3 {
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.popup-item label, .popup-notes label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.popup-item p, .popup-notes p {
  font-size: 0.8rem;
  margin-top: 0.125rem;
}

.popup-notes { margin-top: 0.75rem; }

.mt-2 { margin-top: 0.5rem; }


/* Responsive */
@media (max-width: 640px) {
  .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
  .delivery-methods { grid-template-columns: repeat(2, 1fr); }
  .standing-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Specific Bin UI Styles */
.search-bar {
  display: flex !important;
  gap: 0.5rem;
  align-items: center;
}

.search-bar input {
  flex: 1;
}

.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

#view-bin-btn,
#view-merge-history-btn {
  background: #f3f4f6;
  border-color: var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}

#view-bin-btn:hover,
#view-merge-history-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.bin-search-bar input {
  background: var(--bg-page);
}

#bin-list-body tr td {
  vertical-align: middle;
}

.restore-single {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
}
/* Phase 2: Table Expansion & Badges */
.badge-adhoc {
  background: #fef2f2;
  color: #ef4444;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-standing {
  background: #ecfdf5;
  color: #10b981;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  white-space: nowrap;
}

.product-col {
  text-align: center;
  min-width: 90px;
}

.inline-textarea {
  min-height: 40px;
  width: 100%;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.875rem !important;
  font-family: inherit;
  resize: vertical;
}

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

/* Ensure data table doesn't compress too much */
.data-table {
  min-width: 1200px; /* Allow horizontal scroll for many columns */
}

/* Phase 3: Profile Modal Styles */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.profile-item label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.profile-item p {
  font-size: 0.875rem;
  color: var(--text-main);
  margin-top: 0.125rem;
}

.profile-notes p {
  font-size: 0.875rem;
  color: var(--text-main);
  background: var(--bg-page);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-top: 0.25rem;
}

.profile-history-card {
  margin-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
}

#profile-history-body tr td {
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
}

.clickable-name {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(37, 99, 235, 0.3);
}

.clickable-name:hover {
  text-decoration-color: var(--accent);
  background: var(--accent-soft);
}
/* Dashboard Specific Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: block;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
}

.stat-subvalue {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.graph-title {
    font-size: 1rem;
    font-weight: 600;
}

.range-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-page);
    padding: 2px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.range-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

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

.range-btn.active {
    background: white;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Delivery Configuration Grid */
.delivery-config-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.5rem;
}

.config-header {
  display: grid;
  grid-template-columns: 1fr 100px 1.5fr;
  background: var(--bg-page);
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-row {
  display: grid;
  grid-template-columns: 1fr 100px 1.5fr;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s;
}

.config-row:last-child {
  border-bottom: none;
}

.config-row:hover {
  background: var(--accent-soft);
}

.day-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.method-select {
  padding: 0.4rem 0.5rem !important;
  font-size: 0.8rem !important;
}

.method-select:disabled {
  opacity: 0.5;
  background: var(--bg-page);
  cursor: not-allowed;
  border-color: #eee;
}

/* Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e5e7eb;
  transition: .4s;
  border-radius: 20px;
}

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

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

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

/* Filter Panel Styles */
.filter-panel {
  background: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  animation: slideDownFade 0.2s ease-out;
}

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

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-days-row {
  display: flex;
  gap: 0.5rem;
}

.day-filter-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.day-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.day-filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-select, .filter-select-sm {
  background-color: var(--bg-page);
  border-color: var(--border-subtle);
  font-size: 0.85rem;
}

.filter-product-row {
  display: flex;
  gap: 0.5rem;
}

.filter-select-sm {
  flex: 1;
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.filter-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

#clear-filters-btn {
  font-size: 0.8rem;
  color: var(--error);
}

#clear-filters-btn:hover {
  background: #fef2f2;
  color: #dc2626;
}

.stat-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.5rem 0;
}

.modal-extra-wide {
  max-width: 1000px !important;
  width: 95% !important;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Merge Comparison Table */
.merge-comparison-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.merge-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: white;
}

.merge-comparison-table th, 
.merge-comparison-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  vertical-align: top;
  word-wrap: break-word;
}

.merge-comparison-table th {
  width: 200px;
  background: var(--bg-page);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.70rem;
  letter-spacing: 0.05em;
  text-align: left;
}

.merge-comparison-table td {
  min-width: 250px;
}

.merge-comparison-table tr:last-child th,
.merge-comparison-table tr:last-child td {
  border-bottom: none;
}

/* Alert Notification */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  color: #92400e;
}

.alert-warning code {
  background: rgba(146, 64, 14, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

/* Conflict & Selection */
.has-conflict {
  background: #fff1f2 !important;
}

.conflict-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.375rem;
  background: var(--error);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.has-conflict-field {
  border-top: 1px solid #fecaca;
  margin-top: 1rem;
  padding-top: 1rem;
}

.input-with-hint {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Merge History Modal Special Styles */
#merge-history-list-body tr td {
  padding: 1.25rem 1rem;
}

#merge-history-list-body tr:hover {
  background-color: #f8fafc;
}

.undo-merge-btn {
  color: #dc2626 !important;
  font-weight: 600 !important;
}

.undo-merge-btn:hover {
  background-color: #fef2f2 !important;
  text-decoration: underline;
}
