/* City-IT – Main Game Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0f1a;
  --surface:  #111827;
  --surface2: #1a2235;
  --border:   #1f2937;
  --border2:  #2d3748;
  --text:     #f1f5f9;
  --muted:    #94a3b8;
  --muted2:   #64748b;
  --accent:   #0ea5e9;
  --accent2:  #6366f1;
  --green:    #22c55e;
  --yellow:   #eab308;
  --orange:   #f97316;
  --red:      #ef4444;
  --radius:   10px;
  --sidebar-w: 220px;
  --header-h:  56px;
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); height: 100dvh; overflow: hidden; }

/* ─── HEADER ─────────────────────────────────────── */
#app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 16px; z-index: 100;
}
.hdr-accent { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.hdr-logo-btn { background: none; border: none; cursor: pointer; font-size: 22px; font-weight: 800; letter-spacing: -.5px; padding: 0; }
.logo-city { color: var(--accent); }
.logo-it   { color: var(--text); }
.hdr-stats { display: flex; gap: 8px; flex: 1; }
.hstat-pill { display: flex; align-items: center; gap: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: 100px; padding: 4px 12px; font-size: 13px; }
.hstat-icon { font-size: 14px; }
.hstat-val  { font-weight: 700; color: var(--text); }
.hstat-lbl  { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.hstat-money .hstat-val { color: #4ade80; }
.hstat-rep .hstat-val   { color: var(--yellow); }
.hstat-level .hstat-val { color: var(--accent); }
.hstat-xp .hstat-val    { color: var(--accent2); }
.hdr-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
#hdr-user-info { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.hdr-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; }
.hdr-avatar img { width: 100%; height: 100%; }
.hdr-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 14px; transition: all .2s; }
.hdr-btn:hover { background: var(--border); color: var(--text); }

/* ─── SIDEBAR ─────────────────────────────────────── */
#sidebar {
  position: fixed; left: 0; top: var(--header-h); bottom: 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 8px; overflow-y: auto; z-index: 90;
}
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  text-align: left; width: 100%; position: relative; transition: all .15s;
}
.nav-btn:hover { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: rgba(14,165,233,.15); color: var(--accent); font-weight: 700; }
.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.nav-badge { position: absolute; right: 10px; background: var(--red); color: #fff; border-radius: 100px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.hidden { display: none !important; }

/* ─── MAIN CONTENT ───────────────────────────────── */
#main-content { position: fixed; left: var(--sidebar-w); top: var(--header-h); right: 0; bottom: 0; overflow-y: auto; }
.panel { display: none; min-height: 100%; }
.panel.active { display: block; }
.panel-inner { padding: 24px; max-width: 1200px; }
.panel-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.panel-title { font-size: 22px; font-weight: 700; }
.panel-sub   { color: var(--muted); font-size: 14px; }
.panel-actions { display: flex; gap: 8px; margin-left: auto; }
.panel-actions select { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }

/* ─── CITY MAP ────────────────────────────────────── */
/* ─── LEAFLET MAP PANEL ───────────────────────────── */
#panel-map { padding: 0; position: relative; overflow: hidden; }
#panel-map.active { display: block !important; height: 100%; overflow: hidden; }
#leaflet-map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* ─── Map HUD (stats overlay, top-left) ──────────── */
.map-hud {
  position: absolute; top: 16px; left: 16px; z-index: 1000;
  background: rgba(10, 14, 26, 0.88); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.mhud-title { font-size: 13px; font-weight: 700; color: #e2e8f0; margin-bottom: 10px; letter-spacing: .5px; }
.mhud-stats { display: flex; gap: 16px; }
.mhud-item { text-align: center; }
.mhud-item span { display: block; font-size: 22px; font-weight: 800; color: #7dd3fc; line-height: 1; }
.mhud-lbl { font-size: 10px; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .5px; }
.mhud-ip  span { color: #86efac; }
.mhud-crit span { color: #fca5a5; }

/* ─── District sidebar (slides in from right) ─────── */
.map-sidebar {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 1100;
  width: 320px; background: rgba(10, 14, 26, 0.97); backdrop-filter: blur(12px);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s ease;
  box-shadow: -4px 0 24px rgba(0,0,0,.5);
}
.map-sidebar.open { transform: translateX(0); }
.msb-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.msb-dist-icon { font-size: 28px; }
.msb-dist-info { flex: 1; min-width: 0; }
.msb-name  { font-size: 16px; font-weight: 700; color: #f1f5f9; }
.msb-count { font-size: 12px; color: var(--muted); margin-top: 2px; }
.msb-close {
  background: none; border: 1px solid var(--border); color: var(--muted);
  width: 30px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all .15s;
}
.msb-close:hover { border-color: var(--accent); color: #f1f5f9; }
.msb-tickets-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msb-empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 13px; }

/* ─── Sidebar ticket cards ───────────────────────── */
.msbt-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; cursor: pointer; transition: all .15s;
}
.msbt-card:hover { border-color: var(--accent); background: var(--surface2); }
.msbt-card.prio-critical { border-left: 3px solid var(--red); }
.msbt-card.prio-high     { border-left: 3px solid var(--orange); }
.msbt-card.prio-medium   { border-left: 3px solid var(--yellow); }
.msbt-card.prio-low      { border-left: 3px solid var(--green); }
.msbt-top  { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.msbt-ref  { font-size: 11px; color: var(--muted); font-weight: 600; flex: 1; }
.msbt-reward { font-size: 12px; font-weight: 700; color: #86efac; }
.msbt-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #f1f5f9; }
.msbt-cust  { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.msbt-meta  { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.msbt-sla   { font-size: 11px; }

/* ─── Customer pin markers ───────────────────────── */
.cmap-pin {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(15, 20, 35, 0.92);
  border: 2px solid #475569;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.cmap-pin:hover { transform: scale(1.2); box-shadow: 0 4px 16px rgba(0,0,0,.6); }
.cmap-pin.has-t {
  border-color: var(--mc, #0ea5e9);
  box-shadow: 0 0 0 2px rgba(14,165,233,.3), 0 2px 10px rgba(0,0,0,.5);
  animation: pin-pulse 2.5s ease-in-out infinite;
}
@keyframes pin-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(14,165,233,.25), 0 2px 8px rgba(0,0,0,.5); }
  50%       { box-shadow: 0 0 0 7px rgba(14,165,233,.08), 0 2px 8px rgba(0,0,0,.5); }
}
.cmp-em { font-size: 16px; line-height: 1; }
.cmp-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--mc, #0ea5e9); color: #fff;
  border-radius: 100px; padding: 1px 5px;
  font-size: 10px; font-weight: 800;
  border: 1.5px solid #0a0f1a; line-height: 1.4;
}

/* ─── District name labels on map ────────────────── */
.dist-map-label { pointer-events: none; }
.dml-inner {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 700; color: rgba(241,245,249,.75);
  text-shadow: 0 1px 4px rgba(0,0,0,.8), 0 0 8px rgba(0,0,0,.6);
  white-space: nowrap; letter-spacing: .3px;
  background: rgba(10,14,26,.5); backdrop-filter: blur(4px);
  border-radius: 6px; padding: 4px 8px;
}
.dml-inner span:first-child { font-size: 16px; }

/* ─── TICKET CARD ─────────────────────────────────── */
#ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: all .15s; display: flex; gap: 16px; align-items: flex-start;
}
.ticket-card:hover { border-color: var(--accent); background: var(--surface2); }
.ticket-card.prio-critical { border-left: 3px solid var(--red); }
.ticket-card.prio-high     { border-left: 3px solid var(--orange); }
.ticket-card.prio-medium   { border-left: 3px solid var(--yellow); }
.ticket-card.prio-low      { border-left: 3px solid var(--green); }
.ticket-card.status-in_progress { background: rgba(14,165,233,.05); }
.tc-left { flex: 1; }
.tc-ref  { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.tc-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.tc-customer { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.tc-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-badge { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.tk-badge.prio-critical { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.tk-badge.prio-high     { background: rgba(249,115,22,.15); color: #fdba74; border: 1px solid rgba(249,115,22,.3); }
.tk-badge.prio-medium   { background: rgba(234,179,8,.15); color: #fde047; border: 1px solid rgba(234,179,8,.3); }
.tk-badge.prio-low      { background: rgba(34,197,94,.15); color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.tk-cat     { background: rgba(99,102,241,.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,.3); }
.tk-district { background: rgba(14,165,233,.1); color: #7dd3fc; border: 1px solid rgba(14,165,233,.2); }
.tk-onsite  { background: rgba(249,115,22,.15); color: #fdba74; border: 1px solid rgba(249,115,22,.3); }
.tk-remote  { background: rgba(34,197,94,.15); color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.tc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 80px; }
.tc-reward { font-size: 13px; font-weight: 700; color: #4ade80; }
.tc-sla-mini { font-size: 11px; color: var(--muted); }
.sla-critical { color: var(--red) !important; }
.sla-warning  { color: var(--yellow) !important; }

/* ─── TICKET MODAL ───────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal-box { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 680px; max-height: 90dvh; overflow-y: auto; z-index: 1; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 0; border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 0; }
.modal-ref   { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.modal-title { font-size: 20px; font-weight: 700; }
.modal-close { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.modal-body  { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.ticket-meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 12px; background: var(--surface2); border-radius: var(--radius); padding: 16px; }
.tk-info-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.tk-info-val { font-size: 14px; font-weight: 600; }
.tk-desc-box { background: var(--surface2); border-radius: var(--radius); padding: 16px; }
.tk-desc-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.tk-desc     { font-size: 14px; line-height: 1.6; color: var(--text); }
.sla-bar-wrap { }
.sla-bar-lbl { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
.sla-bar-bg  { background: var(--border); border-radius: 100px; height: 8px; overflow: hidden; }
.sla-bar-fill { height: 100%; border-radius: 100px; background: var(--green); transition: width .5s, background .5s; }
.tk-sol-lbl  { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.solution-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sol-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 12px 16px; border-radius: var(--radius); cursor: pointer; font-size: 14px; text-align: left; transition: all .15s; }
.sol-btn:hover { border-color: var(--accent); background: rgba(14,165,233,.08); }
.sol-btn.correct { border-color: var(--green); background: rgba(34,197,94,.1); color: #86efac; }
.sol-btn.wrong   { border-color: var(--red); background: rgba(239,68,68,.1); color: #fca5a5; }
.tk-feedback { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600; }
.tk-feedback.ok  { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.tk-feedback.err { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.tk-closed-info { padding: 12px 16px; background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); border-radius: var(--radius); color: #86efac; font-weight: 600; }

/* ─── REMOTE TERMINAL ─────────────────────────────── */
.remote-info { color: var(--muted); font-size: 15px; padding: 32px; text-align: center; background: var(--surface2); border-radius: var(--radius); border: 1px solid var(--border); }
.terminal { background: #0d1117; border: 1px solid #30363d; border-radius: var(--radius); overflow: hidden; font-family: 'Courier New', Courier, monospace; }
.terminal-bar { background: #21262d; padding: 10px 14px; display: flex; align-items: center; gap: 6px; }
.terminal-dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }
.terminal-title { margin-left: 8px; font-size: 13px; color: #8b949e; flex: 1; text-align: center; }
.terminal-body { padding: 16px; min-height: 300px; max-height: 500px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #e6edf3; }
.term-line { margin-bottom: 2px; }
.term-line.cmd   { color: #79c0ff; }
.term-line.out   { color: #e6edf3; }
.term-line.err   { color: #ff7b72; }
.term-line.ok    { color: #56d364; }
.term-line.info  { color: #e3b341; }
.terminal-input-row { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid #30363d; background: #161b22; }
.terminal-prompt { color: #56d364; font-size: 14px; font-family: inherit; }
.terminal-input  { flex: 1; background: none; border: none; color: #e6edf3; font-family: inherit; font-size: 14px; outline: none; }

/* ─── SHOP ─────────────────────────────────────────── */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; }
.shop-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.shop-item-icon  { font-size: 32px; }
.shop-item-name  { font-size: 16px; font-weight: 700; }
.shop-item-desc  { font-size: 13px; color: var(--muted); line-height: 1.5; }
.shop-item-price { font-size: 18px; font-weight: 700; color: #4ade80; }
.shop-item-effect { font-size: 12px; color: var(--accent); }
.btn-buy { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; color: #fff; padding: 10px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; transition: opacity .2s; }
.btn-buy:hover { opacity: .85; }
.btn-buy:disabled { opacity: .4; cursor: not-allowed; }
.shop-msg { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.shop-msg.ok  { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.shop-msg.err { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }

/* ─── PROFILE ──────────────────────────────────────── */
.profile-card { display: flex; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.prof-avatar  { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.prof-name    { font-size: 20px; font-weight: 700; }
.prof-muted   { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat-grid    { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card    { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-card-val { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-card-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; }
.skills-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.skills-title  { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.skill-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.skill-name    { font-size: 13px; width: 100px; }
.skill-bar-bg  { flex: 1; background: var(--border); border-radius: 100px; height: 8px; overflow: hidden; }
.skill-bar-fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s; }
.skill-val     { font-size: 13px; font-weight: 700; width: 24px; text-align: right; }
.xp-section    { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.xp-label      { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.xp-bar-bg     { background: var(--border); border-radius: 100px; height: 10px; overflow: hidden; }
.xp-bar-fill   { height: 100%; background: linear-gradient(90deg, var(--accent2), #a855f7); border-radius: 100px; transition: width .4s; }

/* ─── LEADERBOARD ──────────────────────────────────── */
#leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.lb-rank { font-size: 18px; font-weight: 800; width: 36px; text-align: center; }
.lb-rank-1 { color: #fbbf24; }
.lb-rank-2 { color: #94a3b8; }
.lb-rank-3 { color: #f97316; }
.lb-name   { flex: 1; font-size: 15px; font-weight: 600; }
.lb-score  { font-size: 16px; font-weight: 700; color: var(--accent); }
.lb-sub    { font-size: 12px; color: var(--muted); }

/* ─── ADMIN ────────────────────────────────────────── */
.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-msg { padding: 12px 16px; border-radius: 8px; font-size: 14px; }

/* ─── BUTTONS ──────────────────────────────────────── */
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; transition: opacity .2s; }
.btn-primary:hover { opacity: .85; }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ─── TOASTS ────────────────────────────────────────── */
#toast-area { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 300; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500; max-width: 350px; pointer-events: auto; animation: toastIn .3s ease; }
.toast-ok   { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.4); color: #86efac; }
.toast-err  { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; }
.toast-info { background: rgba(14,165,233,.15); border: 1px solid rgba(14,165,233,.4); color: #7dd3fc; }
@keyframes toastIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

/* ─── MISC ──────────────────────────────────────────── */
.empty-state { text-align: center; color: var(--muted); font-size: 15px; padding: 48px; }

/* ─── ADMIN PANEL TABS ────────────────────────────────── */
.admin-tabs { display:flex; gap:4px; margin-bottom:20px; border-bottom:1px solid var(--border); padding-bottom:0; }
.adm-tab { background:none; border:none; color:var(--muted); cursor:pointer; padding:10px 16px; font-size:14px; font-weight:600; border-bottom:2px solid transparent; transition:all .15s; }
.adm-tab:hover { color:var(--text); }
.adm-tab.active { color:var(--accent); border-bottom-color:var(--accent); }
.adm-pane { display:none; }
.adm-pane.active { display:block; }
.adm-toolbar { display:flex; gap:8px; align-items:center; margin-bottom:16px; flex-wrap:wrap; }
.adm-search { background:var(--surface2); border:1px solid var(--border); color:var(--text); padding:8px 12px; border-radius:8px; font-size:13px; flex:1; min-width:200px; }
.adm-count { font-size:12px; color:var(--muted); }

/* ─── ADMIN USER CARDS ────────────────────────────────── */
.adm-user-card { display:flex; align-items:center; gap:12px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; margin-bottom:8px; }
.adm-uc-avatar { flex-shrink:0; width:44px; height:44px; border-radius:50%; overflow:hidden; }
.adm-uc-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.adm-uc-info { flex:1; min-width:0; }
.adm-uc-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:5px; }
.adm-uc-name { font-size:15px; font-weight:700; }
.adm-badge-admin { background:rgba(239,68,68,.15); color:#fca5a5; border:1px solid rgba(239,68,68,.3); font-size:10px; font-weight:700; padding:2px 7px; border-radius:100px; text-transform:uppercase; }
.adm-uc-email { font-size:12px; color:var(--muted); }
.adm-uc-stats { display:flex; gap:14px; font-size:12px; color:var(--muted); flex-wrap:wrap; margin-bottom:6px; }
.adm-uc-districts { display:flex; gap:4px; }
.adm-dist-chip { font-size:16px; opacity:1; }
.adm-dist-chip.locked { opacity:0.25; filter:grayscale(1); }
.adm-uc-edit { flex-shrink:0; }

/* ─── ADMIN TICKET TABLE ──────────────────────────────── */
.adm-ticket-table { display:flex; flex-direction:column; gap:0; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.adm-tt-hdr { display:grid; grid-template-columns:90px 1fr 140px 100px 80px 120px 40px; gap:12px; padding:10px 14px; background:var(--surface2); font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; }
.adm-tt-row { display:grid; grid-template-columns:90px 1fr 140px 100px 80px 120px 40px; gap:12px; padding:10px 14px; border-top:1px solid var(--border); font-size:13px; align-items:center; }
.adm-tt-row:hover { background:var(--surface2); }
.adm-tt-ref { font-family:monospace; font-size:11px; color:var(--muted); }
.adm-tt-title { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tk-status-open { background:rgba(34,197,94,.15); color:#86efac; border:1px solid rgba(34,197,94,.3); }
.tk-status-in_progress { background:rgba(14,165,233,.15); color:#7dd3fc; border:1px solid rgba(14,165,233,.3); }
.tk-status-closed { background:rgba(100,116,139,.15); color:var(--muted); border:1px solid rgba(100,116,139,.3); }
.tk-status-sla_breached { background:rgba(239,68,68,.15); color:#fca5a5; border:1px solid rgba(239,68,68,.3); }

/* ─── ADMIN CUSTOMER ROWS ─────────────────────────────── */
.adm-cust-row { display:grid; grid-template-columns:1fr 80px 120px 80px 150px 90px; gap:10px; padding:10px 14px; border-bottom:1px solid var(--border); font-size:13px; align-items:center; }
.adm-cust-row:hover { background:var(--surface2); }
.adm-cust-name { font-weight:600; }
#adm-customers-list { border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }

/* ─── ADMIN STATS ────────────────────────────────────── */
.adm-stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.adm-stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px; text-align:center; }
.adsc-val { font-size:32px; font-weight:800; color:var(--accent); margin-bottom:6px; }
.adsc-lbl { font-size:13px; color:var(--muted); }

/* ─── BUTTON VARIANTS ─────────────────────────────────── */
.btn-sm  { padding:6px 12px !important; font-size:12px !important; }
.btn-xs  { padding:3px 8px !important; font-size:11px !important; border-radius:6px !important; cursor:pointer; }
.btn-danger { background:rgba(239,68,68,.15); border:1px solid rgba(239,68,68,.3); color:#fca5a5; padding:8px 16px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:600; transition:all .15s; }
.btn-danger:hover { background:rgba(239,68,68,.25); color:#fff; }

/* ─── USER EDIT MODAL ─────────────────────────────────── */
.modal-footer { display:flex; align-items:center; gap:8px; padding:16px 24px; border-top:1px solid var(--border); flex-wrap:wrap; }
.form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
.form-group { display:flex; flex-direction:column; gap:6px; }
.form-group label { font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; }
.form-group input, .form-group select { background:var(--surface2); border:1px solid var(--border); color:var(--text); padding:8px 12px; border-radius:8px; font-size:14px; }
.form-group input:focus, .form-group select:focus { outline:none; border-color:var(--accent); }
.uem-avatar-row { display:flex; align-items:center; gap:16px; margin-bottom:20px; }
.uem-avatar { width:64px; height:64px; border-radius:50%; object-fit:cover; border:2px solid var(--border); }

/* ─── MAP DISTRICT LOCKS ──────────────────────────────── */
.dist-locked-overlay { pointer-events:none; }
.dist-lock-label { pointer-events:auto; }
.dll-inner { display:flex; flex-direction:column; align-items:center; gap:3px; background:rgba(10,14,26,.85); backdrop-filter:blur(6px); border-radius:10px; padding:10px 14px; border:1px solid rgba(239,68,68,.25); cursor:pointer; }
.dll-inner span:first-child { font-size:22px; }
.dll-inner span:nth-child(2) { font-size:12px; font-weight:700; color:#f1f5f9; }
.dll-req { font-size:11px; color:#fca5a5; font-weight:600; }
.cmap-locked { background:rgba(30,35,55,.9); border:2px solid rgba(239,68,68,.4); border-radius:50%; display:flex; align-items:center; justify-content:center; width:30px; height:30px; cursor:pointer; }
