/* Lumeza Tally ERP - Authentic TallyPrime / Tally.ERP 9 Stylesheet */
:root {
  --tally-bg: #fff8dc;          /* Signature Cornsilk / Cream */
  --tally-header: #014421;      /* Deep Tally Green */
  --tally-header-dark: #002b15;
  --tally-box-bg: #e3ffe3;      /* Light sage green for menus */
  --tally-box-border: #2d6a4f;
  --tally-gold: #ffd166;        /* Tally gold key highlights */
  --tally-blue: #003366;
  --tally-right-panel: #d0e8d0;
  --tally-btn-bg: #f4faf4;
  --tally-btn-hover: #b7e4c7;
  --tally-selected: #2d6a4f;
  --tally-selected-text: #ffffff;
  --tally-border: #74c69d;
  --tally-text: #111111;
  --font-tally: 'Segoe UI', Consolas, 'Courier New', monospace, sans-serif;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-tally);
  background-color: var(--tally-bg);
  color: var(--tally-text);
  font-size: 13px;
}

/* App Container */
.tally-app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

/* Top App Header */
.tally-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--tally-header);
  color: #ffffff;
  height: 38px;
  padding: 0 12px;
  border-bottom: 2px solid var(--tally-gold);
}

.tally-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tally-brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--tally-gold);
}

.tally-screen-title {
  font-weight: 600;
  font-size: 13px;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 2px 10px;
  border-radius: 2px;
}

.tally-sync-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #a7f3d0;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
}

.tally-sync-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
  animation: pulse-sync 2s infinite;
}

@keyframes pulse-sync {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.tally-topbar-actions {
  display: flex;
  gap: 8px;
}

.tally-top-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.tally-top-btn:hover {
  background: var(--tally-gold);
  color: #000;
  border-color: var(--tally-gold);
}

.tally-top-btn.exit-btn {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
}
.tally-top-btn.exit-btn:hover {
  background: #ef4444;
  color: white;
}

/* Main Body Layout */
.tally-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 66px);
  overflow: hidden;
}

/* Left Panel: Company & Period Info */
.tally-left-panel {
  width: 320px;
  background-color: #023319;
  color: #ffffff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 2px solid #001f0f;
  overflow-y: auto;
}

.tally-info-box {
  background-color: #044723;
  border: 1px solid #1b7a42;
  border-radius: 3px;
  padding: 12px;
}

.tally-info-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--tally-gold);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  padding-bottom: 4px;
}

.tally-info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}
.tally-info-row span:first-child {
  color: #a7f3d0;
}
.tally-info-row span:last-child {
  font-weight: 600;
}

.tally-company-card {
  background-color: #e3ffe3;
  color: #000000;
  border: 1px solid #2d6a4f;
  padding: 12px;
  border-radius: 3px;
}
.tally-company-card .comp-name {
  font-size: 14px;
  font-weight: 700;
  color: #014421;
  margin-bottom: 4px;
}
.tally-company-card .comp-sub {
  font-size: 11px;
  color: #2d6a4f;
  margin-bottom: 2px;
}

.tally-quick-stats {
  margin-top: auto;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 3px;
  line-height: 1.5;
}

/* Center Panel */
.tally-center-panel {
  flex: 1;
  background-color: var(--tally-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-y: auto;
  padding: 20px;
}

/* Gateway of Tally Box */
.gateway-box {
  width: 440px;
  background-color: var(--tally-box-bg);
  border: 2px solid var(--tally-box-border);
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

.gateway-header {
  background-color: var(--tally-header);
  color: var(--tally-gold);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 8px;
  border-bottom: 2px solid var(--tally-gold);
  letter-spacing: 0.5px;
}

.gateway-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1b4332;
  padding: 6px 14px 2px 14px;
  letter-spacing: 0.5px;
}

.gateway-menu {
  list-style: none;
  padding: 4px 8px 10px 8px;
}

.gateway-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  margin: 1px 0;
  cursor: pointer;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 500;
}

.gateway-menu-item b {
  color: #b7094c;
  text-decoration: underline;
  margin-right: 1px;
}

.gateway-menu-item:hover,
.gateway-menu-item.active {
  background-color: var(--tally-selected);
  color: var(--tally-selected-text);
}
.gateway-menu-item:hover b,
.gateway-menu-item.active b {
  color: var(--tally-gold);
  text-decoration: none;
}

/* Right Function Keys Bar */
.tally-right-panel {
  width: 155px;
  background-color: var(--tally-right-panel);
  border-left: 2px solid var(--tally-border);
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 4px;
  overflow-y: auto;
}

.tally-fkey-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px;
  background-color: var(--tally-btn-bg);
  border: 1px solid #74c69d;
  color: #014421;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  border-radius: 2px;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.1);
  transition: all 0.1s ease;
}

.tally-fkey-btn b {
  color: #081c15;
  font-weight: 800;
  min-width: 28px;
}

.tally-fkey-btn:hover {
  background-color: var(--tally-btn-hover);
  border-color: #2d6a4f;
  transform: translateX(-2px);
}
.tally-fkey-btn:active {
  background-color: var(--tally-selected);
  color: white;
}
.tally-fkey-btn:active b {
  color: var(--tally-gold);
}

/* Bottom Help Bar */
.tally-bottombar {
  height: 28px;
  background-color: #012814;
  color: #d8f3dc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  border-top: 1px solid #1b4332;
}

.tally-bottom-shortcuts {
  display: flex;
  gap: 14px;
}
.tally-bottom-shortcuts span b {
  color: var(--tally-gold);
}

/* Modals & Full Views */
.tally-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.tally-modal-overlay.open {
  display: flex;
}

.tally-modal-box {
  background-color: var(--tally-bg);
  border: 2px solid var(--tally-header);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 3px;
}

.tally-modal-header {
  background-color: var(--tally-header);
  color: var(--tally-gold);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--tally-gold);
}

.tally-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
}
.tally-modal-close:hover {
  color: var(--tally-gold);
}

.tally-modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* Voucher Entry Table Styles */
.tally-voucher-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.tally-voucher-table th,
.tally-voucher-table td {
  border: 1px solid #95d5b2;
  padding: 6px 10px;
  font-size: 12px;
}
.tally-voucher-table th {
  background-color: #d8f3dc;
  color: #014421;
  font-weight: 700;
  text-align: left;
}

/* Forms */
.tally-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  align-items: center;
}
.tally-form-label {
  width: 140px;
  font-weight: 600;
  color: #014421;
}
.tally-form-input, .tally-form-select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #52b788;
  background-color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  border-radius: 2px;
}
.tally-form-input:focus, .tally-form-select:focus {
  outline: 2px solid var(--tally-header);
  background-color: #f0fff4;
}

/* Searchable Combobox Dropdowns (Tally List of Accounts Popover) */
.tally-combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #ffffff;
  border: 2px solid #014421;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 99999;
}
.combobox-item {
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid #edf7ed;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.08s ease;
}
.combobox-item:hover, .combobox-item.selected {
  background-color: #014421 !important;
  color: #ffd700 !important;
}
.combobox-item:hover span, .combobox-item.selected span,
.combobox-item:hover b, .combobox-item.selected b {
  color: #ffd700 !important;
}

/* Buttons in modal */
.tally-btn-action {
  background-color: var(--tally-header);
  color: white;
  border: 1px solid var(--tally-gold);
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
}
.tally-btn-action:hover {
  background-color: #023319;
  color: var(--tally-gold);
}

/* Report Table */
.tally-report-table {
  width: 100%;
  border-collapse: collapse;
}
.tally-report-table th,
.tally-report-table td {
  border: 1px solid #74c69d;
  padding: 6px 10px;
  font-size: 12px;
}
.tally-report-table th {
  background-color: #014421;
  color: #ffffff;
  text-align: left;
}
.tally-report-table tr:nth-child(even) {
  background-color: #f2f9f4;
}
.tally-report-table tr {
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.tally-report-table tr:hover {
  background-color: #d8f3dc;
}
.tally-report-table tr.selected {
  background-color: #014421 !important;
  color: #ffd700 !important;
}
.tally-report-table tr.selected td {
  color: #ffd700 !important;
  font-weight: 600;
}
.tally-report-table tr.selected .status-badge {
  background: #ffd700 !important;
  color: #014421 !important;
}
.tally-num {
  text-align: right;
  font-family: Consolas, monospace;
}

/* Status Badges */
.badge-match {
  background: #10b981;
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 11px;
}
.badge-variance {
  background: #f59e0b;
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 11px;
}
.badge-missing {
  background: #ef4444;
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 11px;
}
.badge-unbooked {
  background: #3b82f6;
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 11px;
}

/* ==========================================================================
   Tally ERP Dark Mode Theme (Deep Slate Forest / Cyber Cornsilk)
   ========================================================================== */
[data-theme="dark"] {
  --tally-bg: #0d1410;
  --tally-header: #042916;
  --tally-header-dark: #021a0d;
  --tally-box-bg: #15241b;
  --tally-box-border: #2d6a4f;
  --tally-gold: #ffd166;
  --tally-blue: #38bdf8;
  --tally-right-panel: #111c15;
  --tally-btn-bg: #1c2e24;
  --tally-btn-hover: #2d4d3c;
  --tally-selected: #2d6a4f;
  --tally-selected-text: #ffffff;
  --tally-border: #2d5a42;
  --tally-text: #e2e8f0;
}

[data-theme="dark"] .tally-form-input,
[data-theme="dark"] .tally-form-select {
  background-color: #1a2920;
  color: #f1f5f9;
  border-color: #2d6a4f;
}

[data-theme="dark"] .tally-form-input:focus,
[data-theme="dark"] .tally-form-select:focus {
  background-color: #22372b;
  outline: 2px solid var(--tally-gold);
}

[data-theme="dark"] .tally-combobox-dropdown,
[data-theme="dark"] .tally-autocomplete-dropdown {
  background-color: #16241c !important;
  color: #e2e8f0;
  border: 2px solid #2d6a4f !important;
}

[data-theme="dark"] .combobox-item {
  border-bottom: 1px solid #23382c;
  color: #e2e8f0;
}

[data-theme="dark"] .tally-voucher-table th,
[data-theme="dark"] .tally-report-table th {
  background-color: #1b3325;
  color: #ffd166;
  border-color: #2d5a42;
}

[data-theme="dark"] .tally-voucher-table td,
[data-theme="dark"] .tally-report-table td {
  border-color: #244432;
  color: #cbd5e1;
}

[data-theme="dark"] .tally-report-table tr:hover {
  background-color: #1a2c20 !important;
}

[data-theme="dark"] .gateway-section-title {
  color: #74c69d;
}

[data-theme="dark"] .tally-form-label {
  color: #a7f3d0;
}

[data-theme="dark"] .tally-company-card {
  background: #18281f !important;
  border-color: #2d6a4f !important;
}

[data-theme="dark"] .tally-info-box {
  background-color: #14221a !important;
  border-color: #2d6a4f !important;
}

[data-theme="dark"] .tally-top-btn {
  background-color: #192b21;
  color: #e2e8f0;
  border-color: #2d6a4f;
}

[data-theme="dark"] .tally-top-btn:hover {
  background-color: #2d4d3c;
  color: #ffd166;
}

[data-theme="dark"] .gateway-menu-item {
  color: #e2e8f0;
}

[data-theme="dark"] .gateway-menu-item span b {
  color: #ffd166;
}

[data-theme="dark"] .gateway-menu-item.active {
  background-color: #2d6a4f;
  color: #ffffff;
}

