/* Voxia Dashboard CSS - Design System */




:root {
  /* Brand Colors */
  --brand-primary: #0066cc;
  --brand-primary-hover: #0052a3;
  --brand-primary-light: #3399ff;
  --brand-primary-dark: #004080;
  
  /* Neutral Colors */
  --neutral-15: #F5F6F8;
  --neutral-25: #F0F2F5;
  --neutral-50: #F9FAFB;
  --neutral-100: #F3F4F6;
  --neutral-200: #E5E7EB;
  --neutral-300: #D1D5DB;
  --neutral-400: #9CA3AF;
  --neutral-500: #6B7280;
  --neutral-600: #4B5563;
  --neutral-700: #374151;
  --neutral-800: #1F2937;
  --neutral-900: #0F172A;
  
  /* Surface Colors */
  --surface-default: #FFFFFF;
  --surface-secondary: #F9FAFB;
  --surface-tertiary: #F3F4F6;
  
  /* Status Colors */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --error: #EF4444;
  --error-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  
  /* Typography */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
  
  /* Font Sizes */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;
  
  /* Font Weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  
  /* Layout */
  --sidebar-width: 264px;
  --sidebar-width-collapsed: 64px;
  --topbar-height: 56px;
  --content-padding: 24px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Card Shadow */
  --card-shadow: 0 1px 1px rgba(16, 24, 40, 0.04), 0 2px 6px rgba(16, 24, 40, 0.06);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Z-Index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

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

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-normal);
  color: var(--neutral-800);
  background-color: var(--neutral-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--neutral-50);
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--surface-default);
  border-right: 1px solid var(--neutral-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease;
  transform: translateX(-100%);
}

@media (min-width: 1025px) {
  .sidebar {
    width: var(--sidebar-width);
    z-index: var(--z-fixed);
    transition: transform var(--transition-normal);
    transform: translateX(0);
  }
}

.sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-width) + var(--sidebar-width-collapsed)));
}

.sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--neutral-200);
}

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

.logo h1 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--brand-primary);
  margin-bottom: var(--space-1);
}

.logo-subtitle {
  font-size: var(--text-sm);
  color: var(--neutral-500);
  font-weight: var(--font-medium);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
  overflow-y: auto;
}

.nav-list {
  list-style: none;
  padding: 0 var(--space-4);
}

.nav-item {
  margin-bottom: var(--space-1);
}

.nav-link {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  color: var(--neutral-600);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
}

.nav-link:hover {
  background-color: var(--neutral-100);
  color: var(--neutral-800);
}

.nav-link.active {
  background-color: var(--brand-primary);
  color: white;
}

.nav-link.active:hover {
  background-color: var(--brand-primary-hover);
}

.nav-icon {
  width: 20px;
  height: 20px;
  margin-right: var(--space-3);
  flex-shrink: 0;
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--neutral-200);
}

.logout-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: var(--error);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  cursor: pointer;
}

.logout-btn:hover {
  background-color: var(--error-light);
  color: var(--error);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

.sidebar.collapsed + .main-content {
  margin-left: var(--sidebar-width-collapsed);
}

/* Top Bar */
.topbar {
  height: var(--topbar-height);
  background-color: var(--surface-default);
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--neutral-600);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  background-color: var(--neutral-100);
  color: var(--neutral-800);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--neutral-600);
}

.breadcrumb-item {
  color: var(--neutral-500);
}

.breadcrumb-item.active {
  color: var(--neutral-800);
  font-weight: var(--font-medium);
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: var(--space-2);
  color: var(--neutral-400);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

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

.search-icon {
  position: absolute;
  left: var(--space-3);
  width: 16px;
  height: 16px;
  color: var(--neutral-400);
  z-index: 1;
}

.search-box input {
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-10);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  background-color: var(--surface-default);
  font-size: var(--text-sm);
  width: 300px;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-btn:hover {
  background-color: var(--neutral-100);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background-color: var(--brand-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.user-avatar svg {
  width: 16px;
  height: 16px;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--neutral-800);
}

.dropdown-icon {
  width: 16px;
  height: 16px;
  color: var(--neutral-500);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: var(--content-padding);
  overflow-y: auto;
}

/* Cards */
.card {
  background-color: var(--surface-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--neutral-200);
  overflow: hidden;
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--neutral-200);
  background-color: var(--surface-secondary);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
  margin: 0;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--neutral-500);
  margin-top: var(--space-1);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--neutral-200);
  background-color: var(--surface-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

/* Filter Button Styles */
.filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--brand-primary);
  background: white;
  color: var(--brand-primary);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--brand-primary);
  color: white;
}

.filter-btn.active {
  background: var(--brand-primary);
  color: white;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.btn-secondary {
  background-color: var(--surface-default);
  color: var(--neutral-700);
  border-color: var(--neutral-300);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--neutral-50);
  border-color: var(--neutral-400);
}

.btn-ghost {
  background-color: transparent;
  color: var(--neutral-600);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--neutral-100);
  color: var(--neutral-800);
}

.btn-danger {
  background-color: var(--error);
  color: white;
  border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
  border-color: #dc2626;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--neutral-700);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background-color: var(--surface-default);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-input.error {
  border-color: var(--error);
}

.form-input:disabled {
  background-color: var(--neutral-100);
  color: var(--neutral-500);
  cursor: not-allowed;
}

.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background-color: var(--surface-default);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background-color: var(--surface-default);
  resize: vertical;
  min-height: 100px;
  transition: all var(--transition-fast);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--neutral-200);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface-default);
}

.table th {
  background-color: var(--surface-secondary);
  padding: var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--neutral-200);
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
  font-size: var(--text-sm);
  color: var(--neutral-700);
}

.table tbody tr:hover {
  background-color: var(--neutral-50);
}

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background-color: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background-color: var(--warning-light);
  color: var(--warning);
}

.badge-error {
  background-color: var(--error-light);
  color: var(--error);
}

.badge-info {
  background-color: var(--info-light);
  color: var(--info);
}

.badge-neutral {
  background-color: var(--neutral-100);
  color: var(--neutral-600);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal {
  background-color: var(--surface-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: var(--z-modal);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--neutral-500);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--neutral-100);
  color: var(--neutral-700);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--neutral-200);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background-color: var(--surface-default);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
  min-width: 300px;
  max-width: 400px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: slideInRight 0.3s ease;
}

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

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

.toast-warning {
  border-left: 4px solid var(--warning);
}

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

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
  margin-bottom: var(--space-1);
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--neutral-600);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  color: var(--neutral-400);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background-color: var(--neutral-100);
  color: var(--neutral-600);
}

/* Loading */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-overlay.show {
  display: flex;
}

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

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--neutral-200);
  border-top: 4px solid var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.stat-card {
  background-color: var(--surface-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--neutral-200);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.stat-card-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.stat-card-icon.primary {
  background-color: var(--brand-primary);
}

.stat-card-icon.success {
  background-color: var(--success);
}

.stat-card-icon.warning {
  background-color: var(--warning);
}

.stat-card-icon.info {
  background-color: var(--info);
}

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--neutral-800);
  margin-bottom: var(--space-1);
}

.stat-card-change {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stat-card-change.positive {
  color: var(--success);
}

.stat-card-change.negative {
  color: var(--error);
}

.stat-card-change.neutral {
  color: var(--neutral-500);
}

/* Responsive Design */
/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

@media (max-width: 1024px) {
  .sidebar {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .sidebar-toggle {
    display: block;
    z-index: 1002;
    position: relative;
  }
  
  .search-box input {
    width: 200px;
  }
  
  .sidebar-close {
    display: block !important;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--neutral-600);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 1002;
  }
  
  .sidebar-close:hover {
    background: var(--neutral-100);
    color: var(--neutral-800);
  }
  
  .sidebar-close svg {
    width: 20px;
    height: 20px;
  }
}

/* Zapobiega przewijaniu gdy sidebar jest otwarty */
body.sidebar-open {
  overflow: hidden;
}

/* Custom Select Styling */
.form-select,
.custom-select,
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-select:hover,
.custom-select:hover {
  border-color: var(--brand-primary);
}

.form-select:focus,
.custom-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  outline: none;
}

.form-select option,
.custom-select option {
  padding: 8px;
  background-color: var(--neutral-0);
  color: var(--neutral-800);
}

@media (min-width: 768px) {
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .content-area {
    padding: var(--space-4);
  }
  
  .topbar {
    padding: 0 var(--space-4);
  }
  
  .search-box input {
    width: 150px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .topbar-right {
    gap: var(--space-2);
  }
  
  .search-box {
    display: none;
  }
  
  .user-name {
    display: none;
  }
  
  .modal {
    margin: var(--space-4);
    max-width: none;
  }
  
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
  }
  
  .toast {
    min-width: auto;
  }
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

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

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

.font-bold {
  font-weight: var(--font-bold);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.font-medium {
  font-weight: var(--font-medium);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-base {
  font-size: var(--text-base);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.text-3xl {
  font-size: var(--text-3xl);
}

.text-4xl {
  font-size: var(--text-4xl);
}

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

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

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

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

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

.text-neutral-500 {
  color: var(--neutral-500);
}

.text-neutral-600 {
  color: var(--neutral-600);
}

.text-neutral-700 {
  color: var(--neutral-700);
}

.text-neutral-800 {
  color: var(--neutral-800);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

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

.border { border: 1px solid var(--neutral-200); }
.border-t { border-top: 1px solid var(--neutral-200); }
.border-b { border-bottom: 1px solid var(--neutral-200); }

.bg-white { background-color: var(--surface-default); }
.bg-gray-50 { background-color: var(--neutral-50); }
.bg-gray-100 { background-color: var(--neutral-100); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Conversations Grid - 4x3 Layout */
.conversations-container {
  padding: var(--space-6);
  background: var(--surface-default);
  min-height: 100vh;
}

.conversations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--neutral-200);
}

.conversations-header h2 {
  color: var(--neutral-800);
  font-size: var(--text-2xl);
  font-weight: 600;
  margin: 0;
}

.conversations-controls {
  display: flex;
  gap: var(--space-3);
}

.calls-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: var(--space-4);
  height: calc(100vh - 200px);
  min-height: 600px;
}

.call-window {
  background: var(--surface-default);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.call-window.empty {
  background: var(--neutral-50);
  border-color: var(--neutral-300);
}

.call-window.active {
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.call-header {
  padding: var(--space-4);
  background: var(--neutral-100);
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.call-info h3 {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--neutral-800);
}

.call-info p {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--text-sm);
  color: var(--neutral-600);
}

.call-duration {
  font-weight: 600;
  color: var(--brand-primary);
  font-family: var(--font-mono);
}

.call-time {
  font-size: var(--text-xs);
  color: var(--neutral-500);
}

.status {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status.empty {
  background: var(--neutral-200);
  color: var(--neutral-600);
}

.status.active {
  background: var(--success-light);
  color: var(--success);
}

.status.ringing {
  background: var(--warning-light);
  color: var(--warning);
}

.status.answered {
  background: var(--info-light);
  color: var(--info);
}

.status.completed {
  background: var(--neutral-200);
  color: var(--neutral-600);
}

.status.failed {
  background: var(--error-light);
  color: var(--error);
}

.chat-container {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
  background: var(--surface-default);
}

.no-messages {
  text-align: center;
  color: var(--neutral-500);
  font-style: italic;
  padding: var(--space-8) var(--space-4);
}

.message {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
}

.message.user {
  background: var(--brand-primary-light);
  color: white;
  margin-left: var(--space-8);
}

.message.assistant {
  background: var(--neutral-100);
  color: var(--neutral-800);
  margin-right: var(--space-8);
}

.message-content {
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: var(--space-1);
}

.message-time {
  font-size: var(--text-xs);
  color: var(--neutral-500);
  opacity: 0.8;
}

.error-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--neutral-600);
}

.error-state h3 {
  color: var(--error);
  margin-bottom: var(--space-4);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .calls-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }
}

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

@media (max-width: 600px) {
  .calls-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(12, 1fr);
    height: auto;
    min-height: 1200px;
  }
  
  .conversations-header {
    flex-direction: column;
    gap: var(--space-4);
    align-items: stretch;
  }
  
  .conversations-controls {
    justify-content: center;
  }
}

/* Outgoing Calls Styles */
.outgoing-calls-container {
  padding: var(--space-6);
  background: var(--surface-default);
  min-height: 100vh;
}

.outgoing-calls-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--neutral-200);
}

.outgoing-calls-header h2 {
  color: var(--neutral-800);
  font-size: var(--text-2xl);
  font-weight: 600;
  margin: 0;
}

.outgoing-call-form {
  background: var(--neutral-50);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.outgoing-call-form h3 {
  color: var(--neutral-800);
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 var(--space-6) 0;
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
  color: var(--neutral-700);
}

.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-3);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  transition: border-color 0.3s ease;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.form-group small {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--neutral-500);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.preset-buttons .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.active-calls-section {
  margin-top: var(--space-8);
}

.active-calls-section h3 {
  color: var(--neutral-800);
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 var(--space-4) 0;
}

.call-card {
  background: var(--surface-default);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--brand-primary);
}

.call-card.outbound {
  border-left-color: var(--success);
}

.call-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.call-phone {
  font-weight: 600;
  color: var(--neutral-800);
  font-size: var(--text-lg);
}

.call-time {
  font-size: var(--text-sm);
  color: var(--neutral-600);
}

.call-status {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.call-status.ringing { 
  background: var(--warning-light); 
  color: var(--warning); 
}

.call-status.answered { 
  background: var(--success-light); 
  color: var(--success); 
}

.call-status.completed { 
  background: var(--info-light); 
  color: var(--info); 
}

.call-status.initiated { 
  background: var(--neutral-200); 
  color: var(--neutral-600); 
}

.call-message {
  font-style: italic;
  color: var(--neutral-600);
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--neutral-50);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand-primary);
}


/* Voxia Conversations - Compact Styles */
.call-window .call-info h3 {
  font-size: 13px !important;
  margin: 0 0 3px 0 !important;
}

.call-window .call-info p {
  font-size: 10px !important;
  margin: 2px 0 !important;
  line-height: 1.3 !important;
}

.call-window .call-duration {
  font-size: 11px !important;
}

.call-window .status {
  font-size: 8px !important;
  padding: 3px 6px !important;
}

.call-window .message {
  font-size: 10px !important;
  padding: 5px 8px !important;
  line-height: 1.3 !important;
}

.call-window.archived {
  border-color: var(--neutral-300);
  background: var(--neutral-50);
  opacity: 0.85;
}

/* Expanded window state */
.call-window.expanded {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 80vw !important;
  max-width: 900px !important;
  height: 80vh !important;
  z-index: 1000 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

.call-window.expanded .call-info h3 {
  font-size: 18px !important;
}

.call-window.expanded .call-info p {
  font-size: 14px !important;
}

.call-window.expanded .message {
  font-size: 13px !important;
  padding: 8px 12px !important;
}

.call-window.expanded .chat-container {
  max-height: calc(80vh - 150px) !important;
}

.call-window:not(.empty) {
  cursor: pointer;
}

/* Clickable windows cursor */
.call-window.clickable {
  cursor: pointer;
}

.call-window.clickable:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.call-window.empty {
  cursor: default;
}

/* Override message styles to match lookup.html */
.call-window .message {
  margin: 4px 0 !important;
  padding: 6px 8px !important;
  border-radius: 12px !important;
  max-width: 95% !important;
  word-wrap: break-word !important;
  font-size: 9px !important;
  line-height: 1.2 !important;
}

.call-window .message.user {
  background: #007bff !important;
  color: white !important;
  margin-left: auto !important;
  text-align: right !important;
}

.call-window .message.agent {
  background: #404040 !important;
  color: #e0e0e0 !important;
  margin-right: auto !important;
}

.call-window .message.system {
  background: #333333 !important;
  color: #a0a0a0 !important;
  text-align: center !important;
  font-style: italic !important;
  margin: 4px auto !important;
  max-width: 80% !important;
  font-size: 8px !important;
}

.call-window .message .timestamp {
  font-size: 7px !important;
  color: #a0a0a0 !important;
  margin-top: 2px !important;
  opacity: 0.8 !important;
}

.call-window .message.user .timestamp {
  color: #fff !important;
  font-weight: bold !important;
  opacity: 1 !important;
}

/* Expanded window - larger text */
.call-window.expanded .message {
  font-size: 11px !important;
  padding: 8px 12px !important;
}

.call-window.expanded .message .timestamp {
  font-size: 9px !important;
}

/* Fix expanded window size */
.call-window.expanded {
  width: 600px !important;
  height: 80vh !important;
}

/* Fix call-info layout for empty windows */
.call-window .call-info p {
  line-height: 1.2 !important;
}

/* Utility classes for buttons and icons */
.w-4 {
  width: 16px;
}

.h-4 {
  height: 16px;
}

.gap-2 {
  gap: 8px;
}

.flex {
  display: flex;
}

.text-error {
  color: var(--error) !important;
}

/* Button visibility fix */
.btn svg {
  flex-shrink: 0;
}

.btn-ghost svg {
  stroke-width: 2;
}

/* Ensure buttons are visible in tables */
table .btn {
  opacity: 1;
  visibility: visible;
}

table .btn:hover {
  background-color: var(--neutral-100);
}

table .btn-ghost:hover {
  background-color: var(--neutral-150);
}

/* Debug - make buttons always visible */
button.btn {
  min-width: 32px !important;
  min-height: 32px !important;
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ============================================================
   MULTI-TENANT STYLES
   ============================================================ */

/* Project Selector */
.project-selector {
  margin-right: var(--space-4);
}

.project-selector select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--surface-default);
  font-size: var(--text-sm);
  color: var(--neutral-700);
  cursor: pointer;
  min-width: 150px;
}

.project-selector select:hover {
  border-color: var(--brand-primary);
}

.project-selector select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* User Role Badge */
.user-role {
  margin-left: var(--space-2);
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Nav Section (Admin) */
.nav-section {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-200);
}

.nav-section-title {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Admin Page Styles */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-header-content {
  flex: 1;
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--neutral-900);
  margin: 0;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--neutral-500);
  margin: var(--space-1) 0 0;
}

.page-actions {
  display: flex;
  gap: var(--space-3);
}

/* Form Styles */
.form-row {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.col-md-6 {
  flex: 1;
}

.form-text {
  font-size: var(--text-xs);
  color: var(--neutral-500);
  margin-top: var(--space-1);
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--neutral-50);
  border-radius: var(--radius-md);
  max-height: 150px;
  overflow-y: auto;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-default);
  border-radius: var(--radius-sm);
  border: 1px solid var(--neutral-200);
  transition: var(--transition-fast);
}

.checkbox-label:hover {
  border-color: var(--brand-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Modal Improvements */
.modal-lg {
  max-width: 700px;
}

.modal hr {
  margin: var(--space-6) 0;
  border: none;
  border-top: 1px solid var(--neutral-200);
}

.modal h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
  margin-bottom: var(--space-4);
}

/* Button Group */
.btn-group {
  display: flex;
  gap: var(--space-2);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--neutral-500);
}

/* Code styling */
code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--neutral-100);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--neutral-700);
}

/* Text utilities */
.text-muted {
  color: var(--neutral-500) !important;
}

/* Admin-only visibility */
[data-admin-only] {
  display: none;
}

body.is-admin [data-admin-only] {
  display: block;
}
