/* ========== Zapret Dark Blue Theme ========== */
:root {
  --bg: #060b18;
  --bg-secondary: #0c1324;
  --bg-tertiary: #111a30;
  --bg-card: #0e1629;
  --bg-card-hover: #121e38;
  --border: #1a2744;
  --border-glow: #1e3a6e;
  --text: #e4eaf5;
  --text-muted: #6b7fa3;
  --text-link: #4da3ff;
  --accent: #0074e8;
  --accent-hover: #1a8cff;
  --accent-glow: rgba(0, 116, 232, .25);
  --danger: #e8364d;
  --danger-glow: rgba(232, 54, 77, .2);
  --warning: #e8a817;
  --info: #4da3ff;
  --purple: #7c5ce0;
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, .2);
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 2px 8px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  --shadow-glow: 0 0 20px rgba(0, 116, 232, .15);
  --transition: .2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, Consolas, monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 100, 220, .12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(0, 80, 180, .06) 0%, transparent 60%);
  background-attachment: fixed;
}

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

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .15); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.08) transparent; }

/* ========== Header ========== */
.header {
  background: rgba(8, 14, 30, .85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.3px;
}

.logo svg { width: 28px; height: 28px; color: var(--accent); }
.logo:hover { text-decoration: none; }

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0074e8, #4da3ff);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 116, 232, .4);
}

.nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover { color: var(--text); background: rgba(77, 163, 255, .08); }
.nav-btn.active {
  color: var(--info);
  background: rgba(77, 163, 255, .1);
  border-color: rgba(77, 163, 255, .25);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-glow);
}

.user-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0074e8, #4da3ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
}

.admin-badge {
  background: linear-gradient(135deg, #7c5ce0, #a78bfa);
  color: white;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:hover { background: var(--bg-card-hover); border-color: var(--border-glow); }

.btn-primary {
  background: linear-gradient(135deg, #0066cc, #0088ff);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 12px rgba(0, 116, 232, .3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0077ee, #1a9aff);
  box-shadow: 0 4px 20px rgba(0, 116, 232, .4);
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: white; box-shadow: 0 4px 16px var(--danger-glow); }

.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 16px; }
.btn-icon { padding: 6px; border: none; background: none; color: var(--text-muted); cursor: pointer; }
.btn-icon:hover { color: var(--text); }

/* ========== Main Layout ========== */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
}

/* ========== Login Page ========== */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  text-align: center;
  gap: 28px;
}

.login-page h1 {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, #4da3ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-page > p { color: var(--text-muted); font-size: 16px; max-width: 500px; line-height: 1.7; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.login-card h2 {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 700;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 14px;
}

.tg-login-btn {
  background: linear-gradient(135deg, #0088cc, #00aaee);
  color: white;
  border: none;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 136, 204, .35);
}

.tg-login-btn:hover {
  background: linear-gradient(135deg, #0099dd, #00bbff);
  box-shadow: 0 6px 28px rgba(0, 136, 204, .5);
  transform: translateY(-2px);
}

.tg-login-btn svg { width: 24px; height: 24px; }

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-glow); transform: translateY(-2px); }

.stat-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 500;
}

.stat-card.open::before { background: linear-gradient(90deg, #22c55e, transparent); }
.stat-card.open .stat-value { color: var(--green); }

.stat-card.progress::before { background: linear-gradient(90deg, var(--warning), transparent); }
.stat-card.progress .stat-value { color: var(--warning); }

.stat-card.closed::before { background: linear-gradient(90deg, var(--text-muted), transparent); }
.stat-card.closed .stat-value { color: var(--text-muted); }

.stat-card.bugs::before { background: linear-gradient(90deg, var(--danger), transparent); }
.stat-card.bugs .stat-value { color: var(--danger); }

.stat-card.ideas::before { background: linear-gradient(90deg, var(--info), transparent); }
.stat-card.ideas .stat-value { color: var(--info); }

/* ========== Toolbar ========== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
}

.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ========== Ticket List ========== */
.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ticket-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
}

.ticket-row:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.ticket-type-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* Legacy type icon colors (used as fallback if no dynamic color) */
.ticket-type-icon.bug { background: linear-gradient(135deg, #d92948, #e8364d); }
.ticket-type-icon.idea { background: linear-gradient(135deg, #0074e8, #4da3ff); }
.ticket-type-icon.feature { background: linear-gradient(135deg, #16a34a, #22c55e); }
.ticket-type-icon.improvement { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }

.ticket-info { min-width: 0; }

.ticket-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ticket-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.ticket-id {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.ticket-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.tag {
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid;
  white-space: nowrap;
}

.ticket-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.ticket-status {
  padding: 3px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .2px;
}

.status-open { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.status-in_progress { background: rgba(232,168,23,.12); color: #f0b429; border: 1px solid rgba(232,168,23,.3); }
.status-review { background: rgba(139,92,246,.12); color: #a78bfa; border: 1px solid rgba(139,92,246,.3); }
.status-testing { background: rgba(77,163,255,.12); color: #6db8ff; border: 1px solid rgba(77,163,255,.3); }
.status-closed { background: rgba(107,127,163,.12); color: #8fa4c4; border: 1px solid rgba(107,127,163,.3); }
.status-rejected { background: rgba(232,54,77,.12); color: #f87171; border: 1px solid rgba(232,54,77,.3); }
.status-duplicate { background: rgba(107,127,163,.12); color: #8fa4c4; border: 1px solid rgba(107,127,163,.3); }

.priority-badge {
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
}

.priority-low { background: rgba(107,127,163,.15); color: #8fa4c4; }
.priority-medium { background: rgba(77,163,255,.12); color: #6db8ff; }
.priority-high { background: rgba(232,168,23,.12); color: #f0b429; }
.priority-critical { background: rgba(232,54,77,.15); color: #f87171; }

.vote-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: var(--transition);
}

.vote-btn:hover { border-color: var(--accent); color: var(--info); }
.vote-btn.voted { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.whale-emoji {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.3s ease;
}
.vote-btn:hover .whale-emoji {
  transform: scale(1.25);
}
.vote-btn.voted .whale-emoji {
  transform: scale(1.15);
  filter: drop-shadow(0 0 3px var(--accent));
}

.message-count {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.private-icon { color: var(--warning); font-size: 14px; }

/* ========== Kanban Board ========== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  overflow-x: auto;
  min-height: calc(100vh - 300px);
}

.kanban-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-width: 250px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.kanban-count {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}

.kanban-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.kanban-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #fff;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* ========== Ticket Detail ========== */
.ticket-detail { max-width: 960px; margin: 0 auto; }

.ticket-header { margin-bottom: 28px; }

.ticket-header h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #fff;
}

.ticket-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
}

.ticket-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}

.ticket-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.ticket-description-wrap {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.ticket-description-wrap .message-avatar { flex-shrink: 0; }
.ticket-description-body { flex: 1; min-width: 0; }
.ticket-description-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ticket-description {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ticket-description p { margin-bottom: 12px; }
.ticket-description code {
  background: var(--bg-tertiary);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--info);
}
.ticket-description pre {
  background: var(--bg-tertiary);
  padding: 14px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.ticket-description pre code { padding: 0; }

.ticket-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.sidebar-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 600;
}

.sidebar-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(26, 39, 68, .5);
}

.sidebar-field:last-child { border-bottom: none; }
.sidebar-field label { color: var(--text-muted); }

.sidebar-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
}

/* ========== Messages / Chat ========== */
.messages-section { margin-top: 28px; }

.messages-section h2 {
  font-size: 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.message {
  display: flex;
  gap: 12px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

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

.message.system {
  background: transparent;
  border: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-muted);
  padding: 10px 18px;
  font-style: italic;
}

.message-avatar { flex-shrink: 0; }
.message-body { flex: 1; min-width: 0; }

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.message-author { font-weight: 600; font-size: 14px; color: #fff; }
.message-date { font-size: 12px; color: var(--text-muted); }

.message-content {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.attachment {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-link);
  transition: var(--transition);
}

.attachment:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 0 8px var(--accent-glow); }

.attachment-preview {
  width: 200px;
  height: 150px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: zoom-in;
  display: inline-block;
}

/* ========== Message Actions ========== */
.message-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity .15s;
}

.message:hover .message-actions { opacity: 1; }

.msg-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.msg-action-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text);
}

.msg-delete-btn:hover {
  color: var(--danger);
  border-color: rgba(232, 54, 77, .3);
  background: rgba(232, 54, 77, .08);
}

.message-edit-textarea {
  width: 100%;
  min-height: 60px;
  background: var(--bg-tertiary);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  resize: vertical;
  box-shadow: 0 0 0 3px var(--accent-glow);
  margin-top: 4px;
}

.message-edit-textarea:focus { outline: none; }

.message-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* ========== Message Reactions ========== */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.message-reactions:empty {
  display: none;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.4;
}

.reaction-btn:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: scale(1.05);
}

.reaction-btn.reacted {
  border-color: var(--accent);
  background: rgba(0, 116, 232, .12);
  color: var(--info);
}

.reaction-count {
  font-size: 12px;
  font-weight: 600;
}

/* ========== Reaction Picker ========== */
.reaction-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(0, 116, 232, .1);
  max-width: 260px;
  animation: reactionPickerIn .15s ease;
}

@keyframes reactionPickerIn {
  from { opacity: 0; transform: translateY(-4px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.reaction-picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: none;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.reaction-picker-btn:hover {
  background: var(--bg-card-hover);
  transform: scale(1.2);
}

/* ========== Message Form ========== */
.message-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.message-form:focus-within { border-color: var(--border-glow); box-shadow: 0 0 0 3px var(--accent-glow); }

.message-textarea {
  width: 100%;
  min-height: 110px;
  background: transparent;
  border: none;
  padding: 18px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  resize: vertical;
}

.message-textarea:focus { outline: none; }
.message-textarea::placeholder { color: var(--text-muted); }

.message-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.15);
}

.file-upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: var(--transition);
}

.file-upload-btn:hover { color: var(--info); border-color: var(--accent); }

.file-preview-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 18px;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--info);
}

.file-preview-item .remove-file {
  cursor: pointer;
  color: var(--danger);
  font-weight: 700;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 8, 16, .75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 116, 232, .1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 18px; color: #fff; }

.modal-body { padding: 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.1);
}

/* ========== Form ========== */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.form-textarea { min-height: 120px; resize: vertical; }

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

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.tags-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-option {
  padding: 5px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.tag-option:hover { border-color: var(--border-glow); background: rgba(77,163,255,.05); }
.tag-option.selected { border-color: currentColor; background: rgba(77,163,255,.12); }

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
}

.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: .4; color: var(--accent); }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: #fff; }
.empty-state p { font-size: 14px; }

/* ========== Loading ========== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Back Button ========== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  transition: var(--transition);
}

.back-btn:hover { color: var(--info); }

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

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

.toast {
  padding: 14px 22px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
  max-width: 400px;
  backdrop-filter: blur(8px);
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

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

/* ========== Ticket detail attachments ========== */
.ticket-attachments {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ========== Tab switch ========== */
.view-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}

.view-tab {
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.view-tab:hover { color: var(--text); }
.view-tab.active { background: var(--accent); color: white; }

/* ========== Telegram WebApp adjustments ========== */
body.tg-webapp .header { padding-top: 8px; }
body.tg-webapp #logout-btn { display: none; } /* can't logout inside webapp */

/* ========== Secondary Toolbar ========== */
.toolbar-secondary {
  margin-top: -10px;
}

/* ========== Ticket Groups ========== */
.ticket-group { margin-bottom: 20px; }
.ticket-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.ticket-group-label {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}
.ticket-group-count {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== Resource View ========== */
.resource-view { max-width: 960px; margin: 0 auto; }
.resource-view-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 18px;
}

/* ========== Request Type Chooser ========== */
.request-type-chooser {
  max-width: 820px;
  margin: 0 auto;
  padding: 12px 0;
}

.request-type-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.request-type-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.request-type-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.request-type-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.request-type-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.request-type-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.request-type-example {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 8px 12px;
  line-height: 1.5;
}

.request-type-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  align-self: flex-start;
}

/* ========== Info Boxes ========== */
.info-box {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
}

.info-box-blue {
  background: rgba(77, 163, 255, .08);
  border: 1px solid rgba(77, 163, 255, .2);
  color: #93c5fd;
}

.info-box-amber {
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .2);
  color: #fcd34d;
}

/* ========== About View ========== */
.about-view {
  max-width: 720px;
  margin: 0 auto;
}

.about-header {
  text-align: center;
  margin-bottom: 32px;
}

.about-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.about-header p {
  color: var(--text-muted);
  font-size: 15px;
}

.about-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
}

.about-link-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
  color: var(--text);
}

.about-link-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.about-link-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.about-link-info p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ========== Online Badge in Nav ========== */
.online-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.nav-btn .online-badge {
  margin-left: 2px;
}

/* ========== Online Users View ========== */
.online-view,
.users-view {
  max-width: 960px;
  margin: 0 auto;
}

.online-header {
  margin-bottom: 20px;
}

.online-header h2 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.online-total-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* ========== Online Users Grid ========== */
.online-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}

.online-user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: var(--transition);
}

.online-user-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
}

.online-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.online-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.online-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green);
}

.online-user-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0074e8, #4da3ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  border: 2px solid var(--green);
}

.online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 6px var(--green-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 4px var(--green-glow); }
  50% { box-shadow: 0 0 10px rgba(34, 197, 94, .5); }
}

.online-user-details {
  flex: 1;
  min-width: 0;
}

.online-user-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.online-user-username {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 13px;
}

.online-user-location {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.admin-real-line {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.online-ticket-link {
  color: var(--text-link);
  cursor: pointer;
}
.online-ticket-link:hover {
  text-decoration: underline;
}

/* ========== Users List ========== */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.user-list-row:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.user-list-row.is-online {
  border-left: 3px solid var(--green);
}

.user-list-info {
  flex: 1;
  min-width: 0;
}

.user-list-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.user-list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.user-status-online {
  color: var(--green);
  font-weight: 600;
}

.user-status-offline {
  color: var(--text-muted);
}

.user-current-location {
  color: var(--text-muted);
  font-style: italic;
}

.user-list-date {
  color: var(--text-muted);
}

/* ========== New Messages Badge ========== */
.new-messages-badge {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: opacity 0.2s, transform 0.2s;
  animation: badge-appear 0.3s ease;
}
.new-messages-badge:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
@keyframes badge-appear {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== Typing Indicator ========== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-top: 6px;
  margin-bottom: 2px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  animation: typingFadeIn .25s ease;
}

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

.typing-avatars {
  display: flex;
  flex-shrink: 0;
}

.typing-avatars > * {
  margin-left: -6px;
}
.typing-avatars > *:first-child {
  margin-left: 0;
}

.typing-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-card);
}

.typing-avatar-placeholder {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0074e8, #4da3ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: white;
  border: 2px solid var(--bg-card);
}

.typing-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 13px;
  color: var(--text-muted);
}

.typing-main {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.typing-dots {
  display: inline-flex;
  gap: 1px;
  margin-left: 2px;
}

.typing-dots span {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--info);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: .2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .3; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* ========== Ticket Readers Indicator ========== */
.reading-indicator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.reading-label {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.reading-avatars {
  display: flex;
  flex-shrink: 0;
}

.reading-avatars > * {
  margin-left: -6px;
}

.reading-avatars > *:first-child {
  margin-left: 0;
}

.reading-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg);
}

.reading-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0074e8, #4da3ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  color: white;
  border: 2px solid var(--bg);
}

.reading-more {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ========== Settings View ========== */
.settings-view {
  max-width: 960px;
  margin: 0 auto;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}

.settings-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 700;
}

.settings-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.settings-profile-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.settings-avatar-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.settings-avatar-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0074e8, #4da3ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 34px;
  color: white;
  border: 2px solid var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.settings-avatar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(26, 39, 68, .5);
  background: rgba(0,0,0,.12);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}

.settings-toggle:hover {
  border-color: var(--border-glow);
  background: rgba(77, 163, 255, .06);
}

.settings-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle-slider {
  width: 44px;
  height: 24px;
  border-radius: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.3);
}

.settings-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6b7fa3, #93a6c6);
  transition: transform .18s ease, background .18s ease;
}

.settings-toggle input:checked + .settings-toggle-slider {
  background: rgba(34, 197, 94, .15);
  border-color: rgba(34, 197, 94, .35);
}

.settings-toggle input:checked + .settings-toggle-slider::after {
  transform: translateX(20px);
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.settings-toggle-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

@media (max-width: 768px) {
  .settings-section { padding: 16px; }
}

/* ========== Type Badge ========== */
.type-badge {
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* ========== Admin Panel ========== */
.admin-view {
  max-width: 960px;
  margin: 0 auto;
}

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 18px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-section-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.admin-types-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-type-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.admin-type-row:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.admin-type-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.admin-type-emoji {
  font-size: 22px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.admin-type-name {
  font-weight: 600;
  font-size: 15px;
}

.admin-type-key {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.admin-type-color-preview {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.admin-type-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-nav-btn {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 8px;
}

.admin-nav-btn.active {
  color: #a78bfa;
  background: rgba(139, 92, 246, .1);
  border-color: rgba(139, 92, 246, .25);
}

/* ========== Hamburger Menu ========== */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 110;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-extra { display: none; }
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
.mobile-nav-overlay.open { display: block; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: repeat(3, 1fr); }
  .ticket-body { grid-template-columns: 1fr; }

  .header { padding: 10px 16px; gap: 8px; }
  .main { padding: 16px; }
  .ticket-row { grid-template-columns: auto 1fr auto; }
  .ticket-row .ticket-status,
  .ticket-row .priority-badge,
  .ticket-row .message-count { display: none; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .form-row { grid-template-columns: 1fr; }

  /* Hamburger visible */
  .hamburger-btn { display: flex; }

  /* Hide desktop elements */
  .header-right { display: none; }
  .logo-text { display: none; }

  /* Mobile nav */
  .nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    flex-direction: column;
    padding: 60px 16px 20px;
    gap: 4px;
    z-index: 101;
    transition: left .25s ease;
    overflow-y: auto;
  }
  .nav.open { left: 0; }

  .nav .nav-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border-radius: var(--radius);
  }

  .mobile-nav-extra {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }

  .resource-view-tabs { flex-direction: column; }
  .request-type-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .kanban-board { grid-template-columns: 1fr; }
  .online-users-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 28px 20px; }
}

/* ========== Image Lightbox ========== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  cursor: default;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
  padding: 4px 10px;
}

.lightbox-close:hover {
  opacity: 1;
}
