:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222.2 84% 4.9%;
  --muted: 210 40% 96%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96%;
  --accent-foreground: 222.2 84% 4.9%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* Header */
.header {
  background: hsl(var(--primary));
  border-bottom: 1px solid hsl(var(--border));
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  color: hsl(var(--primary-foreground));
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: hsl(var(--primary-foreground));
}

/* Navigation Buttons */
#main-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  margin: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: calc(var(--radius) - 2px);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.nav-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
  font-weight: 600;
}

/* Cards */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 1.5rem;
}

.card-header {
  margin-bottom: 1rem;
}

.card-title {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-description {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  padding: 0.5rem 1rem;
  min-height: 2.25rem;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
  background: hsl(var(--secondary) / 0.8);
}

.btn-destructive,
.btn-danger {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover,
.btn-danger:hover {
  background: hsl(var(--destructive) / 0.9);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  min-height: 2rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-file {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-file:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Tables */
.table-container {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border));
}

.table th {
  background: hsl(var(--muted));
  font-weight: 600;
  font-size: 0.875rem;
}

.table tbody tr:hover {
  background: hsl(var(--muted) / 0.5);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Layout */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Utilities */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-success {
  color: #10b981;
}

.text-error {
  color: hsl(var(--destructive));
}

.text-muted {
  color: hsl(var(--muted-foreground));
}

.text-warning {
  color: #f59e0b;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  #main-nav {
    width: 100%;
    justify-content: center;
  }
  
  .nav-btn {
    flex: 1;
  }
  
  .user-info {
    justify-content: center;
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .table {
    min-width: 600px;
  }
}

/* Session selector */
.session-selector {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .action-buttons {
    justify-content: stretch;
  }
  
  .action-buttons .btn {
    flex: 1;
  }
}

/* Enhanced table styles */
.table th input[type="checkbox"],
.table td input[type="checkbox"] {
  margin: 0;
  width: auto;
}

/* Bulk actions bar */
#bulk-actions {
  display: none;
  gap: 0.5rem;
  align-items: center;
  padding: 1rem;
  background: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.2);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* Tab navigation */
.tab-button {
  border: none;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
}

.tab-button:hover {
  background: hsl(var(--muted) / 0.8);
}

.tab-button.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* Enhanced responsive design for bulk actions */
@media (max-width: 640px) {
  #bulk-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  #bulk-actions .btn {
    width: 100%;
    margin-bottom: 0.25rem;
  }
  
  .tab-button {
    flex: 1;
    margin-right: 0.25rem;
  }
}

/* GST claim summary highlight */
#gst-claim-amount {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Search and filter controls */
.search-filter-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-filter-controls > * {
  flex: 1;
  min-width: 150px;
}

/* Enhanced stat cards for business summary */
.business-stat-card {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.1), hsl(var(--primary) / 0.05));
  border: 1px solid hsl(var(--primary) / 0.2);
}

.business-stat-card .stat-value {
  color: hsl(var(--primary));
}