/* Base Styles and Design Tokens */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --card-bg: rgba(21, 28, 44, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-cyan: #06b6d4;
  
  --blue-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --purple-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --green-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --red-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  --cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --text-gradient: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.15);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Glassmorphism utility */
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
}

/* Layout containers */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

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

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

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

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

/* ==================== LOGIN VIEW ==================== */
#view-login {
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.05);
  animation: slide-up-fade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-box {
  width: 60px;
  height: 60px;
  background: var(--blue-gradient);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.logo-icon {
  color: white;
  width: 32px;
  height: 32px;
}

.brand h2 {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.brand p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-wrapper label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.input-field-icon i {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-field-icon input {
  padding-left: 2.75rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: rgba(17, 24, 39, 0.8);
}

.input-field-icon input:focus + i {
  color: var(--accent-blue);
}

.select-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  padding-right: 2.5rem;
}

/* ==================== BUTTONS ==================== */
button {
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  border-radius: 10px;
  outline: none;
}

.btn-primary {
  background: var(--blue-gradient);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
  opacity: 0.95;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
}

.btn-secondary:hover {
  background: rgba(55, 65, 81, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 8px;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-edit-icon {
  color: var(--accent-blue);
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-edit-icon:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.btn-danger-icon {
  color: var(--accent-red);
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
}

.btn-danger-icon:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ff6b6b;
}

/* ==================== NAVBAR ==================== */
.navbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  margin-bottom: 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  color: var(--accent-blue);
  width: 24px;
  height: 24px;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-icon {
  width: 16px;
  height: 16px;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard-layout {
  display: flex;
  gap: 2rem;
  min-height: calc(100vh - 120px);
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 1.5rem;
  align-self: flex-start;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  padding: 0.8rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.nav-item i {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.main-content {
  flex-grow: 1;
  min-width: 0; /* Prevents flex children from overflowing */
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fade-in 0.4s ease forwards;
}

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

.welcome-text {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.border-blue::after { background: var(--accent-blue); }
.border-purple::after { background: var(--accent-purple); }
.border-green::after { background: var(--accent-green); }
.border-cyan::after { background: var(--accent-cyan); }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.stat-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrapper i {
  width: 20px;
  height: 20px;
}

.stat-icon-wrapper.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.stat-icon-wrapper.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.stat-icon-wrapper.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.stat-icon-wrapper.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }

.stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: white;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  font-feature-settings: "tnum";
}

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

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

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

.chart-card {
  padding: 1.5rem;
  min-width: 0; /* Allow grid items to shrink below content size */
  overflow: hidden; /* Prevent overflow */
}

.chart-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: white;
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Table Card styling */
.table-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents layout stretch from wide tables */
  overflow: hidden; /* Restricts layout bounds to trigger scrollbar */
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.table-header h3 {
  font-size: 1.1rem;
  color: white;
  font-weight: 600;
}

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

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-box input {
  padding-left: 2.25rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  width: 220px;
}

.table-actions .select-field {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  width: 150px;
}

/* Table styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.02);
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.table td {
  color: var(--text-primary);
  vertical-align: middle;
}

.table .amount {
  font-weight: 600;
  color: white;
  font-feature-settings: "tnum";
}

.table .channel-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.channel-facebook { background: rgba(24, 119, 242, 0.15); color: #4267b2; }
.channel-google { background: rgba(219, 68, 85, 0.15); color: #ea4335; }
.channel-tiktok { background: rgba(0, 0, 0, 0.3); color: #00f2fe; border: 1px solid rgba(255, 255, 255, 0.1); }
.channel-telegram { background: rgba(36, 161, 222, 0.15); color: #24a1de; }
.channel-other { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.25rem;
  color: white;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

@media (max-width: 576px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .welcome-text {
    font-size: 1.4rem;
  }
  
  .subtitle {
    font-size: 0.85rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-value {
    font-size: 1.85rem;
  }
  
  .login-card {
    padding: 1.5rem 1.25rem;
  }

  .modal-card {
    max-height: 95vh;
  }
  
  .modal-header,
  .modal-body {
    padding: 1rem;
  }
  
  .form-row {
    flex-direction: column;
    gap: 1rem;
  }

  /* Phone Viewport Adaptations */
  .hide-on-mobile {
    display: none !important;
  }

  .chart-container {
    height: 240px !important;
  }

  .table-card,
  .chart-card {
    padding: 1rem;
  }

  .table th,
  .table td {
    padding: 0.6rem 0.4rem;
    font-size: 0.8rem;
  }

  .table-header {
    gap: 0.5rem;
  }

  .table-header h3 {
    font-size: 0.95rem;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100% !important;
  }

  .table-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .table-actions .select-field {
    width: 100% !important;
  }
}

.logout-item:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

.textarea-field {
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ==================== TOASTS ==================== */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: rgba(21, 28, 44, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  pointer-events: auto;
  animation: slide-in-right 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success {
  border-left: 4px solid var(--accent-green);
}
.toast.success i {
  color: var(--accent-green);
}

.toast.error {
  border-left: 4px solid var(--accent-red);
}
.toast.error i {
  color: var(--accent-red);
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ==================== ANIMATIONS ==================== */
@keyframes slide-up-fade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slide-in-right {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fade-in 0.5s ease forwards;
}

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

/* Responsive side nav tweaks */
@media (max-width: 768px) {
  .navbar {
    height: 60px;
    padding: 0 1rem;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    gap: 0;
  }
  
  .user-meta {
    width: auto !important;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .dashboard-layout {
    flex-direction: column;
    gap: 1rem;
  }

  /* Mobile hamburger button */
  .mobile-only {
    display: flex !important;
  }
  
  /* Sidebar Drawer on Mobile */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: -280px; /* hidden off-screen */
    width: 260px;
    height: 100vh;
    z-index: 150;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(11, 15, 25, 0.95) !important;
    backdrop-filter: blur(16px);
    padding: 2rem 1rem !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    border-right: 1px solid var(--card-border);
    align-self: flex-start;
  }
  
  .sidebar.show {
    transform: translateX(280px);
  }

  .side-nav {
    flex-direction: column !important;
    overflow-y: auto;
    white-space: normal;
    gap: 0.75rem;
    height: 100%;
    scrollbar-width: none;
  }
  
  .side-nav::-webkit-scrollbar {
    display: none;
  }
  
  .nav-item {
    width: 100% !important;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 140;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.hidden {
  display: none !important;
}

/* Company Tabs Styling */
.company-tabs-container {
  display: flex;
  gap: 0.75rem;
  padding: 0.35rem;
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow-x: auto;
  align-self: flex-start;
  margin-bottom: 0.5rem;
  max-width: 100%;
  scrollbar-width: none; /* Hide scrollbar for clean look */
}
.company-tabs-container::-webkit-scrollbar {
  display: none;
}

.company-tab-btn {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 9px;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.company-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.company-tab-btn.active {
  background: var(--blue-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25), var(--shadow-glow);
}

/* Additional Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.gap-2 {
  gap: 1.5rem;
}

.border-red::after {
  background: var(--accent-red);
}
.stat-icon-wrapper.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.split-tables-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

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

/* Batch upload style */
.batch-upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(17, 24, 39, 0.2);
  cursor: pointer;
  transition: all 0.25s ease;
}

.batch-upload-zone:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
}

.code-box {
  display: block;
  font-family: monospace;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #93c5fd;
  overflow-x: auto;
  white-space: nowrap;
}

.currency-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.currency-usd { color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.2); }
.currency-myr { color: #facc15; border: 1px solid rgba(250, 204, 21, 0.2); }
.currency-cny { color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.2); }

.stat-card.alert-active {
  border-color: rgba(239, 68, 68, 0.4) !important;
  animation: pulse-red-border 2s infinite alternate;
}

.alert-text-active {
  color: #ff6b6b !important;
  font-weight: 700 !important;
}

@keyframes pulse-red-border {
  0% {
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.1);
  }
  100% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.35);
  }
}

/* Premium Filter Controls */
.filter-select {
  background-color: rgba(255, 255, 255, 0.03) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem !important; /* Fixed padding to prevent text-arrow overlap */
  font-size: 0.85rem !important;
  height: 38px !important;
  width: 135px !important;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.filter-select:hover {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

.filter-select:focus {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Force dark theme for browser dropdown lists */
.filter-select option {
  background-color: #0f172a !important; /* slate-900 */
  color: var(--text-primary) !important;
  padding: 0.5rem !important;
}

.filter-date-input {
  background-color: rgba(255, 255, 255, 0.03) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
  padding: 0.5rem 0.75rem !important;
  font-size: 0.85rem !important;
  height: 38px !important;
  width: 135px !important;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.filter-date-input:hover {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

.filter-date-input:focus {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Invert Chrome/Webkit calendar icon to match dark theme */
.filter-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.9) brightness(0.9) opacity(0.65);
  cursor: pointer;
  transition: opacity 0.2s;
}

.filter-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 0.95;
}

