:root {
    --app-bg: #eef5e8;
    --app-bg-soft: #f7fbf2;
    --app-surface: rgba(255, 255, 255, 0.94);
    --app-surface-strong: #ffffff;
    --app-border: rgba(93, 104, 166, 0.14);
    --app-border-strong: rgba(49, 115, 2, 0.24);
    --app-text: #1f2645;
    --app-muted: #66728f;
    --app-primary: #33d3a7;
    --app-primary-dark: #58d300;
    --app-primary-soft: rgba(104, 242, 5, 0.18);
    --app-success-soft: rgba(71, 166, 3, 0.14);
    --app-danger-soft: rgba(93, 104, 166, 0.12);
    --app-shadow: 0 1.15rem 3rem rgba(49, 115, 2, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Rethink Sans', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(104, 242, 5, 0.18), transparent 24%),
        radial-gradient(circle at bottom right, rgba(93, 104, 166, 0.14), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, var(--app-bg) 100%);
    background-repeat: no-repeat;
    color: var(--app-text);
    min-height: 100vh;
}

.navbar-app {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--app-border);
}

.brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 0.75rem 1.5rem rgba(93, 104, 166, 0.24);
}

.page-shell {
    padding-top: 1.8rem;
    padding-bottom: 3rem;
}

.app-subnav {
    margin-bottom: 1.5rem;
    padding: 0.6rem;
    border: 1px solid var(--app-border);
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--app-shadow);
}

.app-subnav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.78rem 1rem;
    border-radius: 0.95rem;
    color: var(--app-muted);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.18s ease;
}

.app-subnav-link:hover {
    color: var(--app-primary-dark);
    background: var(--app-primary-soft);
}

.app-subnav-link.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
    box-shadow: 0 0.85rem 1.8rem rgba(93, 104, 166, 0.22);
}

.app-flash-stack {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.app-flash {
    border: 1px solid transparent;
    border-radius: 1.1rem;
    padding: 1rem 1.15rem;
    font-weight: 600;
    box-shadow: var(--app-shadow);
}

.app-flash-success {
    background: var(--app-success-soft);
    border-color: rgba(21, 128, 61, 0.14);
    color: #166534;
}

.app-flash-danger {
    background: var(--app-danger-soft);
    border-color: rgba(185, 28, 28, 0.16);
    color: #991b1b;
}

.panel-card,
.stat-card {
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

.panel-card {
    overflow: hidden;
}

.page-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--app-muted);
    max-width: 48rem;
    line-height: 1.65;
}

.metric-label {
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    font-weight: 800;
}

.metric-value {
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.table-modern {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(93, 104, 166, 0.035);
    --bs-table-hover-bg: rgba(104, 242, 5, 0.08);
    margin-bottom: 0;
}

.table-modern thead th {
    color: var(--app-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    border-bottom-width: 1px;
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.table-modern tbody td {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
    border: none;
    box-shadow: 0 0.8rem 1.8rem rgba(93, 104, 166, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--app-primary-dark) 0%, #47A603 100%);
}

.btn-primary,
.btn-outline-secondary,
.btn-outline-primary {
    border-radius: 0.95rem;
    padding-left: 1rem;
    padding-right: 1rem;
    font-weight: 700;
}

.btn.is-submitting {
    pointer-events: none;
    opacity: 0.9;
}

.btn-spinner {
    width: 1rem;
    height: 1rem;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: button-spin 0.75s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-outline-secondary {
    color: var(--app-text);
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.72);
}

.btn-outline-primary {
    color: var(--app-primary);
    border-color: rgba(15, 76, 129, 0.18);
    background: rgba(255, 255, 255, 0.72);
}

.form-control,
.form-select {
    border-radius: 0.95rem;
    padding: 0.82rem 0.95rem;
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.92);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(93, 104, 166, 0.58);
    box-shadow: 0 0 0 0.25rem rgba(93, 104, 166, 0.14);
}

.form-label {
    color: var(--app-text);
}

.badge-soft {
    background: rgba(104, 242, 5, 0.18);
    color: var(--app-primary-dark);
    border-radius: 999px;
    padding: 0.5rem 0.78rem;
    font-weight: 700;
}

.surface-outline {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(247, 251, 242, 0.98) 100%);
}

.stat-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.stat-link .stat-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-link:hover .stat-card {
    transform: translateY(-2px);
    border-color: rgba(93, 104, 166, 0.24);
    box-shadow: 0 1.5rem 3.2rem rgba(49, 115, 2, 0.14);
}

@media (max-width: 991.98px) {
    .page-shell {
        padding-top: 1.25rem;
    }

    .app-subnav {
        overflow-x: auto;
    }

    .app-subnav .d-flex {
        flex-wrap: nowrap !important;
        min-width: max-content;
    }
}

.auth-shell {
    min-height: 100vh;
}

.auth-brand {
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4323cd;
    font-size: 0.78rem;
    font-weight: 700;
}

.auth-card {
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    background: var(--app-surface);
    box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

.auth-panel {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, #4631f3 0%, #3d0273 56%, #7e03a6 100%);
    color: #e2e8f0;
    min-height: 100%;
}

.auth-panel::after {
    content: "";
    position: absolute;
    inset: auto -10% -25% auto;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.small-label {
    color: rgba(226, 232, 240, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 700;
}
