@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --app-bg: #f4f8ff;
    --app-panel: #ffffff;
    --app-border: #dbe7ff;
    --app-muted: #64748b;
    --app-text: #0f172a;
    --app-primary: #2563eb;
    --app-primary-soft: #3b82f6;
    --app-accent: #38bdf8;
    --app-sidebar-width: 272px;
    --app-topbar-height: 72px;
}

body {
    font-family: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(900px 460px at 8% -10%, rgba(59, 130, 246, 0.20), transparent 56%),
        radial-gradient(820px 480px at 98% 0%, rgba(56, 189, 248, 0.16), transparent 54%),
        var(--app-bg);
    color: var(--app-text);
}

.app-shell {
    min-height: 100vh;
}

.app-topbar {
    min-height: var(--app-topbar-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}

.app-brand {
    color: var(--app-text);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.app-brand:hover {
    color: var(--app-primary);
}

.app-sidebar {
    width: var(--app-sidebar-width);
    background: linear-gradient(170deg, #1e3a8a 0%, #1d4ed8 35%, #2563eb 70%, #3b82f6 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.20);
    min-height: calc(100vh - var(--app-topbar-height));
    position: fixed;
    top: var(--app-topbar-height);
    left: 0;
    bottom: 0;
    box-shadow: 10px 0 30px rgba(37, 99, 235, 0.24);
    z-index: 1015;
}

.app-sidebar-content {
    height: 100%;
    overflow-y: auto;
}

/* Bootstrap nav reset replacement for sidebar after removing Bootstrap CSS */
.app-sidebar-nav,
.app-sidebar-nav ul,
.app-sidebar-nav .nav,
.app-sidebar-nav .sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-sidebar-nav .nav-item {
    list-style: none;
}

.app-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    padding: 0.75rem 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.app-sidebar-nav .nav-link i {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.app-sidebar-nav .nav-link:hover {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.app-sidebar-nav .nav-link.active {
    background: linear-gradient(110deg, #ffffff, #eff6ff);
    color: #1e3a8a !important;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 22px rgba(30, 58, 138, 0.18);
}

.app-sidebar-nav .nav-link.active i {
    color: #1e3a8a;
}

.sidebar-section-title {
    display: block;
    padding: 0 0.875rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.72);
}

.app-sidebar-nav .sidebar-dropdown-toggle {
    width: 100%;
    text-align: left;
    background: transparent !important;
    border-color: transparent !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

.app-sidebar-nav .sidebar-dropdown-toggle.is-open {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.app-sidebar-nav .sidebar-dropdown-toggle.is-open i {
    color: rgba(255, 255, 255, 0.95);
}

.app-sidebar-nav .sidebar-dropdown-toggle:not(.is-open):hover {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.26) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.app-sidebar-nav .sidebar-dropdown-toggle[aria-expanded="true"] .sidebar-dropdown-caret {
    transform: rotate(180deg);
}

.app-sidebar-nav .sidebar-dropdown-caret {
    transition: transform 0.2s ease;
}

.sidebar-submenu-wrap {
    padding-left: 0.6rem;
}

.sidebar-submenu .nav-link {
    padding-top: 0.62rem;
    padding-bottom: 0.62rem;
    font-size: 0.94rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-submenu .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.app-main {
    min-width: 0;
    width: 100%;
}

@media (min-width: 992px) {
    .app-main {
        margin-left: var(--app-sidebar-width);
    }
}

.app-content {
    padding: 1.5rem;
}

.app-page-header {
    margin-bottom: 1.5rem;
}

.app-page-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
}

.app-page-subtitle {
    margin: 0.35rem 0 0;
    color: var(--app-muted);
}

.app-surface,
.card,
.dropdown-menu,
.modal-content,
.offcanvas,
.toast,
.list-group-item {
    border-color: var(--app-border);
}

.card,
.dropdown-menu,
.modal-content,
.offcanvas,
.toast {
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.10);
}

.card {
    border-radius: 1.1rem;
}

.btn-primary {
    background: linear-gradient(90deg, var(--app-primary), var(--app-primary-soft));
    border: 0;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(90deg, #1d4ed8, #38bdf8);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.30);
}

.profile-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(140deg, rgba(37, 99, 235, 0.18), rgba(56, 189, 248, 0.20));
    color: #1e3a8a;
    font-weight: 700;
}

.profile-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.site-footer {
    color: var(--app-muted);
    border-top: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
}

.collapse {
    display: none;
    visibility: hidden;
}

.collapse.show {
    display: block;
    visibility: visible;
}

.app-alert {
    margin-bottom: 1rem;
    border-radius: 0.8rem;
    border: 1px solid transparent;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
}

.app-alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.app-alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
}

.text-bg-danger {
    background: #dc2626;
    color: #fff;
}

.login-page {
    min-height: 100vh;
    background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.2), transparent 28%),
        linear-gradient(120deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.35)),
        var(--app-bg);
}

.login-card {
    border: 1px solid var(--app-border);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 50px rgba(42, 36, 31, 0.14);
}

.login-logo {
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(140deg, rgba(37, 99, 235, 0.18), rgba(56, 189, 248, 0.28));
    color: #1e3a8a;
    font-size: 1.35rem;
}

.app-content > * {
    animation: appRise 0.45s ease both;
}

.app-content > *:nth-child(2) { animation-delay: 0.04s; }
.app-content > *:nth-child(3) { animation-delay: 0.08s; }
.app-content > *:nth-child(4) { animation-delay: 0.12s; }
.app-content > *:nth-child(5) { animation-delay: 0.16s; }

.ajax-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    display: none;
}
.ajax-loading-overlay.is-active {
    display: block;
}

.cocms-loader-topbar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    overflow: hidden;
    background: rgba(59, 130, 246, 0.20);
}

.cocms-loader-topbar::after {
    content: '';
    display: block;
    height: 100%;
    width: 34%;
    background: linear-gradient(90deg, #1d4ed8, #38bdf8);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.55);
    animation: cocmsSlide 1.05s ease-in-out infinite;
}

.cocms-loader-chip {
    position: fixed;
    top: 14px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(42, 36, 31, 0.88);
    color: #fff9ee;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 6px 12px;
    box-shadow: 0 10px 22px rgba(42, 36, 31, 0.32);
}

.cocms-loader-chip__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #38bdf8;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.72);
    animation: cocmsPulse 1.2s infinite;
}

.cocms-toast-container {
    z-index: 1110;
    width: min(420px, calc(100vw - 1rem));
}

.cocms-toast-container .toast {
    box-shadow: 0 10px 24px rgba(42, 36, 31, 0.2);
}

@keyframes appRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cocmsPulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.62); }
    70% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes cocmsSlide {
    0% { transform: translateX(-110%); }
    50% { transform: translateX(120%); }
    100% { transform: translateX(220%); }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        box-shadow: none;
        border-right: 0;
    }

    .app-content {
        padding: 1rem;
    }

    .app-sidebar-nav .nav-link {
        color: var(--app-text) !important;
    }

    .app-sidebar-nav .nav-link i {
        color: var(--app-text);
    }

    .app-sidebar-nav .nav-link.active {
        color: #2a241f !important;
    }

    .sidebar-section-title {
        color: var(--app-muted);
    }

    .cocms-loader-chip {
        top: 10px;
        right: 10px;
        font-size: 0.72rem;
        padding: 5px 10px;
    }
}