:root {
    --bg: #050816;
    --fg: #f5f5f5;
    --muted: rgba(255, 255, 255, 0.75);
    --muted-strong: rgba(255, 255, 255, 0.9);
    --surface: rgba(5, 8, 22, 0.96);
    --surface-2: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --accent: #ff7b00;
    --accent-2: #ffb347;
    --danger: #ff4d4f;
    --radius-pill: 999px;
    --radius-card: 18px;
    --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.5);
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
}

/* AS: global stylesheet (layout + components + responsive) */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    line-height: 1.5;
}

.container {
    margin: 0 auto;
    max-width: 1200px;
    padding: var(--space-5);
    width: 100%;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    display: flex;
    flex: 1;
}

.main-content > .container {
    display: flex;
    flex: 1;
    flex-direction: column;
}

/* AS: header */

.site-header {
    backdrop-filter: blur(10px);
    background: rgba(5, 8, 22, 0.95);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    align-items: center;
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
}

.brand {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: var(--space-3);
    text-decoration: none;
}

.brand-logo {
    align-items: center;
    background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent));
    border-radius: var(--radius-pill);
    color: var(--bg);
    display: inline-flex;
    font-size: 1.25rem;
    font-weight: 700;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.brand-subtitle {
    font-size: 0.8rem;
    opacity: 0.7;
}

.user-info {
    align-items: center;
    display: flex;
    font-size: 0.9rem;
    gap: var(--space-3);
}

.user-info-icon {
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-pill);
    display: inline-flex;
    font-size: 0.8rem;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.user-info-name {
    opacity: 0.85;
}

.user-info-actions {
    align-items: center;
    display: flex;
    gap: var(--space-3);
}

.user-info-actions form {
    margin: 0;
}

/* AS: footer */

.site-footer {
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    padding: var(--space-5) 0;
}

.site-footer-inner {
    text-align: center;
}

.site-footer-title {
    font-size: 1.2rem;
    margin-bottom: var(--space-2);
    opacity: 0.9;
}

.site-footer-text {
    margin-bottom: var(--space-4);
    opacity: 0.75;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: center;
    margin-bottom: var(--space-4);
}

.site-footer-link {
    color: var(--accent-2);
    font-size: 0.9rem;
    text-decoration: none;
}

.site-footer-link:hover {
    text-decoration: underline;
}

.site-footer-copy {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* AS: buttons */

.btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 500;
    justify-content: center;
    padding: 0.55rem 1.3rem;
    text-decoration: none;
    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease,
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 20px rgba(255, 135, 29, 0.35);
    color: #050816;
}

.btn-primary:hover {
    box-shadow: 0 10px 24px rgba(255, 135, 29, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--fg);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-full {
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-2);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    text-decoration: underline;
}

/* AS: cards */

.card {
    background: radial-gradient(circle at top left, var(--surface-2), var(--surface));
    border: 1px solid var(--surface-2);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 1.75rem;
}

.card--auth {
    margin: 0 auto;
    max-width: 420px;
    padding: 1.8rem;
}

.card--auth .brand {
    margin-bottom: 0.6rem;
}

.card--hero {
    overflow: hidden;
    position: relative;
}

.card-hero-label {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    opacity: 0.75;
}

.card-hero-title {
    font-size: 1.1rem;
    margin-bottom: 0.9rem;
}

.card-hero-list {
    font-size: 0.9rem;
    line-height: 1.6;
    list-style: none;
    padding-left: 0;
}

/* AS: forms */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    opacity: 0.9;
}

.form-control {
    background: rgba(5, 8, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-pill);
    color: var(--fg);
    font-size: 0.95rem;
    outline: none;
    padding: 0.65rem 0.9rem;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
    width: 100%;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.form-control:focus {
    background: rgba(5, 8, 22, 1);
    border-color: var(--accent-2);
    box-shadow: 0 0 0 1px rgba(255, 180, 71, 0.55);
}

.form-group.error .form-control {
    border-color: var(--danger);
    box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.4);
}

.form-error {
    color: #ffb3b5;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* AS: alerts */

.alert {
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.6rem 1rem;
}

.alert-error {
    background: rgba(255, 77, 79, 0.12);
    border: 1px solid rgba(255, 77, 79, 0.45);
    color: #ffb3b5;
}

.alert-success {
    background: rgba(56, 158, 13, 0.16);
    border: 1px solid rgba(56, 158, 13, 0.55);
    color: #c9f7c1;
}

.alert-info {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--fg);
}

/* AS: auth */

.auth-layout {
    align-items: center;
    display: flex;
    flex: 1;
    justify-content: center;
    padding: var(--space-5) 0;
}

.auth-inner {
    display: flex;
    justify-content: center;
    width: 100%;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    opacity: 0.75;
}

.auth-footer-links {
    font-size: 0.8rem;
    margin-top: 0.7rem;
    opacity: 0.75;
    text-align: center;
}

.auth-footer-links a {
    color: var(--accent-2);
    text-decoration: underline;
}

/* AS: page headers */

.page-header {
    align-items: center;
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.page-description {
    font-size: 0.9rem;
    opacity: 0.75;
}

/* AS: search bar */

.search-bar {
    align-items: flex-end;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 2fr 1fr auto;
    margin: 1.5rem 0 1.25rem;
}

.search-with-icon {
    position: relative;
}

.search-with-icon-icon {
    height: 16px;
    left: 0.85rem;
    opacity: 0.7;
    pointer-events: none;
    position: absolute;
    bottom: 0.65rem;
    width: 16px;
}

.search-with-icon-icon svg {
    display: block;
    height: 100%;
    width: 100%;
}

.search-bar .btn {
    padding-bottom: 0.65rem;
    padding-top: 0.65rem;
}

.search-with-icon .form-control {
    padding-left: 2.25rem;
}

/* AS: tables */

.table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-top: 1rem;
    overflow: hidden;
}

.table {
    border-collapse: collapse;
    font-size: 0.9rem;
    width: 100%;
}

.table thead {
    background: rgba(255, 255, 255, 0.04);
}

.table th,
.table td {
    padding: 0.7rem 1rem;
    text-align: left;
}

.table th {
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    opacity: 0.85;
}

.table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.table-actions {
    display: flex;
    gap: 0.4rem;
}

/* AS: forms layout */

.form-layout {
    max-width: 520px;
}

/* AS: home */

.home-hero {
    margin-bottom: 2rem;
    margin-top: 2.5rem;
}

.home-hero-inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
}

.home-hero-text,
.home-hero-card-wrapper {
    flex: 1 1 260px;
    min-width: 260px;
}

.home-hero-title {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.home-hero-lead {
    margin-bottom: 1.4rem;
    max-width: 520px;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.home-features {
    margin-bottom: 2.5rem;
}

.home-features-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.home-features-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-feature-title {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.home-feature-text {
    font-size: 0.9rem;
    opacity: 0.85;
}

.page-section {
    margin-top: 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.role-badge {
    align-items: center;
    border-radius: var(--radius-pill);
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.6rem;
    text-transform: uppercase;
}

.role-badge--admin {
    background: rgba(255, 123, 0, 0.18);
    color: var(--accent-2);
}

.role-badge--user {
    background: rgba(255, 255, 255, 0.06);
    color: var(--fg);
}

/* AS: responsive */

@media (max-width: 768px) {
    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-bar {
        grid-template-columns: 1fr;
    }
}

