:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #111726;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 38, 59, 0.85);
  --border-color: rgba(56, 189, 248, 0.15);
  --border-glow: rgba(56, 189, 248, 0.35);

  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.1);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.25);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.05) 0px, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Header & Nav */
.app-header {
  height: 72px;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--accent-cyan);
  border-radius: 999px;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  background: rgba(17, 23, 38, 0.9);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

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

.nav-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.2));
  color: var(--accent-cyan);
  border: 1px solid var(--border-glow);
  box-shadow: var(--shadow-sm);
}

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

.system-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 15px var(--accent-emerald); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Layout container */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.view-section.active {
  display: block;
}

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

/* Cards & Glassmorphism */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: var(--border-glow);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .grid-2, .grid-3, .grid-1-2, .grid-2-1 {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 1rem;
  }
}

/* Typography & Titles */
.section-header {
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control, .form-select, textarea.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(17, 23, 38, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus, textarea.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  background: rgba(22, 30, 48, 0.9);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #04101e;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--text-muted);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-rose), #e11d48);
  color: #fff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, var(--accent-amber), #d97706);
  color: #000;
}

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

.btn-block {
  width: 100%;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-normal {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-vip {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-critical {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
  animation: pulseDanger 1.5s infinite;
}

@keyframes pulseDanger {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.badge-status-online { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-status-ocupado { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-status-offline { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Chamados Ticket List */
.ticket-card {
  background: rgba(17, 23, 38, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.ticket-card:hover {
  background: rgba(28, 38, 59, 0.7);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.ticket-card.active {
  border-color: var(--accent-cyan);
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.ticket-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-cyan);
}

.ticket-card.p-vip::before { background: var(--accent-purple); }
.ticket-card.p-critical::before { background: var(--accent-rose); }

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

.ticket-id {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.ticket-company {
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 4px;
}

.ticket-reason {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.ticket-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
  align-items: center;
}

/* Chat Component */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 480px;
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.45;
  position: relative;
  animation: fadeIn 0.2s ease-out;
}

.msg-cliente {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.9);
  color: #f1f5f9;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.msg-tecnico {
  align-self: flex-end;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border-bottom-right-radius: 2px;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3);
}

.msg-system {
  align-self: center;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px dashed var(--border-glow);
  font-size: 0.8rem;
  text-align: center;
  max-width: 90%;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.msg-time {
  font-size: 0.7rem;
  opacity: 0.65;
  margin-top: 4px;
  text-align: right;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: rgba(17, 23, 38, 0.95);
  border-top: 1px solid var(--border-color);
}

.chat-input {
  flex: 1;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fff;
  outline: none;
}

.chat-input:focus {
  border-color: var(--accent-cyan);
}

/* Remote Session Screen Simulation */
.remote-screen-view {
  background: #020617;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.remote-screen-header {
  background: #0f172a;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
}

.screen-canvas-wrapper {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
}

.screen-mock {
  width: 90%;
  height: 90%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: #090d16;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.screen-os-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.os-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.os-dot.red { background: #ef4444; }
.os-dot.yellow { background: #f59e0b; }
.os-dot.green { background: #10b981; }

.screen-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border-left: 2px solid #38bdf8;
  border-top: 2px solid #38bdf8;
  transform: rotate(-45deg);
  pointer-events: none;
  animation: moveCursor 6s infinite alternate ease-in-out;
}

@keyframes moveCursor {
  0% { top: 30%; left: 25%; }
  35% { top: 60%; left: 70%; }
  70% { top: 40%; left: 50%; }
  100% { top: 20%; left: 80%; }
}

/* Modal and Alert Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: #111827;
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 520px;
  width: 90%;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-box {
  transform: scale(1);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stats Counter Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.stat-card {
  background: rgba(17, 23, 38, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.stat-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Table Style for Admin Logs */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.custom-table th {
  text-align: left;
  padding: 12px 14px;
  background: rgba(17, 23, 38, 0.9);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: #1e293b;
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: slideInRight 0.3s ease;
}

.toast.toast-success { border-left-color: var(--accent-emerald); }
.toast.toast-warning { border-left-color: var(--accent-amber); }
.toast.toast-danger { border-left-color: var(--accent-rose); }

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