:root {
    --paper: #fffaf0;
    --panel: rgba(255, 255, 255, 0.95);
    --panel-strong: #ffffff;
    --line: #111111;
    --accent: #f6c544;
    --accent-2: #9bd7ff;
    --soft: #fff4bf;
    --good: #c9f5d0;
    --danger: #ffd8d8;
    --danger-strong: #d94b40;
    --text-main: #111111;
    --text-muted: #4f4f4f;
    --shadow-lg: 8px 8px 0 var(--line);
    --shadow-md: 4px 4px 0 var(--line);
}

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

html {
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    display: block;
    font-family: Tahoma, "Noto Sans Thai", "Kanit", sans-serif;
    color: var(--text-main);
    background:
        linear-gradient(135deg, rgba(246, 197, 68, 0.32), rgba(155, 215, 255, 0.34)),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 18px),
        var(--paper);
    padding: 18px;
}

body.theme-night {
    --paper: #050505;
    --panel: rgba(16, 16, 16, 0.94);
    --panel-strong: #101010;
    --line: #3a3a3a;
    --accent: #f6c544;
    --accent-2: #59d9ff;
    --soft: #3b3207;
    --good: #143322;
    --danger: #361818;
    --danger-strong: #ff9588;
    --text-main: #f5f5f5;
    --text-muted: #b7b7b7;
    --shadow-lg: 0 22px 52px rgba(0, 0, 0, 0.46);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.34);
    background:
        radial-gradient(circle at top right, rgba(246, 197, 68, 0.12), transparent 34%),
        radial-gradient(circle at left center, rgba(89, 217, 255, 0.12), transparent 30%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 18px),
        var(--paper);
}

.hidden {
    display: none !important;
}

.glass-panel,
.glass-header,
.glass-card,
.menu-btn,
.app-list-item,
.modal-block,
.premium-table,
table {
    background: var(--panel);
    border: 2px solid var(--line);
    box-shadow: var(--shadow-lg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.glass-card {
    border-radius: 18px;
    padding: 20px;
}

#loginScreen {
    width: min(460px, 100%);
    margin: 7vh auto 0;
    padding: 28px;
    border-radius: 24px;
    text-align: center;
    display: none;
    position: relative;
}

#loginScreen.active {
    display: block;
}

#loginScreen::before {
    content: "Thai Train Simulator Admin";
    display: inline-block;
    margin-bottom: 16px;
    padding: 8px 14px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--accent);
    color: var(--text-main);
    font-weight: 900;
    font-size: 0.95rem;
}

.login-box h1 {
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: clamp(34px, 4vw, 50px);
    line-height: 1.08;
    font-weight: 900;
}

#screenTitle {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.08;
    font-weight: 900;
}

h2,
h3,
p,
li,
td,
th,
label,
span,
div {
    color: var(--text-main);
}

#loginScreen p,
.panel p,
.app-list-subtitle,
.server-info-list li,
.empty-msg {
    color: var(--text-muted);
}

input,
select,
textarea,
.premium-input {
    width: 100%;
    min-height: 48px;
    background: #ffffff !important;
    border: 2px solid var(--line) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    color: var(--text-main) !important;
    font-size: 1rem;
    outline: none;
    box-shadow: none !important;
    font-family: inherit;
}

input::placeholder,
textarea::placeholder {
    color: #666666 !important;
}

input:focus,
select:focus,
textarea:focus,
.premium-input:focus {
    border-color: var(--accent-2) !important;
    box-shadow: 0 0 0 3px rgba(155, 215, 255, 0.35) !important;
}

button {
    cursor: pointer;
    min-height: 48px;
    border: 2px solid var(--line) !important;
    border-radius: 14px !important;
    padding: 10px 16px;
    position: relative;
    font-family: inherit;
    font-weight: 900 !important;
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
    box-shadow: var(--shadow-md) !important;
}

button:hover {
    transform: translateY(-1px);
    filter: saturate(1.04);
}

button:active,
button.is-pressing {
    transform: translateY(1px) scale(0.992);
    filter: brightness(0.98) saturate(1.06);
}

button:disabled,
button.is-busy {
    cursor: progress;
    opacity: 0.84;
    filter: saturate(0.88);
}

#loginBtn,
.btn-primary {
    background: var(--accent) !important;
    color: var(--text-main) !important;
}

.btn-secondary {
    background: var(--accent-2) !important;
    color: var(--text-main) !important;
}

.btn-danger {
    background: var(--danger) !important;
    color: var(--text-main) !important;
}

.btn-success {
    background: var(--good) !important;
    color: var(--text-main) !important;
}

.btn-warning {
    background: var(--soft) !important;
    color: var(--text-main) !important;
}

.btn-outline {
    background: transparent !important;
    color: var(--danger-strong) !important;
    border: 2px solid var(--line) !important;
    box-shadow: none !important;
}

.theme-toggle-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 12000;
    min-width: 180px;
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--text-main) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.theme-night .theme-toggle-btn {
    background: rgba(10, 10, 10, 0.98) !important;
    color: var(--accent) !important;
    border-color: rgba(246, 197, 68, 0.88) !important;
}

button[style*="#2b78e4"] {
    background: var(--accent-2) !important;
    color: var(--text-main) !important;
}

button[style*="#0f9d58"] {
    background: var(--good) !important;
    color: var(--text-main) !important;
}

button[style*="#ff3333"],
button[style*="#ff453a"] {
    background: var(--danger) !important;
    color: var(--text-main) !important;
}

button[style*="#8e44ad"] {
    background: var(--soft) !important;
    color: var(--text-main) !important;
}

.btn-delete-small {
    background: var(--danger) !important;
    color: var(--text-main) !important;
    border: 2px solid var(--line) !important;
}

.btn-action-large {
    min-height: 54px;
    border-radius: 16px !important;
}

.error {
    color: var(--danger-strong) !important;
    font-size: 0.92rem;
    font-weight: 800;
    margin-top: 15px;
    min-height: 20px;
}

body.theme-night .glass-panel,
body.theme-night .glass-header,
body.theme-night .glass-card,
body.theme-night .menu-btn,
body.theme-night .app-list-item,
body.theme-night .modal-block,
body.theme-night .premium-table,
body.theme-night table,
body.theme-night .action-card,
body.theme-night .shop-hero,
body.theme-night .shop-command-card,
body.theme-night .shop-search-card,
body.theme-night .shop-stat-card,
body.theme-night .shop-form-section,
body.theme-night .shop-badge,
body.theme-night .shop-command-meta,
body.theme-night .shop-tab-btn,
body.theme-night .shop-mini-tab,
body.theme-night .shop-toggle-chip,
body.theme-night .shop-note-list li,
body.theme-night .shop-empty,
body.theme-night .shop-record-card,
body.theme-night .shop-record-status {
    background: rgba(14, 14, 14, 0.94) !important;
    color: var(--text-main) !important;
}

body.theme-night .shop-form-section--accent {
    background: rgba(48, 39, 6, 0.82) !important;
}

body.theme-night .shop-form-section--audio,
body.theme-night .shop-stat-card--cool {
    background: rgba(6, 31, 39, 0.82) !important;
}

body.theme-night .shop-form-section--quick,
body.theme-night .shop-command-card,
body.theme-night .shop-note-card {
    background: linear-gradient(145deg, rgba(20, 20, 20, 0.98), rgba(9, 26, 34, 0.92)) !important;
}

body.theme-night .shop-stat-card--warm,
body.theme-night .shop-record-chip.is-warn {
    background: rgba(58, 45, 8, 0.94) !important;
    color: #ffd978 !important;
}

body.theme-night .shop-stat-card--good,
body.theme-night .shop-record-chip.is-good,
body.theme-night .shop-record-status.is-active,
body.theme-night .shop-record-status.is-granted {
    background: rgba(14, 54, 28, 0.94) !important;
    color: #c5ffd3 !important;
}

body.theme-night .shop-stat-card--pending,
body.theme-night .shop-record-status.is-pending {
    background: rgba(67, 47, 13, 0.94) !important;
    color: #ffe2aa !important;
}

body.theme-night .shop-record-status.is-inactive,
body.theme-night .shop-record-status.is-failed {
    background: rgba(63, 22, 22, 0.94) !important;
    color: #ffc1b8 !important;
}

body.theme-night .shop-record-status.is-neutral,
body.theme-night .shop-record-chip,
body.theme-night .shop-record-chip.is-muted {
    background: rgba(17, 27, 39, 0.94) !important;
    color: #b9eaff !important;
    border-color: rgba(89, 217, 255, 0.16) !important;
}

body.theme-night input,
body.theme-night select,
body.theme-night textarea,
body.theme-night .premium-input,
body.theme-night table,
body.theme-night .premium-table,
body.theme-night .shop-record-card,
body.theme-night .shop-stat-card,
body.theme-night .shop-note-list li,
body.theme-night .shop-toggle-chip,
body.theme-night .shop-badge,
body.theme-night .shop-search-card,
body.theme-night .shop-command-meta,
body.theme-night [style*="background: rgba(255,255,255,0.1)"] {
    background: rgba(9, 9, 9, 0.96) !important;
    color: var(--text-main) !important;
    border-color: var(--line) !important;
}

body.theme-night input::placeholder,
body.theme-night textarea::placeholder {
    color: #8d8d8d !important;
}

body.theme-night th {
    background: rgba(246, 197, 68, 0.2) !important;
    color: #ffe7a1 !important;
}

body.theme-night tr:hover,
body.theme-night .menu-btn:hover,
body.theme-night .menu-btn:focus,
body.theme-night .app-list-item:hover,
body.theme-night .action-card:active {
    background: rgba(89, 217, 255, 0.12) !important;
}

body.theme-night .server-info-list li,
body.theme-night .shop-record-section {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body.theme-night .shop-note-list code {
    background: rgba(89, 217, 255, 0.14) !important;
    color: #b9eaff !important;
}

body.theme-night .shop-empty,
body.theme-night .shop-record-code,
body.theme-night .shop-status--neutral,
body.theme-night .modal-desc,
body.theme-night .panel p,
body.theme-night #loginScreen p,
body.theme-night .app-list-subtitle,
body.theme-night .server-info-list li,
body.theme-night .card-desc,
body.theme-night .shop-card-desc,
body.theme-night .shop-section-note,
body.theme-night .shop-stat-label {
    color: var(--text-muted) !important;
}

body.theme-night [style*="color: black"] {
    color: var(--text-main) !important;
}

.dashboard-container {
    width: min(1280px, 100%);
    min-height: auto;
    display: block;
    margin: 0 auto;
}

.dashboard-container.active {
    display: block;
}

.main-content {
    width: min(1220px, 100%);
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 22px;
    margin-bottom: 18px;
    position: relative;
}

.logo {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.back-btn {
    position: fixed;
    top: 18px;
    left: 18px;
    background: var(--panel);
    border: 2px solid var(--line) !important;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    border-radius: 14px;
    z-index: 9999;
    box-shadow: var(--shadow-md);
}

.dashboard-content {
    padding: 0;
    display: grid;
    gap: 18px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-icon {
    font-size: 2rem;
    color: var(--text-main);
    background: var(--accent);
    width: 58px;
    height: 58px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    border: 2px solid var(--line);
}

.stat-info h3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 1.75rem;
    font-weight: 900;
}

.actions-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
}

.panel h3 {
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 900;
}

.panel p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 15px;
}

textarea {
    resize: vertical;
    margin-bottom: 10px;
}

#broadcastStatus {
    margin-top: 10px;
    margin-bottom: 0;
    color: #127444 !important;
    font-weight: 800;
}

.server-info-list {
    list-style: none;
    margin-bottom: 20px;
}

.server-info-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.15);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}

.server-info-list li:last-child {
    border-bottom: none;
}

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

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

table,
.premium-table {
    width: 100%;
    border-collapse: collapse !important;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(17, 17, 17, 0.16) !important;
    font-size: 0.94rem;
    vertical-align: top;
}

th {
    color: var(--text-main);
    font-weight: 900;
    background: var(--accent) !important;
    text-transform: none;
    letter-spacing: 0;
}

tr:hover {
    background: rgba(155, 215, 255, 0.12) !important;
}

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 20px !important;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.menu-btn,
.app-list-item {
    background: var(--panel-strong);
    color: var(--text-main);
    padding: 18px 20px;
    font-size: 1.08rem;
    border-radius: 18px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-btn:hover,
.menu-btn:focus,
.app-list-item:hover {
    background: rgba(155, 215, 255, 0.2) !important;
    border-color: var(--line) !important;
    outline: none !important;
}

.sidebar,
.sidebar-logo,
.nav-links,
.nav-item,
.tab-pane {
    all: unset;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.action-card {
    background-color: var(--panel-strong);
    border-radius: 18px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.1s, background-color 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--line);
}

.action-card:active {
    transform: scale(0.98);
    background-color: rgba(155, 215, 255, 0.22);
}

.icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.card-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-main);
}

.card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.35;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 17, 17, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-block {
    border-radius: 22px;
    width: 90%;
    max-width: 440px;
    padding: 22px;
    transform: scale(0.94);
    transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-block {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.3em;
    font-weight: 900;
}

.btn-close-modal {
    background: transparent !important;
    border: 2px solid var(--line) !important;
    color: var(--text-main) !important;
    font-size: 1.2em;
    cursor: pointer;
    min-height: 40px;
    min-width: 40px;
    padding: 0;
    box-shadow: none !important;
}

.modal-desc {
    color: var(--text-muted);
    margin-bottom: 18px;
    font-size: 0.92em;
}

.modal-body.menu-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-list-item {
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.app-list-info {
    flex: 1;
}

.app-list-title {
    font-size: 1.05em;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 4px;
}

.app-list-chevron {
    color: var(--text-muted);
    font-size: 1.5em;
    padding-left: 10px;
}

.shop-admin-page {
    display: grid;
    gap: 20px;
}

.shop-back-btn {
    width: fit-content;
}

.shop-shell {
    display: grid;
    gap: 20px;
}

.shop-hero {
    padding: 24px;
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(246, 197, 68, 0.18), rgba(155, 215, 255, 0.22)),
        var(--panel);
}

.shop-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.shop-intro {
    max-width: 760px;
}

.shop-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.shop-intro h2 {
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.08;
    font-weight: 900;
    margin-bottom: 10px;
}

.shop-intro p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 62ch;
}

.shop-actions {
    min-width: 280px;
    max-width: 360px;
    display: grid;
    gap: 12px;
    align-self: stretch;
}

.shop-actions .btn-primary {
    width: 100%;
}

.shop-status {
    min-height: 22px;
    color: #127444;
    font-weight: 800;
    line-height: 1.45;
}

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

.shop-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.shop-quick-actions > * {
    width: 100%;
}

.shop-command-card {
    padding: 18px 20px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(232, 240, 254, 0.92)),
        var(--panel);
}

.shop-command-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.shop-command-meta {
    min-width: 240px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 2px solid rgba(17, 17, 17, 0.08);
    background: rgba(255, 255, 255, 0.98);
    color: #0f4d92;
    font-weight: 800;
    line-height: 1.55;
    box-shadow: var(--shadow-md);
}

.shop-tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shop-tab-btn,
.shop-mini-tab {
    appearance: none;
    border: 2px solid rgba(26, 115, 232, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.98);
    color: #174ea6;
    padding: 11px 18px;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
    box-shadow: var(--shadow-md);
}

.shop-tab-btn:hover,
.shop-mini-tab:hover {
    transform: translateY(-1px);
}

.shop-tab-btn.is-active {
    background: #1a73e8;
    color: #ffffff;
    border-color: #1a73e8;
    box-shadow: 0 16px 28px rgba(26, 115, 232, 0.22);
}

.shop-section-jumps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.shop-panel-stack {
    display: grid;
}

.shop-panel {
    display: none;
    gap: 16px;
}

.shop-panel.is-active {
    display: grid;
}

.shop-panel[hidden] {
    display: none !important;
}

.shop-filter-toolbar {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.shop-search-card {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 2px solid rgba(26, 115, 232, 0.12);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.shop-search-card label {
    font-size: 0.95rem;
    font-weight: 900;
}

.shop-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 14px;
}

.shop-list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.shop-scroll-region {
    max-height: min(74vh, 1200px);
    overflow: auto;
    padding-right: 8px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.shop-scroll-region::-webkit-scrollbar {
    width: 10px;
}

.shop-scroll-region::-webkit-scrollbar-thumb {
    background: rgba(26, 115, 232, 0.26);
    border-radius: 999px;
}

.shop-scroll-region::-webkit-scrollbar-track {
    background: rgba(26, 115, 232, 0.06);
    border-radius: 999px;
}

.shop-credits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    align-items: start;
}

.shop-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.shop-stat-card {
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow-md);
}

.shop-stat-card--warm {
    background: rgba(255, 244, 191, 0.95);
}

.shop-stat-card--good {
    background: rgba(201, 245, 208, 0.95);
}

.shop-stat-card--pending {
    background: rgba(255, 226, 189, 0.95);
}

.shop-stat-card--cool {
    background: rgba(214, 239, 255, 0.95);
}

.shop-stat-label {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-muted);
}

.shop-stat-value {
    margin-top: 8px;
    font-size: clamp(2rem, 4vw, 2.4rem);
    line-height: 1;
    font-weight: 900;
}

.shop-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
    gap: 20px;
    align-items: start;
}

.shop-card {
    padding: 22px;
    border-radius: 22px;
}

.shop-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.shop-card-title {
    font-size: 1.32rem;
    font-weight: 900;
    line-height: 1.2;
}

.shop-card-desc {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 62ch;
}

.shop-editor-layout,
.shop-side-stack {
    display: grid;
    gap: 16px;
}

.shop-side-stack {
    position: sticky;
    top: 16px;
}

.shop-form-section {
    border: 2px solid rgba(17, 17, 17, 0.12);
    border-radius: 20px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.84);
}

.shop-form-section--accent {
    background: rgba(255, 244, 191, 0.48);
}

.shop-form-section--audio {
    background: rgba(214, 239, 255, 0.56);
}

.shop-form-section--quick {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(232, 240, 254, 0.9)),
        var(--panel);
    border-color: rgba(26, 115, 232, 0.18);
}

.shop-section-title {
    font-size: 1.04rem;
    font-weight: 900;
    margin-bottom: 4px;
}

.shop-section-note {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.shop-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

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

.shop-quick-builder-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(140px, 0.7fr) minmax(220px, 1fr) minmax(200px, 1fr) minmax(200px, 0.9fr);
    gap: 12px 14px;
    align-items: end;
}

.shop-quick-builder-action {
    display: grid;
    gap: 8px;
}

.shop-quick-builder-action label {
    font-size: 0.95rem;
    font-weight: 800;
}

.shop-quick-builder-action .btn-primary {
    min-height: 48px;
}

.shop-field {
    display: grid;
    gap: 8px;
}

.shop-field label {
    font-size: 0.95rem;
    font-weight: 800;
}

.shop-field-wide {
    grid-column: 1 / -1;
}

.shop-code-textarea {
    font-family: Consolas, "Courier New", monospace;
}

.shop-file-input {
    min-height: 48px;
    padding: 10px 12px;
}

.shop-sound-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 14px;
}

.shop-inline-select {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.shop-inline-select .btn-secondary {
    min-width: 78px;
}

.shop-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.shop-toggle-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
    font-weight: 800;
}

.shop-toggle-chip input {
    width: auto;
    min-height: auto;
    margin: 0;
    box-shadow: none !important;
}

.shop-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shop-action-row > * {
    flex: 1 1 220px;
}

.shop-note-card {
    background:
        linear-gradient(145deg, rgba(255, 244, 191, 0.4), rgba(255, 255, 255, 0.94)),
        var(--panel);
}

.shop-note-list {
    list-style: none;
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.shop-note-list li {
    padding: 12px 14px;
    border-radius: 16px;
    border: 2px solid rgba(17, 17, 17, 0.1);
    background: #ffffff;
    line-height: 1.6;
    font-size: 0.94rem;
}

.shop-note-list strong,
.shop-note-list code {
    font-weight: 900;
}

.shop-note-list code {
    background: rgba(155, 215, 255, 0.22);
    padding: 2px 6px;
    border-radius: 8px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.88rem;
}

.shop-list-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 20px;
    align-items: start;
}

.shop-list-card {
    min-height: 100%;
}

.shop-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 18px;
    border: 2px dashed rgba(17, 17, 17, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
}

.shop-record-card {
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 12px;
}

.shop-record-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.shop-record-stack {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.shop-record-title {
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.35;
}

.shop-record-code {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.shop-record-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: #ffffff;
    font-weight: 900;
    white-space: nowrap;
}

.shop-record-status.is-active,
.shop-record-status.is-granted {
    background: rgba(201, 245, 208, 0.95);
}

.shop-record-status.is-inactive,
.shop-record-status.is-failed {
    background: rgba(255, 216, 216, 0.95);
}

.shop-record-status.is-pending {
    background: rgba(255, 226, 189, 0.95);
}

.shop-record-status.is-neutral {
    background: rgba(214, 239, 255, 0.92);
}

.shop-record-meta {
    color: var(--text-main);
    font-size: 0.94rem;
    line-height: 1.55;
}

.shop-record-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-record-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(26, 115, 232, 0.12);
    background: rgba(232, 240, 254, 0.96);
    color: #174ea6;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.2;
}

.shop-record-chip.is-muted {
    background: rgba(245, 247, 250, 0.98);
    color: var(--text-muted);
    border-color: rgba(17, 17, 17, 0.08);
}

.shop-record-chip.is-good {
    background: rgba(201, 245, 208, 0.95);
    color: #127444;
    border-color: rgba(18, 116, 68, 0.14);
}

.shop-record-chip.is-warn {
    background: rgba(255, 244, 191, 0.95);
    color: #8b5e00;
    border-color: rgba(139, 94, 0, 0.14);
}

.shop-record-price-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    font-size: 0.95rem;
    line-height: 1.55;
}

.shop-record-price-line strong {
    font-weight: 900;
}

.shop-record-description {
    color: var(--text-muted);
    white-space: pre-wrap;
}

.shop-record-section {
    display: grid;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px dashed rgba(17, 17, 17, 0.2);
}

.shop-record-caption {
    font-size: 0.84rem;
    font-weight: 900;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.shop-record-list {
    display: grid;
    gap: 6px;
}

.shop-record-item {
    font-size: 0.93rem;
    color: var(--text-main);
    line-height: 1.5;
}

.shop-record-item.is-muted {
    color: var(--text-muted);
}

.shop-record-item.is-warn {
    color: #9a4b00;
    font-weight: 800;
}

.shop-record-item.is-danger {
    color: var(--danger-strong);
    font-weight: 800;
}

.shop-record-item.is-info {
    color: #0f4d92;
    font-weight: 800;
}

.shop-record-link {
    color: #0f4d92;
    text-decoration: none;
    font-weight: 900;
}

.shop-record-link:hover {
    text-decoration: underline;
}

.shop-record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-record-actions > * {
    flex: 1 1 138px;
}

[style*="background: rgba(0,0,0,0.5)"],
[style*="background: rgba(0, 0, 0, 0.5)"],
[style*="background: rgba(0,0,0,0.28)"],
[style*="background:rgba(0,0,0,0.5)"] {
    background: var(--panel) !important;
    border: 2px solid var(--line) !important;
    border-radius: 18px !important;
    box-shadow: var(--shadow-md) !important;
}

[style*="background-color: rgba(239, 68, 68, 0.2)"] {
    background: rgba(255, 216, 216, 0.96) !important;
}

[style*="color: #ff3333"] {
    color: var(--danger-strong) !important;
    font-weight: 800;
}

[style*="background: rgba(255,255,255,0.1)"] {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 2px solid var(--line) !important;
}

body.theme-night [style*="background-color: rgba(239, 68, 68, 0.2)"] {
    background: rgba(63, 22, 22, 0.94) !important;
}

body.theme-night [style*="background: rgba(0,0,0,0.5)"],
body.theme-night [style*="background: rgba(0, 0, 0, 0.5)"],
body.theme-night [style*="background: rgba(0,0,0,0.28)"],
body.theme-night [style*="background:rgba(0,0,0,0.5)"] {
    background: rgba(12, 12, 12, 0.95) !important;
}

*:focus-visible {
    outline: 4px solid var(--accent-2) !important;
    outline-offset: 3px !important;
    border-radius: 4px;
}

@media (max-width: 980px) {
    .actions-row {
        grid-template-columns: 1fr;
    }

    .glass-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .shop-workspace,
    .shop-list-grid {
        grid-template-columns: 1fr;
    }

    .shop-side-stack {
        position: static;
    }

    .shop-command-bar,
    .shop-list-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .shop-command-meta {
        min-width: 0;
    }

    .shop-quick-builder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-quick-builder-action {
        grid-column: 1 / -1;
    }

    .shop-scroll-region {
        max-height: none;
        padding-right: 0;
    }
}

@media (max-width: 820px) {
    body {
        padding: 12px;
    }

    .theme-toggle-btn {
        top: 12px;
        left: 12px;
        right: 12px;
        min-width: 0;
        width: auto;
    }

    #loginScreen {
        margin-top: 76px;
    }

    .glass-panel,
    .glass-header,
    .glass-card,
    .menu-btn,
    .app-list-item,
    .premium-table,
    table,
    .modal-block {
        box-shadow: var(--shadow-md);
    }

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

    .back-btn {
        position: static;
        margin-bottom: 12px;
    }

    .shop-hero,
    .shop-card {
        padding: 18px;
    }

    .shop-form-grid {
        grid-template-columns: 1fr;
    }

    .shop-quick-builder-grid {
        grid-template-columns: 1fr;
    }

    .shop-tab-row,
    .shop-section-jumps {
        flex-direction: column;
    }

    .shop-toggle-row,
    .shop-action-row,
    .shop-record-actions {
        flex-direction: column;
    }

    .shop-action-row > *,
    .shop-record-actions > * {
        flex-basis: auto;
    }
}
