* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;
    color: #1d1d1f;
    background: #f5f5f7;
}

button,
input {
    font: inherit;
}

.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 10%;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(20px);
}

.logo {
    color: #1d1d1f;
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
}

.nav-links a,
.logout-button {
    margin: 0;
    padding: 0;
    border: 0;
    color: #333;
    background: transparent;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.logout-button:hover,
.nav-links a:hover {
    color: #0071e3;
}

.page {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 70px 0 100px;
}

.page-header {
    margin-bottom: 38px;
    text-align: center;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 72px);
    letter-spacing: -3px;
}

.page-header p {
    margin: 16px 0 0;
    color: #6e6e73;
    font-size: 18px;
}

.panel {
    background: #fff;
    border: 1px solid #e5e5e7;
    border-radius: 28px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.05);
}

.login-panel {
    width: min(460px, 100%);
    margin: 0 auto;
    padding: 42px;
}

.login-panel h2 {
    margin: 0 0 8px;
    font-size: 30px;
}

.login-panel > p {
    margin: 0 0 30px;
    color: #6e6e73;
    line-height: 1.7;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 14px;
    outline: none;
    background: #fff;
    color: #1d1d1f;
}

.field input:focus {
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.primary-button {
    width: 100%;
    margin-top: 8px;
    padding: 14px 20px;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    cursor: pointer;
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.message {
    min-height: 22px;
    margin-top: 18px;
    color: #d70015;
    font-size: 14px;
    text-align: center;
}

.loading {
    padding: 70px 20px;
    color: #6e6e73;
    text-align: center;
}

.dashboard {
    display: none;
}

.profile-card {
    padding: 34px;
}

.profile-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.profile-name {
    margin: 0;
    font-size: 32px;
}

.profile-email {
    margin: 8px 0 0;
    color: #6e6e73;
}

.profile-created {
    color: #6e6e73;
    font-size: 14px;
    text-align: right;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 30px;
}

.stat {
    padding: 22px;
    border-radius: 20px;
    background: #f5f5f7;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
}

.stat-label {
    margin-top: 6px;
    color: #6e6e73;
    font-size: 14px;
}

.section {
    margin-top: 34px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
    font-size: 30px;
}

.section-count {
    color: #6e6e73;
    font-size: 14px;
}

.password-card {
    padding: 34px;
}

.password-form {
    max-width: 520px;
}

.password-description {
    margin: 0 0 24px;
    color: #6e6e73;
    line-height: 1.7;
}

.password-message {
    text-align: left;
}

.message-success {
    color: #137333;
}

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

.item-card {
    padding: 26px;
}
.order-card {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.order-card:hover {
    transform: translateY(-2px);
    border-color: #c7c7cc;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07);
}

.order-card:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.3);
    outline-offset: 3px;
}

.order-card-action {
    margin-top: 20px;
    color: #0071e3;
    font-size: 14px;
    font-weight: 600;
}
.item-title-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.item-title {
    margin: 0;
    font-size: 20px;
}

.status {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-active,
.status-online,
.status-paid {
    color: #137333;
    background: #e6f4ea;
}

.status-unused,
.status-inactive,
.status-created,
.status-pending {
    color: #8a5a00;
    background: #fff4ce;
}

.status-revoked,
.status-offline,
.status-failed,
.status-cancelled,
.status-canceled,
.status-refunded {
    color: #b3261e;
    background: #fce8e6;
}

.status-default {
    color: #515154;
    background: #eeeeef;
}

.details {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    margin-top: 24px;
    font-size: 14px;
}

.detail-label {
    color: #6e6e73;
}

.detail-value {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 500;
}

.license-key {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
}

.license-key-control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.license-key-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.license-key-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.license-key-button {
    padding: 5px 11px;
    border: 1px solid #d2d2d7;
    border-radius: 999px;
    background: #fff;
    color: #1d1d1f;
    font-size: 12px;
    cursor: pointer;
}

.license-key-button:hover {
    border-color: #86868b;
    background: #f5f5f7;
}

.license-key-button:disabled {
    cursor: default;
    opacity: 0.7;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 48px 20px;
    border: 1px dashed #d2d2d7;
    border-radius: 24px;
    color: #6e6e73;
    text-align: center;
}

.footer {
    padding: 40px 20px;
    color: #86868b;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 820px) {
    .nav {
        padding: 16px 20px;
    }

    .nav-links a:not(:last-child) {
        display: none;
    }

    .page {
        width: min(100% - 28px, 1180px);
        padding-top: 48px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 540px) {
    .login-panel,
    .profile-card,
    .password-card,
    .item-card {
        padding: 24px;
    }

    .profile-top {
        display: block;
    }

    .profile-created {
        margin-top: 16px;
        text-align: left;
    }

    .details {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .detail-value {
        margin-bottom: 10px;
    }
}
