/* 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: wrap;
}

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

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

#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;
  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 */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.form-group {
  margin-bottom: 12px;
}

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

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

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

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

.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;
}

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

/* 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: 8px;
  flex-wrap: wrap;
}

.quick-preset-btns {
  display: flex;
  gap: 4px;
}

.quick-preset-btns .btn {
  padding: 2px 7px;
  font-size: 10px;
}

.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;
}

@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; }
  .tally-sheet { border: 2px solid #000; width: 100%; max-width: 100%; padding: 10px; }
}
