body {
    min-height: 100vh;
}

.app-content {
    padding: 1.25rem 1rem;
}

@media (min-width: 768px) {
    .app-content {
        padding: 1.5rem;
    }
}

.content-header {
    margin-bottom: 1.25rem;
}

.content-header h2 {
    margin-bottom: 0;
}

.card {
    margin-bottom: 1rem;
}

.table-responsive {
    margin-bottom: 1rem;
}

/* ===== Primary buttons (brand gradient, app-wide) ===== */

.btn-primary {
    border: none;
    background: linear-gradient(135deg, #05122b 0%, var(--bs-primary) 100%);
    background-size: 160% 160%;
    background-position: 0% 50%;
    transition: background-position .35s ease, transform .15s ease, box-shadow .15s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    border: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background-position: 100% 50%;
    transform: translateY(-1px);
    box-shadow: 0 .5rem 1.25rem rgba(var(--bs-primary-rgb), .35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled,
.btn-primary.disabled {
    border: none;
    background: #94a3b8;
    transform: none;
    box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
    .btn-primary {
        transition: none;
    }
}

/* ===== Auth / Login pages ===== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: #eef1f6;
}

.auth-shell {
    display: flex;
    width: 100%;
    max-width: 68rem;
    min-height: 34rem;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1.5rem 3.5rem rgba(15, 23, 42, .18);
    animation: authFadeIn .6s ease-out;
}

/* ---- Brand / identity side panel ---- */

.auth-side {
    position: relative;
    flex: 0 0 44%;
    max-width: 34rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 3rem;
    color: #fff;
    background: linear-gradient(160deg, #05122b 0%, var(--bs-primary) 100%);
}

.auth-side::before {
    content: "";
    position: absolute;
    top: -8rem;
    right: -8rem;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, .35) 0%, rgba(96, 165, 250, 0) 70%);
    animation: authGlowPulse 8s ease-in-out infinite;
}

@keyframes authGlowPulse {
    0%, 100% { opacity: .6; transform: scale(1); }
    50%      { opacity: 1;  transform: scale(1.12); }
}

.auth-side-content {
    position: relative;
    z-index: 1;
    max-width: 26rem;
    animation: authFadeIn .8s ease-out;
}

.auth-brand-link {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .75rem;
    font-size: 1.3rem;
    color: var(--bs-primary);
    background: #fff;
}

.auth-brand-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}

.auth-side-rule {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, .18);
    margin: 1.75rem 0;
}

.auth-side-headline {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.auth-side-subtext {
    color: rgba(255, 255, 255, .75);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.auth-dots {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .5rem;
    width: fit-content;
}

.auth-dots span {
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .3);
}

/* ---- Form panel ---- */

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: #fff;
}

.auth-form-inner {
    width: 100%;
    max-width: 24rem;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-mobile-brand {
    display: none;
}

.auth-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: .35rem;
}

.login-box-msg {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.auth-form-inner .form-control {
    border-radius: .6rem;
    border-color: #e5e7eb;
    padding-block: .6rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-form-inner .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15);
}

.auth-form-inner .btn-primary {
    padding-block: .65rem;
}

.auth-form-inner .btn-outline-secondary {
    border-color: #e5e7eb;
    transition: background-color .15s ease;
}

.login-page a:not(.btn) {
    text-decoration: none;
    color: var(--bs-primary);
    font-weight: 500;
    transition: color .15s ease;
}

.login-page a:not(.btn):hover {
    color: var(--bs-primary-text-emphasis, var(--bs-primary));
    filter: brightness(.85);
}

.login-page a.btn {
    text-decoration: none;
}

@media (max-width: 991.98px) {
    .auth-side {
        flex: 0 0 40%;
        padding: 2.5rem;
    }
}

@media (max-width: 767.98px) {
    .login-page {
        padding: 1rem;
    }

    .auth-shell {
        min-height: 0;
        border-radius: .85rem;
    }

    .auth-side {
        display: none;
    }

    .auth-form-panel {
        padding: 2rem 1.5rem;
    }

    .auth-mobile-brand {
        display: inline-flex;
        align-items: center;
        gap: .6rem;
        text-decoration: none;
        margin-bottom: 2rem;
    }

    .auth-mobile-brand .auth-brand-mark {
        color: #fff;
        background: var(--bs-primary);
    }

    .auth-mobile-brand .auth-brand-text {
        color: #111827;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-side::before,
    .auth-side-content,
    .auth-form-inner {
        animation: none !important;
        transition: none !important;
    }
}

.small-box {
    overflow: hidden;
    color: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}

.small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .2);
}

.small-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.small-box .inner {
    order: 1;
}

.small-box .small-box-icon {
    display: block;
    float: right;
    order: 2;
    position: static;
    z-index: 0;
    font-size: 4rem;
    line-height: 1;
    padding-right: 1rem;
    color: rgba(255, 255, 255, .4);
    transition: transform .3s ease;
}

.small-box:hover .small-box-icon {
    transform: scale(1.12) rotate(8deg);
}

.small-box .small-box-footer {
    order: 3;
    width: 100%;
    text-decoration: none;
}

.small-box .inner h3,
.small-box .inner p {
    text-align: left;
    color: #fff;
}

.small-box .small-box-footer {
    color: #fff;
    background-color: rgba(0, 0, 0, .15);
}

.small-box .small-box-footer:hover {
    color: #fff;
    background-color: rgba(0, 0, 0, .25);
}

.small-box.text-bg-primary {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important;
}

.small-box.text-bg-success {
    background: linear-gradient(135deg, #1cc88a 0%, #169b6b 100%) !important;
}

.small-box.text-bg-info {
    background: linear-gradient(135deg, #36b9cc 0%, #258391 100%) !important;
}

.small-box.text-bg-secondary {
    background: linear-gradient(135deg, #858796 0%, #60616f 100%) !important;
}

/* ===== Dashboard ===== */

.dashboard-welcome {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 1rem;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #05122b 0%, var(--bs-primary) 100%);
    position: relative;
    overflow: hidden;
}

.dashboard-welcome::before {
    content: "";
    position: absolute;
    top: -6rem;
    right: -4rem;
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, .3) 0%, rgba(96, 165, 250, 0) 70%);
}

.dashboard-welcome h2 {
    position: relative;
    z-index: 1;
    margin-bottom: .25rem;
    font-weight: 700;
}

.dashboard-welcome p {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, .8);
    margin-bottom: 0;
}

.dashboard-welcome .dashboard-date {
    position: relative;
    z-index: 1;
    font-size: .875rem;
    color: rgba(255, 255, 255, .7);
}

.dashboard-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.portal-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 2rem 1.25rem;
    border-radius: .9rem;
    border: 1px solid var(--bs-border-color);
    text-decoration: none;
    color: inherit;
    background: var(--bs-body-bg);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

a.portal-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 .75rem 1.5rem rgba(15, 23, 42, .1);
    border-color: rgba(var(--bs-primary-rgb), .35);
}

.portal-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    color: #fff;
    background: linear-gradient(135deg, #05122b 0%, var(--bs-primary) 100%);
    transition: transform .25s ease;
}

a.portal-tile:hover .portal-tile-icon {
    transform: scale(1.08) rotate(-4deg);
}

.portal-tile-name {
    font-weight: 600;
    margin-bottom: .25rem;
}

.portal-tile-desc {
    font-size: .825rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0;
}

.activity-feed-item {
    display: flex;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.activity-feed-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-feed-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    font-size: .95rem;
    background: rgba(var(--bs-primary-rgb), .1);
    color: var(--bs-primary);
}
