:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #dbe1ea;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

h1 {
    margin-top: 0;
}

p, li {
    line-height: 1.6;
}

ul {
    padding-left: 20px;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.meta p {
    margin: 6px 0;
}

.btn {
    display: inline-block;
    border: 0;
    background: #2563eb;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background: #1d4ed8;
}

.options {
    margin: 20px 0;
    display: grid;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
}

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

.hero-card {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid #dbeafe;
}

.hero-title {
    margin-bottom: 10px;
}

.hero-subtitle {
    color: var(--muted);
    margin-top: 0;
}

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

.metric-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.metric-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.metric-subvalue {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.section-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.section-title {
    margin-top: 0;
    margin-bottom: 14px;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.result-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.result-card h3,
.result-card h4 {
    margin-top: 0;
    margin-bottom: 12px;
}

.ranking-list {
    margin: 0;
    padding-left: 20px;
}

.ranking-list li {
    margin-bottom: 8px;
}

.score-list {
    display: grid;
    gap: 12px;
}

.score-row {
    display: grid;
    gap: 6px;
}

.score-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.score-label {
    font-weight: 600;
    font-size: 14px;
}

.score-value {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.score-bar {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
    border-radius: 999px;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
}

.summary-list {
    margin: 0;
    padding-left: 20px;
}

.summary-list li {
    margin-bottom: 6px;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

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

.top-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.top-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.top-card-title {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 6px;
}

.top-card-value {
    font-size: 18px;
    font-weight: 700;
}

.top-card-extra {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.module-block + .module-block {
    margin-top: 18px;
}

@media (max-width: 700px) {
    .metric-value {
        font-size: 18px;
    }
}

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

.chart-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}

.chart-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 340px;
}

.chart-box.chart-box-bar {
    height: 360px;
}

.chart-note {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.auth-shell {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
    padding: 24px 0;
}

.auth-card {
    width: min(100%, 760px);
    background: #ffffff;
    border: 1px solid #dbe1ea;
    border-radius: 28px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.10);
    overflow: hidden;
}

.auth-card-inner {
    display: grid;
    grid-template-columns: 1fr;
}

.auth-panel {
    padding: 42px 42px 34px;
}

.auth-title {
    margin: 0 0 12px 0;
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0 0 28px 0;
    font-size: 16px;
    color: #5b6472;
    line-height: 1.55;
}

.form-stack {
    display: grid;
    gap: 18px;
    margin: 0;
}

.form-label {
    display: grid;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: #1f2937;
}

.form-input {
    width: 100%;
    height: 58px;
    padding: 0 16px;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    font-size: 16px;
    color: #1f2937;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-input::placeholder {
    color: #8a94a6;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
    background: #ffffff;
}

.auth-submit {
    margin-top: 6px;
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2f6fe4 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.20);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-submit:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
}

.auth-submit:active {
    transform: translateY(0);
}

.alert-error {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 12px;
    margin: 0 0 18px 0;
    font-size: 14px;
}

.auth-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 26px 0 20px 0;
}

.auth-footer {
    margin: 0;
    font-size: 15px;
    color: #374151;
}

.auth-footer a {
    font-weight: 700;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-note {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

@media (max-width: 640px) {
    .auth-shell {
        padding: 12px 0;
        min-height: auto;
    }

    .auth-card {
        border-radius: 20px;
    }

    .auth-panel {
        padding: 28px 22px 24px;
    }

    .auth-title {
        font-size: 28px;
    }

    .auth-subtitle {
        font-size: 15px;
        margin-bottom: 22px;
    }

    .form-input {
        height: 54px;
    }

    .auth-submit {
        height: 54px;
    }
}

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

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

.module-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 16px;
}

.module-card-head {
    display: grid;
    gap: 14px;
}

.module-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    line-height: 1.15;
}

.module-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.module-badge {
    display: inline-block;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.module-badge-active {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.module-badge-inactive {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fdba74;
}

.module-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.module-badge-pending {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.admin-user-list {
    display: grid;
    gap: 14px;
}

.admin-user-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
}

.admin-user-name {
    margin: 0 0 6px 0;
    font-size: 20px;
}

.admin-user-meta {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.admin-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.inline-form {
    display: inline-flex;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #b91c1c;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-danger:hover {
    background: #ffe4e6;
    transform: translateY(-1px);
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.admin-form-full {
    grid-column: 1 / -1;
}

.admin-code-list {
    display: grid;
    gap: 18px;
}

.admin-code-meta {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

.admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
}

.admin-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-delete-grid {
    display: grid;
    gap: 16px;
    max-width: 420px;
}

.recent-code-box {
    padding: 18px;
    border: 1px dashed #93c5fd;
    border-radius: 16px;
    background: #eff6ff;
}

.recent-code-value {
    margin: 0 0 10px 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #1d4ed8;
}

.ranking-list {
    margin: 0;
    padding-left: 22px;
}

.ranking-list li {
    margin-bottom: 6px;
}

.module-promo-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    margin-top: 10px;
    flex-wrap: wrap;
}

.module-promo-main {
    display: flex;
    align-items: flex-start;
}

.module-promo-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 150px;
    padding-top: 4px;
}

.module-example-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: underline;
    text-align: center;
    line-height: 1.4;
}

.module-price {
    font-size: 20px;
    font-weight: 750;
    color: #111827;
    text-align: center;
    line-height: 1.1;
}