@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --bg-primary: #0b0f19;
  --bg-secondary: #131a2c;
  --bg-tertiary: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #8b5cf6;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Brand/Status Accents */
  --brand-primary: #8b5cf6;      /* Arrival Violet */
  --brand-primary-glow: rgba(139, 92, 246, 0.15);
  --brand-secondary: #06b6d4;    /* Electric Cyan */
  
  --status-new: #3b82f6;          /* Blue */
  --status-inprogress: #8b5cf6;   /* Violet */
  --status-waiting: #f59e0b;      /* Amber */
  --status-scheduled: #06b6d4;    /* Cyan */
  --status-resolved: #10b981;     /* Emerald */
  
  --priority-low: #10b981;
  --priority-medium: #3b82f6;
  --priority-high: #f59e0b;
  --priority-critical: #ef4444;
  
  /* Layout sizes */
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --tabbar-height: 44px;
  
  /* Fonts */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
}

:root[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --border-color: rgba(0, 0, 0, 0.08);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --brand-primary-glow: rgba(139, 92, 246, 0.08);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* MAIN LAYOUT STRUCTURE */
#app-container {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* SIDEBAR STYLING */
#sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-logo {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-dot {
  width: 8px;
  height: 8px;
  background-color: var(--brand-secondary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--brand-secondary);
}

.sidebar-nav {
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

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

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

.nav-item.active {
  background-color: var(--brand-primary-glow);
  color: var(--brand-primary);
  border-left: 3px solid var(--brand-primary);
  border-radius: 0 8px 8px 0;
  padding-left: 13px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

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

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* WORKSPACE - MAIN CONTENT */
#workspace {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
  height: 100%;
}

/* TOPBAR */
#topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

.search-container {
  display: flex;
  align-items: center;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  width: 320px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-container:hover {
  border-color: var(--text-muted);
}

.search-icon {
  color: var(--text-muted);
  margin-right: 8px;
}

.search-placeholder {
  color: var(--text-muted);
  font-size: 13px;
  flex-grow: 1;
}

.search-shortcut {
  font-size: 10px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast);
}

.btn-primary:hover {
  background-color: #7c3aed;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* TAB BAR STYLING */
#tab-bar {
  height: var(--tabbar-height);
  background-color: #0d1322;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-end;
  padding: 0 16px;
  overflow-x: auto;
  gap: 4px;
  flex-shrink: 0;
}

#tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-handle {
  height: 36px;
  padding: 0 16px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 180px;
  min-width: 90px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 13px;
}

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

.tab-handle.active {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
  border-top: 2px solid var(--brand-primary);
}

.tab-close {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.tab-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ef4444;
}

/* VIEW PORTAL */
#view-portal {
  flex-grow: 1;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-primary);
}

.view-container {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  overflow-y: auto;
  padding: 24px;
}

.view-container.active {
  display: block;
  animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- DASHBOARD VIEW --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.metric-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.metric-glow {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand-primary);
  filter: blur(40px);
  bottom: -40px;
  right: -40px;
  opacity: 0.15;
}

.dashboard-sections {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.dashboard-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

/* CHART CANVAS STYLING */
.chart-container {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 20px;
}

/* --- TICKET GRID VIEW --- */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.view-title-container h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.view-title-container p {
  color: var(--text-secondary);
  font-size: 13px;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.filters-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-select {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  outline: none;
}

.filter-select:focus {
  border-color: var(--brand-primary);
}

.view-toggle {
  display: flex;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 2px;
  border-radius: 6px;
}

.toggle-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.toggle-btn.active {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* TICKETS GRID/TABLE LIST */
.tickets-table-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.tickets-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tickets-table th {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.tickets-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-secondary);
}

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

.tickets-table tr {
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.ticket-cell-title {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 4px;
}

.ticket-cell-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}

/* STATUS PILLS */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill.new { background: rgba(59, 130, 246, 0.1); color: var(--status-new); border: 1px solid rgba(59, 130, 246, 0.2); }
.status-pill.in-progress { background: rgba(139, 92, 246, 0.1); color: var(--status-inprogress); border: 1px solid rgba(139, 92, 246, 0.2); }
.status-pill.waiting { background: rgba(245, 158, 11, 0.1); color: var(--status-waiting); border: 1px solid rgba(245, 158, 11, 0.2); }
.status-pill.scheduled { background: rgba(6, 182, 212, 0.1); color: var(--status-scheduled); border: 1px solid rgba(6, 182, 212, 0.2); }
.status-pill.resolved { background: rgba(16, 185, 129, 0.1); color: var(--status-resolved); border: 1px solid rgba(16, 185, 129, 0.2); }

/* PRIORITY PIPES */
.priority-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

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

.priority-dot.low { background-color: var(--priority-low); box-shadow: 0 0 6px var(--priority-low); }
.priority-dot.medium { background-color: var(--priority-medium); box-shadow: 0 0 6px var(--priority-medium); }
.priority-dot.high { background-color: var(--priority-high); box-shadow: 0 0 6px var(--priority-high); }
.priority-dot.critical { background-color: var(--priority-critical); box-shadow: 0 0 6px var(--priority-critical); }

/* --- KANBAN BOARD VIEW --- */
.kanban-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  height: calc(100vh - 250px);
  min-height: 450px;
}

.kanban-column {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

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

.kanban-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-count {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}

.kanban-cards-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex-grow: 1;
}

.kanban-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  cursor: grab;
  transition: all var(--transition-fast);
}

.kanban-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.kanban-card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
}

/* --- TICKET DETAIL VIEW --- */
.ticket-detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  height: calc(100vh - 170px);
  min-height: 500px;
}

.detail-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

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

.detail-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.detail-meta-line {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* FEED/TIMELINE AREA */
.feed-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: rgba(0, 0, 0, 0.05);
}

.feed-item {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  border-radius: 8px;
}

.feed-item.system {
  align-self: center;
  max-width: 90%;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  padding: 4px 12px;
  border: none;
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
}

.feed-item.email {
  align-self: flex-start;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--brand-secondary);
}

.feed-item.note {
  align-self: flex-end;
  background-color: rgba(245, 158, 11, 0.03);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-left: 3px solid var(--priority-high);
}

.feed-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 11px;
}

.feed-author {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.feed-label-note {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--status-waiting);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.feed-label-email {
  background-color: rgba(6, 182, 212, 0.15);
  color: var(--brand-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.feed-body {
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.feed-time-spent {
  padding: 4px 14px 10px;
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* REPLY EDITOR */
.reply-container {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
}

.reply-selector {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.reply-tab {
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reply-tab.active.tab-email {
  color: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

.reply-tab.active.tab-note {
  color: var(--status-waiting);
  border-color: var(--status-waiting);
}

.reply-input-area {
  padding: 16px;
  position: relative;
}

.reply-textarea {
  width: 100%;
  height: 100px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  resize: none;
  outline: none;
  transition: border-color var(--transition-fast);
}

.reply-textarea:focus {
  border-color: var(--brand-primary);
}

/* Internal note active indicator background */
.reply-container.note-active .reply-textarea:focus {
  border-color: var(--status-waiting);
}

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

/* DETAIL SIDEBAR PANEL */
.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  overflow-y: auto;
}

.sidebar-panel-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
}

/* SLA PANEL */
.sla-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sla-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.sla-timer {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.sla-timer.urgent {
  color: var(--priority-critical);
  animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
  0% { opacity: 1; text-shadow: 0 0 2px rgba(239, 68, 68, 0); }
  50% { opacity: 0.8; text-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
  100% { opacity: 1; text-shadow: 0 0 2px rgba(239, 68, 68, 0); }
}

/* TIME TRACKER MODULE */
.tracker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.tracker-time {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-secondary);
}

.tracker-btns {
  display: flex;
  gap: 6px;
}

.btn-tracker {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  font-size: 13px;
}

.btn-tracker:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-tracker.active {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--priority-critical);
  border-color: rgba(239, 68, 68, 0.3);
}

/* CLIENT DETAIL CARD */
.client-detail-card h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.client-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 12px;
}

.client-field:last-child {
  margin-bottom: 0;
}

.client-field span:first-child {
  color: var(--text-muted);
}

.client-field span:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ASSETS ROW GLOW */
.sidebar-asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 8px;
}

.sidebar-asset-row:last-child {
  margin-bottom: 0;
}

.asset-status-glow {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.asset-status-glow.Online { background-color: var(--priority-low); box-shadow: 0 0 6px var(--priority-low); }
.asset-status-glow.Warning { background-color: var(--priority-high); box-shadow: 0 0 6px var(--priority-high); }
.asset-status-glow.Offline { background-color: var(--priority-critical); box-shadow: 0 0 6px var(--priority-critical); }

/* --- CLIENT LIST VIEW --- */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.client-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.client-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-muted);
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.client-card-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.client-card-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.client-card-health-healthy { border-top: 3px solid var(--priority-low); }
.client-card-health-warning { border-top: 3px solid var(--priority-high); }
.client-card-health-critical { border-top: 3px solid var(--priority-critical); }

/* --- COMMAND PALETTE OVERLAY (Ctrl+K) --- */
#command-palette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

#command-palette.active {
  display: flex;
}

.palette-box {
  width: 600px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.palette-search-wrapper {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.palette-input {
  flex-grow: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
  margin-left: 12px;
}

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

.palette-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.palette-group-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 8px 12px;
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.palette-item:hover, .palette-item.selected {
  background-color: var(--bg-tertiary);
}

.palette-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

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

.palette-item:hover .palette-item-icon, .palette-item.selected .palette-item-icon {
  color: var(--brand-primary);
}

.palette-item-shortcut {
  font-size: 10px;
  color: var(--text-muted);
}

/* --- MODAL DIALOGS --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  width: 500px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  animation: zoomIn var(--transition-fast);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}

.form-control:focus {
  border-color: var(--brand-primary);
}

textarea.form-control {
  height: 80px;
  resize: none;
}
