/* styles.css - Mockup Accounting Clean Modern & Tally Print Layout */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px;
}

/* App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: #1e293b;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  letter-spacing: 1px;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.brand-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gstin-badge {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Top 5 Main Modules Navigation */
.main-modules-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.module-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.module-tab-btn:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.module-tab-btn.active {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 1px 4px rgba(37,99,235,0.12);
}

.mod-icon {
  font-size: 20px;
}

.mod-title {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.module-tab-btn.active .mod-title {
  color: var(--primary);
}

.mod-sub {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

/* Middle Section: Executive Report Board Theme (4-4-5 Dashboard) */
.pulse-metrics-section {
  margin-bottom: 12px;
}

.report-board-container {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-top: 3px solid #1e40af;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
}

.report-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed #cbd5e1;
}

.report-board-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.3px;
}

.report-board-pill {
  font-size: 10px;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.report-board-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-board-mini-summary {
  display: none;
  font-size: 11px;
  color: #334155;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 4px 12px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.btn-board-toggle {
  background: #ffffff;
  border: 1px solid #94a3b8;
  color: #1e293b;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  transition: all 0.15s ease;
}

.btn-board-toggle:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Custom Dropdown for Ledgers Pill */
.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1000;
  min-width: 230px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 5px 0;
}

.custom-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  color: #1e293b;
  text-decoration: none;
  font-size: 12px;
  transition: background 0.1s ease;
}

.custom-dropdown-menu .dropdown-item:hover {
  background: #f1f5f9;
  color: #2563eb;
}

.custom-dropdown-menu .dropdown-divider {
  margin: 4px 0;
  border-top: 1px solid #e2e8f0;
}

.metrics-row-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.metrics-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.metrics-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.heading-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-month {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-total {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.badge-parties {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.heading-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

@media (max-width: 1200px) {
  .metrics-row-5 {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
  .metrics-row-4 {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 3px solid #94a3b8;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.metric-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.metric-card.border-green { border-left-color: #10b981; }
.metric-card.border-blue { border-left-color: #2563eb; }
.metric-card.border-amber { border-left-color: #f59e0b; }
.metric-card.border-rose { border-left-color: #f43f5e; }
.metric-card.border-indigo { border-left-color: #6366f1; }
.metric-card.border-purple { border-left-color: #a855f7; }
.metric-card.border-emerald { border-left-color: #059669; }
.metric-card.border-slate { border-left-color: #475569; }
.metric-card.border-cyan { border-left-color: #0891b2; }

.metric-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.metric-label {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.metric-value {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.text-green { color: #059669; }
.text-blue { color: #2563eb; }
.text-amber { color: #d97706; }
.text-rose { color: #e11d48; }
.text-indigo { color: #4f46e5; }
.text-purple { color: #9333ea; }
.text-emerald { color: #047857; }
.text-slate { color: #334155; }
.text-cyan { color: #0e7490; }

.metric-note {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Module Panes */
.module-workspace {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.module-pane {
  display: block;
}

.module-pane.hidden {
  display: none !important;
}

.pane-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}

#pane-ledgers .pane-toolbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  padding-bottom: 2px;
}

#pane-ledgers .toolbar-left {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 5px !important;
  flex: 1 1 auto;
  min-width: 0;
}

#pane-ledgers .toolbar-right {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 5px !important;
  flex-shrink: 0;
  margin-left: auto;
}

#sales-search, #purchase-search, #vch-search {
  width: 170px;
  transition: width 0.15s ease;
}

#sales-search:focus, #purchase-search:focus, #vch-search:focus {
  width: 210px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-group label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.filter-group select, .filter-group input {
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 12px;
  background: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

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

.btn-amber { background: #d97706; color: #fff; }
.btn-amber:hover { background: #b45309; }

.btn-green { background: #059669; color: #fff; }
.btn-green:hover { background: #047857; }

.btn-rose { background: #e11d48; color: #fff; }
.btn-rose:hover { background: #be123c; }

.btn-secondary { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.btn-secondary:hover { background: #e2e8f0; }

.btn-outline { background: #fff; color: #334155; border-color: #cbd5e1; }
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }

.btn-sm { padding: 4px 8px; font-size: 11px; }
.btn-xs { padding: 2px 6px; font-size: 11px; }

/* Tables */
.table-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow-x: auto;
  background: #fff;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.app-table th {
  background: #f8fafc;
  padding: 6px 8px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  color: #475569;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.app-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-size: 12px;
  vertical-align: middle;
}

.app-table tr:hover {
  background: #f8fafc;
}

.actions-cell {
  white-space: nowrap !important;
  text-align: right !important;
  width: 175px;
  min-width: 170px;
}

.actions-cell .btn {
  padding: 2px 6px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  margin-left: 2px;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.site-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 11px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  overflow-y: auto;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 650px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.25);
  overflow: hidden;
  margin: auto 0;
}

.modal-card > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-lg { max-width: 1080px; height: 92vh; }
.modal-md { max-width: 620px; max-height: calc(100vh - 40px); }

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  flex-shrink: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  padding: 2px 8px;
  border-radius: 4px;
}

.modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
}

.modal-body {
  padding: 18px 20px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  flex-shrink: 0;
}

/* Forms & Alignment Engine */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: stretch; /* All columns in a row stretch to equal height */
}

.form-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.form-group.col {
  flex: 1;
  min-width: 160px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  line-height: 1.3;
}

/* Section-box alignment rules for TDS & Discounts */
.tds-section-box, .discount-section-box {
  margin-bottom: 12px;
}
.tds-section-box .form-row,
.discount-section-box .form-row {
  display: flex;
  align-items: flex-end !important;
  gap: 12px;
}
.tds-section-box .form-group.col,
.discount-section-box .form-group.col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.tds-section-box .form-group.col label,
.discount-section-box .form-group.col label {
  min-height: 32px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 6px;
  line-height: 1.25;
}
  line-height: 1.35;
}

/* Base form controls: Standardized 38px height, box-sizing, and centering */
.form-group input, 
.form-group select, 
.form-group textarea,
.form-group .form-control {
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  box-sizing: border-box;
  background-color: #ffffff;
  color: #1e293b;
  vertical-align: middle;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input[type="date"] {
  height: 38px;
  line-height: 1.4;
}

.form-group textarea {
  height: auto;
  min-height: 60px;
}

/* Alignment Guarantee: If labels in a row have different heights,
   push the input/select controls to the bottom so that ALL input boxes are 100% HORIZONTALLY LEVEL! */
.form-group.col > input,
.form-group.col > select,
.form-group.col > textarea,
.form-group.col > .custom-combobox,
.form-group.col > .input-with-presets,
.form-group.col > .flex-gap,
.form-group.col > .form-control,
.form-group.col > .site-input-group {
  margin-top: auto;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus,
.form-group .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

.box-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.box-title {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
}

.site-tag-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Items Dynamic Table */
.items-card {
  margin-bottom: 14px;
}

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

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid #cbd5e1;
}

.items-table th {
  background: #f1f5f9;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #cbd5e1;
  font-weight: 700;
}

.items-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.items-table input, .items-table select {
  width: 100%;
  height: 34px;
  padding: 5px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  box-sizing: border-box;
  vertical-align: middle;
}

/* Totals Summary Grid */
.totals-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-top: 14px;
}

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

.totals-summary-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
}

.t-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #475569;
  margin-bottom: 5px;
}

.t-row.grand-total {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  border-top: 1px dashed #cbd5e1;
  padding-top: 6px;
  margin-top: 6px;
}

.words-disp {
  font-size: 11px;
  font-weight: 700;
  color: #1e40af;
  margin-top: 4px;
  line-height: 1.3;
}

.tds-section-box {
  background: #fdf4ff;
  border: 1px solid #f0abfc;
  border-left: 4px solid #a855f7;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

/* Reports Subnav */
.reports-subnav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.subnav-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

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

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

.gst-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
}

.sbox-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.sbox-val {
  font-size: 20px;
  font-weight: 800;
}

.two-column-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .two-column-tables { grid-template-columns: 1fr; }
}

.column-table-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
}

.column-table-card h4 {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.table-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table-mini th {
  background: #f1f5f9;
  padding: 6px 8px;
  text-align: left;
}

.table-mini td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
}

/* PnL Card */
.pnl-summary-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  max-width: 600px;
}

.pnl-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.pnl-row-divider {
  border-bottom: 1px solid #cbd5e1;
  margin: 6px 0;
}

.pnl-row.highlight {
  font-weight: 800;
  font-size: 15px;
  color: #1e293b;
}

.pnl-row.highlight-net {
  font-weight: 800;
  font-size: 18px;
  color: #2563eb;
  padding-top: 8px;
}

/* ======================================================== */
/* EXACT 1:1 TALLY PRINT SHEET LAYOUT                       */
/* ======================================================== */
.tally-sheet {
  background: #fff;
  border: 2px solid #000;
  padding: 16px 20px;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.35;
  font-size: 12px;
  max-width: 850px;
  margin: 0 auto;
}

.tally-header-title {
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid #000;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.tally-company-section {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #000;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.tally-comp-name {
  font-size: 16px;
  font-weight: 900;
  color: #000;
}

.tally-comp-meta {
  font-size: 11px;
  color: #111;
}

.tally-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #000;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.tally-box-border {
  border-right: 1px solid #000;
  padding-right: 10px;
}

.tally-box-right {
  padding-left: 10px;
}

.tally-table-grid {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
  margin: 8px 0;
  font-size: 11px;
}

.tally-table-grid th, .tally-table-grid td {
  border: 1px solid #000;
  padding: 5px 6px;
}

.tally-table-grid th {
  background: #f0f0f0;
  font-weight: 800;
}

.tally-bank-box {
  border: 1px solid #000;
  padding: 8px;
  font-size: 11px;
}

.tally-sign-box {
  text-align: right;
  padding-top: 35px;
  font-size: 12px;
  font-weight: 800;
}
/* Chart of Accounts: Group-wise Hierarchical Tree View */
.group-tree-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-block {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
}

.category-header.asset { border-left: 5px solid #2563eb; }
.category-header.liability { border-left: 5px solid #d97706; }
.category-header.expense { border-left: 5px solid #dc2626; }
.category-header.income { border-left: 5px solid #059669; }

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.category-stats {
  display: flex;
  align-items: center;
  gap: 14px;
}

.group-item-card {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.group-item-card:last-child {
  border-bottom: none;
}

.group-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
}

.group-item-row:hover {
  background: #f8fafc;
}

.group-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.group-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #64748b;
}

.group-toggle-btn:hover {
  background: #e2e8f0;
}

.group-name-text {
  font-weight: 600;
  font-size: 13px;
  color: #1e293b;
}

.group-parent-tag {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
  margin-left: 6px;
}

.group-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-balance-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
}

.group-balance-pill.dr { color: #059669; background: #ecfdf5; }
.group-balance-pill.cr { color: #dc2626; background: #fef2f2; }

.group-ledgers-drawer {
  background: #fcfcfd;
  border-top: 1px dashed #e2e8f0;
  padding: 8px 16px 12px 38px;
}

.group-ledgers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.group-ledgers-table th {
  text-align: left;
  padding: 6px 10px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}

.group-ledgers-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.group-ledgers-table tr:hover td {
  background: #f8fafc;
}

.tree-subgroup {
  margin-left: 20px;
  border-left: 2px solid #e2e8f0;
}

/* Period Filter Bar & E-Way Toggle */
.period-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.period-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.period-label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin-right: 2px;
}

.btn-period {
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-period:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-period.active {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.custom-date-range {
  display: flex;
  align-items: center;
  gap: 4px;
}

.custom-date-range input[type="date"] {
  padding: 2px 6px;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
}

.btn-eway-pill {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-eway-pill:hover {
  background: #fef3c7;
}

.btn-eway-pill.active {
  background: #d97706;
  color: #fff;
  border-color: #b45309;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.3);
}

/* Metric Strip */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.m-strip-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 5px 8px;
  border-left: 3px solid #64748b;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.m-strip-card.border-emerald { border-left-color: #10b981; }
.m-strip-card.border-blue { border-left-color: #3b82f6; }
.m-strip-card.border-rose { border-left-color: #f43f5e; }
.m-strip-card.border-amber { border-left-color: #f59e0b; }
.m-strip-card.border-purple { border-left-color: #8b5cf6; }

.m-strip-label {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-strip-value {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 1px;
  line-height: 1.2;
}

.m-strip-sub {
  font-size: 9px;
  color: #94a3b8;
  margin-top: 1px;
}

/* Party Balances & Clickable Links */
.party-drilldown-link {
  color: #1e40af;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.party-drilldown-link:hover {
  text-decoration: underline;
  color: #2563eb;
}

.badge-bal-pill {
  display: inline-block;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Due Date Input with Quick Presets */
.input-with-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.input-with-presets input[type="date"] {
  height: 38px;
  min-height: 38px;
  flex: 1;
}

.quick-preset-btns {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.quick-preset-btns .btn {
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 600;
  height: 32px;
  line-height: 1;
}

.highlight-subtle-row {
  background: #f8fafc;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  margin-bottom: 12px;
}

/* Dynamic Additional Charges Card & Table */
.charges-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

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

.charges-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.charges-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.charges-table th {
  padding: 6px 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  border-bottom: 1px solid #cbd5e1;
  text-align: left;
}

.charges-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.charges-table input, .charges-table select {
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  width: 100%;
}

/* Badges for Statuses */
.badge-overdue {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 4px;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  white-space: nowrap;
}

.badge-due-active {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

.badge-cancelled {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 4px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px dashed #ef4444;
  letter-spacing: 0.5px;
}

.badge-eway-missing {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
  cursor: pointer;
  transition: all 0.1s ease;
}

.badge-eway-missing:hover {
  background: #ffedd5;
  border-color: #f97316;
}

.badge-eway-ok {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-family: monospace;
}

/* Success Modal Grid */
.success-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.alert-box-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
}

/* ========================================================= */
/* TALLY PRIME STYLE: PLAIN WHITE & SMALL FONTS (NO SCROLL)   */
/* ========================================================= */

.tally-body {
  background: #f1f5f9;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: #1e293b;
}

/* Thin 34px Top Strip */
.tally-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  color: #f8fafc;
  height: 34px;
  padding: 0 14px;
  font-size: 11.5px;
  border-bottom: 2px solid #0284c7;
  flex-shrink: 0;
}
.tts-left, .tts-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tts-badge {
  background: #0284c7;
  color: #ffffff;
  font-weight: 800;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.tts-company {
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}
.tts-sep {
  color: #475569;
}
.tts-meta {
  color: #cbd5e1;
}
.tts-meta strong {
  color: #ffffff;
}
.tts-btn {
  padding: 2px 6px !important;
  font-size: 10.5px !important;
  color: #38bdf8 !important;
  border-color: #0284c7 !important;
}

/* Inner Navigation Bar */
.gt-inner-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1.5px solid #cbd5e1;
  padding: 6px 14px;
  font-size: 12px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.btn-tally-back {
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.btn-tally-back:hover {
  background: #0369a1;
}
.btn-tally-back kbd, .t-esc-badge {
  background: #facc15;
  color: #0f172a;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 800;
  font-size: 9.5px;
  font-family: monospace;
}
.gt-inner-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.gt-inner-shortcuts {
  display: flex;
  gap: 6px;
}

/* Gateway of Tally Plain White Layout (Fits completely in 100vh with NO scrolling) */
.gateway-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 10px;
  max-width: 1040px;
  margin: 0 auto;
}
.gateway-left-panel {
  flex: 1;
  max-width: 440px;
}
.gt-left-window {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
}
.gt-window-header {
  background: #0284c7;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
}
.gt-section-header {
  background: #f1f5f9;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  color: #0369a1;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gt-refresh-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  color: #0284c7;
}
.gt-section-body {
  padding: 8px 12px;
  background: #ffffff;
}
.gt-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 11.5px;
  color: #334155;
  border-bottom: 1px dashed #f1f5f9;
}
.gt-data-row:last-child {
  border-bottom: none;
}
.gt-data-bold {
  font-weight: 800;
  font-size: 12px;
  color: #0f172a;
  padding-top: 5px;
  border-top: 1px solid #e2e8f0;
  margin-top: 2px;
}
.gt-data-val {
  font-weight: 700;
  font-size: 12px;
}
.gt-window-footer {
  background: #f8fafc;
  color: #64748b;
  font-size: 10.5px;
  text-align: center;
  padding: 5px 10px;
  border-top: 1px solid #e2e8f0;
}
.gt-loading {
  text-align: center;
  color: #64748b;
  font-size: 11px;
  padding: 8px 0;
}

/* Gateway Right Panel (Plain White Tally Menu) */
.gateway-right-panel {
  flex: 1.15;
  max-width: 480px;
}
.gt-menu-window {
  background: #ffffff;
  border: 1.5px solid #0284c7;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}
.gt-menu-header {
  background: #0284c7;
  color: #ffffff;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.gt-menu-section-title {
  background: #f1f5f9;
  color: #0284c7;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 14px;
  text-transform: uppercase;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.t-note {
  font-size: 9.5px;
  color: #64748b;
  font-weight: 400;
  text-transform: none;
}
.gt-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 16px;
  font-size: 12px;
  color: #1e293b;
  text-decoration: none;
  background: #ffffff;
  border-bottom: 1px solid #f8fafc;
  transition: all 0.1s ease;
  cursor: pointer;
}
.gt-menu-item:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  padding-left: 20px;
}
.gt-menu-item:hover .t-key {
  color: #fef08a !important;
}
.gt-menu-item:hover .t-sub {
  color: #e0f2fe !important;
}
.gt-menu-item:hover .t-badge {
  background: #0369a1 !important;
  color: #fef08a !important;
  border-color: #38bdf8 !important;
}
.t-key {
  color: #0284c7;
  font-weight: 900;
  text-decoration: underline;
  margin-right: 1px;
}
.t-sub {
  font-size: 10.5px;
  color: #64748b;
  margin-left: 5px;
}
.t-badge {
  background: #f1f5f9;
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
  font-family: monospace;
}
.gt-menu-footer {
  background: #f8fafc;
  color: #64748b;
  font-size: 10.5px;
  text-align: center;
  padding: 5px 10px;
  border-top: 1px solid #e2e8f0;
}
.gt-menu-footer kbd {
  background: #e2e8f0;
  color: #0f172a;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 700;
  font-size: 10px;
}

/* Day Book Styles */
.db-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: #fff;
  padding: 14px 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  margin-bottom: 16px;
}
.db-title-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.db-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.db-sub {
  font-size: 12px;
  color: #64748b;
}
.db-controls-col {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.db-date-picker-group {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid #0284c7;
  border-radius: 6px;
  padding: 2px;
}
.db-date-display {
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.db-presets-group {
  display: flex;
  gap: 4px;
}
.btn-preset {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-preset:hover {
  background: #e2e8f0;
}
.btn-preset.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  font-weight: 700;
}
.db-table th, .db-table td {
  padding: 9px 12px;
  font-size: 12.5px;
}
.db-total-row th {
  background: #f8fafc;
  border-top: 2px solid #cbd5e1;
  padding: 10px 12px;
  font-size: 13px;
}

/* Outstanding & Advances Styles */
.oa-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.oa-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.oa-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}
.oa-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 800px) {
  .oa-summary-grid {
    grid-template-columns: 1fr;
  }
  .gateway-container {
    flex-direction: column;
  }
  .gateway-left-panel, .gateway-right-panel {
    max-width: 100%;
  }
}
.oa-kpi-card {
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.oa-kpi-card.client-side {
  border-top: 4px solid #0284c7;
}
.oa-kpi-card.vendor-side {
  border-top: 4px solid #dc2626;
}
.oa-kpi-badge {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: #0f172a;
}
.oa-kpi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}
.oa-kpi-divider {
  border-top: 1px solid #e2e8f0;
  margin: 6px 0;
}
.oa-kpi-row.net-row {
  font-size: 14px;
  font-weight: 800;
  padding-top: 6px;
}
.oa-tabs-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
}
.oa-tab-btn {
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: all 0.12s ease;
}
.oa-tab-btn:hover {
  background: #f1f5f9;
}
.oa-tab-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.oa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}

/* ============================================================ */
/* MODAL FORM ROW HORIZONTAL BASELINE ALIGNMENT ENGINE          */
/* Fixes: "allingment of input boxes sahi nahi hai, up down hai" */
/* ============================================================ */
.modal-body .form-row {
  display: flex !important;
  align-items: flex-end !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.modal-body .form-group.col {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  margin-bottom: 0 !important;
}

.modal-body .form-group.col > label,
.tds-section-box .form-group.col > label,
.discount-section-box .form-group.col > label {
  min-height: 28px !important;
  display: flex !important;
  align-items: flex-end !important;
  margin-bottom: 5px !important;
  line-height: 1.25 !important;
}

.modal-body .form-group.col > input,
.modal-body .form-group.col > select,
.modal-body .form-group.col > textarea,
.tds-section-box input,
.tds-section-box select,
.discount-section-box input,
.discount-section-box select {
  height: 38px !important;
  min-height: 38px !important;
  box-sizing: border-box !important;
}

.tds-section-box, .discount-section-box {
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.tds-section-box .form-row,
.discount-section-box .form-row {
  display: flex !important;
  align-items: flex-end !important;
  gap: 12px !important;
  margin-bottom: 0 !important;
}

.tds-section-box .form-group.col,
.discount-section-box .form-group.col {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  margin-bottom: 0 !important;
}

.tds-section-box .form-group.col > label,
.discount-section-box .form-group.col > label {
  min-height: 32px !important;
  display: flex !important;
  align-items: flex-end !important;
  margin-bottom: 5px !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
}

/* ============================================================ */
/* TALLY CHART OF ACCOUNTS & LIST OF LEDGERS (PLAIN WHITE)      */
/* ============================================================ */
.tally-ledgers-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.tl-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.tl-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.2px;
}

.tl-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.tl-actions-col {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tl-filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 10px;
}

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

.tl-filter-icon {
  font-size: 12px;
  color: #64748b;
}

.tl-filter-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin: 0;
  white-space: nowrap;
}

.tl-search-input {
  height: 30px !important;
  min-height: 30px !important;
  font-size: 11.5px !important;
  padding: 4px 8px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 3px !important;
}

.tl-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  background: #ffffff;
}

.tl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  line-height: 1.35;
}

.tl-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 6px 10px;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
}

.tl-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.tl-table tr.tl-row:hover {
  background-color: #f8fafc;
}

.tl-party-name {
  font-weight: 700;
  color: #1d4ed8;
  cursor: pointer;
  display: inline-block;
}

.tl-party-name:hover {
  text-decoration: underline;
  color: #1e40af;
}

.tl-sub-info {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 1px;
}

.tl-gstin-badge {
  font-family: monospace;
  font-size: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  padding: 0 4px;
  color: #475569;
}

.tl-pan-text, .tl-phone-text, .tl-city-text {
  font-size: 10.5px;
  color: #64748b;
}

.tl-group-pill {
  display: inline-block;
  font-size: 10.5px;
  background: #f1f5f9;
  color: #334155;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
}

.tl-bal-zero {
  color: #64748b;
}

.tl-bal-dr {
  color: #b91c1c; /* Debit / Receivable */
}

.tl-bal-cr {
  color: #15803d; /* Credit / Payable */
}

.tl-btn-group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.tl-action-btn {
  padding: 2px 6px !important;
  font-size: 10.5px !important;
  line-height: 1.2 !important;
  border-radius: 3px !important;
}

.tl-total-row td {
  background: #f8fafc;
  border-top: 2px solid #cbd5e1;
  border-bottom: 2px solid #cbd5e1;
  padding: 8px 10px;
  font-size: 12px;
}

@media print {
  body { background: #fff; }
  .app-container, .no-print, .main-modules-nav, .pulse-metrics-section, .pane-toolbar, .period-filter-bar, .metric-strip { display: none !important; }
  .modal-overlay { position: static; background: none; padding: 0; }
  .modal-card { max-width: 100%; box-shadow: none; border: none; }
  .modal-header, .modal-footer { display: none !important; }
  .stmt-filter-bar { display: none !important; }
  .stmt-print-only { display: block !important; }
  .tally-sheet { border: 2px solid #000; width: 100%; max-width: 100%; padding: 10px; }
}

/* Forced Hidden Engine: Never overridden by flex !important */
.hidden,
.form-row.hidden,
.modal-body .form-row.hidden,
#itm-service-account-row.hidden {
  display: none !important;
}

/* Day Book Header & Controls Alignment */
.db-header-bar {
  padding: 10px 14px !important;
  margin-bottom: 12px !important;
}

.db-date-picker-group,
.db-date-display,
#db-filter-voucher-type {
  height: 32px !important;
  min-height: 32px !important;
  line-height: 1.2 !important;
}

/* Compact Tally Rows */
.tl-table th {
  padding: 4px 6px !important;
  font-size: 10.5px !important;
  line-height: 1.2 !important;
}
.tl-table td {
  padding: 3px 6px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}
.tl-party-name {
  font-size: 11.5px !important;
  line-height: 1.2 !important;
}

/* Item & Stock Summary Compact Styling */
#rep-pane-items .table-card table th {
  padding: 4px 6px !important;
  font-size: 10.5px !important;
  line-height: 1.2 !important;
}
#rep-pane-items .table-card table td {
  padding: 4px 6px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}
