/* Futuristic Accounting App UI - Sidebar Layout with Theme Support */

/* Dark Theme (Default) */
:root {
  --bg: #0a0f1e;
  --bg-2: #0d1326;
  --text: #e6eaf2;
  --muted: #9aa4b2;
  --primary: #6aa6ff;
  --primary-2: #8a7bff;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --surface: rgba(255, 255, 255, 0.06);
  --border: rgba(255,255,255,0.12);
  --shadow: 0 8px 30px rgba(0,0,0,0.35);
  
  --sidebar-bg: #0d1326;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(106,166,255,0.2);
  --sidebar-text: #e6eaf2;
  --sidebar-muted: #9aa4b2;
  
  --header-bg: rgba(255,255,255,0.08);
  --header-border: rgba(255,255,255,0.12);
  --header-text: #e6eaf2;
  
  --content-bg: #0a0f1e;
  --content-text: #e6eaf2;
  --content-muted: #9aa4b2;
  
  --sidebar-width: 280px;
  --header-height: 70px;
  
  /* Theme transition properties */
  --transition-theme: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme transitioning class */
.theme-transitioning * {
  transition: var(--transition-theme) !important;
}

/* Light Theme */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #3b82f6;
  --primary-2: #6366f1;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --surface: rgba(0, 0, 0, 0.04);
  --border: rgba(0,0,0,0.12);
  --shadow: 0 8px 30px rgba(0,0,0,0.12);
  
  --sidebar-bg: #f1f5f9;
  --sidebar-hover: rgba(0,0,0,0.06);
  --sidebar-active: rgba(59,130,246,0.15);
  --sidebar-text: #1e293b;
  --sidebar-muted: #64748b;
  
  --header-bg: rgba(255,255,255,0.9);
  --header-border: rgba(0,0,0,0.1);
  --header-text: #1e293b;
  
  --content-bg: #ffffff;
  --content-text: #1e293b;
  --content-muted: #64748b;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at -10% -20%, #1a2655 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 0%, #1a3a5f 0%, transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  transition: var(--transition-theme);
}

/* Light theme background gradients */
[data-theme="light"] html,
[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(59,130,246,0.1) 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(99,102,241,0.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

/* App Layout */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  transition: var(--transition-theme);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar-bg), var(--bg));
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: width 0.3s ease, transform 0.3s ease, var(--transition-theme);
}

/* Collapsed Sidebar */
.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .brand span,
.sidebar.collapsed .accountant-section h3,
.sidebar.collapsed .invite-accountant-btn,
.sidebar.collapsed .nav-item .label,
.sidebar.collapsed .nav-item .submenu-arrow {
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .brand {
  justify-content: center;
}

.sidebar.collapsed .brand img {
  margin: 0;
  max-width: 48px;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
  margin: 4px 8px;
}

.sidebar.collapsed .nav-item .icon {
  font-size: 20px;
  margin: 0;
}

.sidebar.collapsed .nav-item.active::before {
  left: -8px;
}

.sidebar.collapsed .accountant-section {
  padding: 12px 8px;
}

/* Tooltip for collapsed sidebar items */
.sidebar.collapsed .nav-item {
  position: relative;
}

.sidebar.collapsed .nav-item:hover::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 12px;
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  pointer-events: none;
}

/* Smooth transitions for sidebar elements */
.sidebar .brand span,
.sidebar .nav-item .label,
.sidebar .nav-item .submenu-arrow,
.sidebar .accountant-section h3,
.sidebar .invite-accountant-btn {
  transition: opacity 0.2s ease, visibility 0.2s ease, width 0.2s ease;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--sidebar-text);
}

.brand img {
  width: 96px;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
  object-fit: contain;
}

/* Accountant Section */
.accountant-section {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accountant-section h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
  color: var(--sidebar-muted);
}

.invite-accountant-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--sidebar-text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.invite-accountant-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(106,166,255,0.3);
  transform: translateY(-1px);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  gap: 12px;
  border-radius: 8px;
  margin: 4px 12px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
  transform: translateX(4px);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(106,166,255,0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-radius: 0 2px 2px 0;
}

.nav-item .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-item .label {
  flex: 1;
}

.nav-item.has-submenu .submenu-arrow {
  font-size: 10px;
  opacity: 0.7;
}

/* Submenu Styles */
.nav-item.has-submenu {
  position: relative;
  cursor: pointer;
}

.nav-item.has-submenu:hover .submenu {
  display: block;
}

.nav-item.has-submenu.active .submenu {
  display: block;
}

.submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 200px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 1000;
  padding: 8px 0;
  margin-left: 8px;
}

.submenu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 14px;
}

.submenu-item:hover {
  background: var(--sidebar-hover);
  color: var(--primary);
}

.submenu-item.active {
  background: var(--sidebar-active);
  color: var(--primary);
}

.submenu-item .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.submenu-item .label {
  font-weight: 500;
}

/* Collapsed sidebar submenu adjustments */
.sidebar.collapsed .submenu {
  left: 60px;
  margin-left: 0;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: margin-left 0.3s ease;
}

/* Adjust main content when sidebar is collapsed */
.app-layout.sidebar-collapsed .main-content {
  margin-left: 70px;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left .page-title {
  font-size: 30px;
  font-weight: 700;
  margin: 0;
  letter-spacing: .3px;
  color: var(--text);
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
  padding: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(106,166,255,0.15);
  border-color: var(--primary);
  transform: scale(1.05);
}

.sidebar-toggle-btn:active {
  transform: scale(0.95);
}

.sidebar-toggle-btn .icon {
  line-height: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn:hover {
  background: rgba(106,166,255,0.15);
  border-color: var(--primary);
  transform: scale(1.05);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

.theme-toggle-btn .icon {
  line-height: 1;
  transition: var(--transition-theme);
}

/* Theme toggle icons */
.theme-toggle-btn[data-theme="dark"] .icon::before {
  content: "🌙";
}

.theme-toggle-btn[data-theme="light"] .icon::before {
  content: "☀️";
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 18px rgba(122, 147, 255, .35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(122,147,255,.45);
}

.btn-secondary {
  background: linear-gradient(135deg, #475569, #334155);
  box-shadow: 0 4px 18px rgba(51,65,85,.35);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(51,65,85,.45);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
}

.btn-icon {
  background: transparent;
  color: var(--muted);
  padding: 8px;
  border-radius: 50%;
  position: relative;
  border: 1px solid transparent;
}

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

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(106,166,255,0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.user-role {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logout-link, .login-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.logout-link:hover, .login-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: transparent;
}

/* Flash Messages */
.flashes {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.flashes li {
  margin: 8px 0;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 14px;
}

.flashes .success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.flashes .warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.flashes .danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.flashes .info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  min-width: 0;
  transition: var(--transition-theme);
}

.ai-message {
  background: rgba(106, 166, 255, 0.1);
  border: 1px solid rgba(106, 166, 255, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  color: var(--primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-message::before {
  content: "🤖";
  font-size: 16px;
}

/* KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(106,166,255,0.18), rgba(138,123,255,0.12));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

.kpi:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(106,166,255,0.3);
}

.kpi.kpi-primary {
  background: linear-gradient(135deg, rgba(106,166,255,0.2), rgba(106,166,255,0.1));
  border-color: rgba(106,166,255,0.3);
}

.kpi.kpi-info {
  background: linear-gradient(135deg, rgba(138,123,255,0.2), rgba(138,123,255,0.1));
  border-color: rgba(138,123,255,0.3);
}

.kpi.kpi-warning {
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.1));
  border-color: rgba(245,158,11,0.3);
  display: none;
}

.kpi.kpi-success {
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.1));
  border-color: rgba(34,197,94,0.3);
}

.kpi-icon {
  font-size: 36px;
  line-height: 1;
}

.kpi-content {
  flex: 1;
}

.kpi-num {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: var(--text);
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-sublabel {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  font-style: italic;
}

/* Tables */
.table-container { 
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: var(--transition-theme);
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 300px);
  position: relative;
  cursor: grab;
}

/* Light theme: white table container */
[data-theme="light"] .table-container {
  background: #ffffff;
}

.table-container:active {
  cursor: grabbing;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  transition: var(--transition-theme);
}

/* Light theme: white table background */
[data-theme="light"] table {
  background: #ffffff;
}

table th, table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: var(--transition-theme);
}

table th {
  background: linear-gradient(180deg, var(--surface), rgba(255,255,255,0.04));
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition-theme);
}

/* Light theme table header */
[data-theme="light"] table th {
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
}

table tr:hover td {
  background: var(--surface);
  transition: var(--transition-theme);
}

/* Light theme table hover */
[data-theme="light"] table tr:hover td {
  background: #f1f5f9;
}

/* Light theme table cells */
[data-theme="light"] table td {
  background: #ffffff;
}

/* Light theme specific adjustments */
[data-theme="light"] .flashes .success {
  background-color: #d1fae5;
  border-color: #a7f3d0;
  color: #065f46;
}

[data-theme="light"] .flashes .warning {
  background-color: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

[data-theme="light"] .flashes .danger {
  background-color: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

[data-theme="light"] .flashes .info {
  background-color: #dbeafe;
  border-color: #bfdbfe;
  color: #1e40af;
}

[data-theme="light"] .status-draft {
  background-color: #f3f4f6;
  color: #374151;
}

[data-theme="light"] .status-validated {
  background-color: #dbeafe;
  color: #1e40af;
}

[data-theme="light"] .status-posted {
  background-color: #d1fae5;
  color: #065f46;
}

[data-theme="light"] .status-paid {
  background-color: #dbeafe;
  color: #1e40af;
}

[data-theme="light"] .status-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

[data-theme="light"] .verify-ok {
  background-color: #d1fae5;
  color: #065f46;
}

[data-theme="light"] .verify-bad {
  background-color: #fee2e2;
  color: #991b1b;
}

[data-theme="light"] .verify-unknown {
  background-color: #f3f4f6;
  color: #374151;
}

/* Invoices table specific styling */
.invoices-table { 
  min-width: 1000px;
  width: 100%;
  margin: 0;
}

/* Sticky header for invoices table */
.invoices-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
}

/* Light theme sticky header */
[data-theme="light"] .invoices-table thead {
  background: #f8fafc;
}

.invoices-table thead th {
  background: linear-gradient(180deg, var(--surface), rgba(255,255,255,0.04));
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Light theme invoices table header */
[data-theme="light"] .invoices-table thead th {
  background: #f8fafc;
}

.col-checkbox { 
  width: 40px; 
  text-align: center; 
}
.table-container.has-horizontal-scroll .col-checkbox {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--surface);
}

[data-theme="light"] .table-container.has-horizontal-scroll .col-checkbox {
  background: #ffffff;
}

.table-container.has-horizontal-scroll .invoices-table thead .col-checkbox {
  z-index: 15;
  background: linear-gradient(180deg, var(--surface), rgba(255,255,255,0.04));
}

[data-theme="light"] .table-container.has-horizontal-scroll .invoices-table thead .col-checkbox {
  background: #f8fafc;
}

.table-container.has-horizontal-scroll .invoices-table tbody .col-checkbox {
  background: var(--surface);
}

[data-theme="light"] .table-container.has-horizontal-scroll .invoices-table tbody .col-checkbox {
  background: #ffffff;
}
.col-id { 
  width: 60px; 
}
.table-container.has-horizontal-scroll .col-id {
  position: sticky;
  left: 40px; /* after checkbox */
  z-index: 5;
  background: var(--surface);
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}
.table-container.has-horizontal-scroll .invoices-table thead .col-id {
  z-index: 15;
  background: linear-gradient(180deg, var(--surface), rgba(255,255,255,0.04));
}
.table-container.has-horizontal-scroll .invoices-table tbody .col-id {
  background: var(--surface);
}

[data-theme="light"] .table-container.has-horizontal-scroll .col-id {
  background: #ffffff;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .table-container.has-horizontal-scroll .invoices-table thead .col-id {
  background: #f8fafc;
}

[data-theme="light"] .table-container.has-horizontal-scroll .invoices-table tbody .col-id {
  background: #ffffff;
}

.col-vendor { width: 200px; min-width: 180px; }
.col-invoice { width: 120px; }
.col-date { width: 100px; }
.col-currency { width: 80px; }
.col-total { width: 100px; text-align: right; }
.col-remark { width: 150px; max-width: 200px; }
.col-status { width: 100px; }
.col-actions { 
  width: 140px; 
  min-width: 140px; 
}
.table-container.has-horizontal-scroll .col-actions {
  position: sticky;
  left: 100px; /* checkbox (40px) + ID (60px) */
  z-index: 5;
  background: var(--surface);
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}
.table-container.has-horizontal-scroll .invoices-table thead .col-actions {
  z-index: 15;
  background: linear-gradient(180deg, var(--surface), rgba(255,255,255,0.04));
}
.table-container.has-horizontal-scroll .invoices-table tbody .col-actions {
  background: var(--surface);
}

[data-theme="light"] .table-container.has-horizontal-scroll .col-actions {
  background: #ffffff;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .table-container.has-horizontal-scroll .invoices-table thead .col-actions {
  background: #f8fafc;
}

[data-theme="light"] .table-container.has-horizontal-scroll .invoices-table tbody .col-actions {
  background: #ffffff;
}

.col-verify { width: 90px; text-align: center; }

/* Vendor info styling */
.vendor-info { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
}

.vendor-name { 
  font-weight: 500; 
  color: var(--content-text);
}

.vendor-details { 
  display: flex; 
  flex-direction: column; 
  gap: 2px; 
  font-size: 11px; 
  color: var(--content-muted);
}

.tax-id, .reg-no { 
  display: block; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
}


/* Action buttons */
.action-buttons { 
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap; 
  justify-content: flex-start;
  align-items: center;
}

.btn-small { 
  padding: 8px 12px; 
  font-size: 12px; 
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none; 
  border: 1px solid transparent; 
  cursor: pointer; 
  transition: all 0.2s ease;
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(106, 166, 255, 0.3);
  min-width: 60px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-small:hover { 
  background: #5a9eff;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(106, 166, 255, 0.4);
}

.btn-small.danger { 
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-small.danger:hover { 
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-small:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-small.danger:active {
  transform: translateY(0);
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.7);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* Enhanced delete button styling */
.btn-small.danger::before {
  content: "🗑️";
  margin-right: 4px;
  font-size: 11px;
  opacity: 0.8;
}

.btn-small:not(.danger)::before {
  content: "👁️";
  margin-right: 4px;
  font-size: 11px;
  opacity: 0.8;
}

/* Focus states for accessibility */
.btn-small:focus {
  outline: 1px solid var(--primary);
  outline-offset: 1px;
}

.btn-small.danger:focus {
  outline: 1px solid rgba(239, 68, 68, 0.6);
  outline-offset: 1px;
}

/* Enhanced Checkbox styling */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--content-bg);
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

input[type="checkbox"]:hover {
  border-color: var(--primary);
  background: rgba(106, 166, 255, 0.05);
  transform: scale(1.05);
}

input[type="checkbox"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(106, 166, 255, 0.1);
}

input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(106, 166, 255, 0.3);
}

input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:checked:hover {
  background: linear-gradient(135deg, #5a9eff, #7a6bff);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(106, 166, 255, 0.4);
}

/* Checkbox container styling for better layout */
.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.checkbox-container label {
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--content-text);
  line-height: 1.4;
  flex: 1;
  user-select: none;
}

.checkbox-container .checkbox-description {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.3;
}

/* Form elements */
label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--content-text);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--content-bg);
  color: var(--content-text);
  font-size: 14px;
  transition: all 0.2s ease, var(--transition-theme);
  max-width: 100%;
  box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Basic select styling */
select {
  cursor: pointer;
}

select:hover {
  border-color: var(--primary);
}

select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Simple form element styling */
#vendor-select, .search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--content-bg);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

.search-input {
  cursor: text;
}

#vendor-select:focus, .search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(106, 166, 255, 0.2);
  z-index: 20;
}

#vendor-select:hover, .search-input:hover {
  border-color: var(--primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-draft {
  background-color: #e9ecef;
  color: #495057;
}

.status-validated {
  background-color: #cce5ff;
  color: #004085;
}

.status-posted {
  background-color: #d4edda;
  color: #155724;
}

.status-paid {
  background-color: #cce5ff;
  color: #004085;
}

.status-cancelled {
  background-color: #f8d7da;
  color: #721c24;
}

.verify-ok {
  background-color: #d4edda;
  color: #155724;
}

/* Status Action Buttons */
.status-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.status-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 8px 12px;
}

.status-actions .btn .icon {
  font-size: 14px;
}

.other-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.verify-bad {
  background-color: #f8d7da;
  color: #721c24;
}

.verify-unknown {
  background-color: #e9ecef;
  color: #495057;
}

/* Utility classes */
.mt { margin-top: 20px; }
.mb { margin-bottom: 20px; }
.truncate {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }
  
  .app-layout.sidebar-collapsed .main-content {
    margin-left: 0;
  }
  
  .sidebar-toggle-btn {
    display: none;
  }
  
  .top-header {
    padding: 0 15px;
  }
  
  .header-actions {
    display: none;
  }
  
  .user-profile .user-info {
    display: none;
  }
  
  .content-area {
    padding: 15px;
  }
  
  .kpis {
    grid-template-columns: 1fr;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .invoices-table {
    min-width: 800px;
  }
}

@media (max-width: 480px) {
  .top-header {
    flex-direction: column;
    height: auto;
    padding: 15px;
    gap: 15px;
  }
  
  .header-left .page-title {
    font-size: 20px;
  }
  
  .user-profile {
    flex-direction: column;
    gap: 8px;
  }
  
  .user-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: var(--primary);
  border: none;
  font-size: 20px;
  color: white;
  cursor: pointer;
  padding: 12px;
  border-radius: 6px;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animation for sidebar items */
.nav-item {
  transform: translateX(0);
  transition: all 0.2s ease;
}

.nav-item:hover {
  transform: translateX(4px);
}

/* Focus states for accessibility */
.nav-item:focus,
.btn-primary:focus,
.btn-secondary:focus,
.btn-icon:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #5a9eff, #7a6bff);
  box-shadow: 0 0 8px rgba(106, 166, 255, 0.3);
}

::-webkit-scrollbar-corner {
  background: rgba(255, 255, 255, 0.05);
}

/* Firefox scrollbar styling */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) rgba(255, 255, 255, 0.05);
}

/* Sidebar specific scrollbar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Content area scrollbar */
.content-area::-webkit-scrollbar {
  width: 8px;
}

.content-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.content-area::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(106, 166, 255, 0.6), rgba(138, 123, 255, 0.6));
  border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(106, 166, 255, 0.8), rgba(138, 123, 255, 0.8));
}

/* Invoice data column scrollbar */
.invoice-data-column::-webkit-scrollbar {
  width: 6px;
}

.invoice-data-column::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.invoice-data-column::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(106, 166, 255, 0.6), rgba(138, 123, 255, 0.6));
  border-radius: 3px;
}

.invoice-data-column::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(106, 166, 255, 0.8), rgba(138, 123, 255, 0.8));
}

/* Table container scrollbar */
.table-container::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.table-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #5a9eff, #7a6bff);
}

/* Horizontal scrollbar always visible when content overflows */
.table-container {
  scrollbar-gutter: stable;
}

/* Invoice Detail Page Styles */
.invoice-header-card {
  background: linear-gradient(135deg, rgba(106,166,255,0.12), rgba(138,123,255,0.08));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

/* Side-by-Side Comparison Layout */
.invoice-comparison-layout {
  display: grid;
  grid-template-columns: 45% 1fr;
  gap: 24px;
  align-items: start;
  position: relative;
  min-width: 0;
  height: calc(100vh - 140px);
}

.invoice-comparison-layout::before {
  content: '';
  position: absolute;
  left: 45%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, 
    transparent,
    rgba(106,166,255,0.3) 10%,
    rgba(106,166,255,0.3) 90%,
    transparent
  );
  transform: translateX(-50%);
}

.document-preview-column {
  position: relative;
  height: 100%;
}

.sticky-preview {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.sticky-preview h3 {
  margin-bottom: 16px;
}

.sticky-preview::after {
  content: '📄 Original Document';
  position: absolute;
  top: -10px;
  left: 20px;
  background: linear-gradient(135deg, rgba(245,158,11,0.3), rgba(245,158,11,0.2));
  color: var(--text);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(245,158,11,0.4);
  z-index: 10;
}

.invoice-data-column {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  min-width: 0;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  overflow-x: visible;
  padding-right: 8px;
  scroll-behavior: smooth;
}

.invoice-data-column::before {
  content: '📊 Extracted Data';
  position: sticky;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, rgba(106,166,255,0.3), rgba(106,166,255,0.2));
  color: var(--text);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(106,166,255,0.4);
  z-index: 10;
  width: fit-content;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
}

.invoice-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.invoice-title-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invoice-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.invoice-ref {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.invoice-actions {
  display: flex;
  gap: 12px;
}

/* Financial Summary */
.invoice-financial-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.financial-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 16px;
  transition: all 0.3s ease;
}

.financial-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(106,166,255,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106,166,255,0.2);
}

.financial-item.highlight {
  background: linear-gradient(135deg, rgba(106,166,255,0.2), rgba(138,123,255,0.15));
  border: 1px solid rgba(106,166,255,0.4);
}

.financial-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.financial-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.financial-value-large {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

/* Section Headers */
.card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(106,166,255,0.3);
  letter-spacing: 0.3px;
}

.card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 12px 0;
}

/* Info Fields */
.card b {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
  margin-bottom: 4px;
}

.view-mode, .edit-mode {
  color: var(--text);
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Actions */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 12px rgba(106,166,255,0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(106,166,255,0.4);
}

.btn.secondary {
  background: linear-gradient(135deg, #475569, #334155);
  box-shadow: 0 4px 12px rgba(51,65,85,0.3);
}

.btn.secondary:hover {
  box-shadow: 0 6px 18px rgba(51,65,85,0.4);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--primary);
}

.btn.danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.btn.danger:hover {
  box-shadow: 0 6px 18px rgba(239,68,68,0.4);
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

/* Line Items Table */
#line-items-table {
  margin-top: 16px;
  font-size: 12px;
}

#line-items-table thead {
  background: linear-gradient(180deg, rgba(106,166,255,0.15), rgba(106,166,255,0.08));
}

#line-items-table thead th {
  font-size: 11px;
  padding: 8px 10px;
  letter-spacing: 0.3px;
}

#line-items-table tbody tr {
  transition: all 0.2s ease;
}

#line-items-table tbody td {
  padding: 8px 10px;
  font-size: 12px;
}

#line-items-table tbody tr:hover {
  background: rgba(106,166,255,0.08);
}

#line-items-table tbody tr.verification-row {
  background: transparent;
  font-weight: 600;
}

#line-items-table tbody tr.verification-row.success td {
  background: rgba(34,197,94,0.1);
  color: var(--success);
  border-top: 2px solid rgba(34,197,94,0.3);
}

#line-items-table tbody tr.verification-row.error td {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border-top: 2px solid rgba(239,68,68,0.3);
}

/* Make line items buttons more compact */
#line-items-table .btn.small {
  padding: 4px 8px;
  font-size: 11px;
  min-width: 50px;
}

/* Links */
.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.link:hover {
  color: var(--primary-2);
  text-decoration: underline;
}

/* Muted Text */
.muted {
  color: var(--muted);
  font-style: italic;
}

/* Warning Text */
.warning {
  color: var(--warn);
  font-weight: 500;
}

/* Document Preview */
.document-preview-card {
  border-left: 3px solid rgba(245,158,11,0.6) !important;
}

.document-preview-card iframe {
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  background: rgba(255,255,255,0.03);
}

.document-preview-card img {
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  display: block;
  margin: 0 auto;
}

.card iframe,
.card img {
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Line Editor */
#line-editor {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

#line-editor h4 {
  margin-top: 0;
}

#line-editor label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Payment Section */
.card form.grid-4 {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

/* Specific Card Styling */
.invoice-info-card {
  border-left: 3px solid rgba(106,166,255,0.5);
}

.payment-card {
  border-left: 3px solid rgba(34,197,94,0.5);
}

.payment-card-compact {
  padding: 16px 20px !important;
}

.payment-card-compact h3 {
  font-size: 18px;
}

.vendor-details-card,
.customer-details-card,
.banking-details-card {
  border-left: 3px solid rgba(138,123,255,0.5);
}

.document-preview-card {
  border-left: 3px solid rgba(245,158,11,0.5);
}

.line-items-card {
  border-left: 3px solid rgba(106,166,255,0.6);
}

.remarks-card {
  border-left: 3px solid rgba(156,163,175,0.5);
}

/* Enhanced Info Display */
.card .grid-2 > div,
.card .grid-3 > div,
.card .grid-4 > div {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.card .grid-2 > div:last-child,
.card .grid-3 > div:last-child,
.card .grid-4 > div:last-child {
  border-bottom: none;
}

/* Payment History Table */
.payment-card table {
  margin-top: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  overflow: hidden;
}

.payment-card-compact table {
  font-size: 13px;
}

.payment-card-compact table th,
.payment-card-compact table td {
  padding: 8px 12px;
}

.payment-card table th {
  background: linear-gradient(180deg, rgba(34,197,94,0.15), rgba(34,197,94,0.08));
}

.payment-card table tr:hover td {
  background: rgba(34,197,94,0.05);
}

/* Line Total Summary Row */
.line-summary-row {
  background: linear-gradient(180deg, rgba(106,166,255,0.1), rgba(106,166,255,0.05)) !important;
  font-weight: 700;
  border-top: 2px solid rgba(106,166,255,0.3) !important;
}

/* Source File Link */
.card .mt a.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.card .mt a.link:hover {
  background: rgba(106,166,255,0.1);
  border-color: var(--primary);
  text-decoration: none;
  transform: translateX(2px);
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: var(--text);
  animation: spinner 0.8s linear infinite;
  vertical-align: middle;
  margin: 0 4px;
}

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

/* Button loading state */
.btn:disabled {
  cursor: not-allowed !important;
  opacity: 0.7 !important;
}

.btn.loading {
  position: relative;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spinner 0.8s linear infinite;
}

/* Responsive Improvements */
@media (max-width: 1024px) {
  .invoice-comparison-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .invoice-comparison-layout::before {
    display: none;
  }
  
  .document-preview-column {
    height: auto;
  }
  
  .sticky-preview {
    position: relative;
    top: 0;
    max-height: 500px;
  }
  
  .sticky-preview iframe {
    height: 500px !important;
    min-height: 500px !important;
  }
  
  .invoice-data-column {
    max-height: none;
    overflow-y: visible;
  }
  
  .sticky-preview::after,
  .invoice-data-column::before {
    display: none;
  }
}

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

@media (max-width: 768px) {
  .invoice-header-card {
    padding: 20px;
  }
  
  .invoice-header-top {
    flex-direction: column;
    gap: 16px;
  }
  
  .invoice-number {
    font-size: 24px;
  }
  
  .financial-value-large {
    font-size: 22px;
  }
  
  .invoice-financial-summary {
    grid-template-columns: 1fr;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .invoice-comparison-layout {
    gap: 16px;
  }
}

/* Print styles */
@media print {
  .sidebar,
  .top-header,
  .header-actions,
  .user-profile {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .content-area {
    padding: 0;
  }
  
  .invoice-actions,
  .actions {
    display: none;
  }
}

/* Dashboard Filter Panel */
.filter-panel {
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(106,166,255,0.08), rgba(138,123,255,0.05));
  border-color: rgba(106,166,255,0.2);
  padding: 10px 14px;
  transition: all 0.3s ease;
}

.filter-panel.filter-panel-expanded {
  padding: 14px 18px;
  margin-bottom: 16px;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  transition: all 0.2s ease;
}

.filter-header:hover {
  opacity: 0.9;
}

.filter-panel.filter-panel-expanded .filter-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Compact Filter Form */
.filter-form-compact {
  padding-top: 12px;
  margin-top: 8px;
  animation: slideDown 0.2s ease;
}

.filter-panel:not(.filter-panel-expanded) .filter-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.filter-panel.filter-panel-expanded .filter-form-compact {
  display: none !important;
}

.filter-form-compact input,
.filter-form-compact select {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--content-bg);
  color: var(--content-text);
  transition: all 0.2s ease;
}

.filter-form-compact input:focus,
.filter-form-compact select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(106, 166, 255, 0.1);
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 0;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.filter-group {
  position: relative;
  z-index: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.status-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkbox-label:has(input[value="posted"]) {
  display: none;
}

.date-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.preset-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: rgba(106,166,255,0.15);
  border-color: var(--primary);
  transform: translateY(-1px);
}

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

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.chart-card {
  min-height: 350px;
  display: flex;
  flex-direction: column;
}

.chart-card canvas {
  flex: 1;
  max-height: 300px;
}

.chart-wide {
  grid-column: span 2;
}

.no-data {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 40px;
  font-size: 14px;
}

/* Pagination Styling */
.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination-page:hover {
  background: rgba(106, 166, 255, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.pagination-page.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(106, 166, 255, 0.3);
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  font-size: 14px;
}

/* Responsive Pagination */
@media (max-width: 768px) {
  .pagination-container {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .pagination-controls {
    justify-content: center;
  }
  
  .pagination-size {
    justify-content: center;
  }
  
  .pagination-info {
    text-align: center;
  }
}

/* Responsive Chart Grid */
@media (max-width: 1200px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-wide {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .date-presets {
    justify-content: center;
  }
  
  .kpis {
    grid-template-columns: 1fr;
  }
  
  .kpi-num {
    font-size: 20px;
  }
}

/* Settings Page Styles */
.settings-header {
  background: linear-gradient(135deg, rgba(106,166,255,0.12), rgba(138,123,255,0.08));
  border: 1px solid rgba(106,166,255,0.2);
  border-radius: 16px;
  padding: 24px 30px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.settings-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.settings-title-section {
  flex: 1;
}

.settings-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.settings-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  font-weight: 400;
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* Settings Grid Layout */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

/* Settings Cards */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative;
}

.settings-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(106,166,255,0.2);
  border-color: rgba(106,166,255,0.3);
}

/* Card Headers */
.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.card-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(106,166,255,0.2), rgba(138,123,255,0.15));
  border-radius: 12px;
  border: 1px solid rgba(106,166,255,0.3);
}

.card-title h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

.card-title p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  font-weight: 400;
}

.card-content {
  padding: 20px 24px 24px 24px;
}

/* Account Info Card */
.account-info-card {
  border-left: 4px solid rgba(106,166,255,0.6);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: linear-gradient(135deg, rgba(106,166,255,0.2), rgba(106,166,255,0.1));
  border: 1px solid rgba(106,166,255,0.4);
  color: var(--primary);
}

/* Usage Stats Card */
.usage-stats-card {
  border-left: 4px solid rgba(34,197,94,0.6);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(34,197,94,0.3);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.1));
  border-radius: 8px;
  border: 1px solid rgba(34,197,94,0.3);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Usage Progress Bar */
.usage-progress {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.progress-percentage {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 2px 8px rgba(106,166,255,0.3);
}

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

.progress-used {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* Quick Actions Card */
.quick-actions-card {
  border-left: 4px solid rgba(245,158,11,0.6);
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.action-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(245,158,11,0.3);
  transform: translateX(4px);
  text-decoration: none;
  color: var(--text);
}

.action-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.1));
  border-radius: 8px;
  border: 1px solid rgba(245,158,11,0.3);
  flex-shrink: 0;
}

.action-text {
  flex: 1;
}

.action-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.action-subtitle {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

/* Preferences Card */
.preferences-card {
  border-left: 4px solid rgba(138,123,255,0.6);
}

.preferences-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preference-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.preference-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(138,123,255,0.3);
}

.preference-info {
  flex: 1;
}

.preference-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.preference-description {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 24px;
  transition: all 0.3s ease;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Responsive Settings */
@media (max-width: 1200px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .settings-header {
    padding: 20px;
  }
  
  .settings-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .settings-title {
    font-size: 24px;
  }
  
  .settings-actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .settings-actions .btn {
    flex: 1;
    justify-content: center;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .card-header {
    padding: 20px 20px 16px 20px;
  }
  
  .card-content {
    padding: 16px 20px 20px 20px;
  }
  
  .card-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
  }
  
  .card-title h3 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .settings-header {
    padding: 16px;
  }
  
  .settings-title {
    font-size: 20px;
  }
  
  .settings-subtitle {
    font-size: 14px;
  }
  
  .card-header {
    padding: 16px;
    gap: 12px;
  }
  
  .card-content {
    padding: 12px 16px 16px 16px;
  }
  
  .stat-item {
    padding: 12px;
  }
  
  .action-btn {
    padding: 12px;
    gap: 12px;
  }
  
  .preference-item {
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .preference-item .toggle-switch {
    align-self: flex-end;
  }
}

/* Industry Selection Styles */
.industry-value, .industry-placeholder {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.industry-placeholder {
  color: var(--muted);
  font-style: italic;
}

.btn-edit-industry, .btn-set-industry {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.btn-edit-industry:hover, .btn-set-industry:hover {
  background: rgba(106,166,255,0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.info-item .info-value {
  display: flex;
  align-items: center;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  animation: modalSlideIn 0.3s ease;
}

/* Light theme: white modal background */
[data-theme="light"] .modal-content {
  background: #ffffff;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* Light theme: darker border for modal header */
[data-theme="light"] .modal-header {
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Ensure modal header text is visible in both themes */
[data-theme="light"] .modal-header h3 {
  color: #1e293b;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.modal-body {
  padding: 16px 24px;
}

.modal-description {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.industry-option {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 100px;
  position: relative;
  overflow: hidden;
}

.industry-option:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(106,166,255,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106,166,255,0.2);
}

.industry-option.loading {
  opacity: 0.7;
  pointer-events: none;
}

.industry-option.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spinner 0.8s linear infinite;
}

.industry-icon {
  font-size: 24px;
  line-height: 1;
}

.industry-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

.modal-footer {
  padding: 16px 24px 24px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Notification Styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  z-index: 3000;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 300px;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification-success {
  border-color: rgba(34,197,94,0.4);
  background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(34,197,94,0.05));
  color: #22c55e;
}

.notification-error {
  border-color: rgba(239,68,68,0.4);
  background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(239,68,68,0.05));
  color: #ef4444;
}

.notification-info {
  border-color: rgba(106,166,255,0.4);
  background: linear-gradient(135deg, rgba(106,166,255,0.1), rgba(106,166,255,0.05));
  color: var(--primary);
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-header {
    padding: 20px 20px 16px 20px;
  }
  
  .modal-body {
    padding: 12px 20px;
  }
  
  .modal-footer {
    padding: 12px 20px 20px 20px;
  }
  
  .industry-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }
  
  .industry-option {
    padding: 12px 8px;
    min-height: 80px;
  }
  
  .industry-icon {
    font-size: 20px;
  }
  
  .industry-name {
    font-size: 12px;
  }
  
  .notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .industry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-header h3 {
    font-size: 18px;
  }
  
  .modal-description {
    font-size: 13px;
  }
}

/* App Footer */
.app-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  margin-top: auto;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-content strong {
  color: var(--primary);
  font-weight: 600;
}

.footer-content a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-content a:hover {
  color: var(--primary-2);
  text-decoration: underline;
}