:root {
    --ink: #243447;
    --muted: #6b7280;
    --line: #e1e5ea;
    --bg: #edf2f7;
    --panel: #ffffff;
    --primary: #075db3;
    --primary-dark: #064987;
    --accent: #f2b705;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-shell {
    width: min(1180px, calc(100% - 36px));
    margin: 16px auto 30px;
    padding: 26px 28px 34px;
    background: var(--panel);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.11);
}

.institution-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    min-height: 130px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.institution-header h1 {
    margin: 0 0 12px;
    color: #22384e;
    font-size: 38px;
    line-height: 1.08;
}

.institution-header p {
    margin: 0;
    color: #667085;
    font-size: 18px;
}

.logo-seal {
    position: relative;
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    flex: 0 0 auto;
    border: 4px solid #8aa6b8;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #ffffff 0 35%, transparent 36%),
        conic-gradient(#075db3 0 25%, #f2b705 25% 50%, #c92a2a 50% 75%, #0f766e 75% 100%);
    box-shadow: inset 0 0 0 6px #f8fafc, 0 1px 4px rgba(15, 23, 42, 0.18);
    color: #102a43;
}

.logo-seal span {
    position: absolute;
    top: 12px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0;
}

.logo-seal strong {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: #102a43;
    color: #f2b705;
    font-size: 25px;
    line-height: 1;
}

.logo-seal-lg {
    width: 92px;
    height: 92px;
}

.logo-img {
    display: block;
    width: 104px;
    height: 104px;
    object-fit: contain;
    flex: 0 0 auto;
}

.logo-img-lg {
    width: 104px;
    height: 124px;
}

.main-nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    margin: 34px 0 22px;
    overflow: hidden;
    border-radius: 5px;
    border-bottom: 9px solid #3b4654;
    background: var(--primary);
}

.main-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 12px;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
}

.main-nav a:hover {
    background: var(--primary-dark);
}

.page-title {
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.page-title h2 {
    margin: 0 0 8px;
    color: #22384e;
    font-size: 30px;
}

.page-title p {
    margin: 0;
    color: var(--muted);
}

.hero-banner {
    position: relative;
    display: grid;
    grid-template-columns: 44% 56%;
    min-height: 430px;
    margin: 20px 0 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 55% 5%, rgba(255, 255, 255, 0.45) 0 16%, transparent 17%),
        radial-gradient(circle at 98% 42%, rgba(255, 255, 255, 0.5) 0 16%, transparent 17%),
        #bfe8f3;
}

.hero-copy {
    position: relative;
    z-index: 2;
    padding: 42px 34px;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #3b4a5a;
    font-size: 27px;
    line-height: 1.18;
}

.hero-brand .logo-img {
    width: 112px;
    height: 132px;
}

.hero-brand p {
    margin: 0;
}

.hero-copy h2 {
    margin: 76px 0 0;
    color: #253b83;
    font-size: 48px;
    line-height: 1.2;
}

.hero-people {
    position: relative;
    min-height: 430px;
}

.person,
.lab {
    position: absolute;
    display: block;
}

.person {
    bottom: 0;
    width: 118px;
    height: 230px;
    border-radius: 54px 54px 12px 12px;
    background: #ffffff;
    box-shadow: inset 0 -96px 0 #f8fafc;
}

.person::before {
    content: "";
    position: absolute;
    top: -54px;
    left: 27px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f3b27b;
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.06);
}

.person::after {
    content: "";
    position: absolute;
    top: -68px;
    left: 18px;
    width: 82px;
    height: 42px;
    border-radius: 45px 45px 12px 12px;
    background: #1f2937;
}

.person-1 {
    left: 10%;
    width: 98px;
    height: 205px;
    background: #f7fbff;
}

.person-1::before {
    background: #b66a42;
}

.person-2 {
    left: 31%;
    height: 260px;
}

.person-3 {
    left: 57%;
    height: 235px;
}

.person-3::after {
    background: #263f57;
}

.lab {
    opacity: 0.45;
}

.lab-1 {
    left: 72%;
    top: 88px;
    width: 56px;
    height: 150px;
    border: 12px solid #2d8fbd;
    border-left: 0;
    border-bottom: 0;
    border-radius: 0 54px 0 0;
    transform: rotate(-32deg);
}

.lab-2 {
    left: 8%;
    top: 245px;
    width: 58px;
    height: 120px;
    border: 12px solid #2d8fbd;
    border-left: 0;
    border-bottom: 0;
    border-radius: 0 50px 0 0;
    transform: rotate(-18deg);
}

.grid {
    display: grid;
    gap: 18px;
}

.grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.table-wrap,
.form-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 22px;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.05);
}

.metric strong {
    display: block;
    margin-top: 8px;
    color: #22384e;
    font-size: 32px;
}

.metric span {
    color: var(--muted);
    font-weight: 700;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.search-toolbar {
    align-items: center;
}

.live-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 420px;
    min-width: 260px;
}

.live-search input {
    min-height: 48px;
    padding-left: 48px;
    padding-right: 82px;
    border-color: #d7dce2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.live-search input:focus {
    border-color: #60a5fa;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16), 0 8px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.search-icon {
    position: absolute;
    left: 17px;
    width: 16px;
    height: 16px;
    border: 2px solid #64748b;
    border-radius: 50%;
    pointer-events: none;
}

.search-icon::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: -5px;
    width: 8px;
    height: 2px;
    border-radius: 999px;
    background: #64748b;
    transform: rotate(45deg);
}

.search-clear {
    position: absolute;
    right: 44px;
    display: none;
    width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 50%;
    background: #e5e7eb;
    color: #475569;
    font-size: 16px;
}

.search-clear:hover {
    background: #cbd5e1;
}

.search-clear.is-visible {
    display: inline-flex;
}

.search-loader {
    position: absolute;
    right: 14px;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: #0782f7;
    border-right-color: #0782f7;
    border-radius: 50%;
    opacity: 0;
}

.search-loader.is-loading {
    opacity: 1;
    animation: spin 0.65s linear infinite;
}

.search-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: -4px 0 16px;
    padding: 8px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 14px;
    font-weight: 700;
    animation: alertIn 0.32s ease both;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 0;
    border-radius: 5px;
    padding: 10px 18px;
    background: #0782f7;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
}

.btn:hover,
button:hover {
    background: #0569c8;
}

.btn.secondary {
    background: #475467;
}

.btn.warning {
    background: #d97706;
}

.btn.danger {
    background: var(--danger);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: #344054;
    font-size: 13px;
    text-transform: uppercase;
}

.searchable-row {
    transition: opacity 0.22s ease, transform 0.22s ease, background-color 0.22s ease;
}

.searchable-row.row-found {
    background: #f8fbff;
    animation: rowPulse 0.42s ease;
}

.searchable-row.row-hidden {
    display: none;
}

.empty-search {
    padding: 24px;
    border: 1px dashed #bfdbfe;
    border-radius: 8px;
    background: #f8fbff;
    color: #334155;
    text-align: center;
    animation: alertIn 0.3s ease both;
}

.empty-search p {
    margin: 6px 0 0;
    color: #64748b;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
    color: #3f4f63;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #d7dce2;
    border-radius: 5px;
    font: inherit;
    background: #fff;
}

textarea {
    min-height: 116px;
    resize: vertical;
}

.alert {
    position: relative;
    display: grid;
    grid-template-columns: 38px 1fr 30px;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    margin: 0 0 18px;
    padding: 13px 14px;
    overflow: hidden;
    border: 1px solid transparent;
    border-left-width: 5px;
    border-radius: 7px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.09);
    animation: alertIn 0.38s ease both;
}

.alert::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.26;
    animation: alertTimer 4.5s linear forwards;
}

.alert-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.alert-content strong {
    display: block;
    margin-bottom: 2px;
    font-size: 15px;
}

.alert-content p {
    margin: 0;
    color: inherit;
}

.alert-close {
    min-height: 30px;
    width: 30px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
}

.alert-close:hover {
    background: rgba(15, 23, 42, 0.08);
}

.alert-success {
    background: #ecfdf3;
    border-color: #86efac;
    color: #166534;
}

.alert-success .alert-icon {
    background: #16a34a;
}

.alert-error {
    background: #fff1f2;
    border-color: #fda4af;
    color: #9f1239;
}

.alert-error .alert-icon {
    background: #e11d48;
}

.alert-warning {
    background: #fffbeb;
    border-color: #facc15;
    color: #92400e;
}

.alert-warning .alert-icon {
    background: #d97706;
}

.alert-info {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.alert-info .alert-icon {
    background: #2563eb;
}

.alert-hide {
    animation: alertOut 0.35s ease forwards;
}

@keyframes alertIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes alertOut {
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
}

@keyframes alertTimer {
    from {
        transform: scaleX(1);
        transform-origin: left;
    }
    to {
        transform: scaleX(0);
        transform-origin: left;
    }
}

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

@keyframes rowPulse {
    from {
        box-shadow: inset 4px 0 0 #0782f7;
        transform: translateX(3px);
    }
    to {
        box-shadow: inset 0 0 0 transparent;
        transform: translateX(0);
    }
}

.badge {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 700;
}

.footer {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: min(490px, 100%);
    padding: 40px 31px 46px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 3px 16px rgba(15, 23, 42, 0.14);
}

.login-institution {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
    color: #102a83;
}

.login-institution strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
}

.login-institution h1 {
    margin: 3px 0;
    color: #102a83;
    font-size: 29px;
    line-height: 1;
}

.login-institution small {
    color: #475467;
}

.login-card h2 {
    margin: 0;
    color: #2f2f35;
    font-size: 30px;
    line-height: 1.58;
    text-align: center;
}

.login-card hr {
    margin: 14px 0 24px;
    border: 0;
    border-top: 1px solid var(--line);
}

.login-help {
    width: min(360px, 100%);
    margin: 0 auto 30px;
    color: #7b8490;
    font-size: 17px;
    line-height: 1.55;
    text-align: center;
}

.login-form {
    display: grid;
    gap: 21px;
}

.login-form input {
    min-height: 43px;
}

.login-form button {
    justify-self: start;
}

.login-demo {
    margin: 18px 0 0;
    color: #667085;
    font-size: 13px;
}

@media (max-width: 900px) {
    .site-shell {
        width: min(100% - 20px, 760px);
        padding: 18px 16px 26px;
    }

    .institution-header {
        justify-content: flex-start;
        min-height: auto;
        padding-bottom: 22px;
    }

    .institution-header h1 {
        font-size: 28px;
    }

    .main-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 20px;
    }

    .hero-banner {
        grid-template-columns: 1fr;
        min-height: 520px;
    }

    .hero-copy h2 {
        margin-top: 38px;
        font-size: 38px;
    }

    .hero-brand {
        font-size: 21px;
    }

    .grid.cols-4,
    .grid.cols-2,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .institution-header,
    .login-institution {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-nav {
        grid-template-columns: 1fr;
    }

    .login-card h2 {
        font-size: 25px;
    }

    .hero-banner {
        min-height: 480px;
    }

    .hero-people {
        transform: scale(0.78);
        transform-origin: bottom left;
    }
}
