:root {
    --bg: #f3f6fa;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --blue: #1677ff;
    --blue-dark: #0f5fd0;
    --green: #0f8f5f;
    --red: #c2410c;
    --soft-blue: #e8f1ff;
    --soft-green: #e9f8f0;
    --soft-gray: #f2f4f7;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    background: transparent;
}

.mobile-auth {
    width: min(100%, 480px);
    min-height: 100vh;
    margin: 0 auto;
    overflow-x: hidden;
    background: #f4f5f7;
}

.clean-mobile {
    background: #f4f5f7;
}

.phone-status {
    height: 68px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 25px 27px 0;
    color: #111216;
    font-size: 23px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
}

.phone-status span:last-child {
    font-size: 14px;
    padding-top: 3px;
}

.mobile-login-screen {
    min-height: 100vh;
    padding: 39px 16px 86px;
    position: relative;
}

.mobile-brand {
    display: grid;
    justify-items: center;
    gap: 7px;
    margin-bottom: 47px;
}

.mobile-brand h1 {
    margin: 0;
    color: #202124;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0;
}

.brand-mark {
    width: 78px;
    height: 70px;
    border-radius: 0;
    display: grid;
    place-items: center;
    color: #fff;
    background: transparent;
    box-shadow: none;
    transform: none;
    position: relative;
}

.brand-mark::before {
    content: "★";
    position: absolute;
    color: #ffd000;
    font-size: 83px;
    line-height: 1;
    text-shadow: 0 1px 0 #f3c200;
}

.brand-mark-core {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 37px;
    font-weight: 800;
    transform: skew(-18deg);
}

.mobile-input-panel,
.verify-panel-mobile {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.mobile-input-panel label {
    height: 51px;
    display: flex;
    align-items: center;
    padding: 0 14px;
}

.mobile-input-panel label + label {
    border-top: 1px solid #e7e8ec;
}

.mobile-input-panel input,
.verify-row-mobile input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #1f2024;
    background: transparent;
    font-size: 17px;
    letter-spacing: 0;
}

.mobile-input-panel input::placeholder,
.verify-row-mobile input::placeholder {
    color: #c5c6cb;
    opacity: 1;
}

.mobile-primary,
.mobile-secondary {
    width: 100%;
    height: 41px;
    border-radius: 3px;
    display: grid;
    place-items: center;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
}

.mobile-primary {
    margin-top: 33px;
    border: 0;
    color: #fff;
    background: #1296ec;
}

.mobile-secondary {
    margin-top: 16px;
    border: 1px solid #adadb2;
    color: #17181c;
}

.mobile-links {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 39px;
    margin-top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 31px;
    font-size: 14px;
    font-weight: 700;
}

.mobile-links button,
.phone-help,
.verify-row-mobile button {
    border: 0;
    cursor: pointer;
}

.mobile-links span {
    width: 1px;
    height: 16px;
    background: #dddfe4;
}

.mobile-browser {
    position: fixed;
    left: 50%;
    bottom: 17px;
    transform: translateX(-50%);
    width: min(calc(100% - 52px), 428px);
    height: 69px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    border-radius: 18px;
    color: #101116;
    background: #fff;
    box-shadow: 0 7px 28px rgba(22, 27, 34, .08);
    font-size: 22px;
}

.mobile-browser strong {
    font-weight: 400;
}

.browser-menu {
    width: 25px;
    height: 18px;
    border-top: 3px solid #111216;
    border-bottom: 3px solid #111216;
    position: relative;
    flex: 0 0 auto;
}

.browser-menu::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 6px;
    border-top: 3px solid #111216;
}

.browser-refresh {
    font-size: 34px;
    line-height: 1;
}

.mobile-alert {
    margin: -28px 0 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
}

.mobile-alert.error {
    color: var(--red);
    background: #fff2ec;
}

.mobile-alert.success {
    color: var(--green);
    background: var(--soft-green);
}

.verify-clean .mobile-alert {
    margin: 0 0 12px;
    font-size: 13px;
}

.mobile-topbar {
    height: 40px;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    background: #fff;
}

.mobile-topbar h1 {
    margin: 0;
    grid-column: 2;
    text-align: center;
    color: #1f2024;
    font-size: 17px;
    font-weight: 700;
}

.mobile-back {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    text-decoration: none;
}

.mobile-back::before {
    content: "";
    width: 11px;
    height: 11px;
    border-left: 2px solid #1f2024;
    border-bottom: 2px solid #1f2024;
    transform: rotate(45deg);
}

.mobile-verify-screen {
    min-height: calc(100vh - 40px);
    padding: 14px 15px 86px;
}

.verify-tip {
    margin: 0 0 20px;
    color: #8e929b;
    font-size: 14px;
    line-height: 1.42;
    letter-spacing: 0;
}

.verify-row-mobile {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 15px;
    color: #1f2024;
    font-size: 16px;
}

.verify-row-mobile + .verify-row-mobile {
    border-top: 1px solid #e7e8ec;
}

.verify-row-mobile span {
    flex: 0 0 50px;
    font-weight: 700;
}

.verify-row-mobile strong {
    font-size: 16px;
    font-weight: 400;
}

.verify-row-mobile input {
    font-size: 16px;
}

.verify-row-mobile button {
    flex: 0 0 auto;
    color: #1e73d8;
    white-space: nowrap;
    font-size: 16px;
}

.verify-row-mobile button:disabled {
    color: #969aa3;
    cursor: not-allowed;
}

.verify-submit {
    margin-top: 40px;
    height: 41px;
    background: #ccecff;
    color: rgba(255, 255, 255, .74);
    font-size: 16px;
}

.verify-submit:disabled {
    cursor: not-allowed;
    background: #ccecff;
    color: rgba(255, 255, 255, .74);
}

.verify-submit:not(:disabled) {
    cursor: pointer;
    background: #1296ec;
    color: #fff;
}

.phone-help {
    display: block;
    margin: 17px auto 0;
    color: #2b6da3;
    font-size: 15px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.auth-card {
    width: min(100%, 430px);
    padding: 34px 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 45px rgba(25, 35, 50, .08);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    line-height: 1.25;
    letter-spacing: 0;
}

.lead {
    margin: 12px 0 24px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.form {
    display: grid;
    gap: 18px;
}

.form label {
    display: grid;
    gap: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    color: var(--text);
    background: #ffffff;
    font-size: 16px;
}

.form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .14);
}

.primary-button,
.secondary-button {
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    padding: 0 18px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
}

.primary-button {
    width: 100%;
    color: #ffffff;
    background: var(--blue);
}

.primary-button:hover {
    background: var(--blue-dark);
}

.secondary-button {
    border: 1px solid #cfd6e1;
    color: #374151;
    background: #ffffff;
}

.secondary-button:hover {
    background: var(--soft-gray);
}

.text-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.alert.error {
    color: var(--red);
    background: #fff2ec;
}

.alert.success {
    color: var(--green);
    background: var(--soft-green);
}

.admin-page {
    min-height: 100vh;
    padding: 28px;
}

.admin-header {
    max-width: 1180px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-header h1 {
    font-size: 28px;
}

.refresh-state {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.table-wrap {
    max-width: 1180px;
    margin: 0 auto;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 12px 35px rgba(25, 35, 50, .06);
}

table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    color: #4b5563;
    background: #f8fafc;
    font-size: 13px;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--blue-dark);
    background: var(--soft-blue);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.success-badge {
    color: var(--green);
    background: var(--soft-green);
}

.muted-badge {
    color: #667085;
    background: var(--soft-gray);
}

.ua {
    max-width: 320px;
    color: var(--muted);
    word-break: break-word;
}

.empty {
    height: 120px;
    color: var(--muted);
    text-align: center;
    vertical-align: middle;
}

@media (max-width: 640px) {
    .auth-card {
        padding: 28px 20px;
    }

    h1 {
        font-size: 26px;
    }

    .admin-page {
        padding: 20px 12px;
    }

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

@media (max-width: 380px) {
    .phone-status {
        padding-inline: 20px;
        font-size: 21px;
    }

    .mobile-login-screen,
    .mobile-verify-screen {
        padding-inline: 14px;
    }

    .mobile-input-panel input {
        font-size: 16px;
    }

    .mobile-primary,
    .mobile-secondary {
        height: 41px;
        font-size: 16px;
    }

    .mobile-links {
        left: 14px;
        right: 14px;
        gap: 24px;
        font-size: 14px;
    }

    .mobile-browser {
        width: calc(100% - 36px);
        font-size: 19px;
    }

    .verify-row-mobile {
        gap: 14px;
    }

    .verify-row-mobile button,
    .verify-row-mobile input {
        font-size: 19px;
    }
}
