:root {
    --bg: #2f3238;
    --bg-strong: #21242a;
    --surface: #3a3f47;
    --surface-strong: #454a53;
    --surface-soft: #353941;
    --surface-interactive: #4a505a;
    --surface-interactive-strong: #5986ba;
    --text: #f4f6fa;
    --muted: #afb6c2;
    --primary: #4e85c5;
    --primary-strong: #84afe0;
    --accent: #d36f3e;
    --accent-strong: #ff9a5f;
    --border: rgba(10, 12, 15, 0.36);
    --border-strong: rgba(255, 255, 255, 0.14);
    --shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    --inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI Variable Text", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: linear-gradient(180deg, #343840 0%, #2f3339 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    line-height: 1.6;
}

small {
    color: var(--muted);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.shell {
    width: calc(100% - 30px);
    max-width: none;
    margin: 0 auto;
    padding: 12px 0;
}

.shell-app {
    min-height: calc(100vh - 30px);
}

.app-shell {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 0;
    min-height: calc(100vh - 30px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    overflow: hidden;
    background: #2d3036;
    box-shadow: var(--shadow);
}

.app-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: linear-gradient(180deg, #202328 0%, #21242a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 0;
}

.sidebar-brand-block,
.sidebar-footer {
    padding: 0.9rem 0.85rem;
}

.sidebar-brand-block {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-scroll {
    overflow: auto;
    padding: 0.4rem 0;
}

.sidebar-section {
    padding: 0 0.55rem;
}

.sidebar-section + .sidebar-section {
    margin-top: 0.6rem;
}

.sidebar-section-title {
    margin: 0;
    padding: 0.65rem 0.5rem 0.45rem;
    color: #9fa8b6;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: grid;
    gap: 0.18rem;
}

.sidebar-link {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
    min-height: 42px;
    padding: 0.5rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #e7ebf2;
    transition: 140ms ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-link.is-active {
    background: #383d45;
    border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-link-glyph {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    color: #f2f4f8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.sidebar-link-label {
    min-width: 0;
    font-size: 0.94rem;
}

.sidebar-footer {
    display: grid;
    gap: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-context-row {
    display: grid;
    gap: 0.15rem;
}

.sidebar-context-label {
    color: #9fa8b6;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-width: 0;
    background: #343840;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #2f3339;
}

.workspace-title {
    margin: 0.2rem 0 0;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.1;
}

.workspace-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.workspace-content {
    padding: 1rem 1.05rem 1.2rem;
}

.dashboard-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 0.85rem;
}

.dashboard-banner h2,
.shortcut-card h3,
.list-panel h3,
.compact-filter-panel h3 {
    margin: 0.2rem 0 0.5rem;
    font-size: 0.96rem;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.summary-tile {
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    background: #464b55;
}

.summary-tile strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.15rem;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.shortcut-grid-core {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-top: 0.75rem;
}

.shortcut-card {
    display: grid;
    gap: 0.6rem;
    align-content: start;
    min-height: 170px;
}

.compact-link-list,
.activity-stack {
    display: grid;
    gap: 0.45rem;
}

.compact-note-block {
    margin-top: 0.5rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.compact-note-block p {
    margin: 0.35rem 0 0;
}

.compact-activity-group {
    display: grid;
    gap: 0.3rem;
}

.compact-activity-group + .compact-activity-group {
    margin-top: 0.15rem;
}

.dashboard-grid {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.55rem;
}

.dashboard-grid + .shortcut-grid,
.summary-strip + .shortcut-grid,
.dashboard-grid + .dashboard-grid {
    margin-top: 0.75rem;
}

.dashboard-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.list-panel .panel-header {
    margin-bottom: 0.25rem;
}

.data-list {
    display: grid;
}

.data-list-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.7rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.data-list-row:first-child {
    border-top: 0;
}

.data-list-row strong {
    display: block;
    margin-bottom: 0.15rem;
}

.data-list-row span {
    color: #edf2f8;
    font-weight: 700;
    white-space: nowrap;
    font-size: 0.92rem;
}

.data-list-row-block p {
    margin: 0.35rem 0 0;
}

.data-list-row-member {
    align-items: center;
}

.compact-filter-panel {
    margin-bottom: 0.85rem;
}

.compact-filter-form {
    gap: 0.55rem;
}

.compact-month-chart {
    gap: 0.55rem;
}

.vtc-heading-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

.vtc-heading-title {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1.12rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background:
        radial-gradient(circle at 30% 30%, #ffbb45 0%, #ff8b34 38%, #d14828 72%, #922424 100%);
    color: white;
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.18), 0 8px 16px rgba(0, 0, 0, 0.28);
}

.brand strong {
    display: block;
    font-size: clamp(1rem, 1.4vw, 1.45rem);
    letter-spacing: 0.02em;
}

.brand small {
    display: block;
    color: var(--muted);
    margin-top: 0.2rem;
}

.toolbar-button {
    min-height: 36px;
}

.app-stage {
    display: grid;
    grid-template-columns: minmax(240px, 0.72fr) minmax(0, 2fr) minmax(220px, 0.74fr);
    gap: 1rem;
}

.app-stage-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.app-stage-side {
    min-height: 100%;
}

.app-display-panel {
    min-height: 380px;
}

.station-list {
    display: grid;
    gap: 0.65rem;
}

.station-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(49, 52, 60, 0.88), rgba(34, 36, 42, 0.88));
    transition: 140ms ease;
}

.station-row:hover {
    border-color: rgba(167, 200, 235, 0.28);
    background: linear-gradient(180deg, rgba(58, 68, 84, 0.9), rgba(39, 46, 57, 0.9));
}

.station-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, #5d6777 0%, #353b46 100%);
    color: #eff4fb;
    font-weight: 900;
}

.station-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.station-copy strong,
.station-copy small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spectrum-panel {
    display: grid;
    gap: 1rem;
}

.spectrum-grid {
    display: grid;
    grid-template-columns: repeat(30, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(22, 24, 29, 0.98), rgba(16, 18, 22, 0.98)),
        linear-gradient(90deg, rgba(92, 135, 178, 0.08), rgba(211, 111, 62, 0.05));
}

.spectrum-grid span {
    display: block;
    aspect-ratio: 1 / 0.6;
    border-radius: 2px;
    background:
        linear-gradient(90deg, rgba(90, 93, 183, 0.55), rgba(76, 151, 157, 0.55), rgba(148, 142, 72, 0.55), rgba(136, 75, 98, 0.55));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.quick-actions {
    justify-content: flex-start;
}

.hero,
.hero-compact {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(39, 40, 45, 0.97), rgba(30, 31, 35, 0.97));
    box-shadow: var(--inner-shadow), var(--shadow);
}

.hero-home {
    margin-bottom: 1rem;
}

.hero-panel-compact {
    align-content: start;
}

.hero h1,
.section-header h1,
.auth-panel h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    line-height: 1.02;
}

.hero-compact h1,
.section-header h1,
.auth-panel h1 {
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.lead {
    font-size: 0.95rem;
    max-width: 60ch;
    color: #d2d6df;
}

.hero-panel,
.stats-grid,
.card-grid,
.split-layout,
.triple-layout,
.management-grid,
.profile-layout {
    display: grid;
    gap: 0.75rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 1rem 0;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.split-layout {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.triple-layout {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.archive-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.archive-card h2 {
    margin-top: 0;
}

.archive-table {
    margin-top: 1rem;
}

.filter-panel {
    margin-top: 1rem;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.leaderboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.leaderboard-panel,
.stats-sidebar,
.month-chart {
    display: grid;
    gap: 0.75rem;
}

.stats-sidebar {
    align-content: start;
}

.metric-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.metric-tab {
    padding: 0.42rem 0.68rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-weight: 800;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.84rem;
}

.metric-tab.is-active {
    background: linear-gradient(180deg, #5f88b3 0%, #446988 100%);
    border-color: rgba(154, 196, 241, 0.7);
    color: white;
}

.leaderboard-list {
    display: grid;
    gap: 0.55rem;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 38px 42px minmax(0, 1fr);
    gap: 0.7rem;
    align-items: center;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(48, 52, 59, 0.94), rgba(37, 40, 46, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rank-badge {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, #4f5664 0%, #262c36 100%);
    color: white;
    font-size: 0.88rem;
    font-weight: 900;
}

.driver-avatar,
.driver-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.driver-avatar {
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(180deg, #4a5060 0%, #2a2e37 100%);
    color: #dfe6f0;
    font-weight: 900;
}

.driver-avatar img {
    display: block;
    object-fit: cover;
}

.driver-summary {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.driver-title,
.mini-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: baseline;
}

.driver-title span,
.mini-stat-row span {
    color: #dfe7f5;
    font-weight: 900;
    white-space: nowrap;
    font-size: 0.9rem;
}

.progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f79a0, #86afd6);
}

.progress-track-warm span {
    background: linear-gradient(90deg, #8f5a38, #d88d4b);
}

.mini-stat-row,
.cargo-row,
.month-row {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.mini-stat-row:last-child,
.cargo-row:last-child,
.month-row:last-child {
    border-bottom: 0;
}

.cargo-row {
    display: grid;
    gap: 0.35rem;
}

.monthly-panel {
    margin-top: 1.5rem;
}

.month-row {
    display: grid;
    grid-template-columns: 80px minmax(120px, 1fr) 100px 70px;
    gap: 0.75rem;
    align-items: center;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #40454e;
}

th,
td {
    padding: 0.65rem 0.7rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
}

th {
    color: #f1f4f8;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #3a3f47;
}

.management-grid {
    grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.35fr);
    margin-top: 1.5rem;
}

.profile-layout {
    grid-template-columns: minmax(260px, 0.55fr) minmax(420px, 1.45fr);
    align-items: start;
    margin-top: 1.5rem;
}

.branding-preview {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.vtc-banner,
.vtc-banner-preview,
.vtc-banner-fallback {
    min-height: 180px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.vtc-banner {
    margin-bottom: -3rem;
    position: relative;
}

.vtc-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14, 15, 18, 0.1), rgba(24, 25, 28, 0.88));
}

.vtc-banner img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    display: block;
}

.vtc-banner-preview {
    width: 100%;
    object-fit: cover;
    display: block;
}

.vtc-banner-fallback {
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(92, 135, 178, 0.16), rgba(211, 111, 62, 0.18)),
        #252830;
    color: var(--muted);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.vtc-preview-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vtc-hero {
    position: relative;
}

.vtc-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.vtc-title-row h1 {
    margin-bottom: 0.35rem;
}

.vtc-logo,
.vtc-logo-preview,
.vtc-logo-fallback {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

.vtc-logo,
.vtc-logo-preview {
    object-fit: cover;
    display: block;
    background: #252830;
}

.vtc-logo-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #596273 0%, #2f3540 100%);
    color: white;
    font-size: 1.7rem;
    font-weight: 800;
}

.rules-panel {
    margin-top: 1.5rem;
}

.profile-forms {
    display: grid;
    gap: 1rem;
}

.token-created-box {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid rgba(142, 184, 228, 0.32);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(54, 65, 80, 0.92), rgba(37, 45, 56, 0.92));
}

.token-list {
    margin-top: 1rem;
}

.token-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.token-row:last-child {
    border-bottom: 0;
}

.token-row-main {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.token-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.token-empty-state {
    margin-top: 1rem;
}

.panel,
.stat-card,
.flash,
.auth-panel,
.empty-state {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--surface);
    box-shadow: var(--inner-shadow), var(--shadow);
}

.panel,
.auth-panel,
.empty-state {
    padding: 0.95rem;
}

.auth-shell {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.auth-panel {
    width: min(100%, 540px);
}

.auth-panel-wide {
    width: min(100%, 820px);
}

.stat-card {
    padding: 0.8rem 0.9rem;
    background: #434852;
}

.stat-card strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.15rem;
}

.stat-label,
.eyebrow {
    color: #dbe0e8;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.eyebrow {
    margin-bottom: 0.5rem;
}

.hero-actions,
.section-heading,
.panel-header,
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.section,
.section-header,
.stats-grid,
.split-layout,
.triple-layout {
    margin-top: 1.5rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.58rem 0.82rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: 140ms ease;
    font-size: 0.9rem;
}

.button-primary {
    background: linear-gradient(180deg, #5187c7 0%, #3d6ea8 100%);
    border-color: rgba(163, 202, 244, 0.36);
    color: white;
}

.button-secondary {
    background: #464c56;
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.button-ghost {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.button-danger {
    background: linear-gradient(180deg, #9d4c3e 0%, #6f2d24 100%);
    border-color: rgba(255, 172, 160, 0.28);
    color: white;
}

.button:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    filter: brightness(1.05);
}

.inline-form {
    display: inline-flex;
}

.flash {
    margin: 1rem 1.35rem 0;
    padding: 0.8rem 0.95rem;
}

.flash-success {
    border-color: rgba(142, 184, 228, 0.32);
    background: linear-gradient(180deg, rgba(60, 75, 94, 0.96), rgba(41, 52, 66, 0.96));
}

.flash-error {
    border-color: rgba(211, 111, 62, 0.32);
    background: linear-gradient(180deg, rgba(83, 53, 42, 0.96), rgba(56, 35, 30, 0.96));
}

.form-grid,
.stack {
    display: grid;
    gap: 0.75rem;
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.full-width {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.92rem;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.68rem 0.78rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text);
    background: linear-gradient(180deg, rgba(44, 47, 54, 0.98), rgba(31, 34, 40, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

input::placeholder,
textarea::placeholder {
    color: #7f8591;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(142, 184, 228, 0.72);
    box-shadow: 0 0 0 3px rgba(92, 135, 178, 0.18);
}

textarea {
    resize: vertical;
}

.error-text {
    color: #ff9c78;
}

.list-row,
.stack-item,
.application-card,
.member-editor {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}

.list-row:last-child,
.stack-item:last-child,
.application-card:last-child,
.member-editor:last-child {
    border-bottom: 0;
}

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.list-row-card {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.list-row-card:last-child {
    border-bottom: 0;
}

.list-row-link {
    border-radius: 8px;
    padding: 0.7rem 0.75rem;
    margin: 0 -0.2rem;
    border: 1px solid transparent;
    transition: 140ms ease;
}

.list-row-link:hover {
    border-color: rgba(167, 200, 235, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.meta-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.7rem;
    margin: 0.75rem 0;
}

.meta-list dt {
    font-size: 0.76rem;
    color: var(--muted);
}

.meta-list dd {
    margin: 0.2rem 0 0;
    font-weight: 700;
}

.tag {
    padding: 0.24rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(160, 190, 226, 0.18);
    background: rgba(96, 130, 168, 0.14);
    color: #d8e6f8;
    font-size: 0.74rem;
    font-weight: 700;
}

.text-link {
    color: #cfe0f4;
    font-weight: 700;
    font-size: 0.9rem;
}

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

.presence-list {
    display: grid;
    gap: 1rem;
}

.presence-card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(17, 20, 25, 0.5);
}

.presence-header {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
}

.presence-title {
    display: grid;
    gap: 0.2rem;
}

.presence-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
}

.presence-meta strong {
    display: block;
    margin-top: 0.2rem;
}

.presence-coordinates {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-pill.is-online {
    background: rgba(76, 150, 101, 0.22);
    border-color: rgba(116, 199, 144, 0.3);
    color: #dff5e4;
}

.status-pill.is-offline {
    background: rgba(108, 118, 133, 0.2);
    border-color: rgba(172, 183, 198, 0.24);
    color: #d6dee8;
}

.mini-heading {
    display: block;
    margin-bottom: 0.65rem;
}

.application-card,
.member-editor {
    display: grid;
    gap: 1rem;
}

.action-card {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.metric-inline-list,
.meta-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.metric-inline-list {
    color: var(--muted);
    font-size: 0.84rem;
}

.tag-subtle {
    background: rgba(78, 95, 123, 0.18);
    border-color: rgba(118, 136, 168, 0.35);
}

.compact-meta-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 0;
}

.app-modal {
    width: min(760px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    margin: auto;
    padding: 1rem;
    overflow: auto;
    border: 1px solid rgba(164, 176, 198, 0.28);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(31, 35, 43, 0.98), rgba(20, 23, 29, 0.99));
    color: var(--text);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.app-modal::backdrop {
    background: rgba(7, 9, 13, 0.76);
    backdrop-filter: blur(4px);
}

.modal-close-row,
.modal-header,
.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.modal-close-row {
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.modal-header {
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.modal-header h2 {
    margin: 0.2rem 0 0;
}

.modal-close-button {
    min-width: 0;
}

.modal-copy-block {
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(16, 19, 24, 0.66);
}

.modal-copy-block h3 {
    margin-top: 0;
}

.modal-actions {
    justify-content: flex-start;
    margin-top: 0.8rem;
}

.modal-actions-end {
    justify-content: flex-end;
}

.modal-actions-between {
    justify-content: space-between;
}

.modal-actions-wrap {
    flex-wrap: wrap;
}

.comments-box,
.participant-list {
    margin-top: 0.75rem;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(20, 22, 27, 0.38);
}

.comment-item {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-of-type {
    border-bottom: 0;
}

.comment-avatar,
.comment-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.comment-avatar {
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #5c6574 0%, #353b45 100%);
    color: white;
    font-weight: 800;
    overflow: hidden;
}

.comment-avatar img {
    object-fit: cover;
    display: block;
}

.comment-form,
.rsvp-form,
.delete-form {
    margin-top: 0.75rem;
}

.edit-box {
    margin-top: 0.75rem;
    padding: 0.8rem;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.edit-box summary {
    cursor: pointer;
    font-weight: 800;
    color: #dbe7f7;
}

.edit-box[open] summary {
    margin-bottom: 1rem;
}

.rsvp-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.participant-row {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.participant-row:last-of-type {
    border-bottom: 0;
}

.profile-card {
    text-align: center;
}

.avatar-preview,
.avatar-fallback {
    width: 120px;
    height: 120px;
    margin: 0 auto 0.8rem;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.avatar-preview {
    display: block;
    object-fit: cover;
}

.avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #5f6878 0%, #353b45 100%);
    color: white;
    font-size: 3rem;
    font-weight: 800;
}

code {
    padding: 0.12rem 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #e8edf5;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.role-picker {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.role-picker legend {
    padding: 0 0.35rem;
    color: var(--muted);
    font-weight: 700;
}

.role-picker label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
}

.role-picker input {
    width: auto;
}

.empty-state,
.empty-panel {
    text-align: center;
}

@media (max-width: 920px) {
    .app-shell,
    .workspace-header,
    .workspace-actions,
    .dashboard-banner,
    .hero,
    .hero-compact,
    .leaderboard-layout,
    .management-grid,
    .profile-layout,
    .vtc-title-row,
    .section-heading,
    .section-header,
    .panel-header {
        grid-template-columns: 1fr;
        display: grid;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        grid-template-rows: auto auto auto;
    }

    .sidebar-scroll {
        overflow: visible;
    }

    .workspace-header {
        padding: 1.2rem 1.2rem 1rem;
    }

    .app-stage {
        grid-template-columns: 1fr;
    }

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

    .dashboard-grid-two,
    .dashboard-grid-three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .shell {
        width: calc(100% - 30px);
        padding: 15px 0;
    }

    .workspace-content {
        padding: 1rem;
    }

    .hero,
    .hero-compact,
    .panel,
    .auth-panel,
    .empty-state {
        padding: 1.25rem;
    }

    .hero-actions,
    .workspace-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button,
    .inline-form {
        width: 100%;
    }

    .leaderboard-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .driver-avatar {
        display: none;
    }

    .token-row {
        flex-direction: column;
    }

    .driver-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }
}
