* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #202124;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --danger: #dc2626;
    --success: #15803d;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 22px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 800;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
}

.nav a:hover {
    color: var(--primary);
}

.page {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.login-card,
.card,
.hero-card {
    background: var(--card);
    border-radius: 22px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.login-card {
    width: min(460px, 100%);
    margin: 8vh auto;
}

.form-card {
    width: min(620px, 100%);
}

.form-card-wide {
    width: 100%;
}

.login-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #eef2ff;
    display: grid;
    place-items: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
}

h1,
h2 {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
}

h2 {
    margin-bottom: 10px;
}

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

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
    color: var(--primary);
    font-weight: 800;
}

.form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

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

.span-2 {
    grid-column: span 2;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
select,
textarea {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    background: #fff;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #dbeafe;
    border-color: var(--primary);
}

button,
.button-link {
    border: 0;
    border-radius: 14px;
    padding: 14px 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    color: #fff;
    background: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover,
.button-link:hover {
    filter: brightness(0.95);
}

.button-link.secondary {
    color: var(--text);
    background: #eef2ff;
}

.small-button,
.small-link {
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14px;
    text-decoration: none;
    font-weight: 800;
}

.small-link {
    color: var(--primary);
    background: #eef2ff;
}

.small-button {
    color: #fff;
    background: var(--primary);
}

.small-button.danger {
    background: var(--danger);
}

.alert,
.success {
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 700;
    margin-bottom: 18px;
}

.alert {
    background: #fef2f2;
    color: var(--danger);
}

.success {
    background: #f0fdf4;
    color: var(--success);
}

.password-hint,
.field-hint {
    margin-top: 10px;
    font-size: 14px;
}

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

.points-badge {
    min-width: 150px;
    min-height: 120px;
    border-radius: 26px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 900;
    font-size: 42px;
}

.points-badge span {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-top: -18px;
}

.empty-state {
    margin-top: 16px;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: var(--muted);
    background: #fafafa;
}

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

.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.user-row .muted {
    display: block;
    font-size: 14px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.mini-avatar {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    display: inline-block;
}

.stat-card {
    display: grid;
    gap: 8px;
}

.stat-card span {
    color: var(--muted);
    font-weight: 700;
}

.stat-card strong {
    font-size: 36px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.table-subline {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 13px;
    font-weight: 800;
}

.pill-green {
    color: #166534;
    background: #dcfce7;
}

.pill-gray {
    color: #374151;
    background: #f3f4f6;
}

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

.inline-form {
    margin: 0;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
}

legend {
    font-weight: 900;
    padding: 0 8px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    background: #fafafa;
    font-weight: 700;
}

.checkbox-label input {
    width: auto;
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .page {
        padding: 16px;
    }

    .grid,
    .hero-card,
    .form-grid,
    .checkbox-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .span-2 {
        grid-column: span 1;
    }

    .points-badge {
        width: 100%;
    }
}


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

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

.task-main {
    min-width: 0;
}

.task-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.task-description {
    margin: 8px 0;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
    margin-top: 8px;
}

.done-note {
    font-weight: 900;
    color: var(--success);
    white-space: nowrap;
}

.ranking-list {
    display: grid;
    gap: 10px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 42px 36px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafafa;
}

.rank {
    font-weight: 900;
    color: var(--primary);
}

.ranking-points {
    font-weight: 900;
}

.inline-person {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.pill-blue {
    color: #1d4ed8;
    background: #dbeafe;
}

.pill-yellow {
    color: #92400e;
    background: #fef3c7;
}

.pill-red {
    color: #991b1b;
    background: #fee2e2;
}

@media (max-width: 760px) {
    .task-card,
    .ranking-row {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .ranking-row {
        display: flex;
    }
}
