/* Design System Tokens */
:root {
  --primary-color: #0F4C81;
  --primary-rgb: 15, 76, 129;
  --secondary-color: #00A8A8;
  --secondary-rgb: 0, 168, 168;
  --accent-color: #FFB703;
  --accent-rgb: 255, 183, 3;
  
  /* Light Mode Colors */
  --bg-color: #F8FAFC;
  --surface-color: #FFFFFF;
  --surface-alt: #F1F5F9;
  --border-color: #E2E8F0;
  --text-main: #1F2937;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --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);
  
  --font-heading: 'Poppins', 'Inter', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Poppins', 'Segoe UI', sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
body.dark {
  --bg-color: #0F172A;
  --surface-color: #1E293B;
  --surface-alt: #0F172A;
  --border-color: #334155;
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-light: #64748B;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

/* Global Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--surface-alt);
}
::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Top Header Bar Styling */
.top-header-bar {
  height: 60px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

body.dark .top-header-bar {
  background-color: #1E293B;
  border-bottom-color: #334155;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hamburger-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
}

.hamburger-btn:hover {
  background-color: var(--surface-alt);
}

.header-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
}

.header-subtitle {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.promo-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

body.dark .promo-text {
  color: #E2E8F0;
}

.trial-btn {
  background-color: #DC2626; /* Red background like reference */
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
  transition: all var(--transition-fast);
  text-transform: uppercase;
}

.trial-btn:hover {
  background-color: #B91C1C;
  box-shadow: 0 4px 6px rgba(220, 38, 38, 0.3);
  transform: translateY(-1px);
}

/* Sidebar Brand Styling */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.5rem 1.5rem 0.5rem;
  border-bottom: 1px solid #1E293B;
  margin-bottom: 1rem;
}

.sidebar-brand-logo {
  height: 52px;
  width: auto;
  margin-bottom: 0.5rem;
  object-fit: contain;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: 0.75px;
  color: #FFFFFF;
}

.sidebar-brand-subtitle {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.65rem;
  line-height: 1.1;
  letter-spacing: 0.5px;
  color: var(--secondary-color);
  margin-top: 3px;
  text-transform: uppercase;
}

.sidebar-brand-tagline {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.58rem;
  line-height: 1.1;
  color: #64748B;
  margin-top: 2px;
}

.logo-wrapper {
  height: 48px;
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
}

.brand-logo {
  height: 42px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: filter var(--transition-normal);
}

body.dark .brand-logo {
  filter: brightness(1.1);
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: 0.75px;
  color: var(--primary-color);
  transition: color var(--transition-normal);
}

.brand-subtitle {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.65rem;
  line-height: 1.1;
  letter-spacing: 0.5px;
  color: var(--secondary-color);
  margin-top: 2px;
  text-transform: uppercase;
}

.brand-tagline {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.58rem;
  line-height: 1.1;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Dark Mode overrides for navbar branding */
body.dark .brand-title {
  color: #38bdf8;
}

/* Footer specific overrides */
.footer-brand .logo-wrapper {
  height: auto;
  margin-bottom: 0.75rem;
}
.footer-brand .brand-logo {
  height: 38px;
}
.footer-brand .brand-title {
  color: #F8FAFC;
}
.footer-brand .brand-tagline {
  color: #94A3B8;
}

/* Responsive adjustments for tiny mobile screens */
@media (max-width: 480px) {
  .brand-logo {
    height: 34px;
  }
  .brand-title {
    font-size: 1.05rem;
  }
  .brand-subtitle {
    font-size: 0.55rem;
  }
  .brand-tagline {
    display: none;
  }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  border-radius: 6px;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color);
  background-color: rgba(var(--primary-rgb), 0.08);
}

body.dark .nav-link:hover, body.dark .nav-link.active {
  color: var(--secondary-color);
  background-color: rgba(var(--secondary-rgb), 0.15);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--surface-color);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: var(--surface-alt);
  color: var(--text-main);
  transform: rotate(15deg);
}

.theme-toggle-btn .sun-icon {
  display: none;
}

body.dark .theme-toggle-btn .moon-icon {
  display: none;
}

body.dark .theme-toggle-btn .sun-icon {
  display: block;
}

/* Call to Action Button */
.cta-btn {
  background-color: var(--primary-color);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(var(--primary-rgb), 0.2);
  transition: all var(--transition-fast);
}

.cta-btn:hover {
  background-color: #0d416f;
  transform: translateY(-1px);
  box-shadow: 0 6px 10px -1px rgba(var(--primary-rgb), 0.3);
}

body.dark .cta-btn {
  background-color: var(--secondary-color);
  box-shadow: 0 4px 6px -1px rgba(var(--secondary-rgb), 0.2);
}

body.dark .cta-btn:hover {
  background-color: #008f8f;
  box-shadow: 0 6px 10px -1px rgba(var(--secondary-rgb), 0.3);
}

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.5rem;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  width: 100%;
}

/* Left Sidebar */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: 260px;
  height: calc(100vh - 60px);
  border-right: 1px solid #1E293B;
  background-color: #0B0F19; /* premium deep dark background */
  padding: 1.5rem 1rem 1rem 1rem;
  flex-shrink: 0;
  overflow: hidden;
  z-index: 998;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color var(--transition-normal);
}

.sidebar.collapsed {
  margin-left: -260px;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
}

.sidebar-sticky {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* Sidebar Custom scrollbar */
.sidebar-sticky::-webkit-scrollbar {
  width: 4px;
}
.sidebar-sticky::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-sticky::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 2px;
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #FFFFFF; /* white section headings */
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.sidebar-section-title i {
  width: 14px;
  height: 14px;
  color: var(--secondary-color);
}

.sidebar-section-title:first-of-type {
  margin-top: 0;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  color: #94A3B8; /* light gray menu text */
  font-weight: 500;
  font-size: 0.85rem;
  line-height: 1.3;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.sidebar-link i {
  width: 14px;
  height: 14px;
  color: #475569;
  transition: color var(--transition-fast);
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #F1F5F9;
}

.sidebar-link:hover i {
  color: #94A3B8;
}

.sidebar-link.active {
  background-color: #1E293B !important; /* solid dark gray active background */
  color: #FFFFFF !important;
  font-weight: 600;
  position: relative;
  padding-left: 0.95rem; /* space for the active bar */
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #FFB703; /* Yellow vertical active bar */
  border-radius: 0 4px 4px 0;
}

.sidebar-link.active i {
  color: #FFB703 !important;
}

/* Force dark styling on connection banner in dark sidebar */
.sidebar .db-status-banner {
  background-color: rgba(30, 41, 59, 0.4) !important;
  border-color: #1E293B !important;
  color: #94A3B8 !important;
  margin-top: 2rem;
}
.sidebar .db-status-banner.online {
  color: #34d399 !important;
}
.sidebar .db-status-banner.offline {
  color: #fbbf24 !important;
}

/* DB Status Banner */
.db-status-banner {
  margin-top: auto;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid transparent;
}

.db-status-banner i {
  width: 16px;
  height: 16px;
}

.db-status-banner.online {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: #059669;
}

body.dark .db-status-banner.online {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.db-status-banner.offline {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: #d97706;
}

body.dark .db-status-banner.offline {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Main Content area */
.main-content {
  flex-grow: 1;
  padding: 2.5rem 2.5rem 0 2.5rem;
  overflow-x: hidden;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed + .main-content {
  margin-left: 0;
}

.page-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.content-section {
  display: block;
  scroll-margin-top: 90px;
}

.content-section.active-tab-content {
  display: block;
}

/* Welcome Banner */
.welcome-banner {
  margin-bottom: 2rem;
}

.welcome-banner h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.5px;
  margin-bottom: 0.35rem;
}

body.dark .welcome-banner h1 {
  color: var(--text-main);
}

.welcome-banner p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Dashboard Grid layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Cards Base */
.card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-icon {
  width: 22px;
  height: 22px;
  color: var(--primary-color);
}

body.dark .header-icon {
  color: var(--secondary-color);
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.dark .badge {
  background-color: rgba(var(--secondary-rgb), 0.2);
  color: var(--secondary-color);
}

/* Form Styles */
.calc-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-left {
  position: absolute;
  left: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

input[type="number"], input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  background-color: var(--surface-alt);
  color: var(--text-main);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

input[type="number"]:focus, input[type="text"]:focus, input[type="email"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--surface-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

body.dark input[type="number"]:focus, body.dark input[type="text"]:focus, body.dark input[type="email"]:focus, body.dark select:focus, body.dark textarea:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(var(--secondary-rgb), 0.2);
}

.input-with-icon input[type="number"],
.input-with-icon input {
  padding-left: 3rem;
}

/* Select wrapper styling for custom down arrow */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.75rem;
  color: var(--text-muted);
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  position: absolute;
  pointer-events: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
}

/* Toggles & Radio Buttons */
.toggle-container {
  display: flex;
  background-color: var(--surface-alt);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  width: 100%;
}

.toggle-container input[type="radio"] {
  display: none;
}

.toggle-btn {
  flex: 1;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.toggle-container input[type="radio"]:checked + .toggle-btn {
  background-color: var(--primary-color);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

body.dark .toggle-container input[type="radio"]:checked + .toggle-btn {
  background-color: var(--secondary-color);
}

/* Secondary Toggle (CGST/IGST) Color adjustments */
.secondary-toggle input[type="radio"]:checked + .toggle-btn {
  background-color: var(--surface-color);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

body.dark .secondary-toggle input[type="radio"]:checked + .toggle-btn {
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}

/* Validation Errors */
.error-msg {
  color: #DC2626;
  font-size: 0.8rem;
  font-weight: 500;
  display: none;
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.btn-primary:hover {
  background-color: #0b3b64;
  transform: translateY(-1px);
}

body.dark .btn-primary {
  background-color: var(--secondary-color);
}

body.dark .btn-primary:hover {
  background-color: #008282;
}

.btn-secondary {
  background-color: var(--surface-alt);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--surface-color);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--surface-alt);
  color: var(--text-main);
}

.form-actions {
  display: flex;
  gap: 1rem;
}

.form-actions .btn {
  flex: 1;
}

/* Result Card Styles */
.result-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.bg-highlight {
  background-color: var(--surface-alt);
}

.result-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.result-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.result-value.text-primary {
  color: var(--primary-color);
}

body.dark .result-value.text-primary {
  color: #38bdf8;
}

.result-value.text-secondary {
  color: var(--secondary-color);
}

body.dark .result-value.text-secondary {
  color: #4dd0e1;
}

.result-value.text-accent {
  color: #b45309;
}

body.dark .result-value.text-accent {
  color: var(--accent-color);
}

.result-divider {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 1px;
  margin: 0.5rem 0;
  text-align: center;
  position: relative;
}

.result-divider::before, .result-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 25%;
  height: 1px;
  background-color: var(--border-color);
}

.result-divider::before { left: 0; }
.result-divider::after { right: 0; }

.sub-row {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.hide {
  display: none !important;
}

.highlight-gst {
  background-color: rgba(var(--secondary-rgb), 0.06);
  border-color: rgba(var(--secondary-rgb), 0.15);
}

body.dark .highlight-gst {
  background-color: rgba(var(--secondary-rgb), 0.1);
  border-color: rgba(var(--secondary-rgb), 0.2);
}

.grand-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem;
  background-color: rgba(var(--accent-rgb), 0.08);
  border: 1px dashed rgba(var(--accent-rgb), 0.4);
  border-radius: 10px;
}

body.dark .grand-total-row {
  background-color: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.grand-total-row .result-label {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1rem;
}

.grand-total-row .result-value {
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.result-footer-text {
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 1.5rem;
}

/* Tooltip Customization */
.tooltip {
  position: absolute;
  bottom: 120%;
  right: 50%;
  transform: translateX(50%);
  background-color: #1F2937;
  color: #FFFFFF;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1F2937;
}

.btn-icon:hover .tooltip {
  opacity: 1;
}

/* Common Section Headers */
.section-title-wrapper {
  margin-bottom: 2rem;
}

.section-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary-color);
  letter-spacing: 1.5px;
  margin-bottom: 0.25rem;
}

.section-title-wrapper h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.accent-bar {
  width: 50px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

/* Tables design (History, Slabs) */
.history-table-container, .rate-table-card {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

th {
  background-color: var(--surface-alt);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: rgba(var(--primary-rgb), 0.02);
}

body.dark tbody tr:hover {
  background-color: rgba(var(--secondary-rgb), 0.04);
}

.btn-danger-link {
  background: none;
  border: none;
  color: #DC2626;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
}

.btn-danger-link:hover {
  background-color: rgba(220, 38, 38, 0.08);
}

.btn-delete-row {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.btn-delete-row:hover {
  color: #DC2626;
  background-color: rgba(220, 38, 38, 0.08);
}

.text-center { text-align: center; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.text-gray-400 { color: var(--text-light); }

.empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* GST Rates Section Grid */
.rates-layout-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: start;
}

.slabs-table td:first-child {
  font-weight: 700;
  color: var(--primary-color);
}

body.dark .slabs-table td:first-child {
  color: var(--secondary-color);
}

.info-cards-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-box {
  border-left: 4px solid var(--border-color);
}

.info-box.border-primary {
  border-left-color: var(--primary-color);
}

.info-box.border-secondary {
  border-left-color: var(--secondary-color);
}

.info-box h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.info-box ul {
  padding-left: 1.25rem;
  list-style-type: disc;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* FAQ Accordion Styling */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.faq-trigger {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-heading);
}

.faq-icon {
  width: 20px;
  height: 20px;
  color: var(--text-light);
  transition: transform var(--transition-normal);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.5rem;
  color: var(--text-muted);
  transition: all var(--transition-normal);
}

.faq-content p {
  padding-bottom: 1.25rem;
}

.faq-item.active {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

body.dark .faq-item.active {
  border-color: var(--secondary-color);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--primary-color);
}

body.dark .faq-item.active .faq-icon {
  color: var(--secondary-color);
}

.faq-item.active .faq-content {
  max-height: 500px;
}

/* About Card & Visual Elements */
.about-card {
  padding: 3rem;
  background: linear-gradient(135deg, var(--surface-color), var(--surface-alt));
}

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-info .lead {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

body.dark .about-info .lead {
  color: var(--secondary-color);
}

.about-info p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.stats-row {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.stat-box {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--primary-color);
}

body.dark .stat-number {
  color: var(--secondary-color);
}

.stat-desc {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.about-visual {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.visual-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.visual-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 0.75rem;
}

.visual-icon.text-secondary { color: var(--secondary-color); }
.visual-icon.text-accent { color: var(--accent-color); }

.visual-card h5 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.visual-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Contact Grid */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
}

.contact-info-card {
  background-color: var(--primary-color);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  border: none;
}

body.dark .contact-info-card {
  background-color: #1E293B;
  border: 1px solid var(--border-color);
}

.contact-info-card h3 {
  color: #FFFFFF;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}

.contact-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

body.dark .contact-desc {
  color: var(--text-muted);
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.method-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.method-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-color);
  flex-shrink: 0;
  margin-top: 2px;
}

.method-item h4 {
  font-size: 0.95rem;
  color: #FFFFFF;
  margin-bottom: 0.2rem;
}

.method-item p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

body.dark .method-item p {
  color: var(--text-muted);
}

/* Contact Form alerts */
.alert-box {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}

.alert-box.success {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: #047857;
}

.alert-box.danger {
  background-color: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.2);
  color: #B91C1C;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

/* Footer Styling */
.main-footer {
  background-color: #0F172A;
  color: #94A3B8;
  border-top: 1px solid #1E293B;
  padding: 4rem 2.5rem 2.5rem 2.5rem;
  margin-left: -2.5rem;
  margin-right: -2.5rem;
  margin-top: 4rem;
  transition: all var(--transition-normal);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  height: 38px;
  width: auto;
  display: block;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 320px;
}

.footer-links h4 {
  color: #FFFFFF;
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid #1E293B;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2.5rem; }
.mb-8 { margin-bottom: 2.5rem; }

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .rates-layout-grid {
    grid-template-columns: 1fr;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
  }
  
  .mobile-nav-toggle {
    display: block;
    z-index: 1100;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-color);
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
  }

  .nav-menu.mobile-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .dashboard-layout {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-left: 0 !important;
  }
  
  .sidebar-sticky {
    height: auto;
    position: static;
  }

  .main-content {
    padding: 1.5rem;
    margin-left: 0 !important;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .main-footer {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 3rem 1.5rem 1.5rem 1.5rem;
  }

  .form-row {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   India GST Info Sections Styling
   ========================================================================== */

.section-heading-blue {
  color: var(--primary-color);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

body.dark .section-heading-blue {
  color: #38bdf8;
}

.info-paragraph {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.6;
}

/* Grids */
.cards-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 1024px) {
  .cards-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .cards-grid-4 {
    grid-template-columns: 1fr;
  }
  .cards-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Timeline */
.vertical-timeline {
  position: relative;
  padding-left: 3rem;
  margin-top: 1.5rem;
}

.vertical-timeline::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-badge {
  position: absolute;
  left: -3rem;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  border: 4px solid var(--surface-color);
  box-shadow: var(--shadow-sm);
  z-index: 1;
  transition: all var(--transition-fast);
}

body.dark .timeline-badge {
  background-color: var(--secondary-color);
  border-color: var(--surface-color);
}

.timeline-content {
  background-color: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.timeline-content p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.5;
}

/* Sub-feature Cards */
.sub-feature-card {
  background-color: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sub-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

body.dark .sub-feature-card:hover {
  border-color: var(--secondary-color);
}

.card-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background-color: rgba(var(--secondary-rgb), 0.15);
  color: var(--secondary-color);
  text-transform: uppercase;
}

.sub-feature-card h5 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.sub-feature-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Benefit Cards */
.benefit-card {
  background-color: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
}

.benefit-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-color);
}

body.dark .benefit-card:hover {
  border-color: var(--secondary-color);
}

.benefit-icon-wrapper {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

body.dark .benefit-icon-wrapper {
  background-color: rgba(var(--secondary-rgb), 0.15);
  color: var(--secondary-color);
}

.benefit-icon-wrapper i {
  width: 1.25rem;
  height: 1.25rem;
}

.benefit-card h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Capability Cards */
.capability-card {
  background-color: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  height: 100%;
  transition: all var(--transition-fast);
}

.capability-card:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

body.dark .capability-card:hover {
  border-color: var(--secondary-color);
}

.capability-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

body.dark .capability-icon {
  background-color: rgba(var(--secondary-rgb), 0.15);
  color: var(--secondary-color);
}

.capability-icon i {
  width: 1.5rem;
  height: 1.5rem;
}

.capability-card h5 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.rate-table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

/* ==========================================================================
   Expense Report Generator Styles
   ========================================================================== */

/* Grid and Card Layouts */
.expense-dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 992px) {
  .expense-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

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

.item-builder-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

@media (max-width: 992px) {
  .item-builder-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .item-builder-grid {
    grid-template-columns: 1fr;
  }
}

/* Budget Tracker */
.budget-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.budget-input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.budget-input-group input {
  width: 100px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--card-bg);
  color: var(--text-main);
}

.budget-status-body {
  padding: 1.25rem 0;
}

.budget-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--primary-teal);
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* Alert Box */
.alert-box {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.alert-box.danger {
  background-color: rgba(239, 83, 80, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(239, 83, 80, 0.2);
}

.alert-box.success {
  background-color: rgba(16, 172, 132, 0.1);
  color: var(--primary-teal);
  border: 1px solid rgba(16, 172, 132, 0.2);
}

.alert-box.hide {
  display: none;
}

/* Workflow Status */
.workflow-body {
  padding: 1.25rem 0;
}

.workflow-desc {
  font-size: 0.85rem;
}

.workflow-progress-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  position: relative;
}

.step-node {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.step-node.active {
  background-color: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.2);
}

.step-connector {
  flex-grow: 1;
  height: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.step-node.active + .step-connector {
  background-color: var(--primary-blue);
}

/* Badges styling */
.badge-workflow {
  background-color: var(--border-color);
  color: var(--text-muted);
}
.badge-submitted {
  background-color: rgba(15, 76, 129, 0.1);
  color: var(--primary-blue);
}
.badge-approved {
  background-color: rgba(16, 172, 132, 0.1);
  color: var(--primary-teal);
}
.badge-rejected {
  background-color: rgba(239, 83, 80, 0.1);
  color: var(--accent-red);
}

/* File Upload and Receipt Previews */
.file-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.receipt-preview-thumbnail {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-top: 0.5rem;
  background-color: var(--border-color);
}

.receipt-preview-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-receipt {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(239, 83, 80, 0.8);
  color: #fff;
  border: none;
  border-radius: 0 0 0 4px;
  width: 16px;
  height: 16px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.receipt-table-preview {
  position: relative;
  display: inline-block;
}

.receipt-table-preview i {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.receipt-table-preview i:hover {
  transform: scale(1.2);
}

/* Lightbox Modal for Receipt Previews */
.receipt-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.receipt-lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.receipt-lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.btn-close-lightbox {
  position: absolute;
  top: -15px;
  right: -15px;
  background: var(--accent-red);
  color: #ffffff;
  border: none;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Add Item Form Builder Container */
.add-item-form-container {
  background-color: rgba(0, 0, 0, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.item-builder-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Action Buttons Bar */
.actions-bar-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.actions-buttons-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .actions-bar-layout {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
}

/* Spend Analytics Canvas Boxes */
.charts-container {
  display: flex;
  gap: 1.5rem;
  justify-content: space-around;
  align-items: center;
  height: 220px;
  padding: 0.5rem 0;
}

.chart-box {
  width: 48%;
  height: 100%;
  position: relative;
}

@media (max-width: 768px) {
  .charts-container {
    flex-direction: column;
    height: 450px;
  }
  .chart-box {
    width: 100%;
    height: 200px;
  }
}

/* Mobile Responsiveness & Layout Improvements */
html, body {
  overflow-x: hidden;
}

@media (max-width: 768px) {
  /* Header Bar Adjustments */
  .top-header-bar {
    padding: 0 0.75rem !important;
  }
  .header-title {
    font-size: 1.1rem !important;
  }
  .header-subtitle {
    display: none !important;
  }
  .promo-text {
    display: none !important;
  }
  .trial-btn {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
  }

  /* Sidebar Drawer Collapse/Slide-in Overlay */
  .sidebar {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
    height: calc(100vh - 60px) !important;
    z-index: 1001 !important;
    margin-left: 0 !important;
    transform: translateX(0) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15) !important;
    border-right: 1px solid var(--border-color) !important;
  }

  .sidebar.collapsed {
    transform: translateX(-100%) !important;
    box-shadow: none !important;
    border-right-color: transparent !important;
  }

  .sidebar-sticky {
    height: 100% !important;
    overflow-y: auto !important;
  }

  /* Main Content adjustment */
  .main-content {
    margin-left: 0 !important;
    padding: 1.5rem 1rem 0 1rem !important;
    width: 100% !important;
  }

  /* Welcome Banner h1 adjustment */
  .welcome-banner h1 {
    font-size: 1.75rem !important;
  }
  .welcome-banner p {
    font-size: 0.95rem !important;
  }

  /* Horizontal Scrolling for all Data Tables */
  .history-table-container,
  .rate-table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
  }

  .history-table-container table,
  .rate-table-container table {
    min-width: 800px !important;
    width: 100% !important;
  }

  #ratesSlabTable {
    min-width: 100% !important; /* This simple table fits easily without scrolling */
  }

  /* Footer Margin & Padding Adjustments */
  .main-footer {
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    padding: 2.5rem 1rem 1.5rem 1rem !important;
  }
  
  .footer-container {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

@media (max-width: 576px) {
  /* Cards Fitting Screen Width (Removes excessive side margin/padding) */
  .card {
    padding: 1.25rem 1rem !important;
    border-radius: 12px !important;
  }

  /* Form Grid to Single-Column Stacking */
  .form-row, .form-row-2 {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  /* Expense Items Builder actions and bar stacking */
  .actions-bar-layout {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .actions-buttons-group {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }

  .actions-bar-layout button,
  .actions-buttons-group button,
  #btnNewReport {
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: center !important;
  }

  /* Workflow Progress Steps adjustments */
  .step-node {
    width: 50px !important;
    height: 50px !important;
    font-size: 0.7rem !important;
    flex-shrink: 0 !important;
  }

  /* Approve/Reject active buttons stacking */
  #workflowActionsPanel:not(.hide) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  
  #workflowActionsPanel:not(.hide) button {
    width: 100% !important;
    text-align: center;
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
    justify-content: center !important;
  }

  /* GST Result Summary row wrapping for narrow screens */
  .result-row {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  .result-value {
    text-align: right !important;
    word-break: break-all !important;
  }
  
  .form-actions {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  .form-actions .btn {
    width: 100% !important;
  }
}

/* Print Overrides */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .sidebar,
  .header,
  .actions-bar,
  .actions-buttons-group,
  .add-item-form-container,
  .actions-bar-layout button,
  .history-card,
  #savedExpensesTable,
  .footer,
  #calculator-section,
  #rates-section,
  #faq-section,
  #about-section,
  #contact-section,
  #coming-soon-section,
  .btn-remove-receipt,
  #btnUploadTrigger,
  .tooltip,
  .mobile-header-bar {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  .content-section {
    display: block !important;
    width: 100% !important;
  }
  #expense-section {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    margin-bottom: 2rem !important;
    padding: 0 !important;
  }
  .expense-dashboard-grid {
    display: block !important;
  }
  .form-grid-3, .item-builder-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .rate-table-container, .slabs-table {
    width: 100% !important;
    overflow: visible !important;
  }
  .slabs-table th, .slabs-table td {
    border: 1px solid #dddddd !important;
    padding: 6px !important;
    font-size: 10pt !important;
  }
  .slabs-table th:last-child, .slabs-table td:last-child {
    display: none !important; /* Hide actions column */
  }
  h1, h2, h3, h4 {
    color: #000000 !important;
    page-break-after: avoid;
  }
}
