:root {
    --pico-font-size: 90%;
    --portal-header-height: 5rem;
}

/* ── Page skeleton ────────────────────────────────── */
.page-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Left column (white, logo + nav) ──────────────── */
.left-column {
    width: 190px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid var(--pico-muted-border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.left-column .logo-area {
    height: var(--portal-header-height);
    flex-shrink: 0;
    padding: 0 1.2rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.left-column .logo-area img {
    max-width: 100%;
    height: auto;
}

.left-column nav {
    background: none;
    border: none;
    margin: 0;
    padding: 1rem 0.5rem;
    color: inherit;
}

.left-column nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.left-column nav li {
    margin-bottom: 0.15rem;
    color: var(--pico-color);
}

.left-column nav a {
    display: block;
    padding: 0.45rem 0.75rem;
    border-radius: var(--pico-border-radius);
    text-decoration: none;
    color: var(--pico-color);
    font-size: 0.9em;
}

.left-column nav a:hover {
    background: var(--pico-table-row-stripped-background-color);
    text-decoration: none;
}

.left-column nav a.active {
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
    font-weight: 600;
}

.left-column .logout-area {
    margin-top: auto;
    padding: 0.75rem 0.5rem;
    border-top: 1px solid var(--pico-muted-border-color);
}

/* ── Right area (top bar + content) ──────────────── */
.right-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-bar {
    height: var(--portal-header-height);
    background: hsl(151.28, 47.47%, 38.82%);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    flex-shrink: 0;
    color: white;
    box-sizing: border-box;
}

.top-bar li,
.top-bar a {
    color: white;
    font-size: large;
}

.top-bar button.outline {
    color: white;
    border-color: rgba(255, 255, 255, 0.65);
}

.top-bar button.outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

.portal-main {
    flex: 1;
    padding: 1.5rem 2rem;
    min-width: 0;
}

/* ── Flash notices ────────────────────────────────── */
.notice {
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 1rem;
}

.notice.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.notice.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ── Section cards ────────────────────────────────── */
section {
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

/* ── Sortable column headers ──────────────────────── */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable::after {
    content: ' ⇅';
    opacity: 0.35;
    font-size: 0.8em;
}

th.sortable.sort-asc::after  { content: ' ↑'; opacity: 1; }
th.sortable.sort-desc::after { content: ' ↓'; opacity: 1; }

/* ── Clickable table rows ─────────────────────────── */
tr.clickable-row {
    transition: background-color 0.12s;
}

tr.clickable-row td:nth-child(-n+3) {
    cursor: pointer;
}

tr.clickable-row:hover {
    background-color: #e6f4ee;
    filter: none;
}

tr.clickable-row:hover td {
    color: var(--pico-primary);
}

/* ── History / access status badges ──────────────── */
.badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: 1em;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.completeness-ok {
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: var(--pico-border-radius);
    padding: 0.6rem 1rem;
    margin: 0;
}

.badge-pending    { background: #f3f4f6; color: #374151; }
.badge-complete   { background: #d1fae5; color: #065f46; }
.badge-completed  { background: #d1fae5; color: #065f46; }
.badge-partial    { background: #d1fae5; color: #065f46; }
.badge-failed     { background: #fee2e2; color: #991b1b; }
.badge-inprogress { background: #dbeafe; color: #1e40af; }
.badge-active     { background: #dbeafe; color: #1e40af; }
.badge-awaiting   { background: #fef3c7; color: #92400e; }
