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

:root {
  --bg: #080c10;
  --surface: #0e1420;
  --surface2: #141c2e;
  --border: #1e2d47;
  --accent: #00d4ff;
  --accent2: #0066ff;
  --green: #00ff9d;
  --orange: #ff8c00;
  --red: #ff3d5a;
  --yellow: #ffd700;
  --text: #c8d8f0;
  --text-dim: #5a7a9a;
  --text-bright: #e8f4ff;
  --sidebar-w: 230px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
  font-family: 'Syne', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== MOBILE TOPBAR ===== */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.mobile-brand { font-size: 1rem; font-weight: 800; color: var(--text-bright); }
.mobile-brand span { color: var(--accent); }

.hamburger {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px; height: 36px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; cursor: pointer;
}

.hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all 0.25s;
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
}

.sidebar-overlay.show { display: block; }

/* ===== LAYOUT ===== */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  z-index: 160;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-bright);
  flex-shrink: 0;
}

.sidebar-brand span { color: var(--accent); }
.sidebar-brand small {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav { padding: 10px 0; flex: 1; }

.nav-item {
  padding: 10px 20px;
  font-size: 0.82rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); text-decoration: none; }
.nav-item.active {
  color: var(--accent);
  background: rgba(0,212,255,0.06);
  border-left: 2px solid var(--accent);
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 16px;
}

.sidebar-user {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.avatar.admin-av { background: linear-gradient(135deg, #ff8c00, #ff3d5a); }
.avatar.claudia-av { background: linear-gradient(135deg, #00b4d8, #00ff9d); color: #080c10; }
.avatar-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.avatar-info { min-width: 0; }
.avatar-name { color: var(--text); font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-role { color: var(--text-dim); font-size: 0.6rem; font-family: 'JetBrains Mono', monospace; }

.main-content {
  margin-left: var(--sidebar-w);
  padding: 32px;
  min-height: 100vh;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-left {
  background: linear-gradient(135deg, #080c10 0%, #0a1628 100%);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,212,255,0.07) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-logo { font-size: 1.8rem; font-weight: 800; color: var(--text-bright); margin-bottom: 6px; }
.auth-logo span { color: var(--accent); }
.auth-tagline { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--text-dim); margin-bottom: 48px; }

.auth-features { display: flex; flex-direction: column; gap: 18px; }
.feat-item { display: flex; align-items: center; gap: 14px; font-size: 0.88rem; color: var(--text); }
.feat-icon {
  width: 36px; height: 36px;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}

.auth-right {
  background: var(--surface);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--border);
}

/* ===== FORM ELEMENTS ===== */
.form-title { font-size: 1.4rem; font-weight: 700; color: var(--text-bright); margin-bottom: 4px; }
.form-subtitle { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--text-dim); margin-bottom: 26px; }

.form-group { margin-bottom: 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.form-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.63rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 13px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,212,255,0.08);
}

.form-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.form-select { 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='%235a7a9a' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
.form-select option { background: var(--bg); }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.danger { background: linear-gradient(135deg, #c0392b, var(--red)); }
.btn-primary.w-auto { width: auto; padding: 10px 22px; }

.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.btn-new {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border: none;
  border-radius: 7px;
  padding: 9px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.form-link {
  text-align: center;
  margin-top: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.alert-error { background: rgba(255,61,90,0.1); border: 1px solid rgba(255,61,90,0.3); color: var(--red); }
.alert-success { background: rgba(0,255,157,0.08); border: 1px solid rgba(0,255,157,0.25); color: var(--green); }
.alert-info { background: rgba(0,212,255,0.06); border: 1px solid rgba(0,212,255,0.2); color: var(--accent); }

/* ===== PAGE STRUCTURE ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 26px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title-text { font-size: 1.2rem; font-weight: 700; color: var(--text-bright); }
.page-subtitle { font-family: 'JetBrains Mono', monospace; font-size: 0.63rem; color: var(--text-dim); margin-top: 3px; }

/* ===== STATS ===== */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-card.blue::before { background: var(--accent); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.green::before { background: var(--green); }
.stat-card.red::before { background: var(--red); }
.stat-card.gray::before { background: var(--text-dim); }

.stat-value { font-family: 'JetBrains Mono', monospace; font-size: 1.9rem; font-weight: 700; color: var(--text-bright); line-height: 1; }
.stat-card.blue .stat-value { color: var(--accent); }
.stat-card.orange .stat-value { color: var(--orange); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.red .stat-value { color: var(--red); }
.stat-label { font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }

/* ===== TICKET LIST ===== */
.ticket-list { display: flex; flex-direction: column; gap: 8px; }

.ticket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 70px 1fr auto auto;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, background 0.15s;
  text-decoration: none;
  color: inherit;
}

.ticket-card:hover { border-color: var(--accent); background: rgba(0,212,255,0.02); text-decoration: none; }
.ticket-card.urgente { border-left: 3px solid var(--red); }
.ticket-card.alta { border-left: 3px solid var(--orange); }
.ticket-card.media { border-left: 3px solid var(--yellow); }
.ticket-card.bassa { border-left: 3px solid var(--text-dim); }

.ticket-id { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--accent); }
.ticket-title-text { font-size: 0.87rem; color: var(--text-bright); font-weight: 600; line-height: 1.3; }
.ticket-sub { font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; color: var(--text-dim); margin-top: 3px; }
.ticket-date { font-family: 'JetBrains Mono', monospace; font-size: 0.63rem; color: var(--text-dim); white-space: nowrap; }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-aperto { background: rgba(255,140,0,0.12); color: var(--orange); border: 1px solid rgba(255,140,0,0.3); }
.badge-in_lavorazione { background: rgba(0,212,255,0.1); color: var(--accent); border: 1px solid rgba(0,212,255,0.25); }
.badge-risolto { background: rgba(0,255,157,0.08); color: var(--green); border: 1px solid rgba(0,255,157,0.22); }
.badge-chiuso { background: rgba(90,122,154,0.12); color: var(--text-dim); border: 1px solid var(--border); }
.badge-urgente { background: rgba(255,61,90,0.1); color: var(--red); border: 1px solid rgba(255,61,90,0.25); }

/* ===== CHAT ===== */
.ticket-detail { display: grid; grid-template-columns: 1fr 270px; gap: 18px; }

.chat-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
  min-height: 400px;
  max-height: 700px;
}

.chat-header-bar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.chat-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.message { display: flex; gap: 9px; align-items: flex-start; }
.message.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700;
}

.msg-av-user { background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #fff; }
.msg-av-claudia { background: linear-gradient(135deg, #00b4d8, #00ff9d); color: #080c10; }
.msg-av-admin { background: linear-gradient(135deg, #ff8c00, #ff3d5a); color: #fff; }

.msg-content { max-width: 74%; }
.message.user .msg-content { align-items: flex-end; display: flex; flex-direction: column; }

.msg-bubble {
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 0.84rem;
  line-height: 1.55;
  word-break: break-word;
}

.msg-bubble.user { background: linear-gradient(135deg, rgba(0,102,255,0.25), rgba(0,212,255,0.15)); border: 1px solid rgba(0,212,255,0.2); color: var(--text-bright); border-top-right-radius: 4px; }
.msg-bubble.claudia { background: rgba(0,255,157,0.05); border: 1px solid rgba(0,255,157,0.15); color: var(--text); border-top-left-radius: 4px; }
.msg-bubble.admin { background: rgba(255,140,0,0.05); border: 1px solid rgba(255,140,0,0.15); color: var(--text); border-top-left-radius: 4px; }

.msg-meta { font-family: 'JetBrains Mono', monospace; font-size: 0.58rem; color: var(--text-dim); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.claudia-tag { background: rgba(0,255,157,0.12); color: var(--green); border-radius: 4px; padding: 1px 5px; font-size: 0.55rem; border: 1px solid rgba(0,255,157,0.2); }

.chat-input-bar {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  align-items: flex-end;
  flex-shrink: 0;
}

.chat-input-box {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 13px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text);
  outline: none;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.4;
}

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

.send-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  width: 42px; height: 42px;
  color: var(--bg);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s;
  flex-shrink: 0;
  font-weight: 700;
}

.send-btn:hover { opacity: 0.85; }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.typing-indicator {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 4px 18px 6px;
  flex-shrink: 0;
}

.typing-indicator.show { display: flex; }
.typing-dots { display: flex; gap: 3px; align-items: center; }
.typing-dots span {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

/* ===== TICKET INFO PANEL ===== */
.ticket-info-panel { display: flex; flex-direction: column; gap: 12px; }

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px;
}

.info-card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; font-size: 0.8rem; gap: 8px; }
.info-row:last-child { margin-bottom: 0; }
.info-key { color: var(--text-dim); font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; flex-shrink: 0; }
.info-val { color: var(--text-bright); font-weight: 600; text-align: right; font-size: 0.8rem; }

.priority-badge { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; display: flex; align-items: center; gap: 4px; }
.priority-badge::before { content: '●'; font-size: 0.48rem; }
.priority-badge.urgente { color: var(--red); }
.priority-badge.alta { color: var(--orange); }
.priority-badge.media { color: var(--yellow); }
.priority-badge.bassa { color: var(--green); }

/* ===== ADMIN TABLE ===== */
.data-table { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }

.table-head {
  background: var(--bg);
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 70px 1fr 130px 95px 85px 75px 85px;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}

.table-row-item {
  padding: 11px 16px;
  display: grid;
  grid-template-columns: 70px 1fr 130px 95px 85px 75px 85px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  transition: background 0.1s;
}

.table-row-item:last-child { border-bottom: none; }
.table-row-item:hover { background: rgba(0,212,255,0.02); }

.btn-mini {
  padding: 4px 11px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-mini:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-mini.danger { border-color: rgba(255,61,90,0.3); color: var(--red); }
.btn-mini.danger:hover { background: rgba(255,61,90,0.08); }

/* ===== PROFILE PAGE ===== */
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.profile-card-header {
  background: var(--surface2);
  padding: 28px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.profile-card-body { padding: 20px 24px; }

.profile-stat-row { display: flex; flex-direction: column; gap: 10px; }

.profile-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.profile-stat-label { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--text-dim); }
.profile-stat-value { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; font-weight: 600; }

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 16px;
}

.section-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.danger-zone {
  background: rgba(255,61,90,0.04);
  border: 1px solid rgba(255,61,90,0.2);
  border-radius: 12px;
  padding: 20px 24px;
}

.danger-zone .section-card-title { color: var(--red); border-color: rgba(255,61,90,0.2); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

.empty-state .icon { font-size: 2.5rem; margin-bottom: 14px; }
.empty-state p { margin-bottom: 20px; line-height: 1.6; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .table-head, .table-row-item { grid-template-columns: 60px 1fr 100px 70px 70px; }
  .table-head > *:nth-child(6), .table-head > *:nth-child(7),
  .table-row-item > *:nth-child(6), .table-row-item > *:nth-child(7) { display: none; }
  .profile-grid { grid-template-columns: 240px 1fr; }
}

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

  .mobile-topbar { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
    top: 0;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content {
    margin-left: 0;
    padding: 76px 16px 24px;
  }

  .ticket-detail { grid-template-columns: 1fr; }
  .ticket-info-panel { display: none; }

  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 32px 24px; }

  .stats-row { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }

  .profile-grid { grid-template-columns: 1fr; }

  .ticket-card { grid-template-columns: 60px 1fr auto; }
  .ticket-date { display: none; }

  .table-head, .table-row-item { grid-template-columns: 55px 1fr 65px 75px; }
  .table-head > *:nth-child(n+4), .table-row-item > *:nth-child(n+4) { display: none; }
  .table-head > *:nth-child(6), .table-row-item > *:nth-child(6) { display: block; }

  .page-header { gap: 10px; }
  .chat-area { height: calc(100vh - 200px); }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 70px 12px 20px; }
  .section-card { padding: 16px; }
  .profile-card-body { padding: 16px; }
}
