:root {
    --ink: #1f2933;
    --muted: #60706b;
    --line: #d8e4df;
    --paper: #ffffff;
    --wash: #f5faf7;
    --teal: #0f5d57;
    --teal-dark: #0a433f;
    --gold: #f3c05a;
    --maroon: #8b1f3a;
    --blue: #245c90;
    --shadow: 0 14px 34px rgba(30, 48, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #eef5f1;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    line-height: 1.55;
}

a {
    color: var(--teal);
}

.brca-text {
    font-style: italic;
}

.wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: #25313b;
    color: #e7f0ee;
    font-size: 13px;
}

.topbar-inner,
.brand-row,
.nav-inner,
.footer-inner,
.ribbon-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.topbar-inner {
    min-height: 34px;
}

.language-switch {
    display: inline-flex;
    gap: 6px;
}

.language-switch a {
    color: #e7f0ee;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
}

.language-switch .current {
    background: rgba(255, 255, 255, 0.18);
}

.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.brand-row {
    min-height: 112px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--ink);
    text-decoration: none;
}

.brand strong {
    display: block;
    font-size: 27px;
    letter-spacing: 0;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 14px;
    margin-top: 3px;
}

.logo-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 210px;
    justify-content: flex-end;
    color: var(--muted);
    font-size: 14px;
}

.partner-logo {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 76px;
    object-fit: contain;
}

.partner-logo-secondary {
    max-height: 90px;
}

.database-ribbon {
    background: #f8fbfa;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.ribbon-inner {
    justify-content: flex-start;
    min-height: 58px;
    gap: 10px;
    font-size: 14px;
}

.gray-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background-color: #f2f2f2;
    color: #666;
    font-size: 14px;
    cursor: not-allowed;
    outline: none;
}

.gray-input:focus {
    border-color: #d0d0d0;
    box-shadow: none;
}

.ribbon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-left: 4px solid transparent;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;

}

.ribbon-button:hover,
.ribbon-button.active {
    border-color: rgba(15, 93, 87, 0.35);
    border-left-color: var(--gold);
    background: #e8f3ef;
    color: var(--teal-dark);
}

.main-nav {
    background: #f8fbfa;
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    min-height: 48px;
}

.nav-links,
.nav-user {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-inner a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    text-decoration: none;
    color: var(--ink);
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.nav-inner a.active,
.nav-inner a:hover {
    background: #e2f0ec;
    color: var(--teal-dark);
}

.nav-inner .nav-register {
    background: var(--maroon);
    color: #fff;
}

.page {
    padding: 28px 0 48px;
    min-height: 62vh;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.flash {
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: var(--paper);
    border-left-width: 5px;
    border-radius: 6px;
}

.flash-success {
    border-left-color: var(--teal);
}

.flash-warning {
    border-left-color: var(--gold);
}

.flash-error {
    border-left-color: var(--maroon);
}

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: stretch;
}

.intro-panel,
.side-panel,
.auth-panel,
.content-section {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.intro-panel {
    min-height: 380px;
    padding: 56px;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.9) 56%, rgba(245, 250, 247, 0.68) 100%),
        repeating-linear-gradient(135deg, rgba(15, 93, 87, 0.11) 0 2px, transparent 2px 20px);
}

.side-panel {
    padding: 28px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--maroon);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0 0 14px;
    letter-spacing: 0;
}

h1 {
    font-size: 36px;
    line-height: 1.15;
}

h2 {
    font-size: 22px;
}

.lead {
    max-width: 740px;
    color: var(--muted);
    font-size: 18px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.button,
button.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.button.primary {
    background: var(--teal);
    color: #fff;
}

.button.secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--teal-dark);
}

.button.full {
    width: 100%;
}

.button.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.access-notice {
    margin-top: 18px;
    padding: 14px 15px;
    border: 1px solid rgba(15, 93, 87, 0.22);
    border-left: 5px solid var(--teal);
    border-radius: 6px;
    background: #eef8f5;
    color: #243b38;
}

.access-notice strong {
    display: block;
    margin-bottom: 6px;
    color: var(--teal-dark);
    font-size: 15px;
}

.access-notice p {
    margin: 0;
    color: #43544f;
    font-size: 14px;
}

.metrics-band {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 24px 0;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.metrics-band div {
    background: #fff;
    padding: 22px;
}

.metrics-band strong,
.metrics-band span {
    display: block;
}

.metrics-band strong {
    color: var(--teal-dark);
    font-size: 24px;
}

.metrics-band span {
    color: var(--muted);
    font-size: 14px;
}

.content-section {
    padding: 28px;
}

.editorial-page {
    margin-bottom: 22px;
}

.info-grid,
.contact-layout {
    display: grid;
    gap: 18px;
}

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

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

.info-grid article,
.contact-primary,
.contact-detail {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.contact-primary {
    border-top: 4px solid var(--teal);
}

.contact-detail {
    border-top: 4px solid var(--gold);
}

.contact-wide {
    grid-column: 1 / -1;
}

.contact-role {
    color: var(--teal-dark);
    font-weight: 700;
}

.contact-email {
    font-size: 20px;
    font-weight: 700;
    word-break: break-word;
}

.auth-panel {
    max-width: 480px;
    margin: 0 auto;
    padding: 32px;
}

.auth-panel.wide {
    max-width: 760px;
}

.stack-form {
    display: grid;
    gap: 15px;
}

.stack-form.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
    grid-column: 1 / -1;
}

label span,
.field-label {
    display: block;
    margin-bottom: 6px;
    color: #31413d;
    font-weight: 700;
    font-size: 14px;
}

input,
select {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid #bdcdc8;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus {
    outline: 3px solid rgba(15, 93, 87, 0.18);
    border-color: var(--teal);
}

.readonly-field {
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid #bdcdc8;
    border-radius: 6px;
    background: #f4f8f6;
    color: var(--ink);
    font-weight: 700;
    word-break: break-word;
}

.code-input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 6px;
}

.muted {
    color: var(--muted);
}

.inline-form {
    margin-top: 16px;
    text-align: center;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--teal);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.status-list {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.status-list div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e8efec;
    padding-bottom: 10px;
}

.status-list dt {
    color: var(--muted);
}

.status-list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.status-list .profile-value {
    max-width: 190px;
}

.status-list .long-value {
    display: -webkit-box;
    max-height: 3.2em;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.6;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-pending {
    color: #6d4b00;
    background: #fff4ce;
}

.badge-approved {
    color: #0f5132;
    background: #d9f3e3;
}

.badge-rejected {
    color: #7f1d1d;
    background: #fde2e2;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

.table-header h1 {
    margin-bottom: 6px;
}

.table-header p {
    margin: 0;
    color: var(--muted);
}

.table-controls {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 150px;
    gap: 12px;
    align-items: end;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
}

.table-search-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 12px;
    align-items: end;
}

.per-page-form {
    margin: 0;
}

.table-meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.data-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    min-width: 920px;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.data-table th,
.data-table td {
    text-align: left;
    vertical-align: top;
    padding: 11px 12px;
    border-bottom: 1px solid #e6efeb;
    border-right: 1px solid #eef4f1;
    box-sizing: border-box;
}

.cell-content {
    display: block;
    width: auto;
    max-width: none;
    height: 3.1em;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    word-wrap: break-word;
    line-height: 1.55;
    box-sizing: border-box;
}

.data-table th.disease-column,
.data-table td.disease-column {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    overflow: hidden;
}

.data-table .disease-column .cell-content {
    width: 236px;
    max-width: 236px;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: normal;
    contain: paint;
}

.data-table th {
    position: sticky;
    top: 0;
    background: #25313b;
    z-index: 1;
    color: #fff;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.25;
}

.data-table th a {
    display: inline-block;
    color: inherit;
    text-decoration: none;
}

.data-table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

.data-table tbody tr:nth-child(even) td {
    background: #dbe7e3;
}

.data-table tbody tr:hover td {
    background: #fff8e6;
}

.user-table td {
    max-width: 220px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 210px;
}

.small-action {
    border: 1px solid transparent;
    border-radius: 5px;
    min-height: 30px;
    padding: 0 9px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.small-action.approve {
    background: var(--teal);
    color: #fff;
}

.small-action.reject {
    background: var(--maroon);
    color: #fff;
}

.small-action.neutral {
    background: #eef2f1;
    color: var(--ink);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 5px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    font-size: 13px;
}

.filter-tabs .current {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 13px;
}

.footer-inner {
    min-height: 58px;
}

@media (max-width: 860px) {
    .brand-row,
    .nav-inner,
    .footer-inner,
    .table-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .logo-slot {
        justify-content: flex-start;
        min-width: 0;
        max-width: 100%;
        flex-wrap: wrap;
    }

    .home-grid,
    .metrics-band,
    .table-controls,
    .table-search-form,
    .stack-form.two-column,
    .info-grid,
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .intro-panel {
        padding: 32px;
        min-height: 0;
    }

    h1 {
        font-size: 30px;
    }
}

@media (max-width: 520px) {
    .wrap {
        width: min(100% - 20px, 1180px);
    }
    
    .page {
        padding-top: 14px;
    }

    .topbar-inner {
        min-height: 42px;
        justify-content: flex-end;
        padding: 4px 0 6px;
    }

    .site-header {
        padding: 12px 0 14px;
    }

    .brand-row {
        gap: 13px;
        min-height: 0;
    }

    .brand strong {
        font-size: 22px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand img {
        width: 52px;
        height: 52px;
    }

    .logo-slot {
        width: 100%;
        gap: 10px;
        margin-top: 0px;
        padding-bottom: 0px;
        justify-content: center;
    }

    .partner-logo {
        max-width: calc(50% - 5px);
        max-height: 48px;
    }

    .partner-logo-secondary {
        max-height: 56px;
    }

    .main-nav {
        padding-top: 8px;
    }

    .nav-inner {
        gap: 10px;
    }

    .intro-panel,
    .side-panel,
    .auth-panel,
    .content-section {
        padding: 22px;
    }

    .ribbon-inner {
        gap: 8px;
        flex-wrap: wrap;
        padding: 8px 0;
    }

    .ribbon-button {
        flex: 1 1 130px;
    }
}
