@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --surface-strong: rgba(255, 255, 255, 0.92);
    --line: rgba(148, 163, 184, 0.2);
    --text-strong: #0f172a;
    --text-body: #334155;
    --text-soft: #64748b;
    --page-bg:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.14), transparent 24%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 22%),
        linear-gradient(180deg, #f8fbff 0%, #f2f7fb 44%, #eaf1f8 100%);
    --shell-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --card-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    --sidebar-width: 272px;
    --sidebar-width-collapsed: 84px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--page-bg) !important;
    color: var(--text-body) !important;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
    animation: ambientFloat 16s ease-in-out infinite;
}

body::before {
    width: 18rem;
    height: 18rem;
    top: 7rem;
    right: -4rem;
    background: rgba(20, 184, 166, 0.2);
}

body::after {
    width: 16rem;
    height: 16rem;
    left: -3rem;
    bottom: 2rem;
    background: rgba(59, 130, 246, 0.15);
    animation-delay: -8s;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-strong);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.top-navbar,
.main-content,
.footer {
    position: relative;
    z-index: 1;
}

.sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: 1000;
    width: var(--sidebar-width) !important;
    background: linear-gradient(180deg, #0f172a 0%, #111c34 46%, #0b1220 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 20px 0 50px rgba(2, 6, 23, 0.2);
    transition: width 0.28s ease, transform 0.28s ease !important;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 1rem;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.sidebar > .p-3 {
    position: relative;
    z-index: 1;
    padding: 1.3rem !important;
}

.brand-shell {
    padding: 0.75rem 0.8rem 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.brand-mark img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.brand-copy {
    transition: opacity 0.2s ease;
}

.brand-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.85);
}

.brand-title {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.sidebar .nav {
    gap: 0.3rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: rgba(226, 232, 240, 0.82) !important;
    padding: 0.95rem 1rem !important;
    margin: 0.12rem 0 !important;
    border-radius: 16px !important;
    font-size: 0.94rem;
    font-weight: 600;
    transition: transform 0.24s ease, background-color 0.24s ease, box-shadow 0.24s ease !important;
}

.sidebar .nav-link i {
    width: 1.1rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.28), rgba(37, 99, 235, 0.2)) !important;
    color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 20px rgba(15, 23, 42, 0.2);
}

.sidebar .dropdown-menu {
    margin: 0.35rem 0 0.4rem 2.25rem !important;
    background: transparent !important;
}

.sidebar .dropdown-item {
    color: rgba(226, 232, 240, 0.74) !important;
    padding: 0.7rem 0.9rem !important;
    border-radius: 12px !important;
    margin-bottom: 0.25rem;
    font-size: 0.88rem;
}

.sidebar .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

.sidebar-toggle {
    position: fixed !important;
    z-index: 1001;
    top: 2rem !important;
    left: calc(var(--sidebar-width) - 14px) !important;
    width: 42px;
    height: 42px;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #0f766e, #14b8a6) !important;
    box-shadow: 0 12px 25px rgba(15, 118, 110, 0.35);
}

.sidebar-toggle:hover {
    transform: translateY(-2px) !important;
}

html.sidebar-collapsed .sidebar {
    width: var(--sidebar-width-collapsed) !important;
}

html.sidebar-collapsed .sidebar .brand-copy,
html.sidebar-collapsed .sidebar .dropdown-menu,
html.sidebar-collapsed .sidebar .nav-link span {
    display: none !important;
}

html.sidebar-collapsed .sidebar .brand-shell {
    justify-content: center;
}

html.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding-inline: 0 !important;
}

html.sidebar-collapsed .sidebar .nav-link i {
    margin-right: 0 !important;
}

html.sidebar-collapsed .sidebar-toggle {
    left: var(--sidebar-width-collapsed) !important;
}

html.sidebar-collapsed .main-content,
html.sidebar-collapsed .top-navbar,
html.sidebar-collapsed .footer {
    margin-left: var(--sidebar-width-collapsed) !important;
}

.top-navbar {
    margin-left: var(--sidebar-width) !important;
    padding: 1rem 1.25rem 0 !important;
    background: transparent !important;
    border-bottom: 0 !important;
    transition: margin-left 0.28s ease !important;
}

.top-navbar .container-fluid {
    min-height: 76px;
    padding: 1rem 1.25rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(18px);
    box-shadow: var(--card-shadow);
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.topbar-profile {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.45rem 0.6rem 0.45rem 0.45rem;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.topbar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.15), rgba(37, 99, 235, 0.12));
    color: var(--primary-dark);
    font-weight: 800;
    overflow: hidden;
}

.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.1;
}

.topbar-role {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.main-content {
    margin-left: var(--sidebar-width) !important;
    transition: margin-left 0.28s ease !important;
}

.content-wrapper {
    margin: 1.25rem !important;
    padding: 1.6rem !important;
    border-radius: 30px !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.76)) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(16px);
    box-shadow: var(--shell-shadow) !important;
    animation: pageEnter 0.65s ease both;
}

.card,
.modal-content {
    border: 1px solid var(--line) !important;
    border-radius: 24px !important;
    background: var(--surface) !important;
    backdrop-filter: blur(16px);
    box-shadow: var(--card-shadow) !important;
    overflow: hidden;
}

.card {
    animation: cardEnter 0.6s ease both;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease !important;
}

.card:hover,
a .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.14) !important;
    border-color: rgba(15, 118, 110, 0.18) !important;
}

.card-header,
.modal-header,
.modal-footer {
    background: rgba(255, 255, 255, 0.62) !important;
    border-color: rgba(148, 163, 184, 0.14) !important;
}

.btn {
    border-radius: 14px !important;
    font-weight: 700 !important;
    padding: 0.72rem 1.05rem !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 22px rgba(15, 23, 42, 0.12);
    filter: saturate(1.05);
}

.btn-primary,
.card.bg-primary {
    background: linear-gradient(135deg, #0f766e, #14b8a6) !important;
    border: 0 !important;
    color: #fff !important;
}

.btn-success,
.card.bg-success {
    background: linear-gradient(135deg, #15803d, #22c55e) !important;
    border: 0 !important;
    color: #fff !important;
}

.btn-warning,
.card.bg-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    border: 0 !important;
    color: #fff !important;
}

.btn-danger,
.card.bg-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    border: 0 !important;
    color: #fff !important;
}

.btn-info,
.card.bg-info {
    background: linear-gradient(135deg, #2563eb, #38bdf8) !important;
    border: 0 !important;
    color: #fff !important;
}

.btn-secondary,
.card.bg-secondary {
    background: linear-gradient(135deg, #475569, #64748b) !important;
    border: 0 !important;
    color: #fff !important;
}

.btn-dark {
    background: linear-gradient(135deg, #0f172a, #1e293b) !important;
    border: 0 !important;
    color: #fff !important;
}

.btn-outline-danger {
    background: rgba(254, 242, 242, 0.92) !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
    color: var(--danger) !important;
}

.btn-outline-danger:hover {
    background: var(--danger) !important;
    color: #fff !important;
}

.alert {
    border-radius: 18px !important;
    border: 1px solid transparent !important;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.alert-success {
    background: rgba(220, 252, 231, 0.96) !important;
    border-color: rgba(34, 197, 94, 0.16) !important;
    color: #166534 !important;
}

.alert-warning {
    background: rgba(254, 243, 199, 0.96) !important;
    border-color: rgba(245, 158, 11, 0.16) !important;
    color: #92400e !important;
}

.alert-danger {
    background: rgba(254, 226, 226, 0.96) !important;
    border-color: rgba(239, 68, 68, 0.16) !important;
    color: #991b1b !important;
}

.badge {
    border-radius: 999px !important;
    padding: 0.5rem 0.8rem !important;
    font-weight: 700 !important;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: rgba(248, 250, 252, 0.95) !important;
    color: var(--text-strong) !important;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-color: rgba(148, 163, 184, 0.15) !important;
}

.table td {
    border-color: rgba(148, 163, 184, 0.12) !important;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(248, 250, 252, 0.78);
}

.form-control,
.form-select {
    min-height: 48px;
    border-radius: 14px !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text-strong) !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.45) !important;
    box-shadow: 0 0 0 0.28rem rgba(20, 184, 166, 0.16) !important;
    transform: translateY(-1px);
}

.footer {
    margin-left: var(--sidebar-width) !important;
    padding: 0 1.25rem 1.25rem !important;
    background: transparent !important;
    transition: margin-left 0.28s ease !important;
}

.footer .container-fluid {
    padding: 1rem 1.25rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--card-shadow);
}

.footer p {
    color: var(--text-soft) !important;
    font-weight: 600;
}

.switch {
    width: 54px !important;
    height: 28px !important;
}

.slider {
    background: #cbd5e1 !important;
    border-radius: 999px !important;
}

.slider:before {
    width: 22px !important;
    height: 22px !important;
    left: 3px !important;
    bottom: 3px !important;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.15);
}

input:checked + .slider {
    background: linear-gradient(135deg, #14b8a6, #22c55e) !important;
}

input:checked + .slider:before {
    transform: translateX(26px) !important;
}

@keyframes ambientFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0, -18px, 0) scale(1.05); }
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body::before,
    body::after {
        display: none;
    }

    .sidebar {
        width: min(86vw, 300px) !important;
    }

    .sidebar-toggle {
        left: 1rem !important;
        top: 1rem !important;
        border-radius: 999px !important;
    }

    .sidebar.show ~ .sidebar-toggle {
        left: min(86vw, 300px) !important;
    }

    .main-content,
    .top-navbar,
    .footer {
        margin-left: 0 !important;
    }

    .top-navbar {
        padding: 0.9rem 0.9rem 0 !important;
    }

    .top-navbar .container-fluid {
        padding: 0.9rem 1rem;
    }

    .top-navbar .ms-auto {
        width: 100%;
        justify-content: flex-end;
        gap: 0.55rem;
        flex-wrap: wrap;
    }

    .content-wrapper {
        margin: 0.85rem !important;
        padding: 1rem !important;
        border-radius: 22px !important;
    }

    .footer {
        padding: 0 0.85rem 0.85rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
