/* ==========================================================================
   SixTails FiveM Portal — Interactive 1-to-1 CodeM / ShineRP NUI Studio Styles
   Built strictly as UI visual mockups (no proprietary Lua/client game source)
   ========================================================================== */

.fm-nui-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10020;
  background: rgba(5, 7, 13, 0.84);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.fm-nui-backdrop.is-open {
  display: flex;
}

.fm-nui-shell {
  width: min(1320px, 100%);
  height: min(820px, 92vh);
  background: #090c14;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.78);
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  overflow: hidden;
  position: relative;
}

.fm-nui-sidebar {
  background: #06080f;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fm-nui-side-head {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fm-nui-side-head strong {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e2e8f0;
}
.fm-nui-side-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fm-nui-mod-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: 0.18s ease;
}
.fm-nui-mod-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(167, 123, 255, 0.35);
  color: #fff;
}
.fm-nui-mod-btn.is-active {
  background: linear-gradient(135deg, rgba(167, 123, 255, 0.22), rgba(56, 189, 248, 0.12));
  border-color: rgba(167, 123, 255, 0.65);
  color: #fff;
  box-shadow: 0 8px 20px rgba(167, 123, 255, 0.15);
}
.fm-nui-mod-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: #38bdf8;
  flex-shrink: 0;
}
.fm-nui-mod-btn.is-active .fm-nui-mod-ico {
  background: rgba(167, 123, 255, 0.25);
  color: #f2c45a;
}
.fm-nui-mod-meta {
  min-width: 0;
  flex: 1;
}
.fm-nui-mod-meta b {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-nui-mod-meta small {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 2px;
}

.fm-nui-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: radial-gradient(circle at 75% 15%, rgba(56, 189, 248, 0.1), transparent 45%),
              radial-gradient(circle at 20% 85%, rgba(167, 123, 255, 0.12), transparent 50%),
              #0b0f1a;
}

.fm-nui-topbar {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 9, 16, 0.82);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.fm-nui-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.fm-nui-title-wrap h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}
.fm-nui-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.fm-nui-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}
.fm-nui-pill.resmon { color: #34d399; border-color: rgba(52, 211, 153, 0.35); background: rgba(16, 185, 129, 0.12); }
.fm-nui-pill.fw { color: #38bdf8; border-color: rgba(56, 189, 248, 0.35); background: rgba(56, 189, 248, 0.12); }

.fm-nui-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fm-nui-price {
  font-size: 1rem;
  font-weight: 800;
  color: #f2c45a;
  padding: 0 6px;
}
.fm-nui-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.fm-nui-close:hover { background: rgba(244, 63, 94, 0.28); color: #fff; }

.fm-nui-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #070a12;
}

.fm-nui-ctrlbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 13, 22, 0.94);
  z-index: 2;
}
.fm-nui-ctrlbar[hidden] { display: none !important; }
.fm-nui-ctrl-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.fm-nui-cbtn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.16s ease;
}
.fm-nui-cbtn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.fm-nui-cbtn.is-active {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-color: #60a5fa;
  color: #fff;
}
.fm-nui-cbtn.is-gold {
  border-color: rgba(242, 196, 90, 0.45);
  color: #f2c45a;
  background: rgba(242, 196, 90, 0.1);
}
.fm-nui-cbtn.is-gold:hover { background: rgba(242, 196, 90, 0.22); }

.fm-nui-iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  background: transparent;
  display: block;
}

.fm-nui-foot {
  padding: 9px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 9, 16, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ---------- 1. NEXA PHONE ULTRA ---------- */
.nui-phone-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.nui-dev-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.nui-dev-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.nui-dev-tab.is-active {
  background: #3b82f6;
  border-color: #60a5fa;
  color: #fff;
}
.nui-phone-stage {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.nui-phone-frame {
  width: 268px;
  height: 515px;
  border-radius: 42px;
  padding: 9px;
  background: linear-gradient(135deg, #737b8c, #1f2937);
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.72), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  position: relative;
  transition: height 0.3s cubic-bezier(.22,1.15,.36,1), border-radius 0.3s;
}
.nui-phone-frame.mode-flip.is-folded { height: 260px; }
.nui-phone-frame.mode-brick {
  width: 246px;
  height: 486px;
  border-radius: 34px;
  padding: 24px 16px 18px;
  background: linear-gradient(180deg, #273449, #0f172a);
}
.nui-phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 34px;
  background: linear-gradient(160deg, #1b1446, #0f172a 60%, #1e1b4b);
  padding: 14px;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.nui-phone-frame.mode-brick .nui-phone-screen {
  height: 225px;
  border-radius: 10px;
  background: #9bbc0f;
  color: #0f380f;
  font-family: Consolas, monospace;
  padding: 10px;
}
.nui-brick-keypad {
  display: none;
  margin-top: 14px;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.nui-phone-frame.mode-brick .nui-brick-keypad { display: grid; }
.nui-brick-key {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}
.nui-brick-key:active { transform: translateY(1px); background: #475569; }
.nui-island {
  width: 78px;
  height: 20px;
  background: #000;
  border-radius: 999px;
  margin: -4px auto 10px;
  flex-shrink: 0;
}
.nui-phone-frame.mode-brick .nui-island { display: none; }
.nui-app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.nui-app-ico {
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 0.65rem;
}
.nui-app-ico > span {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.nui-watch-card {
  width: 170px;
  padding: 14px;
  border-radius: 28px;
  background: #111827;
  border: 3px solid #374151;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- 2. NEXA ADMIN PANEL ---------- */
.nui-admin-shell {
  width: 100%;
  height: 550px;
  max-width: 1000px;
  border-radius: 18px;
  border: 1px solid var(--na-border, rgba(255,255,255,0.08));
  background: var(--na-bg, #080a0f);
  color: var(--na-text, #f1f5f9);
  display: grid;
  grid-template-columns: 225px 1fr;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}
.nui-admin-shell[data-atheme="midnight"] { --na-bg: #040711; --na-surf: #0b1120; --na-accent: #38bdf8; }
.nui-admin-shell[data-atheme="crimson"]  { --na-bg: #0c070a; --na-surf: #170d12; --na-accent: #f43f5e; }
.nui-admin-shell[data-atheme="emerald"]  { --na-bg: #060d0b; --na-surf: #0c1915; --na-accent: #10b981; }
.nui-admin-shell[data-atheme="light"]    { --na-bg: #eef2f6; --na-surf: #ffffff; --na-text: #0f172a; --na-border: rgba(15,23,42,0.12); }

/* ---------- 3. NEXA LSPD MDT & DISPATCH ---------- */
.nui-mdt-shell {
  width: 100%;
  max-width: 1000px;
  height: 555px;
  background: rgba(9, 13, 22, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 18px;
  display: grid;
  grid-template-columns: 225px 1fr;
  overflow: hidden;
  position: relative;
}

/* ---------- 4. NEXA MEDICAL DOWNED + MEDTAB ---------- */
.nui-med-downed {
  width: 100%;
  max-width: 820px;
  border-radius: 18px;
  padding: 28px;
  background: radial-gradient(circle at 50% 45%, rgba(15, 20, 32, 0.92), rgba(127, 29, 29, 0.42));
  border: 1px solid rgba(244, 63, 94, 0.35);
  text-align: center;
  position: relative;
}
.nui-med-ring-svg { width: 118px; height: 118px; transform: rotate(-90deg); }
.nui-med-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 8; }
.nui-med-ring-prog { fill: none; stroke: #f43f5e; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.35s linear; }

/* ---------- 5. NEXA DEALERSHIP ---------- */
.nui-pdm-grid {
  width: 100%;
  max-width: 1010px;
  height: 540px;
  display: grid;
  grid-template-columns: 255px 1fr 255px;
  gap: 12px;
}
.nui-pdm-panel {
  background: rgba(9, 12, 19, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

/* ---------- 6. NEXA MECHANIC TECHPAD PRO ---------- */
.nui-techpad-wrap {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 16px;
  align-items: center;
}
.nui-techpad-chassis {
  position: relative;
  border-radius: 26px;
  padding: 16px 14px;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid #334155;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.72);
}
.nui-hw-btn {
  position: absolute;
  right: -5px;
  width: 5px;
  border-radius: 0 4px 4px 0;
  background: #475569;
}
.nui-techpad-screen {
  background: #0a0e16;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  height: 490px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- 7. NEXA HUD GAME PREVIEW ---------- */
.nui-hud-canvas {
  width: 100%;
  max-width: 980px;
  height: 530px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 70% 25%, rgba(229, 169, 60, 0.18), transparent 45%),
    linear-gradient(180deg, #131c2e 0%, #0b0f18 55%, #07090f 100%);
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.nui-hud-canvas.is-light {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 55%, #93c5fd 100%);
}

/* ---------- 8. NEXA JOBS INDUSTRIAL TABLET ---------- */
.nui-jobs-tablet {
  width: 100%;
  max-width: 980px;
  height: 540px;
  background: #111317;
  border: 1px solid #262932;
  border-top: 3px solid #e5a93c;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- 9. NEXA CHAT SUITE ---------- */
.nui-chat-shell {
  width: min(640px, 100%);
  border-radius: 16px;
  background: rgba(10, 12, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.nui-chat-shell[data-ctheme="cyber"] {
  background: rgba(7, 14, 24, 0.92);
  border-color: rgba(34, 211, 238, 0.35);
}
.nui-chat-shell[data-ctheme="amethyst"] {
  background: rgba(16, 10, 26, 0.92);
  border-color: rgba(192, 132, 252, 0.35);
}

/* ---------- 10. NEXA INVOICES & GARAGES ---------- */
.nui-tablet-920 {
  width: 100%;
  max-width: 960px;
  height: 540px;
  background: rgba(10, 13, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- 11. NEXA MULTICHAR ---------- */
.nui-multichar-stage {
  width: 100%;
  max-width: 1000px;
  height: 545px;
  border-radius: 18px;
  padding: 20px 26px;
  background: radial-gradient(circle at 50% 42%, rgba(99, 102, 241, 0.18), rgba(5, 7, 13, 0.92) 72%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 960px) {
  .fm-nui-shell { grid-template-columns: 1fr; height: 94vh; }
  .fm-nui-sidebar { max-height: 155px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .fm-nui-side-list { flex-direction: row; overflow-x: auto; padding: 8px; }
  .fm-nui-mod-btn { min-width: 190px; }
  .nui-pdm-grid, .nui-techpad-wrap, .nui-admin-shell, .nui-mdt-shell {
    grid-template-columns: 1fr;
    height: auto;
  }
}
