/* ============================================================
   IT Helpdesk — Main Stylesheet
   Theme: Modern Industrial / Clean Utility
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --c-primary:     #e52826;
  --c-primary-d:   #c4211f;
  --c-secondary:   #f25a58;
  --c-accent:      #06b6d4;
  --c-success:     #10b981;
  --c-warning:     #f59e0b;
  --c-danger:      #ef4444;
  --c-info:        #3b82f6;

  --c-bg:          #f0f2f8;
  --c-surface:     #ffffff;
  --c-surface2:    #f8fafc;
  --c-border:      #e2e8f0;
  --c-border2:     #cbd5e1;

  --c-text:        #1e293b;
  --c-text-muted:  #64748b;
  --c-text-light:  #94a3b8;

  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --transition:    .2s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-d); }
img { max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrap { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────  */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(175deg, #1e1b4b 0%, #312e81 50%, #1e293b 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #e52826, #f25a58);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
}
.sidebar-logo .logo-text { color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; }
.sidebar-logo .logo-sub  { color: rgba(255,255,255,.5); font-size: 11px; }

.sidebar-nav { padding: 16px 0; flex: 1; }
.nav-section-title {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  margin: 2px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active {
  color: #fff;
  background: rgba(99,102,241,.35);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  width: 3px; height: 100%;
  background: var(--c-primary);
  border-radius: 0 3px 3px 0;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item.nav-item-new-ticket { color: #22c55e; }
.nav-item.nav-item-new-ticket i,
.nav-item.nav-item-new-ticket svg { color: #22c55e; }
.nav-item.nav-item-new-ticket:hover,
.nav-item.nav-item-new-ticket.active {
  color: #86efac;
  background: rgba(34,197,94,.16);
}
.nav-item.nav-item-new-ticket:hover i,
.nav-item.nav-item-new-ticket:hover svg,
.nav-item.nav-item-new-ticket.active i,
.nav-item.nav-item-new-ticket.active svg { color: #86efac; }
.nav-badge {
  margin-left: auto;
  background: var(--c-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #e52826, #f25a58);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.user-info .user-name { color: #fff; font-size: 13px; font-weight: 600; }
.user-info .user-role { color: rgba(255,255,255,.45); font-size: 11px; }
.user-actions { margin-left: auto; display: flex; gap: 4px; }
.user-actions a {
  color: rgba(255,255,255,.45);
  font-size: 14px; padding: 4px 6px;
  border-radius: 6px; transition: all var(--transition);
}
.user-actions a:hover { color: #fff; background: rgba(255,255,255,.1); }
.user-actions a.action-edit { color: #facc15; }
.user-actions a.action-edit:hover { color: #fde047; background: rgba(250,204,21,.15); }
.user-actions a.action-logout { color: #ef4444; }
.user-actions a.action-logout:hover { color: #f87171; background: rgba(239,68,68,.15); }
.user-actions a.action-edit svg { color: #facc15; }
.user-actions a.action-edit:hover svg { color: #fde047; }
.user-actions a.action-logout svg { color: #ef4444; }
.user-actions a.action-logout:hover svg { color: #f87171; }

/* ── Main content ───────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-left { flex: 1; display: flex; align-items: center; gap: 12px; }
.burger-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--c-text); font-size: 18px;
}
.page-title { font-weight: 700; font-size: 18px; }
.breadcrumb { font-size: 13px; color: var(--c-text-muted); }
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb span { color: var(--c-text); font-weight: 500; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.lang-switcher { display: flex; gap: 4px; }
.lang-btn {
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--c-border2);
  background: none; cursor: pointer;
  color: var(--c-text-muted); transition: all var(--transition);
}
.lang-btn.active { border-color: var(--c-primary); color: var(--c-primary); background: rgba(99,102,241,.06); }
.lang-btn:hover  { border-color: var(--c-primary); color: var(--c-primary); }

.topbar-new-btn {
  display: flex; align-items: center; gap: 6px;
  background: #22c55e; color: #fff;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  animation: pulse-green 2s ease-in-out infinite;
}
.topbar-new-btn:hover { background: #16a34a; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34,197,94,.45); animation: none; }
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  50% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
}

/* ── Page content ───────────────────────────────────────────── */
.page-content { padding: 28px; flex: 1; max-width: 1400px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 15px;
}
.card-header i { color: var(--c-primary); }
.card-header .card-actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 24px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface2);
  display: flex; align-items: center; gap: 10px;
}

/* ── Stat cards ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--c-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-icon.purple { background: rgba(99,102,241,.12); color: var(--c-primary); }
.stat-icon.blue   { background: rgba(59,130,246,.12); color: var(--c-info); }
.stat-icon.green  { background: rgba(16,185,129,.12); color: var(--c-success); }
.stat-icon.orange { background: rgba(245,158,11,.12); color: var(--c-warning); }
.stat-icon.red    { background: rgba(239,68,68,.12);  color: var(--c-danger); }
.stat-icon.cyan   { background: rgba(6,182,212,.12);  color: var(--c-accent); }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--c-text-muted); font-weight: 500; margin-top: 3px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-low       { background: rgba(16,185,129,.12); color: #059669; }
.badge-medium    { background: rgba(245,158,11,.12);  color: #d97706; }
.badge-high      { background: rgba(239,68,68,.12);   color: #dc2626; }
.badge-critical  { background: #ef4444; color: #fff; animation: pulse-badge 1.5s infinite; }
.badge-open      { background: rgba(59,130,246,.12); color: #2563eb; }
.badge-inprogress{ background: rgba(229,40,38,.12); color: #c4211f; }
.badge-pending   { background: rgba(245,158,11,.12); color: #d97706; }
.badge-resolved  { background: rgba(16,185,129,.12); color: #059669; }
.badge-closed    { background: rgba(107,114,128,.12);color: #4b5563; }

@keyframes pulse-badge {
  0%,100% { opacity: 1; }
  50%      { opacity: .7; }
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 10px 16px;
  background: var(--c-surface2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-text-muted);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  text-align: left;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-size: 13.5px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--c-surface2); }
.td-code { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--c-primary); font-weight: 500; }
.td-title a { color: var(--c-text); font-weight: 600; }
.td-title a:hover { color: var(--c-primary); }
.td-meta { font-size: 12px; color: var(--c-text-muted); }
.empty-row td { text-align: center; padding: 48px; color: var(--c-text-muted); }
.empty-row i { font-size: 40px; display: block; margin-bottom: 12px; color: var(--c-border2); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary  { background: var(--c-primary);  color: #fff; }
.btn-primary:hover  { background: var(--c-primary-d); box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.btn-secondary{ background: var(--c-surface2); color: var(--c-text); border-color: var(--c-border2); }
.btn-secondary:hover{ background: var(--c-border); }
.btn-success  { background: var(--c-success);  color: #fff; }
.btn-success:hover  { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,.3); }
.btn-danger   { background: var(--c-danger);   color: #fff; }
.btn-danger:hover   { background: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,.3); }
.btn-warning  { background: var(--c-warning);  color: #fff; }
.btn-outline  { background: transparent; border-color: var(--c-border2); color: var(--c-text); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-lg  { padding: 12px 28px; font-size: 15px; }
.btn-icon{ padding: 8px; width: 34px; height: 34px; justify-content: center; }
.btn-icon.btn-sm { width: 28px; height: 28px; padding: 4px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--c-text);
}
.form-label.required::after { content: ' *'; color: var(--c-danger); }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--c-border2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-control.is-invalid { border-color: var(--c-danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.form-hint { font-size: 12px; color: var(--c-text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--c-danger); margin-top: 5px; }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* ── File upload / drop zone ────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--c-border2);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--c-primary);
  background: rgba(99,102,241,.04);
}
.drop-zone input[type=file] { display: none; }
.drop-icon { font-size: 36px; color: var(--c-text-light); margin-bottom: 8px; }
.drop-text { font-size: 14px; color: var(--c-text-muted); }
.drop-text b { color: var(--c-primary); cursor: pointer; }
.drop-text b:hover { text-decoration: underline; }
.drop-hint { font-size: 12px; color: var(--c-text-light); margin-top: 4px; }
.file-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.file-item i { color: var(--c-primary); }
.file-item .remove-file { cursor: pointer; color: var(--c-danger); margin-left: 4px; }

/* ── Alerts / Flash ─────────────────────────────────────────── */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
  border: 1.5px solid;
  animation: slideDown .3s ease;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.25); color: #065f46; }
.alert-danger   { background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.25);  color: #991b1b; }
.alert-warning  { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.25); color: #92400e; }
.alert-info     { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.25); color: #1e40af; }
.alert-close { margin-left: auto; cursor: pointer; opacity: .6; }
.alert-close:hover { opacity: 1; }

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

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; flex-wrap: wrap;
}
.page-link {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--c-border);
  color: var(--c-text);
  background: var(--c-surface);
  transition: all var(--transition);
}
.page-link:hover { border-color: var(--c-primary); color: var(--c-primary); }
.page-link.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ── Login page ─────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #1e3a5f 100%);
  padding: 24px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.login-logo .icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #e52826, #f25a58);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
}
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--c-text); line-height: 1.2; }
.login-logo p  { font-size: 13px; color: var(--c-text-muted); }
.login-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: var(--c-text-muted); margin-bottom: 28px; }
.input-group { position: relative; }
.input-group .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--c-text-muted); font-size: 15px;
}
.input-group .form-control { padding-left: 42px; }
.input-group .toggle-password {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: var(--c-text-muted);
}

/* ── Ticket detail ──────────────────────────────────────────── */
.ticket-header {
  background: linear-gradient(135deg, #e52826 0%, #f25a58 100%);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  color: #fff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.ticket-header::before {
  content: '';
  position: absolute; right: -30px; top: -30px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.ticket-code-big { font-family: 'JetBrains Mono', monospace; font-size: 13px; opacity: .75; margin-bottom: 6px; }
.ticket-title-big { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.ticket-meta-row { display: flex; flex-wrap: wrap; gap: 16px; }
.ticket-meta-item { font-size: 13px; opacity: .85; display: flex; align-items: center; gap: 6px; }

.ticket-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }

.replies-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.reply-item {
  display: flex; gap: 12px;
  padding: 16px 20px;
  background: var(--c-surface2);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-border2);
}
.reply-item.is-admin { border-left-color: var(--c-primary); background: rgba(229,40,38,.04); }
.reply-item.is-internal { border-left-color: var(--c-warning); background: rgba(245,158,11,.04); }
.reply-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #e52826, #f25a58);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.reply-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.reply-author { font-weight: 700; font-size: 13.5px; }
.reply-time   { font-size: 12px; color: var(--c-text-muted); }
.reply-internal-badge { background: rgba(245,158,11,.12); color: #b45309; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.reply-body { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }

.info-card { padding: 0; }
.info-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-border);
  font-size: 13.5px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--c-text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; min-width: 90px; }
.info-val { flex: 1; font-weight: 500; }

.attachments-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  text-decoration: none; color: var(--c-text);
  transition: all var(--transition);
}
.attachment-item:hover { border-color: var(--c-primary); color: var(--c-primary); }
.attachment-item.is-image img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }

/* ── Filters bar ─────────────────────────────────────────────── */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 18px;
  align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.filter-group label { font-size: 11px; font-weight: 600; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .06em; }
.filter-group .form-control { padding: 7px 12px; font-size: 13px; }
.filters-actions { display: flex; gap: 8px; align-self: flex-end; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}
.modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--c-border);
  font-weight: 700; font-size: 16px;
}
.modal-close { margin-left: auto; cursor: pointer; color: var(--c-text-muted); font-size: 18px; line-height: 1; }
.modal-close:hover { color: var(--c-text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: 10px; }

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

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--c-border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 18px; background: none; border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--c-text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition); display: flex; align-items: center; gap: 7px;
}
.tab-btn:hover { color: var(--c-primary); }
.tab-btn.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Priority selector ───────────────────────────────────────  */
.priority-select { display: flex; gap: 8px; flex-wrap: wrap; }
.priority-option { position: relative; }
.priority-option input[type=radio] { display: none; }
.priority-option label {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--c-border2);
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all var(--transition);
}
.priority-option i,
.priority-option svg { transition: color var(--transition); }

.priority-option.priority-low label { border-color: rgba(16,185,129,.45); color: #047857; background: rgba(16,185,129,.08); }
.priority-option.priority-medium label { border-color: rgba(245,158,11,.5); color: #b45309; background: rgba(245,158,11,.1); }
.priority-option.priority-high label,
.priority-option.priority-critical label { border-color: rgba(239,68,68,.5); color: #b91c1c; background: rgba(239,68,68,.08); }

.priority-option.priority-low i,
.priority-option.priority-low svg { color: #10b981; }
.priority-option.priority-medium i,
.priority-option.priority-medium svg { color: #f59e0b; }
.priority-option.priority-high i,
.priority-option.priority-high svg,
.priority-option.priority-critical i,
.priority-option.priority-critical svg { color: #ef4444; }

.priority-option.is-selected.priority-low label,
.priority-option.priority-low input[type=radio]:checked + label { background: #10b981; border-color: #10b981; color: #fff; }
.priority-option.is-selected.priority-medium label,
.priority-option.priority-medium input[type=radio]:checked + label { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.priority-option.is-selected.priority-high label,
.priority-option.priority-high input[type=radio]:checked + label,
.priority-option.is-selected.priority-critical label,
.priority-option.priority-critical input[type=radio]:checked + label { background: #ef4444; border-color: #ef4444; color: #fff; }

.priority-option.is-selected i,
.priority-option.is-selected svg,
.priority-option input[type=radio]:checked + label i,
.priority-option input[type=radio]:checked + label svg { color: #fff; }

/* ── Dashboard Charts Grid ──────────────────────────────────── */
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.chart-container { position: relative; height: 260px; }
.chart-container-sm { height: 240px; }
@media(max-width:1024px) {
  .dashboard-charts-grid { grid-template-columns: 1fr; }
}
@media(max-width:768px) {
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .dashboard-charts-grid { grid-template-columns: 1fr; }
}

/* ── Mini progress bar (agent table) ─────────────────────────  */
.mini-progress {
  height: 6px; background: var(--c-border); border-radius: 99px;
  overflow: hidden; margin-bottom: 2px;
}
.mini-progress-bar {
  height: 100%; background: var(--c-success); border-radius: 99px;
  transition: width .5s ease;
}

/* ── Misc ───────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--c-border); margin: 20px 0; }
.text-muted { color: var(--c-text-muted); }
.text-small { font-size: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 10px; }
.ml-auto { margin-left: auto; }
.spinner {
  width: 20px; height: 20px; border: 3px solid rgba(99,102,241,.2);
  border-top-color: var(--c-primary); border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Scrollbar ───────────────────────────────────────────────  */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .ticket-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 199;
  }
  .sidebar-overlay.open { display: block; }

  .main-wrap { margin-left: 0; }
  .burger-btn { display: flex; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  th:nth-child(n+4), td:nth-child(n+4) { display: none; }
  .filters-bar { flex-direction: column; }
  .filter-group { min-width: 100%; }
  .login-card { padding: 32px 24px; }
  .ticket-header { padding: 18px 20px; }
  .ticket-title-big { font-size: 18px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .priority-select { flex-direction: column; }
  .topbar { padding: 0 16px; }
  .topbar-new-btn span { display: none; }
}
