/* =====================
   CSS VARIABLES & RESET
   ===================== */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #3B82F6;
  --secondary: #64748B;
  --background: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  
  /* Status Colors */
  --status-open: #F59E0B;
  --status-open-bg: #FEF3C7;
  --status-pending: #8B5CF6;
  --status-pending-bg: #EDE9FE;
  --status-resolved: #10B981;
  --status-resolved-bg: #D1FAE5;
  --status-closed: #6B7280;
  --status-closed-bg: #F3F4F6;
  
  /* Priority Colors */
  --priority-urgent: #DC2626;
  --priority-urgent-bg: #FEE2E2;
  --priority-high: #EA580C;
  --priority-high-bg: #FFEDD5;
  --priority-medium: #CA8A04;
  --priority-medium-bg: #FEF9C3;
  --priority-low: #16A34A;
  --priority-low-bg: #DCFCE7;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  
  /* Spacing */
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* =====================
   LAYOUT
   ===================== */
#app {
  display: flex;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.logo-icon {
  font-size: 1.5rem;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 4px;
}

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

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

.nav-icon {
  font-size: 1.1rem;
}

.badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-warning {
  background: var(--status-open);
}

.sidebar-section {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.filter-group {
  margin-bottom: 12px;
}

.filter-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--background);
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* =====================
   MAIN CONTENT
   ===================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* =====================
   HEADER
   ===================== */
.header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  color: var(--text-secondary);
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
}

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

.search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
}

.search-input {
  padding: 10px 12px 10px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 280px;
  font-size: 0.875rem;
  background: var(--background);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  width: 320px;
}

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--background);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.btn-icon {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 8px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* =====================
   DASHBOARD VIEW
   ===================== */
.view {
  padding: 24px;
}

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

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.stat-icon {
  font-size: 2rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-open .stat-value { color: var(--status-open); }
.stat-pending .stat-value { color: var(--status-pending); }
.stat-resolved .stat-value { color: var(--status-resolved); }
.stat-closed .stat-value { color: var(--status-closed); }

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

.chart-card {
  min-height: 300px;
}

/* =====================
   CARDS
   ===================== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

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

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.card-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.card-link:hover {
  text-decoration: underline;
}

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

/* =====================
   TICKET LIST VIEW
   ===================== */
.tickets-container {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 0;
  height: calc(100vh - var(--header-height));
}

.ticket-list-panel {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.ticket-list-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.sort-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: var(--background);
}

.ticket-list {
  flex: 1;
  overflow-y: auto;
}

.ticket-list:empty::after {
  content: 'No tickets found';
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.ticket-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ticket-item:hover {
  background: var(--background);
}

.ticket-item.active {
  background: var(--background);
  border-left: 3px solid var(--primary);
}

.ticket-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ticket-subject {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  flex: 1;
}

.ticket-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--background);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.ticket-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ticket-customer {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ticket-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* =====================
   TICKET DETAIL PANEL
   ===================== */
.ticket-detail-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 40px;
  text-align: center;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.875rem;
}

.ticket-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ticket-detail-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.ticket-detail-subject {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-value {
  font-size: 0.875rem;
  font-weight: 500;
}

/* =====================
   STATUS & PRIORITY BADGES
   ===================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.open {
  background: var(--status-open-bg);
  color: var(--status-open);
}

.status-badge.pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}

.status-badge.resolved {
  background: var(--status-resolved-bg);
  color: var(--status-resolved);
}

.status-badge.closed {
  background: var(--status-closed-bg);
  color: var(--status-closed);
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-badge.urgent {
  background: var(--priority-urgent-bg);
  color: var(--priority-urgent);
}

.priority-badge.high {
  background: var(--priority-high-bg);
  color: var(--priority-high);
}

.priority-badge.medium {
  background: var(--priority-medium-bg);
  color: var(--priority-medium);
}

.priority-badge.low {
  background: var(--priority-low-bg);
  color: var(--priority-low);
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.priority-dot.urgent { background: var(--priority-urgent); }
.priority-dot.high { background: var(--priority-high); }
.priority-dot.medium { background: var(--priority-medium); }
.priority-dot.low { background: var(--priority-low); }

/* =====================
   CONVERSATION THREAD
   ===================== */
.conversation-thread {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.conversation-message {
  margin-bottom: 24px;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.message-avatar.customer { background: var(--secondary); }
.message-avatar.agent { background: var(--primary); }
.message-avatar.admin { background: #7C3AED; }

.message-author {
  font-weight: 600;
  font-size: 0.875rem;
}

.message-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 2px 6px;
  background: var(--background);
  border-radius: 4px;
}

.message-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.message-body {
  background: var(--background);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-left: 44px;
}

.internal-note .message-body {
  background: #FEF3C7;
  border-left: 3px solid var(--status-open);
}

.message-footer {
  margin-top: 8px;
  margin-left: 44px;
}

.internal-badge {
  font-size: 0.7rem;
  color: var(--status-open);
  font-weight: 600;
  text-transform: uppercase;
}

/* =====================
   REPLY BOX
   ===================== */
.reply-box {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  background: var(--surface);
}

.reply-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.reply-tab {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.reply-tab.active {
  background: var(--background);
  color: var(--text-primary);
}

.reply-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 100px;
}

.reply-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

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

/* =====================
   MODAL
   ===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal.active .modal-content {
  transform: scale(1);
}

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

.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-body {
  padding: 24px;
}

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

/* =====================
   FORMS
   ===================== */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

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

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

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

/* =====================
   CHARTS & STATS DISPLAYS
   ===================== */
.priority-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.priority-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.priority-bar-label {
  width: 80px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: capitalize;
}

.priority-bar-track {
  flex: 1;
  height: 24px;
  background: var(--background);
  border-radius: 4px;
  overflow: hidden;
}

.priority-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-normal);
}

.priority-bar-fill.urgent { background: var(--priority-urgent); }
.priority-bar-fill.high { background: var(--priority-high); }
.priority-bar-fill.medium { background: var(--priority-medium); }
.priority-bar-fill.low { background: var(--priority-low); }

.priority-bar-count {
  width: 40px;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--background);
  border-radius: var(--radius-md);
}

.category-name {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
}

.category-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

/* =====================
   SLIDE PANEL (Mobile)
   ===================== */
.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 500px;
  height: 100vh;
  background: var(--surface);
  z-index: 200;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  display: none;
  flex-direction: column;
}

.slide-panel.active {
  transform: translateX(0);
}

.slide-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.slide-panel-content {
  flex: 1;
  overflow-y: auto;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* =====================
   TOAST NOTIFICATIONS
   ===================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideIn var(--transition-normal);
}

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

.toast-icon {
  font-size: 1.25rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.toast.success { border-left: 4px solid var(--status-resolved); }
.toast.error { border-left: 4px solid var(--priority-urgent); }
.toast.warning { border-left: 4px solid var(--status-open); }

/* =====================
   SELECT DROPDOWN (Custom)
   ===================== */
.select-with-avatar {
  position: relative;
}

.select-with-avatar select {
  width: 100%;
  padding: 8px 12px;
  padding-left: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--background);
  cursor: pointer;
}

.agent-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =====================
   AUTH SCREEN
   ===================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.auth-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .logo {
  justify-content: center;
  margin-bottom: 24px;
  font-size: 1.5rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-form {
  margin-bottom: 24px;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

.auth-footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-demo {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.auth-demo p {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.demo-accounts {
  display: flex;
  gap: 8px;
}

.demo-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.demo-btn:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.demo-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
}

.demo-email {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Role-based visibility */
.agent-only {
  display: none;
}

body.role-agent .agent-only,
body.role-admin .agent-only {
  display: block;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .charts-row {
    grid-template-columns: 1fr;
  }
  
  .tickets-container {
    grid-template-columns: 350px 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .search-input {
    width: 200px;
  }
  
  .search-input:focus {
    width: 200px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .tickets-container {
    grid-template-columns: 1fr;
  }
  
  .ticket-list-panel {
    height: 50vh;
  }
  
  .ticket-detail-panel {
    display: none;
  }
  
  .slide-panel {
    display: flex;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* =====================
   UTILITIES
   ===================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
