:root {
  --dash-bg: #0a0d13;
  --dash-panel: #111620;
  --dash-panel-2: #151b27;
  --dash-line: #252c38;
  --dash-text: #edf1f7;
  --dash-muted: #8f99aa;
  --dash-blue: #5b8cff;
  --dash-blue-2: #3769df;
  --dash-green: #4fd19a;
  --dash-red: #ed6b73;
  --dash-amber: #e0ae5a;
}

.dashboard-body { background: var(--dash-bg); color: var(--dash-text); }
.dashboard-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--dash-line); background: #0c1017; padding: 1rem; z-index: 40; }
.sidebar-brand, .auth-brand { display: flex; align-items: center; gap: .85rem; padding: .55rem .55rem 1.2rem; text-decoration: none; }
.brand-symbol { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: white; background: linear-gradient(145deg, #2d64df, #6c91f0); font-weight: 900; letter-spacing: -.06em; box-shadow: 0 8px 28px rgba(55,105,223,.32); }
.brand-symbol span { color: #c9d8ff; }
.brand-copy, .auth-brand > span:last-child { display: grid; gap: .1rem; }
.brand-copy strong, .auth-brand strong { font-size: .96rem; }
.brand-copy small, .auth-brand small { color: var(--dash-muted); font-size: .72rem; }
.sidebar-nav { display: grid; gap: .3rem; }
.sidebar-link { width: 100%; display: flex; align-items: center; gap: .8rem; min-height: 44px; padding: .7rem .8rem; border: 0; border-radius: 8px; color: #9ea8b8; background: transparent; text-decoration: none; text-align: left; font-size: .88rem; font-weight: 650; }
.sidebar-link svg { width: 19px; height: 19px; flex: 0 0 auto; }
.sidebar-link:hover { color: white; background: #151b25; }
.sidebar-link.active { color: white; background: linear-gradient(90deg, rgba(91,140,255,.22), rgba(91,140,255,.08)); box-shadow: inset 3px 0 var(--dash-blue); }
.sidebar-bottom { margin-top: auto; display: grid; gap: .3rem; }
.sidebar-bottom form { margin: 0; }
.sidebar-button { cursor: pointer; }
.dashboard-main { min-width: 0; }
.dashboard-topbar { position: sticky; top: 0; z-index: 25; min-height: 70px; display: flex; align-items: center; gap: 1rem; padding: 0 2rem; border-bottom: 1px solid var(--dash-line); background: rgba(10,13,19,.88); backdrop-filter: blur(16px); }
.sidebar-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--dash-line); border-radius: 8px; color: white; background: var(--dash-panel); }
.topbar-context { color: var(--dash-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.account-chip { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.account-avatar { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 9px; color: #cbd8ff; background: #1b2a4c; font-weight: 800; }
.account-chip > span:last-child { display: grid; gap: .1rem; }
.account-chip strong { font-size: .82rem; }
.account-chip small { color: var(--dash-muted); font-size: .7rem; text-transform: capitalize; }
.dashboard-content { width: min(1480px, 100%); margin: 0 auto; padding: 2rem; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.45rem); letter-spacing: -.035em; }
.page-heading p { max-width: 760px; margin: .45rem 0 0; color: var(--dash-muted); line-height: 1.6; }
.page-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.panel { border: 1px solid var(--dash-line); border-radius: 12px; background: var(--dash-panel); box-shadow: 0 14px 40px rgba(0,0,0,.13); }
.panel + .panel { margin-top: 1rem; }
.panel-heading { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--dash-line); }
.panel-heading h2 { margin: 0; font-size: .98rem; }
.panel-heading p { margin: .28rem 0 0; color: var(--dash-muted); font-size: .78rem; line-height: 1.5; }
.panel-heading a { color: #a9c0ff; text-decoration: none; font-size: .8rem; font-weight: 700; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .65rem .95rem; border: 1px solid #323b4b; border-radius: 8px; color: #e9edf4; background: #1a212d; text-decoration: none; font-size: .8rem; font-weight: 750; }
.button:hover:not(:disabled) { border-color: #4a5870; background: #202938; }
.button.primary { border-color: #5b8cff; background: linear-gradient(180deg, #6593ff, #4475e8); color: white; box-shadow: 0 8px 24px rgba(68,117,232,.2); }
.button.danger { border-color: rgba(237,107,115,.55); color: #ff9ba1; }
.button.ghost { background: transparent; }
.button.small { min-height: 32px; padding: .42rem .68rem; font-size: .72rem; }
.button.full { width: 100%; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.flash { margin-bottom: 1rem; padding: .9rem 1rem; border: 1px solid; border-radius: 9px; font-size: .84rem; }
.flash-success { border-color: rgba(79,209,154,.35); color: #91ebc4; background: rgba(79,209,154,.08); }
.flash-error { border-color: rgba(237,107,115,.35); color: #ff9da4; background: rgba(237,107,115,.08); }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: .28rem .52rem; border: 1px solid transparent; border-radius: 999px; font-size: .68rem; font-weight: 800; text-transform: capitalize; white-space: nowrap; }
.badge.success { color: #82e6b9; border-color: rgba(79,209,154,.25); background: rgba(79,209,154,.08); }
.badge.danger { color: #ff989f; border-color: rgba(237,107,115,.25); background: rgba(237,107,115,.08); }
.badge.warning { color: #f0c776; border-color: rgba(224,174,90,.25); background: rgba(224,174,90,.08); }
.badge.neutral { color: #b0bbca; border-color: #303947; background: #171e29; }
.role-owner { color: #d7bdff; border-color: rgba(166,111,255,.28); background: rgba(166,111,255,.08); }
.role-administrator { color: #9db8ff; border-color: rgba(91,140,255,.28); background: rgba(91,140,255,.08); }
.role-editor { color: #7de3bd; border-color: rgba(79,209,154,.28); background: rgba(79,209,154,.08); }
.role-viewer { color: #bac2cf; border-color: #303947; background: #171e29; }
.muted { color: var(--dash-muted) !important; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { min-height: 150px; display: flex; flex-direction: column; justify-content: center; padding: 1.25rem; border: 1px solid var(--dash-line); border-radius: 12px; background: linear-gradient(145deg, #121821, #10151e); }
.stat-card span { color: var(--dash-muted); font-size: .76rem; font-weight: 700; }
.stat-card strong { margin: .55rem 0 .2rem; font-size: 2rem; letter-spacing: -.05em; }
.stat-card small { color: #707b8d; }
.stat-card.accent { background: linear-gradient(145deg, #13213a, #111927); border-color: #273b60; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 1rem; margin-bottom: 1rem; }
.progress-list { padding: .4rem 1.25rem 1.1rem; }
.progress-list > div { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #202733; }
.progress-list > div:last-child { border-bottom: 0; }
.progress-list span { display: grid; gap: .25rem; }
.progress-list strong { font-size: .84rem; }
.progress-list small { color: var(--dash-muted); }
.progress-list b { color: #76ddb2; font-size: .72rem; }
.identity-preview { padding: 1.5rem; }
.identity-preview > span { color: #89a8f7; font-size: .68rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; }
.identity-preview h3 { margin: .65rem 0; font-size: 1.75rem; letter-spacing: -.04em; }
.identity-preview p { margin: 0; color: var(--dash-muted); line-height: 1.65; }
.activity-list { padding: .35rem 1.25rem 1rem; }
.activity-row { min-height: 66px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .8rem; border-bottom: 1px solid #202733; }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { width: 9px; height: 9px; border-radius: 50%; background: var(--dash-blue); box-shadow: 0 0 0 5px rgba(91,140,255,.1); }
.activity-row strong { font-size: .8rem; }
.activity-row p { margin: .22rem 0 0; color: var(--dash-muted); font-size: .72rem; }
.activity-row time { color: #768194; font-size: .69rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .95rem 1rem; border-bottom: 1px solid #222a36; text-align: left; vertical-align: middle; }
th { color: #7f8a9d; background: #10151e; font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }
td { color: #cbd2dc; font-size: .78rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.015); }
.table-primary { display: grid; gap: .22rem; }
.table-primary strong { color: #f2f5f9; font-size: .82rem; }
.table-primary small { color: var(--dash-muted); }
.table-actions { text-align: right; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
code { color: #adc3ff; font-size: .73rem; }
details summary { cursor: pointer; color: #a9c0ff; }
details pre { max-width: 520px; overflow: auto; padding: .8rem; border-radius: 7px; color: #b9c2d0; background: #090c11; font-size: .68rem; }
.empty-state { padding: 2rem !important; color: var(--dash-muted); text-align: center; }
label { display: grid; gap: .48rem; color: #b8c0cc; font-size: .74rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #303847; border-radius: 8px; outline: 0; color: #eef2f7; background: #0d121a; padding: .74rem .8rem; font-size: .82rem; transition: border-color .15s ease, box-shadow .15s ease; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: #5b8cff; box-shadow: 0 0 0 3px rgba(91,140,255,.12); }
input[type="color"] { min-height: 45px; padding: .3rem; }
input[readonly] { color: #9da8b8; background: #10151d; }
.form-grid { display: grid; gap: 1rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stacked-form { display: grid; gap: 1rem; }
.form-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.checkbox-row { display: flex; align-items: center; gap: .65rem; }
.checkbox-row input { width: 18px; height: 18px; }
.code-editor { min-height: 440px; font-family: "SFMono-Regular", Consolas, monospace; font-size: .78rem; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.editor-main { padding-bottom: 1.25rem; }
.editor-main > label, .editor-main > .form-grid { margin: 1rem 1.25rem 0; }
.editor-sidebar { display: grid; gap: 1rem; position: sticky; top: 86px; }
.editor-sidebar .panel { padding-bottom: 1rem; }
.editor-sidebar .panel > label, .editor-sidebar .panel > button, .editor-sidebar .panel > a { margin: 1rem 1rem 0; width: calc(100% - 2rem); }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.settings-main { display: grid; gap: 1rem; }
.settings-main .panel { padding-bottom: 1.25rem; }
.settings-main .panel > label, .settings-main .panel > .form-grid { margin: 1rem 1.25rem 0; }
.settings-sidebar { position: sticky; top: 86px; }
.sticky-panel { padding-bottom: 1rem; }
.sticky-panel > .button, .sticky-panel > .embed-preview { margin: 1rem 1rem 0; width: calc(100% - 2rem); }
.embed-preview { position: relative; padding: 1rem; border-left: 4px solid var(--preview-colour); border-radius: 4px 8px 8px 4px; background: #0d1219; }
.embed-preview small { color: #788498; }
.embed-preview strong { display: block; margin: .55rem 0 .4rem; color: #d9e5ff; }
.embed-preview p { margin: 0; color: #a4aeba; font-size: .75rem; line-height: 1.5; }
.embed-preview span { display: block; margin-top: .7rem; color: #6f7c8e; font-size: .66rem; }
.media-layout { display: grid; gap: 1rem; }
.upload-panel { padding-bottom: 1.25rem; }
.upload-panel form { max-width: 650px; margin: 1rem 1.25rem 0; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.media-card { overflow: hidden; border: 1px solid var(--dash-line); border-radius: 12px; background: var(--dash-panel); }
.media-preview { aspect-ratio: 16 / 9; display: grid; place-items: center; background: #080b10; }
.media-preview img { width: 100%; height: 100%; object-fit: contain; }
.media-details { display: grid; gap: .7rem; padding: 1rem; }
.media-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.media-details > small { color: var(--dash-muted); }
.media-details form { margin: 0; }
.narrow-form { max-width: 900px; padding-bottom: 1.25rem; }
.narrow-form > label, .narrow-form > .form-grid, .narrow-form > .form-actions { margin: 1rem 1.25rem 0; }
.notice-panel { margin-bottom: 1rem; padding: 1rem 1.15rem; border: 1px solid rgba(91,140,255,.28); border-radius: 10px; background: rgba(91,140,255,.07); }
.notice-panel strong { color: #bdd0ff; }
.notice-panel p { margin: .35rem 0 0; color: #9faabd; font-size: .8rem; line-height: 1.55; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.module-card { min-height: 360px; display: flex; flex-direction: column; padding: 1.2rem; border: 1px solid var(--dash-line); border-radius: 12px; background: var(--dash-panel); }
.module-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.module-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; color: #afc5ff; background: #182747; font-size: .76rem; font-weight: 900; }
.module-card h2 { margin: 1.2rem 0 .55rem; font-size: 1rem; }
.module-card p { margin: 0; color: var(--dash-muted); font-size: .78rem; line-height: 1.6; }
.module-card ul { display: grid; gap: .55rem; margin: 1.2rem 0; padding: 0; list-style: none; }
.module-card li { color: #b4bdca; font-size: .76rem; }
.module-card li::before { content: "•"; margin-right: .55rem; color: var(--dash-blue); }
.module-card .button { margin-top: auto; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 2rem; color: var(--dash-text); background: radial-gradient(circle at 30% 10%, #17233a, #090c12 45%); }
.auth-card { width: min(460px, 100%); padding: 1.25rem; border: 1px solid #283141; border-radius: 14px; background: rgba(15,20,29,.94); box-shadow: 0 32px 90px rgba(0,0,0,.4); }
.auth-brand { padding: 0 0 1.4rem; }
.auth-heading { margin-bottom: 1.3rem; }
.auth-heading h1 { margin: 0; font-size: 1.65rem; letter-spacing: -.035em; }
.auth-heading p { margin: .45rem 0 0; color: var(--dash-muted); font-size: .82rem; line-height: 1.55; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-grid, .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 270px; transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.35); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: grid; place-items: center; }
  .dashboard-topbar { padding: 0 1rem; }
  .dashboard-content { padding: 1.25rem; }
  .dashboard-grid, .editor-layout, .settings-grid { grid-template-columns: 1fr; }
  .editor-sidebar, .settings-sidebar { position: static; }
}

@media (max-width: 650px) {
  .dashboard-content { padding: 1rem; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-actions .button { width: 100%; }
  .stats-grid, .module-grid, .media-grid, .form-grid.two { grid-template-columns: 1fr; }
  .account-chip > span:last-child { display: none; }
  .activity-row { grid-template-columns: auto minmax(0,1fr); }
  .activity-row time { display: none; }
}

/* Mock FiveM integration */
.sidebar { overflow-y: auto; }
.sidebar-nav { display: grid; gap: .95rem; padding-bottom: 1rem; }
.sidebar-section { display: grid; gap: .28rem; }
.sidebar-section-label { padding: 0 .8rem .22rem; color: #5f6a7b; font-size: .58rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.topbar-context { display: flex; align-items: center; gap: .8rem; }
.integration-pill { display: inline-flex; align-items: center; gap: .42rem; padding: .3rem .55rem; border: 1px solid #303947; border-radius: 999px; color: #aab4c4; background: #141a23; font-size: .64rem; font-weight: 800; letter-spacing: .03em; text-transform: none; }
.integration-pill i { width: 7px; height: 7px; border-radius: 50%; background: #758093; }
.integration-pill.simulated { color: #f0c776; border-color: rgba(224,174,90,.28); background: rgba(224,174,90,.08); }
.integration-pill.simulated i { background: var(--dash-amber); box-shadow: 0 0 0 4px rgba(224,174,90,.1); }
.integration-pill.connected { color: #82e6b9; }
.integration-pill.connected i { background: var(--dash-green); }
.integration-pill.disconnected { color: #ff989f; }
.integration-pill.disconnected i { background: var(--dash-red); }
.demo-warning { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.1rem; border: 1px solid rgba(224,174,90,.3); border-radius: 11px; background: linear-gradient(90deg, rgba(224,174,90,.09), rgba(224,174,90,.035)); }
.demo-warning strong { color: #f2cd82; font-size: .84rem; }
.demo-warning p { margin: .28rem 0 0; color: #aeb6c2; font-size: .76rem; line-height: 1.55; }
.dashboard-demo-warning { border-color: rgba(91,140,255,.28); background: linear-gradient(90deg, rgba(91,140,255,.1), rgba(91,140,255,.035)); }
.dashboard-demo-warning strong { color: #bdd0ff; }
.stat-card .stat-text { font-size: 1.25rem; letter-spacing: -.035em; line-height: 1.15; overflow-wrap: anywhere; }
.compact-stats .stat-card { min-height: 126px; }
.quick-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--dash-line); }
.quick-module-grid a { min-height: 135px; display: flex; flex-direction: column; justify-content: center; padding: 1.2rem; color: inherit; background: var(--dash-panel); text-decoration: none; }
.quick-module-grid a:hover { background: #151c27; }
.quick-module-grid span { color: var(--dash-muted); font-size: .72rem; font-weight: 750; }
.quick-module-grid strong { margin: .45rem 0; font-size: 1.8rem; }
.quick-module-grid small { color: #748093; }
.online-player-list { padding: .35rem 1.15rem 1rem; }
.online-player-row { min-height: 66px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .75rem; border-bottom: 1px solid #202733; color: inherit; text-decoration: none; }
.online-player-row:last-child { border-bottom: 0; }
.online-player-row:hover strong { color: #b9cbff; }
.online-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: #c6d5ff; background: #1b2947; font-size: .72rem; font-weight: 850; }
.online-player-row > span:nth-child(2) { display: grid; gap: .2rem; }
.online-player-row strong { font-size: .8rem; }
.online-player-row small { color: var(--dash-muted); font-size: .68rem; }
.online-player-row b { color: #80dab5; font-size: .68rem; }
.portal-site-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin-top: 1rem; border-top: 1px solid var(--dash-line); background: var(--dash-line); }
.portal-site-stats span { padding: .9rem .8rem; color: var(--dash-muted); background: var(--dash-panel); font-size: .68rem; text-align: center; }
.portal-site-stats strong { display: block; margin-bottom: .25rem; color: var(--dash-text); font-size: 1rem; }
.filter-panel { margin-bottom: 1rem; padding: 1rem; }
.filter-grid { display: grid; align-items: end; gap: .8rem; }
.filter-grid label { min-width: 0; }
.filter-grid .button { min-width: 88px; }
.player-filter-grid { grid-template-columns: minmax(280px, 1.5fr) minmax(140px,.5fr) minmax(190px,.7fr) auto auto; }
.inventory-filter-grid { grid-template-columns: minmax(320px,1.4fr) minmax(170px,.5fr) auto auto; }
.transfer-filter-grid { grid-template-columns: minmax(280px,1.2fr) minmax(160px,.5fr) minmax(180px,.6fr) auto auto; }
.vehicle-filter-grid { grid-template-columns: minmax(300px,1.2fr) minmax(160px,.5fr) auto auto; }
.mdt-filter-grid { grid-template-columns: minmax(260px,1.1fr) minmax(180px,.6fr) minmax(140px,.5fr) auto auto; }
.inline-detail { display: block; margin-top: .3rem; color: var(--dash-muted); font-size: .66rem; }
.inventory-label-preview { max-width: 280px; display: block; overflow: hidden; color: var(--dash-muted); text-overflow: ellipsis; white-space: nowrap; }
.profile-hero { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 1.2rem; margin-bottom: 1rem; padding: 1.4rem; }
.profile-avatar { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 18px; color: #d8e2ff; background: linear-gradient(145deg,#273d6d,#17243e); font-size: 1.35rem; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.profile-identity > span { color: #8eabf5; font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.profile-identity h2 { margin: .45rem 0 .35rem; font-size: 1.75rem; letter-spacing: -.04em; }
.profile-identity p { margin: 0; color: var(--dash-muted); font-size: .76rem; }
.profile-live { display: grid; justify-items: end; gap: .35rem; text-align: right; }
.profile-live strong { margin-top: .2rem; font-size: .78rem; }
.profile-live small { color: var(--dash-muted); font-size: .68rem; }
.profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-bottom: 1rem; }
.account-characters-panel { grid-column: 1 / -1; }
.detail-list { margin: 0; padding: .35rem 1.25rem 1rem; }
.detail-list > div { min-height: 52px; display: grid; grid-template-columns: 150px minmax(0,1fr); align-items: center; gap: 1rem; border-bottom: 1px solid #202733; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--dash-muted); font-size: .7rem; }
.detail-list dd { margin: 0; min-width: 0; color: #d5dbe4; font-size: .76rem; overflow-wrap: anywhere; }
.character-switcher { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; padding: 1rem 1.2rem 1.2rem; }
.character-switch { display: grid; gap: .25rem; padding: .85rem; border: 1px solid var(--dash-line); border-radius: 9px; color: inherit; background: #0e131b; text-decoration: none; }
.character-switch.current { border-color: rgba(91,140,255,.55); background: rgba(91,140,255,.08); }
.character-switch span { font-size: .8rem; font-weight: 800; }
.character-switch small { color: var(--dash-muted); font-size: .66rem; }
.profile-assets-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.condition-meter { width: 105px; height: 7px; display: block; overflow: hidden; border-radius: 999px; background: #252d39; }
.condition-meter i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#4fd19a,#8ae3bd); }
.compact-check { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.compact-check input { width: 16px; height: 16px; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.span-two { grid-column: 1 / -1; }
.form-note { margin: 1rem; padding: .75rem; border-radius: 8px; color: var(--dash-muted); background: #0d1219; font-size: .7rem; }
.mock-reset-panel { margin-top: 1rem; padding-bottom: 1rem; }
.mock-reset-panel form { margin: 1rem 1.2rem 0; }
.server-status-card { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; padding: 1.5rem; background: radial-gradient(circle at 85% 20%,rgba(79,209,154,.1),transparent 34%),var(--dash-panel); }
.server-kicker { display: inline-flex; align-items: center; gap: .5rem; color: #82e6b9; font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.server-kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--dash-green); box-shadow: 0 0 0 5px rgba(79,209,154,.1); }
.server-status-card h2 { margin: .7rem 0 .35rem; font-size: 1.35rem; }
.server-status-card p { margin: 0; color: var(--dash-muted); font-size: .75rem; }
.server-status-card dl { display: grid; grid-template-columns: repeat(5,auto); gap: 1.6rem; margin: 0; }
.server-status-card dl div { display: grid; gap: .28rem; }
.server-status-card dt { color: var(--dash-muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; }
.server-status-card dd { margin: 0; font-size: .8rem; font-weight: 800; }
.server-grid { grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); }
.server-event-list { padding: .35rem 1.15rem 1rem; }
.server-event-row { min-height: 65px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .75rem; border-bottom: 1px solid #202733; }
.server-event-row:last-child { border-bottom: 0; }
.server-event-row strong { font-size: .76rem; }
.server-event-row p { margin: .2rem 0 0; color: var(--dash-muted); font-size: .66rem; }
.server-event-row time { color: #738094; font-size: .63rem; }

@media (max-width: 1180px) {
  .player-filter-grid, .transfer-filter-grid, .mdt-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inventory-filter-grid, .vehicle-filter-grid { grid-template-columns: minmax(0,1fr) minmax(160px,.45fr) auto auto; }
  .server-status-card { align-items: flex-start; flex-direction: column; }
  .server-status-card dl { width: 100%; grid-template-columns: repeat(5,1fr); }
}

@media (max-width: 900px) {
  .topbar-context > span:first-child { display: none; }
  .profile-grid, .profile-assets-grid, .server-grid { grid-template-columns: 1fr; }
  .account-characters-panel { grid-column: auto; }
  .server-status-card dl { grid-template-columns: repeat(3,1fr); }
  .character-switcher { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 650px) {
  .integration-pill { display: none; }
  .demo-warning, .server-status-card { align-items: stretch; flex-direction: column; }
  .filter-grid, .player-filter-grid, .inventory-filter-grid, .transfer-filter-grid, .vehicle-filter-grid, .mdt-filter-grid { grid-template-columns: 1fr; }
  .filter-grid .button { width: 100%; }
  .quick-module-grid, .portal-site-stats, .character-switcher, .form-grid.three { grid-template-columns: 1fr; }
  .profile-hero { grid-template-columns: auto minmax(0,1fr); }
  .profile-live { grid-column: 1 / -1; justify-items: start; text-align: left; }
  .detail-list > div { grid-template-columns: 1fr; align-content: center; gap: .25rem; padding: .6rem 0; }
  .server-status-card dl { grid-template-columns: repeat(2,1fr); }
}


/* Consistent card spacing inside grid layouts */
.dashboard-grid > .panel + .panel,
.profile-grid > .panel + .panel,
.profile-assets-grid > .panel + .panel {
  margin-top: 0;
}
.profile-grid,
.profile-assets-grid {
  align-items: stretch;
}
.profile-grid > .panel,
.profile-assets-grid > .panel {
  height: 100%;
}
.profile-assets-grid {
  margin-top: 1rem;
}
.profile-grid .panel-heading,
.profile-assets-grid .panel-heading {
  min-height: 82px;
  align-items: flex-start;
}

/* Inventory grid */
.inventory-panel-heading {
  align-items: center;
}
.inventory-view-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .9rem;
  flex-wrap: wrap;
}
.inventory-view-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--dash-line);
  border-radius: 8px;
  background: #0c1118;
}
.inventory-view-button {
  min-height: 31px;
  padding: .35rem .7rem;
  border: 0;
  border-radius: 6px;
  color: var(--dash-muted);
  background: transparent;
  cursor: pointer;
  font-size: .7rem;
  font-weight: 800;
}
.inventory-view-button:hover,
.inventory-view-button.active {
  color: #f3f6fb;
  background: #202938;
}
.inventory-view-panel[hidden] {
  display: none;
}
.inventory-grid-shell {
  overflow-x: auto;
  padding: 1.2rem;
}
.inventory-grid {
  min-width: 690px;
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: .7rem;
}
.inventory-grid.compact {
  min-width: 650px;
}
.inventory-slot {
  position: relative;
  min-height: 112px;
  aspect-ratio: 1.18 / 1;
  overflow: visible;
  border: 1px solid #293241;
  border-radius: 10px;
  color: #cbd2dc;
  background: linear-gradient(145deg, #121924, #0d121a);
}
.inventory-slot.empty {
  background: rgba(10, 14, 20, .58);
  border-color: #202733;
}
.inventory-slot.occupied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem .65rem .7rem;
  cursor: help;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.015);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.inventory-slot.occupied:hover,
.inventory-slot.occupied:focus-visible {
  z-index: 20;
  transform: translateY(-2px);
  border-color: #52627a;
  background: linear-gradient(145deg, #172131, #101720);
  outline: none;
}
.inventory-slot-number {
  position: absolute;
  top: .48rem;
  left: .55rem;
  color: #667286;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .62rem;
}
.inventory-slot-quantity {
  position: absolute;
  top: .45rem;
  right: .5rem;
  min-width: 24px;
  min-height: 21px;
  display: grid;
  place-items: center;
  padding: 0 .38rem;
  border: 1px solid #3a4659;
  border-radius: 999px;
  color: #eef3fb;
  background: #202a39;
  font-size: .64rem;
  font-weight: 850;
}
.inventory-item-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid #334159;
  border-radius: 11px;
  color: #c5d5ff;
  background: #192640;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.inventory-item-label {
  width: 100%;
  overflow: hidden;
  color: #edf1f7;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: .68rem;
  font-weight: 750;
}
.inventory-slot-durability {
  width: calc(100% - 1.2rem);
  height: 4px;
  position: absolute;
  right: .6rem;
  bottom: .45rem;
  left: .6rem;
  overflow: hidden;
  border-radius: 999px;
  background: #242c37;
}
.inventory-slot-durability i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #65d2a3;
}
.inventory-slot.tone-danger .inventory-item-mark { color: #ffc1c5; border-color: rgba(237,107,115,.35); background: rgba(237,107,115,.12); }
.inventory-slot.tone-medical .inventory-item-mark { color: #9ce9c8; border-color: rgba(79,209,154,.35); background: rgba(79,209,154,.11); }
.inventory-slot.tone-contraband .inventory-item-mark { color: #d4b8ff; border-color: rgba(171,116,255,.35); background: rgba(171,116,255,.11); }
.inventory-slot.tone-information .inventory-item-mark { color: #bcd0ff; border-color: rgba(91,140,255,.35); background: rgba(91,140,255,.11); }
.inventory-slot.tone-equipment .inventory-item-mark { color: #f0cd8a; border-color: rgba(224,174,90,.35); background: rgba(224,174,90,.1); }
/* The tooltip content stays inside each slot as a data source.
   JavaScript renders the visible tooltip at document level so panels and
   scrolling inventory containers cannot clip it. */
.inventory-tooltip {
  display: none;
}
.inventory-floating-tooltip {
  width: min(320px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  position: fixed;
  z-index: 1000000;
  display: block;
  overflow: auto;
  padding: .9rem;
  border: 1px solid #3a4658;
  border-radius: 10px;
  color: #d7dde7;
  background: #090d13;
  box-shadow: 0 24px 70px rgba(0,0,0,.62);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.inventory-floating-tooltip[hidden] {
  display: none;
}
.inventory-floating-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.inventory-floating-tooltip::after {
  content: "";
  width: 10px;
  height: 10px;
  position: absolute;
  left: var(--tooltip-arrow-left, 50%);
  border-right: 1px solid #3a4658;
  border-bottom: 1px solid #3a4658;
  background: #090d13;
  transform: translateX(-50%) rotate(45deg);
}
.inventory-floating-tooltip[data-placement="top"]::after {
  bottom: -6px;
}
.inventory-floating-tooltip[data-placement="bottom"]::after {
  top: -6px;
  transform: translateX(-50%) rotate(225deg);
}
.inventory-tooltip-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .35rem;
}
.inventory-tooltip-heading strong {
  color: #f4f7fb;
  font-size: .8rem;
}
.inventory-tooltip-heading small,
.inventory-tooltip-quantity,
.inventory-tooltip-empty {
  color: var(--dash-muted);
  font-size: .65rem;
}
.inventory-tooltip > code,
.inventory-floating-tooltip > code {
  display: block;
  margin-bottom: .55rem;
  font-size: .66rem;
}
.inventory-tooltip-quantity {
  display: block;
  margin-bottom: .45rem;
}
.inventory-tooltip-list {
  margin: .5rem 0 0;
  padding-top: .45rem;
  border-top: 1px solid #252d39;
}
.inventory-tooltip-list > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: .6rem;
  padding: .28rem 0;
}
.inventory-tooltip-list dt {
  color: #768296;
  font-size: .62rem;
}
.inventory-tooltip-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #cbd3df;
  font-size: .64rem;
}
.inventory-tooltip-empty {
  margin: .55rem 0 0;
  padding-top: .5rem;
  border-top: 1px solid #252d39;
}

@media (max-width: 650px) {
  .inventory-panel-heading,
  .inventory-view-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .inventory-view-actions {
    width: 100%;
  }
  .inventory-view-toggle {
    align-self: flex-start;
  }
}
