:root {
    --teal-dark: #3f9aae;
    --teal-light: #79c9c5;
    --sand: #ffe2af;
    --coral: #f96e5b;
    --sky-light: #79c9c5;
    --sky: #63bcb9;
    --sky-dark: #3f9aae;
    --indigo: #1f3941;
    --slate: #2f7885;
    --cloud: #fff7ec;
}

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top, rgba(121, 201, 197, 0.35), var(--cloud) 58%);
    color: var(--indigo);
    min-height: 100vh;
    font-size: 0.92rem;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    border: none;
    border-radius: 24px;
    overflow: visible;
    max-width: 1100px;
    width: 100%;
    background: white;
}

.brand-panel {
    background: linear-gradient(135deg, var(--sky-dark), var(--sky));
    color: white;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: visible;
    border-radius: 24px 0 0 24px;
}

.brand-panel::after {
    content: "";
    position: absolute;
    inset: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    pointer-events: none;
    z-index: 1;
}

.brand-illustration {
    position: absolute;
    left: -18%;
    top: 50%;
    transform: translateY(-50%);
    width: min(600px, 120%);
    z-index: 2;
    pointer-events: none;
}

.brand-illustration img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 14px 24px rgba(9, 36, 78, 0.24));
}

.brand-panel h1 {
    font-size: 2rem;
    font-weight: 700;
}

.brand-panel p {
    opacity: 0.9;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
    font-weight: 500;
}

.feature-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    display: inline-block;
}

.form-panel {
    padding: 3rem;
    background: white;
    border-radius: 0 24px 24px 0;
}

.form-panel .form-control {
    border-radius: 14px;
    border: 1px solid #ead7b7;
    background: #fffdf8;
    padding: 0.9rem 1.1rem;
}

.btn-sky,
.btn-ghost,
.btn-ghost-amber {
    border-radius: 999px;
    padding: 0.45rem 1.15rem;
    font-weight: 600;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    line-height: 1;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-sky {
    background: linear-gradient(135deg, #f96e5b, #ea5f4d);
    border: none;
    box-shadow: 0 8px 18px rgba(249, 110, 91, 0.3);
    color: #fff;
}

.btn-sky:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #ff7e6d, #f26856);
    box-shadow: 0 10px 22px rgba(249, 110, 91, 0.36);
    color: #fff;
}

.btn-sky.w-100 {
    width: 100%;
    display: flex;
}

.btn-ghost.w-100,
.btn-ghost-amber.w-100 {
    width: 100%;
    display: flex;
}

.form-panel .input-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #62635f;
}

.dashboard-wrapper {
    min-height: 100vh;
    background: var(--cloud);
    display: flex;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--sky-dark), var(--slate));
    color: white;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar .brand {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    overflow: hidden;
}

.sidebar-logo img {
    max-width: 70%;
    height: auto;
}

.sidebar-logout {
    border-radius: 999px;
    padding: 0.45rem 1.5rem;
    font-weight: 600;
}

.sidebar small {
    opacity: 0.8;
}

.home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 1.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 0.25rem;
}

.home-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(20, 44, 85, 0.35);
}

.tree-menu {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
}

.module-icon-card {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sky-dark);
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(27, 59, 68, 0.24);
}

.module-title-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.tree-menu > li {
    margin-bottom: 1rem;
}

.tree-menu .module-title {
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    white-space: nowrap;
    border: none;
    background: transparent;
    color: inherit;
    padding: 0;
    cursor: pointer;
}

.module-title__state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #ffffff;
    font-size: 0.65rem;
    margin-right: 0.45rem;
    transition: transform 0.2s ease;
}

.tree-item--open .module-title__state {
    transform: rotate(45deg);
}

.module-title--link {
    cursor: pointer;
}

.tree-menu a {
    color: inherit;
    text-decoration: none;
}

.tree-menu .module-title.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(40, 77, 86, 0.18);
}

.module-title__blob {
    display: none;
}

.tree-menu .module-title:hover {
    color: #fff;
}

.tree-menu .module-title.active:hover {
    color: #ffffff;
}

.tree-menu ul {
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.4rem;
}

.tree-menu li ul li {
    font-size: 0.86rem;
    opacity: 1;
    padding: 0.2rem 0;
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.tree-menu li ul li a {
    color: #f5fffe;
    opacity: 1;
    text-decoration: none;
    font-size: 0.76rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tree-menu li ul li.active .menu-bullet {
    background: linear-gradient(135deg, #ffe2af, #f96e5b);
    box-shadow: 0 0 12px rgba(249, 110, 91, 0.45);
    transform: scale(1.15);
}

.tree-menu li ul li a.active {
    color: #274d56;
    background: #ffe2af;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(64, 110, 119, 0.2);
}

.menu-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #79c9c5, #3f9aae);
    display: inline-block;
    margin-right: 0.4rem;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(121, 201, 197, 0.45);
}

.tree-children {
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.25s ease;
    padding-left: 0;
}

.tree-children[hidden] {
    display: block;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.tree-item--open .tree-children {
    max-height: 500px;
    opacity: 1;
    margin-top: 0.25rem;
}

.tree-item {
    transition: border-color 0.2s ease;
}

.tree-item--open .module-title-card {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.38);
    box-shadow: 0 12px 30px rgba(28, 63, 71, 0.32);
}

.tree-item--open .module-title {
    color: #fff;
    font-weight: 700;
}

.tree-item--open .module-icon-card {
    background: rgba(255, 255, 255, 0.92);
    color: var(--sky-dark);
    box-shadow: 0 8px 24px rgba(24, 56, 64, 0.3);
}

.tree-menu li ul li a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.tree-menu li ul li a.active:hover {
    color: #274d56;
    background: #ffe2af;
}

.tree-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
}

.content-area {
    flex: 1;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.content-area h1 {
    font-size: 1.45rem;
}

.content-area h2 {
    font-size: 1.05rem;
}

.content-area h3,
.content-area h4 {
    font-size: 0.95rem;
}

.content-area p,
.content-card p,
.content-card li,
.content-card label,
.content-card input,
.content-card select,
.content-card textarea {
    font-size: 0.85rem;
}

.content-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(44, 78, 88, 0.08);
}

.table {
    font-size: 0.8rem;
}

.table thead th {
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-actions .btn {
    min-height: 34px;
}

.form-submit {
    margin-top: 1.5rem;
    text-align: center;
}

.form-submit .btn {
    min-width: 220px;
    border-radius: 999px;
}

.institution-filter {
    background: white;
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 15px 30px rgba(44, 78, 88, 0.08);
    border: 1px solid rgba(121, 201, 197, 0.2);
}

.institution-filter__mode .form-check-label {
    font-weight: 500;
    color: #4c5568;
}

.institution-filter .btn {
    border-radius: 999px;
}

.institution-filter--locked {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(120deg, rgba(121, 201, 197, 0.16), rgba(63, 154, 174, 0.1));
}

.user-form input,
.user-form select {
    border-radius: 12px;
}

.status-pill {
    background: rgba(121, 201, 197, 0.16);
    color: var(--sky-dark);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.logout-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
}

.logout-link:hover {
    color: white;
}

.btn-ghost,
.btn-ghost-amber {
    border: 1px solid transparent;
}

.btn-ghost {
    background: #e5f4f2;
    border-color: #c7e6e2;
    color: #2e5f68;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-ghost:hover {
    background: #d7ece9;
    border-color: #afd8d2;
    color: #224c54;
    transform: translateY(-1px);
}

.btn-ghost-amber {
    background: #fff1d3;
    border-color: #f1d39c;
    color: #7a5a2a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-ghost-amber:hover {
    background: #ffe8bc;
    border-color: #e6c586;
    color: #5f471f;
    transform: translateY(-1px);
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(121, 201, 197, 0.16);
    color: var(--sky-dark);
    border: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.action-icon:hover {
    background: rgba(121, 201, 197, 0.28);
    color: var(--sky-dark);
    transform: translateY(-1px);
}

.action-icon--danger {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.action-icon--danger:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.action-icon--accent {
    background: rgba(255, 193, 7, 0.18);
    color: #bc8a00;
}

.action-icon--accent:hover {
    background: rgba(255, 193, 7, 0.28);
    color: #a87200;
}

.permission-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.permission-pill--on {
    background: #e0f3ec;
    color: #0f9d58;
    border-color: rgba(15, 157, 88, 0.3);
}

.permission-pill--off {
    background: #fbe6e3;
    color: #c0392b;
    border-color: rgba(192, 57, 43, 0.25);
    opacity: 0.9;
}

.permission-table--editable th,
.permission-table--editable td {
    vertical-align: middle;
}

.permission-table thead th {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.permission-table--editable td:first-child {
    text-align: left;
}

.permission-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.permission-checkbox {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.permission-select {
    min-width: 8rem;
}

.status-toggle {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    padding: 0.35rem;
    background: #eef3f6;
    border-radius: 999px;
    border: 1px solid rgba(90, 178, 247, 0.25);
    min-width: 180px;
}

.status-toggle::after {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    right: calc(50% + 4px);
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    transition: left 0.25s ease, right 0.25s ease, background 0.25s ease;
    background: linear-gradient(135deg, #2ecc71, #1abc9c);
}

.status-toggle[data-state="inactive"]::after {
    left: calc(50% + 4px);
    right: 4px;
    background: linear-gradient(135deg, #ff6b6b, #c0392b);
}

.status-toggle[data-state="active"]::after {
    background: linear-gradient(135deg, #2ecc71, #1abc9c);
}

.status-option {
    position: relative;
    flex: 1;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.status-option input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.status-option span {
    pointer-events: none;
    color: #6a7b95;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.status-option input:checked + span {
    color: #fff;
}

.status-option input:focus-visible + span {
    text-decoration: underline;
}


.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(31, 57, 65, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-toggle-btn {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 14px;
}

@media (min-width: 993px) {
    .sidebar-overlay {
        display: none;
    }
}

@media (max-width: 992px) {
    .brand-panel,
    .form-panel {
        padding: 2rem;
    }

    .brand-panel {
        border-radius: 24px 24px 0 0;
    }

    .form-panel {
        border-radius: 0 0 24px 24px;
    }

    .brand-illustration {
        width: min(430px, 96%);
        left: -14%;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.95;
    }

    .dashboard-wrapper {
        flex-direction: column;
        position: relative;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: min(280px, 85vw);
        max-width: 85vw;
        z-index: 1050;
        overflow-y: auto;
        box-shadow: 15px 0 40px rgba(29, 62, 69, 0.35);
        transition: transform 0.3s ease;
        padding: 3rem 1.75rem;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .content-area {
        padding: 1.75rem 1.5rem;
    }

    .sidebar-toggle-btn {
        display: inline-flex;
    }

    .tree-menu > li {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 768px) {
    .brand-illustration {
        width: min(320px, 90%);
        left: -10%;
    }
}
