/* ASTicket — Custom styles */
:root {
  --as-primary: #0d6efd;
  --as-sidebar-width: 260px;
  --as-topbar-height: 56px;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #f8f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Ticket priority badges ---- */
.badge-priority-scheduled { background-color: #6c757d !important; }
.badge-priority-medium     { background-color: #0d6efd !important; }
.badge-priority-high       { background-color: #fd7e14 !important; }
.badge-priority-emergency  { background-color: #dc3545 !important; }

/* ---- Ticket status badges ---- */
.badge-status-open                { background-color: #6c757d !important; }
.badge-status-in_analysis         { background-color: #0d6efd !important; }
.badge-status-awaiting_client     { background-color: #ffc107 !important; color: #000 !important; }
.badge-status-awaiting_tech       { background-color: #0dcaf0 !important; color: #000 !important; }
.badge-status-awaiting_commercial { background-color: #6f42c1 !important; }
.badge-status-closed              { background-color: #198754 !important; }
.badge-status-cancelled           { background-color: #212529 !important; }

/* ---- Overdue row highlight ---- */
tr.overdue-row {
  background-color: #fff5f5 !important;
  font-weight: 600;
}
tr.overdue-row td { border-left: 4px solid #dc3545; }

/* ---- SLA countdown timer ---- */
.sla-timer { font-variant-numeric: tabular-nums; }
.sla-timer.ok      { color: #198754; }
.sla-timer.warning { color: #fd7e14; }
.sla-timer.danger  { color: #dc3545; font-weight: bold; animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ---- Tag cloud ---- */
.tag-cloud .tag-item {
  cursor: pointer;
  transition: opacity .15s, transform .15s;
  user-select: none;
}
.tag-cloud .tag-item:hover  { opacity: .85; transform: scale(1.05); }
.tag-cloud .tag-item.active { outline: 2px solid #000; outline-offset: 2px; }

/* ---- Ticket thread ---- */
.reply-thread .reply-item { border-left: 3px solid #dee2e6; }
.reply-thread .reply-item.internal { border-left-color: #ffc107; background-color: #fffdf0; }
.reply-thread .reply-item.system   { border-left-color: #0dcaf0; background-color: #f0faff; }

/* ---- Sidebar layout (tech dashboard) ---- */
.layout-sidebar {
  display: flex;
  flex: 1 1 auto;
  min-height: calc(100vh - var(--as-topbar-height));
}
.sidebar {
  width: var(--as-sidebar-width);
  min-height: 100%;
  background: #fff;
  border-right: 1px solid #dee2e6;
  flex-shrink: 0;
}
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
}

/* ---- Ticket detail panel ---- */
#ticket-panel {
  position: fixed;
  top: var(--as-topbar-height);
  right: 0;
  width: 680px;
  height: calc(100vh - var(--as-topbar-height));
  background: #fff;
  border-left: 1px solid #dee2e6;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 1040;
  box-shadow: -4px 0 16px rgba(0,0,0,.12);
}
#ticket-panel.open { transform: translateX(0); }

/* ---- Responsive ---- */
@media (max-width: 991px) {
  #ticket-panel { width: 100%; }
  .sidebar { display: none; }
}

/* ---- Cards ---- */
.stat-card { border: none; border-radius: .75rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }

/* ---- Forms ---- */
.form-label { font-weight: 500; font-size: .875rem; }
.required-field::after { content: ' *'; color: #dc3545; }

/* ---- Type/Priority selection cards ---- */
.type-card {
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
  user-select: none;
}
.type-card:hover {
  border-color: #0d6efd !important;
  background-color: #f0f6ff;
  transform: translateY(-1px);
}

.type-card.selected {
  border-color: #0d6efd !important;
  background-color: var(--bs-primary-bg-subtle, #cfe2ff);
}
