/* ==========================================================================
   Tally Sync & Accounting Export - Modern Workspace Styles
   Option 1 / Phase 1: High-Performance, Compact, Easy-to-Operate Design System
   ========================================================================== */

.tally-preview-shell {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding-bottom: 32px !important;
}

/* --------------------------------------------------------------------------
   Page Header
   -------------------------------------------------------------------------- */
.tally-page-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
  margin-bottom: 2px !important;
}

.tally-page-head h2 {
  font-size: 24px !important;
  font-weight: 800 !important;
  color: #0f2746 !important;
  margin: 0 0 4px !important;
  line-height: 1.2 !important;
  letter-spacing: -0.01em !important;
}

.tally-page-head p {
  font-size: 13px !important;
  color: #64748b !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

.tally-head-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.tally-btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #0e2238 !important;
  color: #ffffff !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #0e2238 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 2px 6px rgba(14, 34, 56, 0.18) !important;
  white-space: nowrap !important;
}

.tally-btn-primary:hover {
  background: #173b64 !important;
  border-color: #173b64 !important;
  box-shadow: 0 4px 12px rgba(14, 34, 56, 0.25) !important;
  transform: translateY(-1px) !important;
}

.tally-btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #ffffff !important;
  color: #1e293b !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  padding: 8px 14px !important;
  height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.tally-btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

/* --------------------------------------------------------------------------
   Modern Navigation Pill Strip (Dark Navy)
   -------------------------------------------------------------------------- */
.tally-nav-strip {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 5px !important;
  border-radius: 12px !important;
  background: #0e2238 !important;
  box-shadow: 0 4px 14px rgba(14, 34, 56, 0.12) !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.tally-nav-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 8px 16px !important;
  border-radius: 9px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
  min-height: 36px !important;
}

.tally-nav-tab:hover {
  color: #f1f5f9 !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.tally-nav-tab.is-active {
  background: #ffffff !important;
  color: #0e2238 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}

.tally-nav-tab svg {
  flex-shrink: 0 !important;
}

.tally-nav-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.tally-nav-tab.is-active .tally-nav-badge {
  background: #0e2238 !important;
  color: #ffffff !important;
}

.tally-nav-tab:not(.is-active) .tally-nav-badge {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #cbd5e1 !important;
}

/* --------------------------------------------------------------------------
   KPI Metric Cards
   -------------------------------------------------------------------------- */
.tally-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
}

.tally-kpi-card {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03) !important;
  position: relative !important;
  min-width: 0 !important;
}

.tally-kpi-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.tally-kpi-icon.tone-blue {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #dbeafe !important;
}

.tally-kpi-icon.tone-emerald {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}

.tally-kpi-icon.tone-amber {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid #fde68a !important;
}

.tally-kpi-icon.tone-purple {
  background: #faf5ff !important;
  color: #7c3aed !important;
  border: 1px solid #e9d5ff !important;
}

.tally-kpi-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.tally-kpi-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
}

.tally-kpi-label {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  white-space: nowrap !important;
}

.tally-kpi-tag {
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 1px 6px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
}

.tally-kpi-tag.tone-blue {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.tally-kpi-tag.tone-emerald {
  background: #ecfdf5 !important;
  color: #047857 !important;
}

.tally-kpi-tag.tone-amber {
  background: #fffbeb !important;
  color: #b45309 !important;
}

.tally-kpi-tag.tone-purple {
  background: #faf5ff !important;
  color: #6d28d9 !important;
}

.tally-kpi-val-row {
  display: flex !important;
  align-items: baseline !important;
  gap: 8px !important;
}

.tally-kpi-val {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f2746 !important;
  line-height: 1.1 !important;
  font-variant-numeric: tabular-nums !important;
}

.tally-kpi-meta {
  font-size: 11px !important;
  color: #64748b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* --------------------------------------------------------------------------
   Filter Toolbar
   -------------------------------------------------------------------------- */
.tally-toolbar-card {
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  padding: 12px 16px !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03) !important;
}

.tally-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.tally-search-field {
  position: relative !important;
  flex: 1 1 220px !important;
  min-width: 180px !important;
}

.tally-search-icon {
  position: absolute !important;
  left: 11px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  display: flex !important;
  align-items: center !important;
}

.tally-search-field input {
  width: 100% !important;
  height: 38px !important;
  padding: 0 12px 0 36px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  font-size: 12.5px !important;
  color: #0f172a !important;
  outline: none !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.tally-search-field input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.tally-filter-group {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.tally-filter-group span {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  white-space: nowrap !important;
}

.tally-filter-group input[type="date"],
.tally-filter-group select {
  height: 38px !important;
  padding: 0 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  font-size: 12.5px !important;
  color: #334155 !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s !important;
}

.tally-filter-group select {
  padding-right: 26px !important;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center !important;
  appearance: none !important;
  cursor: pointer !important;
}

.tally-filter-group input:focus,
.tally-filter-group select:focus {
  border-color: #2563eb !important;
}

.tally-toggle-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 11px !important;
  height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.tally-toggle-chip input {
  margin: 0 !important;
  cursor: pointer !important;
}

.tally-toggle-chip:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.tally-toggle-chip.is-active {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}

.tally-reset-btn {
  height: 38px !important;
  padding: 0 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.tally-reset-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.tally-result-pill {
  margin-left: auto !important;
  height: 28px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  background: #f1f5fa !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
}

/* --------------------------------------------------------------------------
   Selection Sticky Action Banner
   -------------------------------------------------------------------------- */
.tally-selection-banner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  color: #065f46 !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.08) !important;
  animation: tallyFadeIn 0.18s ease-out !important;
}

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

.tally-selection-info {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.tally-selection-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.tally-selection-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  border: none !important;
}

.tally-selection-btn.primary {
  background: #059669 !important;
  color: #ffffff !important;
}

.tally-selection-btn.primary:hover {
  background: #047857 !important;
}

.tally-selection-btn.secondary {
  background: #ffffff !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0 !important;
}

.tally-selection-btn.secondary:hover {
  background: #f0fdf4 !important;
}

.tally-selection-btn.ghost {
  background: transparent !important;
  color: #065f46 !important;
  text-decoration: underline !important;
}

/* --------------------------------------------------------------------------
   Modern Vouchers Table
   -------------------------------------------------------------------------- */
.tally-table-card {
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03) !important;
  overflow: hidden !important;
}

.tally-table-wrap {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

.tally-table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: auto !important;
  margin: 0 !important;
}

.tally-table th {
  background: #edf3fa !important;
  color: #173b64 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  border-top: 1px solid #dbe6f1 !important;
  border-bottom: 2px solid #cbdbe9 !important;
  padding: 9px 10px !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

.tally-table td {
  padding: 9px 10px !important;
  font-size: 12.5px !important;
  color: #1e293b !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
  line-height: 1.35 !important;
  box-sizing: border-box !important;
}

.tally-table tr:hover td {
  background: #f8fbff !important;
}

/* Specific Columns */
.tally-col-check {
  width: 1% !important;
  text-align: center !important;
  white-space: nowrap !important;
  padding-left: 12px !important;
  padding-right: 6px !important;
}

.tally-col-idx {
  width: 1% !important;
  text-align: center !important;
  white-space: nowrap !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  padding-left: 4px !important;
  padding-right: 8px !important;
}

.tally-col-date {
  width: 1% !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  color: #475569 !important;
}

.tally-col-type {
  width: 1% !important;
  white-space: nowrap !important;
}

.tally-col-ref {
  width: 1% !important;
  white-space: nowrap !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #0f2746 !important;
}

.tally-col-context {
  width: auto !important;
  min-width: 140px !important;
}

.tally-col-flow {
  width: auto !important;
  min-width: 150px !important;
  white-space: nowrap !important;
}

.tally-col-amount {
  width: 1% !important;
  white-space: nowrap !important;
  text-align: right !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
  color: #0f2746 !important;
}

.tally-col-status {
  width: 1% !important;
  white-space: nowrap !important;
  text-align: left !important;
}

.tally-col-action {
  width: 1% !important;
  white-space: nowrap !important;
  text-align: right !important;
  padding-right: 14px !important;
}

/* Voucher Type Badges */
.tally-vch-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.tally-vch-badge.receipt {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}

.tally-vch-badge.payment {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
}

.tally-vch-badge.purchase {
  background: #faf5ff !important;
  color: #7c3aed !important;
  border: 1px solid #e9d5ff !important;
}

.tally-vch-badge.debit-note {
  background: #fff7ed !important;
  color: #c2410c !important;
  border: 1px solid #fed7aa !important;
}

.tally-vch-badge.credit-note {
  background: #fdf2f8 !important;
  color: #be185d !important;
  border: 1px solid #fbcfe8 !important;
}

.tally-vch-badge.journal {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid #fde68a !important;
}

/* Flow Pill (Debit -> Credit) */
.tally-flow-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 11.5px !important;
  color: #334155 !important;
}

.tally-flow-pill .flow-debit {
  font-weight: 600 !important;
  color: #0f2746 !important;
}

.tally-flow-pill .flow-arrow {
  color: #94a3b8 !important;
  font-size: 10px !important;
}

.tally-flow-pill .flow-credit {
  font-weight: 600 !important;
  color: #475569 !important;
}

/* Status Badges */
.tally-status-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.tally-status-pill.ready {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}

.tally-status-pill.synced {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

.tally-status-pill.mapping {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid #fde68a !important;
}

.tally-status-pill.review {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
}

/* Action Buttons */
.tally-row-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
}

.tally-view-btn {
  height: 26px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f2746 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  transition: all 0.15s ease !important;
}

.tally-view-btn:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
}

.tally-xml-snippet-btn {
  height: 26px !important;
  padding: 0 7px !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  transition: all 0.15s ease !important;
}

.tally-xml-snippet-btn:hover {
  background: #edf8f0 !important;
  border-color: #a7f3d0 !important;
  color: #059669 !important;
}

/* --------------------------------------------------------------------------
   Ledger Mapping Workspace
   -------------------------------------------------------------------------- */
.tally-mapping-header-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 14px 18px !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  flex-wrap: wrap !important;
}

.tally-mapping-progress-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  min-width: 220px !important;
}

.tally-mapping-progress-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #0f2746 !important;
}

.tally-mapping-progress-bar {
  width: 100% !important;
  height: 6px !important;
  border-radius: 999px !important;
  background: #e2e8f0 !important;
  overflow: hidden !important;
}

.tally-mapping-progress-fill {
  height: 100% !important;
  background: #10b981 !important;
  border-radius: 999px !important;
  transition: width 0.3s ease !important;
}

.tally-mapping-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.tally-map-input {
  height: 32px !important;
  padding: 0 8px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  color: #0f172a !important;
  background: #ffffff !important;
  outline: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s !important;
}

.tally-map-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12) !important;
}

.tally-map-scope-select {
  height: 32px !important;
  padding: 0 6px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 11.5px !important;
  color: #334155 !important;
  background: #ffffff !important;
  outline: none !important;
}

/* --------------------------------------------------------------------------
   Tally Import Guide (Step-by-Step Cards)
   -------------------------------------------------------------------------- */
.tally-guide-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
}

.tally-guide-card {
  padding: 18px !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.tally-guide-step-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: #0e2238 !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

.tally-guide-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f2746 !important;
  margin: 0 !important;
}

.tally-guide-copy {
  font-size: 12.5px !important;
  color: #64748b !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

.tally-shortcut-box {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  background: #f1f5fa !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-family: ui-monospace, SFMono-Regular, monospace !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #0f2746 !important;
  width: fit-content !important;
}

.tally-tips-card {
  padding: 16px 20px !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.tally-tips-card h4 {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f2746 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.tally-tips-list {
  margin: 0 !important;
  padding-left: 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  font-size: 12.5px !important;
  color: #475569 !important;
}

/* --------------------------------------------------------------------------
   XML Preview & Snippet Modal
   -------------------------------------------------------------------------- */
.tally-xml-code-wrap {
  position: relative !important;
  background: #0f172a !important;
  color: #f8fafc !important;
  border-radius: 8px !important;
  padding: 14px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  max-height: 400px !important;
  overflow: auto !important;
  white-space: pre !important;
}

.tally-xml-copy-floating {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  z-index: 2 !important;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .tally-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .tally-guide-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .tally-kpi-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .tally-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .tally-search-field {
    width: 100% !important;
  }
}
