:root {
    color-scheme: dark;
    --pg-bg: #020711;
    --pg-bg-grid: rgba(37, 208, 255, 0.07);
    --pg-panel: rgba(5, 14, 27, 0.98);
    --pg-panel-soft: rgba(10, 29, 48, 0.96);
    --pg-text: #f4f9ff;
    --pg-muted: #9db0c6;
    --pg-line: rgba(71, 136, 190, 0.36);
    --pg-line-strong: rgba(125, 178, 221, 0.46);
    --pg-accent: #25d0ff;
    --pg-accent-2: #21d38b;
    --pg-danger: #ff5a5f;
    --pg-input: rgba(255, 255, 255, 0.06);
    --pg-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
    --page-max: 1880px;
    font-family: Arial, "Segoe UI", Tahoma, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-width: 1180px;
    min-height: 100%;
    color: var(--pg-text);
    background:
        linear-gradient(90deg, var(--pg-bg-grid) 1px, transparent 1px),
        linear-gradient(180deg, rgba(37, 208, 255, 0.05) 1px, transparent 1px),
        var(--pg-bg);
    background-size: 42px 42px;
}

button,
input,
select {
    font: inherit;
}

button {
    color: inherit;
}

.hidden {
    display: none !important;
}

.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 36px;
    background:
        radial-gradient(circle at 18% 12%, rgba(37, 208, 255, 0.14), transparent 30%),
        radial-gradient(circle at 86% 76%, rgba(33, 211, 139, 0.08), transparent 30%),
        var(--pg-bg);
}

.login-card {
    width: 460px;
    display: grid;
    gap: 18px;
    padding: 30px;
    border: 1px solid var(--pg-line);
    border-radius: 10px;
    color: var(--pg-text);
    background: var(--pg-panel);
    box-shadow: var(--pg-shadow);
}

.brand-line,
.brand-shell {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-line {
    display: grid;
    justify-content: center;
    justify-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.brand-line-login small {
    color: var(--pg-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.brand-logo-panel {
    width: 100%;
    min-height: 106px;
    display: grid;
    place-items: center;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(237, 247, 250, 0.95));
    box-shadow: inset 0 0 0 1px rgba(6, 20, 36, 0.04), 0 14px 34px rgba(0, 0, 0, 0.20);
}

.brand-logo-full {
    width: min(100%, 360px);
    height: auto;
    display: block;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(37, 208, 255, 0.48);
    border-radius: 8px;
    color: #eaffff;
    background: rgba(37, 208, 255, 0.16);
    font-size: 1.35rem;
    font-weight: 950;
    overflow: hidden;
}

.brand-mark img {
    width: 86%;
    height: 86%;
    display: block;
    object-fit: contain;
}

.shell-mark {
    width: 46px;
    height: 46px;
    padding: 3px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(229, 246, 249, 0.95));
    font-size: 1.05rem;
}

.brand-copy,
.shell-brand-text {
    display: grid;
    gap: 2px;
    line-height: 1.1;
}

.brand-copy strong,
.shell-brand-text strong {
    font-size: 1.55rem;
}

.brand-copy small,
.shell-brand-text small {
    color: var(--pg-muted);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0;
}

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

.field span {
    color: var(--pg-muted);
    font-size: 0.86rem;
    font-weight: 850;
}

.field input,
.language-select {
    width: 100%;
    border: 1px solid var(--pg-line-strong);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--pg-text);
    background: var(--pg-input);
    outline: none;
}

.field input:focus,
.language-select:focus {
    border-color: var(--pg-accent);
    outline: 2px solid rgba(37, 208, 255, 0.18);
}

select option {
    color: var(--pg-text);
    background: #071321;
}

.primary-btn,
.nav-button,
.submenu-button {
    min-height: 34px;
    border: 1px solid var(--pg-line-strong);
    border-radius: 10px;
    padding: 0 10px;
    color: var(--pg-text);
    background: rgba(255, 255, 255, 0.06);
    font-weight: 850;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.primary-btn:hover,
.nav-button:hover,
.nav-button.active,
.submenu-button:hover {
    border-color: rgba(37, 208, 255, 0.48);
    background: rgba(37, 208, 255, 0.13);
    transform: translateY(-1px);
}

.form-message {
    min-height: 18px;
    margin: 0;
    color: #ffd8d8;
    font-size: 0.86rem;
    font-weight: 750;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}

.top-bar {
    width: 100%;
    border-bottom: 1px solid var(--pg-line);
    background: var(--pg-panel);
    box-shadow: var(--pg-shadow);
}

.top-bar-inner {
    max-width: var(--page-max);
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 auto;
    padding: 8px 28px;
}

.brand-shell {
    flex: 0 0 auto;
}

.top-nav {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    min-width: 0;
}

.nav-menu {
    position: relative;
    display: inline-flex;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 750;
}

.submenu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    padding: 8px;
    border: 1px solid var(--pg-line-strong);
    border-radius: 10px;
    background: var(--pg-panel-soft);
    box-shadow: var(--pg-shadow);
}

.submenu::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 22px;
    width: 10px;
    height: 10px;
    background: var(--pg-panel-soft);
    border-left: 1px solid var(--pg-line-strong);
    border-top: 1px solid var(--pg-line-strong);
    transform: rotate(45deg);
}

.submenu-button {
    width: 100%;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-color: transparent;
    background: transparent;
    font-size: 13px;
    font-weight: 750;
    text-align: left;
}

.submenu-section {
    padding: 6px 10px 4px;
    color: var(--pg-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-icon,
.frame-title-icon {
    width: 16px;
    height: 16px;
    display: block;
    flex: 0 0 auto;
}

.nav-icon svg,
.frame-title-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke-width: 2.2;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
}

.language-select {
    width: 132px;
    min-height: 36px;
    padding: 0 12px;
}

.frame-wrapper {
    width: min(100%, var(--page-max));
    justify-self: center;
    min-height: calc(100vh - 98px);
    display: flex;
    flex-direction: column;
    margin: 12px;
    overflow: hidden;
    border: 1px solid var(--pg-line);
    border-radius: 10px;
    background: var(--pg-panel);
    box-shadow: var(--pg-shadow);
}

.frame-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(71, 136, 190, 0.24);
    background: var(--pg-panel-soft);
}

.frame-header[hidden] {
    display: none !important;
}

.frame-header-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--pg-text);
    font-size: 15px;
    font-weight: 850;
}

.frame-header-note {
    color: var(--pg-muted);
    font-size: 13px;
    font-weight: 650;
}

.frame-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

.frame-close-button {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 30px;
    border: 1px solid rgba(37, 208, 255, 0.52);
    border-radius: 8px;
    color: #eaffff;
    background: rgba(255, 255, 255, 0.06);
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.frame-close-button:hover {
    border-color: rgba(255, 90, 95, 0.70);
    background: rgba(255, 90, 95, 0.16);
    transform: translateY(-1px);
}

.inline-frame-host {
    flex: 1 1 auto;
    height: calc(100vh - 150px);
    min-height: 560px;
    background: #050e1b;
}

.inline-frame {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: transparent;
}

.admin-shell.workspace-empty .frame-wrapper {
    min-height: calc(100vh - 98px);
}

.admin-shell.workspace-empty .inline-frame-host {
    height: calc(100vh - 98px);
    min-height: calc(100vh - 98px);
}

.admin-shell.workspace-empty .inline-frame {
    display: none;
}

.toast {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    padding: 13px 18px;
    border: 1px solid var(--pg-line);
    border-radius: 10px;
    color: var(--pg-text);
    background: var(--pg-panel-soft);
    box-shadow: var(--pg-shadow);
}

@media (max-width: 1500px) {
    .top-bar-inner {
        gap: 10px;
        padding-inline: 18px;
    }

    .nav-button {
        padding: 0 8px;
        font-size: 12.7px;
        gap: 6px;
    }

    .submenu-button {
        font-size: 12.5px;
    }
}
