/* /home/infodev/web/tms.infogate.dev/public_html/assets/css/style.css */
:root {
  --bg-dark: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1b2640;
  --bg-elevated: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --primary-hover: #4f46e5;
  
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.2);
  --amber: #f59e0b;
  --rose: #ef4444;
  --cyan: #06b6d4;
  --purple: #a855f7;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* Sidebar */
.sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--primary-glow);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--cyan);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.nav-menu {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  font-weight: 600;
}

.nav-item .icon {
  font-size: 1.15rem;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.nav-badge.danger {
  background: var(--rose);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Main Content */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Live Timer Bar (Clockify Style) */
.timer-bar {
  background: rgba(19, 27, 46, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.timer-input {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  width: 320px;
  outline: none;
  transition: border 0.2s;
}

.timer-input:focus {
  border-color: var(--border-focus);
}

.timer-select {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  max-width: 220px;
}

.timer-select option {
  background: #111827;
  color: #fff;
}

.timer-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.digital-clock {
  font-family: 'JetBrains Mono', monospace, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
}

.pulse-dot.running {
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-timer {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-timer:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 14px var(--primary-glow);
}

.btn-timer.stop {
  background: var(--rose);
}

.btn-timer.stop:hover {
  background: #dc2626;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
}

/* Page Body */
.page-container {
  padding: 28px;
  flex: 1;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease-in;
}

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

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 12px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

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

.btn-success {
  background: var(--emerald);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-success:hover {
  background: #059669;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 6px;
  color: #fff;
}

.stat-card .subtext {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.emerald { border-left: 4px solid var(--emerald); }
.stat-card.amber { border-left: 4px solid var(--amber); }
.stat-card.rose { border-left: 4px solid var(--rose); }

/* Filters Bar */
.filters-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-tab {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.filter-tab.active {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.3);
  font-weight: 600;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  color: var(--text-main);
  font-size: 0.85rem;
  width: 240px;
  outline: none;
}

.search-input:focus {
  border-color: var(--border-focus);
}

.select-input {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

/* Tickets Table / List */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.data-table th {
  background: rgba(15, 23, 42, 0.6);
  padding: 14px 18px;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px 18px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-new { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-in_progress { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-waiting_client { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-resolved { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-closed { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }

.badge-urgent { background: rgba(239, 68, 68, 0.2); color: #f87171; font-weight: 700; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-high { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-medium { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-low { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

.badge-client {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.ticket-number {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--cyan);
  cursor: pointer;
}

.ticket-number:hover {
  text-decoration: underline;
}

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

.requester-name {
  font-weight: 600;
  color: #fff;
}

.requester-company {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 950px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  flex: 1;
}

.modal-body.single-col {
  grid-template-columns: 1fr;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

/* Ticket Conversation inside Modal */
.conversation-thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.message-bubble.client {
  border-left: 4px solid var(--cyan);
}

.message-bubble.agent {
  border-left: 4px solid var(--emerald);
  background: rgba(16, 185, 129, 0.04);
}

.message-bubble.system {
  border-left: 4px solid var(--purple);
  background: rgba(168, 85, 247, 0.04);
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.82rem;
}

.message-sender {
  font-weight: 600;
  color: #fff;
}

.message-date {
  color: var(--text-dim);
}

.message-text {
  font-size: 0.9rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.reply-box textarea {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 100px;
  outline: none;
  margin-bottom: 12px;
}

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

/* Sidebar Inside Modal */
.modal-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
}

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

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.info-item span:first-child {
  color: var(--text-dim);
}

.info-item span:last-child {
  font-weight: 500;
  color: #fff;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
}

/* Simulator Box */
.simulator-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
}

.code-pill {
  font-family: 'JetBrains Mono', monospace;
  background: #0f172a;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--cyan);
  font-size: 0.85rem;
  display: inline-block;
  user-select: all;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Print Styles for Invoicing Report */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .sidebar, .timer-bar, .filters-bar, .btn-primary, .btn-secondary, .section-header button {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
  }
  .table-container, .stat-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
  }
  .data-table th, .data-table td {
    color: #000 !important;
    border-bottom: 1px solid #eee !important;
  }
}

/* ================= SECURITY GATE / AUTH LOCKSCREEN ================= */
.auth-gate-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0b0f19 70%);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(19, 27, 46, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.15);
  text-align: center;
  backdrop-filter: blur(16px);
  animation: fadeIn 0.3s ease-out;
}

.auth-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px auto;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.auth-card h2 {
  font-size: 1.4rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 6px;
  line-height: 1.5;
}

.auth-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 24px 0;
}

.auth-badge {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--cyan);
  font-weight: 500;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--rose);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fca5a5;
  font-size: 0.82rem;
  margin-bottom: 16px;
  text-align: left;
}

/* User Profile Widget in Sidebar */
.user-profile-widget {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #312e81;
  color: #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-logout:hover {
  color: var(--rose);
  background: rgba(239, 68, 68, 0.1);
}

