:root {
    --bg: #eef7f4;
    --card: #ffffff;
    --line: #cfe2dd;
    --text: #08252a;
    --muted: #57706f;
    --green: #168676;
    --green-dark: #0c6157;
    --danger: #c93434;
    --soft: #edf6f3;
    --shadow: 0 18px 50px rgba(11, 68, 62, .11);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(22, 134, 118, .13), transparent 35%), var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
    width: min(1480px, calc(100% - 32px));
    margin-inline: auto;
}

.topbar-shell {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: 14px;
}

.topbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.menu-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--text);
    background: var(--soft);
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 900;
    text-decoration: none;
}

.brand-icon {
    display: flex;
    color: inherit;
    text-decoration: none;
}

.clock-box {
    display: grid;
    min-width: 150px;
    margin-left: 8px;
    line-height: 1.15;
}

.topbar-title {
    position: absolute;
    left: 50%;
    max-width: 38%;
    transform: translateX(-50%);
    color: var(--text);
    font-size: 18px;
    font-weight: 950;
    letter-spacing: -.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clock-box strong {
    font-size: 20px;
}

.clock-box span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    border-radius: 12px;
}

.nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    display: none;
    min-width: 230px;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.nav.is-open {
    display: flex;
}

.nav a,
.account a {
    color: var(--text);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 12px;
}

.nav a:hover,
.account a:hover {
    background: var(--soft);
}

.account {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    color: var(--muted);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
    background: #f7fcfa;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    padding-top: 1px;
}

.user-pill strong,
.user-pill small {
    display: block;
    line-height: 1.1;
}

.user-pill small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.logout-form {
    margin: 0;
}

.logout-form button {
    border: 1px solid #f0caca;
    border-radius: 12px;
    padding: 10px 12px;
    color: #a32727;
    background: #fff6f6;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.logout-form button:hover {
    background: var(--soft);
}

.page {
    width: min(1480px, calc(100% - 32px));
    margin: 28px auto;
}

.footer,
.login-footer {
    width: min(1480px, calc(100% - 32px));
    margin: 24px auto;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    font-weight: 800;
}

.hero-card,
.card {
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 16px 22px;
    margin-bottom: 16px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--green);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0 0 12px;
}

h1 {
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -.04em;
}

h2 {
    font-size: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 22px;
}

.card {
    padding: 22px;
}

.form-card {
    align-self: start;
}

label {
    display: grid;
    gap: 7px;
    margin: 0 0 14px;
    color: #294245;
    font-size: 13px;
    font-weight: 800;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #bdd4ce;
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
    background: #f8fcfb;
}

code {
    border-radius: 7px;
    padding: 2px 6px;
    background: var(--soft);
}

select {
    min-height: 42px;
    border: 1px solid #bdd4ce;
    border-radius: 12px;
    padding: 9px 12px;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    background: #f8fcfb;
}

input:focus {
    border-color: var(--green);
    outline: 3px solid rgba(22, 134, 118, .15);
}

select:focus {
    border-color: var(--green);
    outline: 3px solid rgba(22, 134, 118, .15);
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check input {
    width: auto;
    min-height: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background: var(--green);
    box-shadow: 0 12px 28px rgba(22, 134, 118, .2);
}

.btn-soft {
    color: var(--text);
    background: #e9f2ef;
}

.btn-danger {
    color: #fff;
    background: var(--danger);
}

.btn-disabled,
.btn-disabled:disabled {
    color: #7b908d;
    background: #e9f0ee;
    cursor: not-allowed;
    opacity: .85;
}

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

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

th,
td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

thead tr,
tbody tr {
    box-shadow: inset 0 -1px 0 #e0ece9;
}

th {
    color: #274348;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.actions {
    display: grid;
    grid-template-columns: 76px 64px;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
    min-width: 148px;
}

.actions form {
    margin: 0;
    display: contents;
}

.actions .btn {
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    line-height: 40px;
}


.role-form {
    margin: 0;
}

.password-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    white-space: nowrap;
}

.password-form input {
    width: 180px;
    min-width: 150px;
    min-height: 40px;
}

.password-form .btn {
    min-height: 40px;
    padding-inline: 14px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(320px, 430px) 1fr;
    gap: 22px;
    margin-bottom: 22px;
}

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

.section-head p {
    margin: 0;
}

.switch-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text);
}

.switch-check input {
    width: 18px;
    height: 18px;
    min-height: auto;
}

.settings-save {
    margin-top: 18px;
}

.pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 900;
}

.pill-ok {
    color: #0f6d40;
    background: #dbf4e5;
}

.pill-off {
    color: #875116;
    background: #fff1cc;
}

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

.alert {
    margin: 0 0 14px;
    border-radius: 14px;
    padding: 13px 16px;
    font-weight: 700;
}

.alert-ok {
    color: #0d6840;
    background: #dff6e8;
}

.alert-error {
    color: #9f1f1f;
    background: #fde1e1;
}

.login-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 10% 15%, rgba(125, 220, 205, .24), transparent 28%),
        linear-gradient(105deg, #0f4d45 0%, #13584f 50%, #f5fbf9 50.2%, #eef7f4 100%);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(360px, 560px) minmax(340px, 448px);
    gap: clamp(82px, 10vw, 150px);
    align-items: center;
    width: min(1180px, calc(100% - 56px));
    min-height: min(720px, calc(100vh - 80px));
    margin: auto;
}

.login-brand-panel {
    color: #fff;
}

.login-brand-panel .eyebrow {
    color: #9ee8dc;
}

.login-brand-panel h1 {
    max-width: 520px;
    margin-bottom: 22px;
    color: #fff;
    font-size: clamp(44px, 5.5vw, 70px);
    line-height: 1.02;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 70px;
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

.login-lead {
    max-width: 500px;
    color: rgba(255, 255, 255, .82);
    font-size: 18px;
    line-height: 1.7;
}

.login-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 34px;
    max-width: 500px;
}

.login-chips span {
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .08);
    color: #e9fffb;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.login-card {
    position: relative;
    border: 1px solid rgba(207, 226, 221, .96);
    border-radius: 28px;
    padding: clamp(28px, 4vw, 48px);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 30px 80px rgba(7, 55, 50, .17);
}

.qr-box {
    display: grid;
    place-items: center;
    margin: 12px 0;
}

.qr-box img {
    width: 220px;
    height: 220px;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 10px;
    background: #fff;
}

.secret-code {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    background: var(--soft);
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 900;
    letter-spacing: .12em;
}

.auth-manual {
    font-size: 13px;
    line-height: 1.55;
}


.auth-reset {
    margin: 12px 0 0;
    text-align: center;
}

.auth-reset button {
    border: 0;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.auth-danger-zone {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.auth-danger-zone summary {
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
}

.auth-reset-form {
    margin-top: 12px;
}

.auth-reset-form label {
    margin-bottom: 8px;
}

.backup-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.backup-codes code {
    display: block;
    padding: 12px;
    text-align: center;
    font-size: 16px;
    font-weight: 950;
    letter-spacing: .08em;
}

.auth-print {
    width: 100%;
    margin-bottom: 10px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.digital-thumb {
    width: 92px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 10px;
    object-fit: cover;
    background: var(--soft);
}

.small-input {
    max-width: 110px;
}

.compact-head {
    margin: 22px 0 12px;
}

.compact-head h3 {
    margin: 0 0 4px;
}

.player-list {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.player-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(239, 248, 245, .72);
}

.player-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

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

.btn-small {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.sync-output {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    background: var(--soft);
}

.sync-output summary {
    font-weight: 900;
    cursor: pointer;
}

.sync-output pre {
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 12px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 27, 31, .46);
    backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(440px, 100%);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 26px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 28px 90px rgba(5, 38, 34, .25);
}

.modal-card h2 {
    margin-bottom: 10px;
}

.modal-card p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.55;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.login-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.login-card-head h2 {
    margin-bottom: 0;
    font-size: 32px;
}

.login-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 15px;
    color: var(--green);
    background: var(--soft);
    font-weight: 900;
}

.login-form label {
    margin-bottom: 18px;
}

.login-remember {
    margin-top: -4px;
    color: var(--muted);
}

.login-submit {
    width: 100%;
    min-height: 54px;
    justify-content: space-between;
    padding-inline: 20px;
    font-size: 17px;
}

.login-note {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

@media (max-width: 900px) {
    .topbar,
    .account {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        align-items: stretch;
    }

    .clock-box {
        margin-left: 0;
    }

    .account {
        margin-left: 0;
    }

    .nav {
        left: 0;
        right: 0;
        min-width: auto;
    }

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

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

    .topbar-title {
        position: static;
        max-width: none;
        transform: none;
        order: 3;
    }

    .login-screen {
        background: linear-gradient(180deg, #0f4d45 0%, #166357 42%, #eef7f4 42.2%, #eef7f4 100%);
    }

    .login-shell {
        grid-template-columns: 1fr;
        gap: 22px;
        width: min(100% - 24px, 620px);
        min-height: auto;
        margin: 24px auto;
    }

    .login-logo {
        margin-bottom: 36px;
    }

    .login-brand-panel h1 {
        font-size: 48px;
    }
}
