/* TallyX Cloud Data Viewer — Modern Design System */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --dark: #0f172a;
  --gray-900: #1e293b;
  --gray-800: #334155;
  --gray-700: #475569;
  --gray-600: #64748b;
  --gray-500: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50: #f8fafc;
  --white: #ffffff;
  
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  font-size: 14px;
}

/* Layout */
#app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--gray-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.2s ease-in-out;
  z-index: 40;
}

.sidebar-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--gray-800);
}

.logo-badge {
  background: var(--primary);
  color: var(--white);
  font-weight: 800;
  font-size: 16px;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--gray-300);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-item:hover {
  background-color: var(--gray-800);
  color: var(--white);
}

.nav-item.active {
  background-color: var(--primary);
  color: var(--white);
}

/* Main Container */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header */
.top-header {
  height: 64px;
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--gray-700);
  cursor: pointer;
}

.company-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-select {
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background-color: var(--white);
  font-weight: 600;
  color: var(--gray-800);
  outline: none;
  cursor: pointer;
}

.company-select:focus {
  border-color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.btn-logout {
  background: none;
  border: 1px solid var(--gray-300);
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--gray-700);
  cursor: pointer;
  font-weight: 500;
}

.btn-logout:hover {
  background-color: var(--gray-100);
  color: var(--danger);
  border-color: var(--danger);
}

/* Content Area */
.content-body {
  padding: 24px;
  flex: 1;
}

/* Card System */
.card {
  background-color: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  margin-top: 4px;
}

.stat-desc {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }
.badge-info { background-color: var(--primary-light); color: var(--primary); }

/* Table System */
.table-responsive,
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background-color: var(--white);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.table,
.data-table,
.table-container > table,
.table-responsive > table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  text-align: left;
  font-size: 13px;
}

.table th,
.data-table th,
.table-container > table th,
.table-responsive > table th {
  background-color: var(--gray-50);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
  vertical-align: middle;
}

.table td,
.data-table td,
.table-container > table td,
.table-responsive > table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
  line-height: 1.5;
}

.table tbody tr:last-child td,
.data-table tbody tr:last-child td,
.table-container > table tbody tr:last-child td,
.table-responsive > table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover,
.data-table tbody tr:hover,
.table-container > table tbody tr:hover,
.table-responsive > table tbody tr:hover {
  background-color: #f8fafc;
  transition: background-color 0.15s ease;
}

.table td[style*="text-align:right"],
.table th[style*="text-align:right"],
.table td[style*="text-align: right"],
.table th[style*="text-align: right"],
.data-table td[style*="text-align:right"],
.data-table th[style*="text-align:right"],
.data-table td[style*="text-align: right"],
.data-table th[style*="text-align: right"] {
  font-variant-numeric: tabular-nums;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--gray-200);
}

/* Controls Bar */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.input-search, .filter-select, .input-date {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  outline: none;
  font-size: 13px;
}

.input-search:focus, .filter-select:focus, .input-date:focus {
  border-color: var(--primary);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

/* Pagination */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
}

.btn-page {
  padding: 6px 12px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  border-radius: var(--radius);
  cursor: pointer;
}

.btn-page:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal / Drawer */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}

.btn-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* Login Page Layout */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--dark) 100%);
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-block {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
}

.alert-error {
  background-color: var(--danger-light);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}

/* Loading & Empty States */
.state-center {
  padding: 40px;
  text-align: center;
  color: var(--gray-500);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    height: 100vh;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 640px) {
  .top-header {
    padding: 0 16px;
  }
  .content-body {
    padding: 16px;
  }
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Master Data Entry & Write Activity (Module 27A) */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.form-full {
  grid-column: 1 / -1;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.form-label .req {
  color: var(--danger);
  margin-left: 2px;
}
.form-control {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  outline: none;
  font-size: 13px;
  width: 100%;
  transition: border-color 0.15s;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.form-help {
  font-size: 11px;
  color: var(--gray-500);
}
.btn-secondary {
  background-color: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover {
  background-color: var(--gray-100);
}
.btn-success {
  background-color: var(--success);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-success:hover {
  background-color: #059669;
}
.btn-danger {
  background-color: var(--danger);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover {
  background-color: #dc2626;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-claimed { background: #dbeafe; color: #1e40af; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-retry { background: #ffedd5; color: #9a3412; }

.tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 20px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: none;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.tab-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}
.tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

/* =========================================================
   Tally Prime Style Profit & Loss Account (T-Format)
   ========================================================= */
.tally-sheet-wrapper {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-top: 16px;
  font-family: var(--font-sans);
}

.tally-t-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13.5px;
  color: var(--gray-900);
}

.tally-t-table thead tr {
  background: var(--gray-100);
  border-top: 2px solid var(--gray-700);
  border-bottom: 2px solid var(--gray-700);
}

.tally-t-table th {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gray-800);
  text-align: left;
  vertical-align: middle;
}

.tally-t-table th.t-col-amt {
  text-align: right;
  font-weight: 600;
  letter-spacing: normal;
}

.t-col-header-meta {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: normal;
}

.t-col-header-period {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-600);
  letter-spacing: normal;
}

.tally-t-table td {
  padding: 5px 14px;
  vertical-align: middle;
  line-height: 1.4;
}

.tally-t-table td.t-amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}

/* Center dividing border between Dr & Cr sides */
.t-divider {
  border-right: 2px solid var(--gray-300) !important;
}

.tally-row-group {
  cursor: pointer;
  font-weight: 600;
  transition: background 0.1s;
}

.tally-row-group:hover {
  background-color: var(--gray-50);
}

.tally-row-highlight {
  font-weight: 700;
  font-style: italic;
}

.tally-row-profit {
  color: #047857;
  font-weight: 700;
}

.tally-row-loss {
  color: #b91c1c;
  font-weight: 700;
}

.tally-group-toggle {
  display: inline-block;
  width: 14px;
  font-size: 9px;
  color: var(--gray-500);
  margin-right: 4px;
  transition: transform 0.15s;
}

.tally-sub-row {
  background-color: #f8fafc;
  font-size: 12.5px;
  color: var(--gray-700);
}

.tally-sub-row td.t-part {
  padding-left: 28px;
}

.tally-sub-row:hover {
  background-color: #f1f5f9;
}

.tally-sub-bullet {
  color: var(--gray-400);
  margin-right: 6px;
}

/* Subtotal Trading Account row */
.tally-row-trading-total {
  border-top: 1px solid var(--gray-400);
  border-bottom: 1px solid var(--gray-400);
  font-weight: 700;
  background-color: #fafafa;
}

.tally-row-trading-total td.t-amt {
  font-weight: 700;
  color: var(--gray-900);
}

/* Grand Total P&L row */
.tally-row-grand-total {
  border-top: 1px solid var(--gray-500);
  border-bottom: 3px double var(--gray-900);
  font-weight: 800;
  background-color: var(--gray-100);
}

.tally-row-grand-total td {
  padding: 8px 14px;
}

.tally-row-grand-total td.t-part {
  letter-spacing: 2px;
  font-weight: 800;
  text-transform: uppercase;
}

.tally-row-grand-total td.t-amt {
  font-weight: 800;
  font-size: 14px;
  color: var(--gray-900);
}

.tally-spacer-row td {
  padding: 8px 14px;
}

/* Balance Sheet P&L Sublines (Opening Balance & Current Period) */
.tally-bs-subline {
  font-style: italic;
  font-size: 12.5px;
  color: var(--gray-700);
  padding-left: 24px !important;
}

.tally-bs-subline-amt {
  font-size: 12.5px;
  color: var(--gray-800);
  text-align: right;
  padding-right: 14px;
}

.tally-subline-underline {
  border-bottom: 1px solid var(--gray-500);
  display: inline-block;
  min-width: 90px;
}

/* =========================================================
   Tally Prime Style Trial Balance Table & Cursor Styling
   ========================================================= */
.tally-tb-container {
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-top: 10px;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
  display: flex;
  flex-direction: column;
}

.tally-tb-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
}

.tally-tb-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.tally-tb-meta-box {
  text-align: right;
}

.tally-tb-comp-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.tally-tb-period-label {
  font-size: 11.5px;
  color: #475569;
}

.tally-tb-scroll-wrapper {
  overflow-x: auto;
  width: 100%;
}

.tally-tb-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  color: #0f172a;
  min-width: 780px;
}

.tally-tb-table th {
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 700;
  vertical-align: middle;
}

.tally-tb-table th.t-part-header {
  font-size: 12.5px;
  letter-spacing: 2px;
  padding: 8px 12px;
  border-right: 1px solid #94a3b8;
  border-bottom: 1px solid #64748b;
  text-align: left;
  vertical-align: middle;
}

.tally-tb-table th.t-col-header {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #64748b;
  vertical-align: middle;
  line-height: 1.25;
}

.tally-tb-table th.t-col-tx-header {
  text-align: center;
  border-bottom: 1px solid #cbd5e1;
  padding: 4px 10px;
}

.tally-tb-table th.t-col-sub {
  font-size: 11.5px;
  padding: 4px 10px;
  text-align: right;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #64748b;
}

.tally-tb-table td {
  padding: 3.5px 10px;
  vertical-align: middle;
  line-height: 1.4;
}

.tally-tb-table td.t-part {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid #cbd5e1;
}

.tally-tb-table td.t-amt {
  text-align: right;
  font-family: 'Consolas', 'Menlo', 'Monaco', monospace;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #0f172a;
  border-right: 1px solid #e2e8f0;
}

.tally-tb-table td.t-amt:last-child {
  border-right: none;
}

.tally-tb-data-row {
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.05s ease;
}

.tally-tb-data-row:hover {
  background-color: #f8fafc; /* Subtle neutral hover, no yellow */
}

.tally-tb-data-row.tally-row-active {
  background-color: #f1f5f9; /* Subtle neutral soft gray, no yellow */
}

.tally-tb-spacer {
  height: 14px;
  background-color: #ffffff;
}

.tally-tb-spacer td {
  padding: 2px 10px;
  border-bottom: 1px solid #f8fafc;
  border-right: 1px solid #f1f5f9;
}

.tally-tb-grand-total {
  background-color: #f8fafc;
  border-top: 1px solid #334155;
  border-bottom: 3px double #0f172a;
}

.tally-tb-grand-total td {
  padding: 7px 10px;
  font-weight: 800;
  border-right: 1px solid #e2e8f0;
}

.tally-tb-grand-total td:last-child {
  border-right: none;
}

.tally-tb-grand-total td.t-part {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12.5px;
  color: #0f172a;
  border-right: 1px solid #cbd5e1;
}

.tally-tb-grand-total td.t-amt {
  font-size: 13px;
  color: #0f172a;
}

.tally-tb-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background-color: #f1f5f9;
  border-top: 1px solid #cbd5e1;
  font-size: 11.5px;
  color: #475569;
}

/* TallyPrime Cash Flow Styles (Clean, Authentic, No Yellow) */
.tally-cf-container {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-family: var(--font-sans);
  margin-bottom: 20px;
}

.tally-cf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tally-cf-table thead th {
  background-color: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  font-weight: 700;
  vertical-align: middle;
}

.tally-cf-table thead th.cf-part-header {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  text-align: left;
}

.tally-cf-table thead th.cf-meta-header {
  font-size: 12.5px;
}

.tally-cf-table tbody td {
  padding: 7px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  color: #1e293b;
}

.tally-cf-table tbody td.cf-part {
  font-weight: 500;
  text-align: left;
}

.tally-cf-table tbody td.cf-amt {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tally-cf-table tbody td.cf-amt-divider {
  border-right: 1px solid #e2e8f0;
}

.tally-cf-data-row {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.tally-cf-data-row:hover {
  background-color: #f8fafc; /* Neutral soft hover, no yellow */
}

.tally-cf-data-row.tally-row-active {
  background-color: #e2e8f0; /* Neutral active state, no yellow */
}

.tally-cf-grand-total {
  background-color: #f8fafc;
  border-top: 1px solid #334155;
  border-bottom: 3px double #0f172a;
}

.tally-cf-grand-total td {
  padding: 8px 14px;
  font-weight: 800;
}

.tally-cf-grand-total td.cf-part {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  color: #0f172a;
}

.tally-cf-grand-total td.cf-amt {
  font-size: 13.5px;
  color: #0f172a;
}

/* Tally Monthly Bar Chart */
.tally-cf-chart-container {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 16px 20px;
  margin-top: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tally-cf-chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
}

.tally-cf-chart-body {
  display: flex;
  height: 190px;
  align-items: stretch;
  gap: 12px;
  margin-top: 14px;
  padding-bottom: 8px;
}

.tally-cf-chart-scale {
  width: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-mono);
  text-align: right;
  padding-right: 8px;
  border-right: 1px solid #cbd5e1;
}

.tally-cf-chart-bars-area {
  flex: 1;
  display: flex;
  height: 100%;
  align-items: flex-end;
  gap: 8px;
  border-bottom: 1px solid #cbd5e1;
  position: relative;
}

.tally-cf-chart-month-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  cursor: pointer;
}

.tally-cf-chart-month-col:hover .cf-bar-inflow {
  opacity: 0.85;
}

.tally-cf-chart-month-col:hover .cf-bar-outflow {
  opacity: 0.85;
}

.cf-bar-inflow {
  width: 44%;
  max-width: 18px;
  background-color: #dc2626; /* Tally Inflow Red */
  border-radius: 2px 2px 0 0;
  transition: height 0.25s ease;
}

.cf-bar-outflow {
  width: 44%;
  max-width: 18px;
  background-color: #2563eb; /* Tally Outflow Blue */
  border-radius: 2px 2px 0 0;
  transition: height 0.25s ease;
}

.tally-cf-chart-month-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-top: 6px;
  text-align: center;
}

/* TallyPrime Funds Flow Styles (Clean, Authentic, No Yellow) */
.tally-ff-container {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-family: var(--font-sans);
  margin-bottom: 20px;
}

.tally-ff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tally-ff-table thead th {
  background-color: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  font-weight: 700;
  vertical-align: middle;
  text-align: right;
}

.tally-ff-table thead th.ff-part-header {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  text-align: left;
}

.tally-ff-table thead th.ff-col-group {
  text-align: center;
  border-bottom: 1px solid #cbd5e1;
}

.tally-ff-table thead th.ff-col-sub {
  font-size: 12px;
  font-weight: 600;
}

.tally-ff-table tbody td {
  padding: 6px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  color: #1e293b;
}

.tally-ff-table tbody td.ff-part {
  font-weight: 500;
  text-align: left;
}

.tally-ff-table tbody td.ff-amt {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tally-ff-table tbody td.ff-amt-divider {
  border-right: 1px solid #e2e8f0;
}

.tally-ff-data-row {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.tally-ff-data-row:hover {
  background-color: #f8fafc; /* Neutral soft hover, NO yellow */
}

.tally-ff-data-row.tally-row-active {
  background-color: #e2e8f0; /* Neutral active state, NO yellow */
}

.tally-ff-grand-total {
  background-color: #f8fafc;
  border-top: 1px solid #334155;
  border-bottom: 3px double #0f172a;
}

.tally-ff-grand-total td {
  padding: 8px 14px;
  font-weight: 800;
}

.tally-ff-grand-total td.ff-part {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  color: #0f172a;
}

.tally-ff-grand-total td.ff-amt {
  font-size: 13.5px;
  color: #0f172a;
  text-align: right;
  font-family: var(--font-mono);
}

/* Bi-Directional Zero-Centered Funds Flow Chart */
.tally-ff-chart-container {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 16px 20px;
  margin-top: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tally-ff-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tally-ff-chart-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.tally-ff-chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
}

.ff-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ff-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: #dc2626;
  border-radius: 2px;
}

.tally-ff-chart-body {
  display: flex;
  height: 220px;
  align-items: stretch;
  gap: 12px;
  position: relative;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.tally-ff-chart-scale {
  width: 95px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-mono);
  text-align: right;
  padding: 6px 8px;
  border-right: 1px solid #cbd5e1;
  background: #f8fafc;
}

.tally-ff-chart-bars-area {
  flex: 1;
  display: flex;
  height: 100%;
  position: relative;
  align-items: stretch;
}

/* Horizontal zero baseline line in the center */
.tally-ff-zero-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #475569;
  z-index: 2;
}

/* Grid lines for top and bottom bounds */
.tally-ff-grid-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1px dashed #e2e8f0;
}

.tally-ff-grid-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  border-bottom: 1px dashed #e2e8f0;
}

.tally-ff-chart-month-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  position: relative;
  cursor: pointer;
  z-index: 3;
}

.tally-ff-chart-month-col:hover {
  background-color: rgba(241, 245, 249, 0.6);
}

.tally-ff-chart-month-col.active {
  background-color: rgba(226, 232, 240, 0.8);
}

/* Half containers: top half for positive, bottom half for negative */
.ff-bar-half-top {
  width: 100%;
  height: 50%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.ff-bar-half-bottom {
  width: 100%;
  height: 50%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

.ff-bar-pos {
  width: 22px;
  background-color: #dc2626; /* Tally red */
  border-radius: 2px 2px 0 0;
  transition: height 0.2s ease;
}

.ff-bar-neg {
  width: 22px;
  background-color: #dc2626; /* Tally red */
  border-radius: 0 0 2px 2px;
  transition: height 0.2s ease;
}

.tally-ff-chart-month-labels {
  display: flex;
  padding-left: 107px; /* Scale width + gap */
  margin-top: 6px;
}

.tally-ff-chart-month-label {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-align: center;
  cursor: pointer;
}

/* Detailed Schedule Styles */
.tally-ff-detail-header-row {
  background-color: #f1f5f9;
  font-weight: 700;
  color: #0f172a;
}

.tally-ff-group-header {
  background-color: #f8fafc;
  font-weight: 700;
  color: #1e293b;
  border-top: 1px solid #cbd5e1;
}

.tally-ff-group-header td {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.tally-ff-detail-subtotal {
  font-weight: 700;
  background-color: #f8fafc;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.tally-ff-detail-subtotal td {
  font-weight: 700;
  color: #0f172a;
}

/* ==========================================================================
   TallyPrime Bills Outstanding (Bills Receivable & Bills Payable) Styles
   Strictly neutral slate styling — NO yellow highlighters or yellow backgrounds
   ========================================================================== */

.tally-bills-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tally-bills-header-box {
  background-color: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tally-bills-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.tally-bills-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tally-bills-main-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tally-bills-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-600);
}

.tally-bills-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tally-bills-meta-label {
  font-weight: 600;
  color: var(--gray-700);
}

.tally-bills-meta-val {
  font-weight: 500;
  color: var(--gray-900);
}

.tally-bills-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tally-bills-search-input {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background-color: var(--white);
  color: var(--gray-900);
  min-width: 240px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tally-bills-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.tally-bills-f5-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--white);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tally-bills-f5-btn:hover {
  background-color: var(--primary-light);
}

.tally-bills-kpi-bar {
  display: flex;
  gap: 12px;
  padding: 10px 18px;
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

.tally-bills-kpi-card {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
}

.tally-bills-kpi-card.highlight {
  border-left: 3px solid var(--primary);
}

.tally-bills-kpi-card.overdue {
  border-left: 3px solid #dc2626;
}

.tally-bills-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-500);
  letter-spacing: 0.5px;
}

.tally-bills-kpi-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 2px;
  font-family: var(--font-mono);
}

.tally-bills-table-wrapper {
  overflow-x: auto;
  max-height: 70vh;
  position: relative;
}

.tally-bills-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  color: var(--gray-900);
}

.tally-bills-table thead th {
  position: sticky;
  top: 0;
  background-color: #f1f5f9;
  color: var(--gray-800);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 9px 12px;
  border-bottom: 2px solid var(--gray-300);
  border-top: 1px solid var(--gray-200);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  z-index: 10;
}

.tally-bills-table thead th:hover {
  background-color: #e2e8f0;
}

.tally-bills-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}

.tally-bills-table tr.bills-row {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

/* Strictly neutral slate hover and selection — NO yellow */
.tally-bills-table tr.bills-row:hover {
  background-color: #f8fafc;
}

.tally-bills-table tr.bills-row.active-row {
  background-color: #e2e8f0 !important;
  font-weight: 600;
  color: #0f172a;
}

.tally-bills-table tr.bills-row.active-row td {
  color: #0f172a;
}

.tally-bills-table tr.bills-total-row {
  position: sticky;
  bottom: 0;
  background-color: #f1f5f9;
  font-weight: 700;
  border-top: 2px solid var(--gray-400);
  border-bottom: 3px double var(--gray-400);
  z-index: 10;
}

.tally-bills-table tr.bills-total-row td {
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.tally-bills-col-date {
  width: 105px;
  font-family: var(--font-mono);
  color: var(--gray-700);
  white-space: nowrap;
}

.tally-bills-col-ref {
  width: 170px;
  font-family: var(--font-mono);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tally-bills-col-party {
  min-width: 220px;
  font-weight: 500;
}

.tally-bills-col-costcentre {
  width: 140px;
  font-size: 12px;
  color: var(--gray-700);
}

.tally-bills-col-amt {
  width: 140px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
}

.tally-bills-col-due {
  width: 105px;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--gray-700);
  white-space: nowrap;
}

.tally-bills-col-overdue {
  width: 120px;
  text-align: right;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.tally-bills-overdue-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.tally-bills-overdue-badge.overdue {
  color: #b91c1c;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
}

.tally-bills-overdue-badge.not-overdue {
  color: #047857;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.tally-bills-footer-help {
  padding: 8px 18px;
  background-color: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--gray-500);
}

.tally-bills-key-hints {
  display: flex;
  gap: 14px;
  align-items: center;
}

.tally-bills-key-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  color: var(--gray-700);
  background-color: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}

/* ============================================================
   Tally Stock Summary Hierarchical Report & Drill-Down (Neutral Slate)
   Strictly NO yellow highlighters
   ============================================================ */
.tally-stock-container {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
  margin-top: 12px;
}

.tally-stock-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
  color: var(--gray-600);
}

.tally-stock-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--primary);
  font-weight: 500;
  transition: color 0.15s ease;
}

.tally-stock-breadcrumb-item:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.tally-stock-breadcrumb-item.active {
  color: var(--gray-900);
  font-weight: 700;
  cursor: default;
  text-decoration: none;
}

.tally-stock-breadcrumb-separator {
  color: var(--gray-400);
  font-size: 11px;
}

.tally-stock-header-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
}

.tally-stock-title-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tally-stock-main-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tally-stock-meta-area {
  text-align: right;
}

.tally-stock-meta-company {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
}

.tally-stock-meta-period {
  font-size: 12.5px;
  color: var(--gray-500);
  font-family: var(--font-mono);
}

.tally-stock-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.tally-stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--font-sans);
}

.tally-stock-table th {
  background-color: #f8fafc;
  color: var(--gray-700);
  font-weight: 700;
  padding: 8px 14px;
  border-top: 1px solid var(--gray-300);
  border-bottom: 1px solid var(--gray-300);
  border-right: 1px solid var(--gray-200);
  text-align: left;
  font-size: 12.5px;
}

.tally-stock-table th.num-col,
.tally-stock-table td.num-col {
  text-align: right;
  font-family: var(--font-mono);
}

.tally-stock-row {
  border-bottom: 1px solid var(--gray-100);
  transition: background-color 0.1s ease;
  cursor: pointer;
  background-color: #ffffff;
}

.tally-stock-row:nth-child(even) {
  background-color: #fafbfc;
}

.tally-stock-row:hover {
  background-color: #f1f5f9 !important;
}

.tally-stock-row.selected,
.tally-stock-row.selected:nth-child(even) {
  background-color: #dbeafe !important;
}

.tally-stock-row.selected td {
  background-color: #dbeafe !important;
  color: #1e3a8a !important;
  border-top: 1px solid #93c5fd;
  border-bottom: 1px solid #93c5fd;
}

.tally-stock-row.selected td:first-child {
  box-shadow: inset 4px 0 0 #2563eb;
}

.tally-stock-row td {
  padding: 8px 14px;
  border-right: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}

.tally-stock-row.group-row td.col-particulars {
  font-weight: 600;
  color: var(--gray-900);
}

.tally-stock-row.item-row td.col-particulars {
  font-weight: 500;
  color: #1e293b;
}

.tally-stock-footer-row td {
  background-color: #f8fafc;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--gray-900);
  padding: 10px 14px;
  border-top: 2px solid var(--gray-400);
  border-bottom: 3px double var(--gray-400);
}

/* Monthly Chart Visualization */
.tally-stock-chart-card {
  margin: 16px 18px 20px 18px;
  padding: 16px 20px;
  background-color: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.tally-stock-chart-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tally-stock-chart-svg {
  width: 100%;
  height: 180px;
  overflow: visible;
}

.tally-stock-footer-help {
  padding: 8px 18px;
  background-color: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--gray-500);
}

/* =========================================================
   Universal 3-Character Searchable Select Box (Neutral Slate)
   ========================================================= */
.tx-ss-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  min-width: 160px;
}

.form-group .tx-ss-wrapper,
td .tx-ss-wrapper {
  width: 100%;
  display: flex;
}

.tx-ss-native-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  z-index: -1 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.tx-ss-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-800);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 32px;
  line-height: 1.3;
  font-family: var(--font-sans);
}

.tx-ss-trigger:hover {
  border-color: #94a3b8;
  background: #fcfcfd;
}

.tx-ss-trigger.is-open,
.tx-ss-trigger.open,
.tx-ss-trigger:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.tx-ss-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-ss-trigger.is-placeholder .tx-ss-trigger-text,
.tx-ss-trigger-text.placeholder {
  color: var(--gray-500);
  font-weight: 500;
}

.tx-ss-trigger-arrow,
.tx-ss-trigger-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  color: var(--gray-400);
  font-size: 10px;
}

.tx-ss-portal {
  position: fixed;
  z-index: 100050;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 4px 10px -4px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-sans);
}

.tx-ss-search-header {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.tx-ss-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 2px 6px 2px 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tx-ss-search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.tx-ss-search-icon {
  font-size: 12px;
  color: #64748b;
  flex-shrink: 0;
}

.tx-ss-search-input {
  flex: 1;
  border: none;
  padding: 5px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  background: transparent;
  outline: none;
  min-width: 0;
}

.tx-ss-min-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}

.tx-ss-min-badge.is-ready,
.tx-ss-min-badge.ready {
  background: #dbeafe;
  color: #1d4ed8;
}

.tx-ss-options-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 4px 0;
}

.tx-ss-option {
  padding: 8px 12px;
  font-size: 12.5px;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.06s ease;
}

.tx-ss-option:hover {
  background-color: #f1f5f9;
}

.tx-ss-option.is-selected,
.tx-ss-option.selected {
  background-color: #f0f9ff;
  font-weight: 700;
  color: #0369a1;
}

.tx-ss-option.is-highlighted,
.tx-ss-option.active {
  background-color: #dbeafe !important;
  color: #1e3a8a !important;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #2563eb;
}

.tx-ss-opt-main,
.tx-ss-option-main {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-ss-opt-main mark {
  background-color: #bae6fd;
  color: #0c4a6e;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 700;
}

.tx-ss-opt-sub,
.tx-ss-option-meta {
  font-size: 11px;
  color: #475569;
  background: rgba(241, 245, 249, 0.9);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-ss-option.is-highlighted .tx-ss-opt-sub {
  background: #bfdbfe;
  color: #1e3a8a;
}

.tx-ss-footer-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #64748b;
}

.tx-ss-footer-hint kbd {
  display: inline-block;
  padding: 0px 4px;
  font-size: 10px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  margin-right: 2px;
}

.tx-ss-prompt {
  padding: 16px 14px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
  background: #ffffff;
}

/* ==========================================================================
   TallyX Information Architecture & Hierarchical Report Navigation System
   ========================================================================== */

/* Collapsible Navigation Groups in Sidebar */
.nav-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--gray-300);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-group-header:hover {
  background-color: var(--gray-800);
  color: var(--white);
}

.nav-group-header.active {
  background-color: rgba(37, 99, 235, 0.18);
  color: var(--white);
  border-left: 3px solid var(--primary);
}

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-group-chevron {
  font-size: 11px;
  color: var(--gray-500);
  transition: transform 0.2s ease;
}

.nav-group.expanded .nav-group-chevron {
  transform: rotate(90deg);
  color: var(--gray-300);
}

.nav-group-items {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 4px 10px;
  border-left: 1px solid var(--gray-800);
  margin-left: 16px;
}

.nav-group.expanded .nav-group-items {
  display: flex;
}

.nav-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-subitem:hover {
  background-color: var(--gray-800);
  color: var(--white);
}

.nav-subitem.active {
  background-color: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.nav-subitem-title {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-pill-count {
  font-size: 10px;
  font-weight: 700;
  background-color: var(--gray-800);
  color: var(--gray-400);
  padding: 1px 6px;
  border-radius: 10px;
}

.nav-subitem.active .nav-pill-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

/* Breadcrumbs Navigation */
.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.breadcrumb-crumb {
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.breadcrumb-crumb:hover {
  color: var(--primary);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--gray-400);
  font-size: 11px;
}

.breadcrumb-current {
  color: var(--gray-900);
  font-weight: 600;
}

/* Reports Landing Dashboard */
.reports-dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.reports-hero-card {
  background: #ffffff;
  color: var(--gray-900);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: visible;
}

.reports-hero-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.reports-hero-subtitle {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 16px;
}

.reports-search-box-wrap {
  position: relative;
  max-width: 680px;
}

.reports-search-input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  font-size: 13.5px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  background: var(--gray-50);
  color: var(--gray-900);
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.reports-search-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.reports-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--gray-500);
  pointer-events: none;
}

.reports-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}

.reports-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  color: var(--gray-900);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.reports-search-dropdown.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.search-result-item:hover, .search-result-item.highlighted {
  background-color: var(--primary-light);
}

.search-result-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-result-path {
  font-size: 11px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Category Grid & Cards */
.reports-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 16px;
}

.reports-category-card {
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.reports-category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.reports-category-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.reports-category-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.reports-category-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--gray-100);
  color: var(--gray-700);
}

.reports-category-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.reports-category-desc {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.4;
  margin-bottom: 12px;
}

.reports-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.reports-category-tag {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
}

.reports-category-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  border-top: 1px solid var(--gray-100);
  padding-top: 10px;
}

/* Quick Strip Sections: Favorites & Recently Viewed */
.quick-section {
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.quick-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quick-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-800);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.quick-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.fav-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 0 4px;
  color: var(--gray-400);
  transition: all 0.15s ease;
}

.fav-star-btn:hover {
  transform: scale(1.25);
}

.fav-star-btn.active {
  color: #f59e0b;
}

/* Category Reports List View */
.category-view-header-card {
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.subcategory-section {
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.subcategory-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-800);
  border-bottom: 2px solid var(--gray-100);
  padding-bottom: 6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.report-items-table {
  width: 100%;
  border-collapse: collapse;
}

.report-items-table tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background-color 0.15s ease;
}

.report-items-table tr:hover {
  background-color: var(--gray-50);
}

.report-items-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

/* Related Reports Bar */
.related-reports-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 7px 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.related-reports-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 4px;
}

.related-report-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--gray-300);
  padding: 2px 8px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.related-report-pill:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}


