body {
    min-height: 100vh;
}

main {
    min-height: calc(100vh - 320px);
}

.input,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    border: 1px solid hsl(var(--input));
    border-radius: calc(var(--radius) - 2px);
    background: hsl(var(--background));
    padding: 0.5rem 0.75rem;
    color: hsl(var(--foreground));
    outline: none;
}

.input:focus,
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

label {
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 500;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--primary));
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.button:hover {
    background: hsl(var(--primary) / 0.9);
}

.button.secondary,
.button.outline {
    border-color: hsl(var(--border));
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.button.secondary:hover,
.button.outline:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.button.on-dark {
    border-color: rgb(255 255 255 / 0.5);
    background: transparent;
    color: white;
}

.button.danger {
    border-color: hsl(var(--destructive));
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.button.small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.inline-form {
    display: inline;
}

.section {
    max-width: 72rem;
    margin: 0 auto;
    padding: 6rem 1rem 4rem;
}

.section.narrow {
    max-width: 56rem;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.muted-copy {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

.section h1,
.admin-main h1 {
    margin-bottom: 0.75rem;
    color: hsl(var(--primary));
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
}

.grid {
    display: grid;
    gap: 1rem;
}

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

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.auth-card {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    padding: 1.5rem;
    box-shadow: var(--shadow-medium);
}

.auth-card {
    max-width: 28rem;
    margin: 6rem auto;
}

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

.form-grid h2 {
    grid-column: 1 / -1;
    color: hsl(var(--primary));
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.form-grid .button {
    justify-self: start;
}

.profile-card img,
.media-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.profile-card img {
    aspect-ratio: 1 / 1;
    max-height: 220px;
}

.action-card {
    display: block;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.search-form input {
    max-width: 28rem;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
}

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

th,
td {
    border-bottom: 1px solid hsl(var(--border));
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: middle;
}

th {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    font-weight: 500;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.row-actions input {
    min-width: 10rem;
}

.user-list {
    overflow: hidden;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--card));
}

.user-list-item {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid hsl(var(--border));
}

.user-list-item:last-child {
    border-bottom: 0;
}

.user-list-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.75rem;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border-radius: 9999px;
    background: hsl(var(--primary) / 0.12);
    color: hsl(var(--primary));
    font-weight: 700;
}

.user-list-copy {
    min-width: 0;
}

.user-list-copy strong,
.user-list-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-list-copy span {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

.user-list-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.status-badge,
.admin-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    border-radius: 9999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.pending {
    border: 1px solid #fcd34d;
    background: #fef3c7;
    color: #92400e;
}

.status-badge.approved {
    border: 1px solid #6ee7b7;
    background: #d1fae5;
    color: #065f46;
}

.status-badge.rejected {
    border: 1px solid #fca5a5;
    background: #fee2e2;
    color: #991b1b;
}

.admin-badge {
    border: 1px solid hsl(var(--border));
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: end;
    min-height: 2.5rem;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid hsl(var(--border));
    padding: 0.75rem 0;
}

.stat {
    display: block;
}

.stat span {
    display: block;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    font-weight: 500;
}

.stat strong {
    display: block;
    margin-top: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.alert {
    position: relative;
    z-index: 60;
    max-width: 72rem;
    margin: 5rem auto 0;
    border-radius: var(--radius);
    border: 1px solid;
    padding: 0.75rem 1rem;
    background: hsl(var(--card));
}

.alert.success {
    border-color: rgb(187 247 208);
    background: rgb(240 253 244);
    color: rgb(22 101 52);
}

.alert.error {
    border-color: rgb(254 202 202);
    background: rgb(254 242 242);
    color: rgb(185 28 28);
}

.ssk-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    background: hsl(var(--primary) / 0.3);
    transition: width 0.3s, background-color 0.3s;
}

.ssk-dot.active {
    width: 3rem;
    background: hsl(var(--primary));
}

.check-dot {
    margin-top: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    border-radius: 9999px;
    border: 1.75px solid hsl(var(--primary));
    position: relative;
}

.check-dot::after {
    content: "";
    position: absolute;
    left: 0.42rem;
    top: 0.25rem;
    width: 0.35rem;
    height: 0.65rem;
    border: solid hsl(var(--primary));
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.mobile-menu-icon {
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0;
}

.mobile-menu-icon::before,
.mobile-menu-icon::after,
.mobile-menu-icon {
    border-top: 2px solid currentColor;
}

.mobile-menu-icon::before,
.mobile-menu-icon::after {
    content: "";
    display: block;
}

.chevron-down {
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-0.1rem) rotate(45deg);
}

.program-menu {
    margin-top: 0.25rem;
}

.program-menu.is-open {
    display: block;
}

.program-menu-item {
    position: relative;
    display: flex;
    width: 100%;
    cursor: pointer;
    user-select: none;
    align-items: center;
    border-radius: calc(var(--radius) - 4px);
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    outline: none;
}

.program-menu-item:hover {
    background: hsl(var(--accent) / 0.1);
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    color: hsl(var(--muted-foreground));
}

.password-toggle svg,
.footer-icon {
    width: 1rem;
    height: 1rem;
}

.password-toggle svg path,
.password-toggle svg circle,
.footer-icon path {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

@media (max-width: 900px) {
    .grid.two,
    .grid.three,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form input {
        max-width: none;
    }

    .user-list-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .user-list-meta,
    .user-list-actions {
        justify-content: flex-start;
    }
}
