/* Simplex portal styling, see LAYOUT.md. Overrides Bootstrap 5.1. */

@font-face {
    font-family: 'League Spartan';
    src: url(../resources/LeagueSpartan-Bold.otf) format('opentype');
    font-weight: 600 800;
    font-display: swap;
}

:root {
    --simplex-font-heading: 'League Spartan', var(--simplex-font-body);
    --simplex-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --simplex-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

    --simplex-primary: #1aa38c;
    --simplex-primary-text: #087f70;
    --simplex-primary-button: #148575;
    --simplex-primary-button-hover: #0f7566;
    --simplex-primary-button-pressed: #0b6357;
    --simplex-on-primary: #ffffff;
    --simplex-link-hover: #006e60;
    --simplex-accent: #e7a43a;
    --simplex-on-accent: #17332f;
    --simplex-secondary: #284f60;
    --simplex-secondary-hover: #1f4050;
    --simplex-tint: #eefaf8;

    --simplex-surface: #f8f8f8;
    --simplex-surface-raised: #ffffff;
    --simplex-surface-sunken: #e8f0ed;
    --simplex-surface-subtle: #fafbfd;
    --simplex-text: #17332f;
    --simplex-muted: #596b66;
    --simplex-border: #d4deda;
    --simplex-border-panel: #e8ebf1;
    --simplex-border-subtle: #eef1f5;

    --simplex-input-bg: #fbfcfe;
    --simplex-input-border: #dfe4ec;
    --simplex-input-border-hover: #c6cfdd;
    --simplex-label: #65747a;
    --simplex-placeholder: #98a3a8;
    --simplex-table-head: #8992a1;
    --simplex-icon: #94a0ae;

    --simplex-success: #16804a;
    --simplex-warning: #a15c07;
    --simplex-danger: #b42318;
    --simplex-danger-hover: #93190f;
    --simplex-success-bg: #e9f6ef;
    --simplex-success-border: #cfe9da;
    --simplex-danger-bg: #fdecea;
    --simplex-danger-border: #f3dcd9;
    --simplex-danger-text: #8a3b34;

    --sidebar-bg: #073f38;
    --sidebar-divider: #165048;
    --sidebar-active: #0e5148;
    --sidebar-org: #0b4840;
    --sidebar-org-hover: #2b6c62;
    --sidebar-org-icon: #135a50;
    --sidebar-caption: #7fa8a1;
    --sidebar-text: #bcd5d0;
    --sidebar-icon: #9cc4bd;
    --sidebar-icon-active: #67dec9;

    --simplex-shadow-panel: 0 2px 5px rgba(19, 34, 54, .04), 0 12px 32px rgba(19, 34, 54, .05);
    --simplex-shadow-menu: 0 6px 24px rgba(19, 34, 54, .12), 0 2px 6px rgba(19, 34, 54, .06);
    --simplex-shadow-dialog: 0 24px 70px rgba(24, 45, 51, .2);
    --simplex-focus-ring: 0 0 0 3px rgba(26, 163, 140, .16);

    color-scheme: light;
}

html[data-theme='dark'] {
    --simplex-primary-text: #67dec9;
    --simplex-link-hover: #79c0c2;
    --simplex-tint: #13241f;

    --simplex-surface: #101312;
    --simplex-surface-raised: #191e1c;
    --simplex-surface-sunken: #0b0d0c;
    --simplex-surface-subtle: #151a18;
    --simplex-text: #f2f5f3;
    --simplex-muted: #b4bfba;
    --simplex-border: #343c38;
    --simplex-border-panel: #2a312e;
    --simplex-border-subtle: #252b28;

    --simplex-input-bg: #141917;
    --simplex-input-border: #343c38;
    --simplex-input-border-hover: #4a544f;
    --simplex-label: #b4bfba;
    --simplex-placeholder: #7d8984;
    --simplex-table-head: #9aa6a1;
    --simplex-icon: #8d9994;

    --simplex-success: #4cc38a;
    --simplex-danger: #f08a80;
    --simplex-success-bg: rgba(22, 128, 74, .16);
    --simplex-success-border: rgba(76, 195, 138, .3);
    --simplex-danger-bg: rgba(180, 35, 24, .16);
    --simplex-danger-border: rgba(240, 138, 128, .3);
    --simplex-danger-text: #f6b4ad;

    --sidebar-bg: #0c1a18;
    --sidebar-divider: #1d2f2b;
    --sidebar-active: #15302b;
    --sidebar-org: #112420;
    --sidebar-org-hover: #2a4a44;
    --sidebar-org-icon: #183a34;
    --sidebar-caption: #6f8f89;
    --sidebar-text: #a9c2bd;
    --sidebar-icon: #8fb1aa;

    --simplex-shadow-panel: 0 2px 5px rgba(0, 0, 0, .2), 0 12px 32px rgba(0, 0, 0, .25);
    --simplex-shadow-dialog: 0 24px 70px rgba(0, 0, 0, .5);

    color-scheme: dark;
}

/* Base
-------------------------------------------------- */
html {
    font-size: 14px;
}

body {
    margin: 0;
    background: var(--simplex-surface);
    color: var(--simplex-text);
    font-family: var(--simplex-font-body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--simplex-font-heading);
    font-weight: 700;
    color: var(--simplex-text);
}

a {
    color: var(--simplex-primary-text);
}

a:hover {
    color: var(--simplex-link-hover);
}

:focus-visible {
    outline: 3px solid rgba(26, 163, 140, .55);
    outline-offset: 2px;
}

code, pre, .font-monospace {
    font-family: var(--simplex-font-mono) !important;
}

.text-muted {
    color: var(--simplex-muted) !important;
}

.text-danger {
    color: var(--simplex-danger) !important;
}

svg.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: currentColor;
}

/* Portal shell
-------------------------------------------------- */
.portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: 272px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: transform .2s ease;
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--sidebar-divider);
    color: #fff;
    text-decoration: none;
}

.drawer-brand:hover {
    color: #fff;
}

.drawer-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #fff;
}

.drawer-mark img {
    width: 28px;
    height: 28px;
}

.drawer-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.drawer-wordmark strong {
    font-family: var(--simplex-font-heading);
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.drawer-wordmark span {
    font-size: 12px;
    color: #bcd5d0;
}

.portal-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px 16px;
}

.nav-caption {
    padding: 18px 12px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sidebar-caption);
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    margin-bottom: 2px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
}

.nav-item-link .icon {
    color: var(--sidebar-icon);
}

.nav-item-link:hover,
.nav-item-link:focus-visible {
    background: var(--sidebar-active);
    color: #fff;
}

.nav-item-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

.nav-item-link.active .icon {
    color: var(--sidebar-icon-active);
}

.drawer-footer {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-top: 1px solid var(--sidebar-divider);
}

.org-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--sidebar-org);
    color: #fff;
}

.org-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--sidebar-org-icon);
    color: var(--sidebar-icon-active);
}

.org-icon .icon {
    width: 18px;
    height: 18px;
}

.org-copy {
    min-width: 0;
    line-height: 1.25;
}

.org-copy small {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sidebar-caption);
}

.org-copy span {
    display: block;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-footer form {
    margin: 0;
}

.portal-backdrop {
    display: none;
}

.portal-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: 272px;
    padding-bottom: 44px;
}

.portal-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 72px;
    padding: 0 32px;
    border-bottom: 1px solid var(--simplex-border-panel);
    background: var(--simplex-surface-raised);
}

.header-mark {
    display: none;
    width: 23px;
    height: 23px;
}

.header-title {
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    color: var(--simplex-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--simplex-input-border);
    border-radius: 9px;
    background: var(--simplex-surface-raised);
    color: var(--simplex-label);
}

.icon-btn:hover {
    border-color: var(--simplex-input-border-hover);
    background: var(--simplex-tint);
    color: var(--simplex-primary-text);
}

.nav-toggle {
    display: none;
}

.appearance-toggle .icon {
    display: none;
}

html[data-appearance='light'] .appearance-toggle .icon-light,
html[data-appearance='dark'] .appearance-toggle .icon-dark,
html[data-appearance='system'] .appearance-toggle .icon-system {
    display: block;
}

.portal-content {
    width: 100%;
    max-width: 1392px;
    margin: 0 auto;
    padding: 40px 48px 56px;
}

.portal-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 272px;
    z-index: 1010;
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 32px;
    border-top: 1px solid var(--simplex-border-panel);
    background: var(--simplex-surface-raised);
    font-size: 12px;
    color: var(--simplex-muted);
}

/* Page heading
-------------------------------------------------- */
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
}

.eyebrow {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--simplex-primary-text);
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 36px);
    letter-spacing: -.02em;
}

.heading-description {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--simplex-muted);
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Panel
-------------------------------------------------- */
.panel {
    margin-bottom: 20px;
    border: 1px solid var(--simplex-border-panel);
    border-radius: 12px;
    background: var(--simplex-surface-raised);
    box-shadow: var(--simplex-shadow-panel);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--simplex-border-subtle);
}

.panel-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--simplex-tint);
    color: var(--simplex-primary-text);
}

.panel-icon--danger {
    background: var(--simplex-danger-bg);
    color: var(--simplex-danger);
}

.panel-copy {
    flex: 1;
    min-width: 0;
}

.panel-copy h2 {
    margin: 0;
    font-size: 15px;
}

.panel-copy p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--simplex-muted);
}

.panel-count {
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 13px;
    background: var(--simplex-tint);
    font-size: 11px;
    font-weight: 700;
    color: var(--simplex-primary-text);
}

.panel-body {
    padding: 20px 22px 22px;
}

.panel-body--flush {
    padding: 0;
}

.panel-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--simplex-border-subtle);
    border-radius: 0 0 12px 12px;
    background: var(--simplex-surface-subtle);
}

.panel-footer .spacer {
    flex: 1;
}

.panel form {
    margin: 0;
}

.field-group {
    display: grid;
    gap: 16px;
    max-width: 460px;
}

.field-group--wide {
    max-width: none;
}

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

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--simplex-muted);
}

.detail-list {
    display: grid;
    grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
    gap: 12px 24px;
    margin: 0;
}

.detail-list dt {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--simplex-label);
}

.detail-list dd {
    margin: 0;
    font-size: 13px;
    word-break: break-word;
}

.empty-state {
    padding: 36px 24px;
    border: 1px dashed var(--simplex-border);
    border-radius: 16px;
    font-size: 13px;
    text-align: center;
    color: var(--simplex-muted);
}

.empty-hint {
    padding: 28px 16px;
    font-size: 12.5px;
    text-align: center;
    color: var(--simplex-muted);
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.quick-link {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--simplex-border-panel);
    border-radius: 12px;
    background: var(--simplex-surface-raised);
    box-shadow: var(--simplex-shadow-panel);
    color: var(--simplex-text);
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease;
}

.quick-link:hover {
    border-color: var(--simplex-primary);
    color: var(--simplex-text);
    transform: translateY(-2px);
}

.quick-link h2 {
    margin: 0 0 4px;
    font-size: 15px;
}

.quick-link p {
    margin: 0;
    font-size: 12.5px;
    color: var(--simplex-muted);
}

/* Forms
-------------------------------------------------- */
.form-label,
.control-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--simplex-label);
}

.form-control,
.form-select {
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--simplex-input-border);
    border-radius: 10px;
    background-color: var(--simplex-input-bg);
    color: var(--simplex-text);
    font-size: 13px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-select {
    padding-right: 40px;
}

html[data-theme='dark'] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23b4bfba' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

.form-control:hover,
.form-select:hover {
    border-color: var(--simplex-input-border-hover);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--simplex-primary);
    background-color: var(--simplex-input-bg);
    box-shadow: var(--simplex-focus-ring);
    color: var(--simplex-text);
}

.form-control::placeholder {
    color: var(--simplex-placeholder);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background-color: var(--simplex-surface-sunken);
    color: var(--simplex-muted);
    opacity: 1;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.search-field {
    min-height: 46px;
    border-radius: 12px;
    background-color: var(--simplex-surface-raised);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    margin: 0;
    padding-left: 0;
}

.form-check .form-check-input {
    float: none;
    margin: 0;
}

.form-check-label {
    font-size: 13px;
    color: var(--simplex-text);
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 1px solid var(--simplex-input-border-hover);
    background-color: var(--simplex-input-bg);
}

.form-check-input[type=checkbox] {
    border-radius: 5px;
}

.form-check-input:checked {
    border-color: var(--simplex-primary-button);
    background-color: var(--simplex-primary-button);
}

.form-check-input:focus {
    border-color: var(--simplex-primary);
    box-shadow: var(--simplex-focus-ring);
}

.input-group > .btn {
    min-height: 44px;
}

.field-validation-error,
.validation-summary-errors {
    font-size: 12px;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

.validation-summary-valid {
    display: none;
}

/* Buttons
-------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn-sm {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
}

.btn:focus,
.btn:focus-visible {
    box-shadow: none;
    outline: 3px solid rgba(26, 163, 140, .55);
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
    outline: 0;
}

.btn-primary {
    border-color: var(--simplex-primary-button);
    background-color: var(--simplex-primary-button);
    color: var(--simplex-on-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--simplex-primary-button-hover);
    background-color: var(--simplex-primary-button-hover);
    color: var(--simplex-on-primary);
}

.btn-primary:active,
.btn-primary.active {
    border-color: var(--simplex-primary-button-pressed);
    background-color: var(--simplex-primary-button-pressed);
    color: var(--simplex-on-primary);
}

.btn-secondary {
    border-color: var(--simplex-secondary);
    background-color: var(--simplex-secondary);
    color: #fff;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    border-color: var(--simplex-secondary-hover);
    background-color: var(--simplex-secondary-hover);
    color: #fff;
}

.btn-outline-secondary {
    border-color: var(--simplex-input-border);
    background-color: var(--simplex-input-bg);
    color: var(--simplex-label);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    border-color: var(--simplex-input-border-hover);
    background-color: var(--simplex-tint);
    color: var(--simplex-primary-text);
}

.btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--simplex-label);
}

.btn-ghost:hover,
.btn-ghost:focus {
    background: var(--simplex-surface-sunken);
    color: var(--simplex-text);
}

.btn-danger {
    border-color: var(--simplex-danger);
    background-color: #b42318;
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    border-color: var(--simplex-danger-hover);
    background-color: var(--simplex-danger-hover);
    color: #fff;
}

.btn-link {
    color: var(--simplex-primary-text);
    text-decoration: none;
}

.btn:disabled,
.btn.disabled {
    border-color: var(--simplex-surface-sunken);
    background-color: var(--simplex-surface-sunken);
    color: var(--simplex-muted);
    opacity: 1;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.row-action {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--simplex-icon);
}

.row-action .icon {
    width: 18px;
    height: 18px;
}

.row-action:hover {
    background: var(--simplex-tint);
    color: var(--simplex-primary);
}

.row-action--danger:hover {
    background: var(--simplex-danger-bg);
    color: var(--simplex-danger);
}

/* Tables
-------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--simplex-surface-subtle);
    margin: 0;
    border-color: var(--simplex-border-subtle);
    color: var(--simplex-text);
}

.table > :not(:first-child) {
    border-top: 0;
}

.table > thead > tr > th {
    height: 42px;
    padding: 0 16px;
    border-bottom: 1px solid var(--simplex-border-subtle);
    background: var(--simplex-surface-subtle);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--simplex-table-head);
    vertical-align: middle;
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--simplex-border-subtle);
    font-size: 12.5px;
    color: var(--simplex-text);
    vertical-align: middle;
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.table > tbody > tr:hover > td {
    background: var(--simplex-surface-subtle);
}

.table-sm > thead > tr > th {
    height: 34px;
    padding: 0 10px;
}

.table-sm > tbody > tr > td {
    padding: 8px 10px;
}

.table-bordered > :not(caption) > * > * {
    border: 1px solid var(--simplex-border-subtle);
}

.actions-col {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.cell-wrap {
    min-width: 220px;
    max-width: 380px;
    word-break: break-word;
}

.cell-mono {
    font-family: var(--simplex-font-mono);
    font-size: 12px;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 20px;
    background: var(--simplex-surface-sunken);
    font-size: 10.5px;
    font-weight: 650;
    color: var(--simplex-muted);
    white-space: nowrap;
}

.role-chip--accent {
    background: var(--simplex-tint);
    color: var(--simplex-primary-text);
}

.role-chip--success {
    background: var(--simplex-success-bg);
    color: var(--simplex-success);
}

.role-chip--danger {
    background: var(--simplex-danger-bg);
    color: var(--simplex-danger);
}

/* Toolbar (filters above tables)
-------------------------------------------------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--simplex-border-subtle);
}

.toolbar .search-field {
    flex: 1 1 280px;
}

/* Alerts
-------------------------------------------------- */
.alert {
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 13px;
}

.alert-dismissible {
    padding-right: 48px;
}

.alert-dismissible .btn-close {
    padding: 14px 16px;
}

.alert-success {
    border-color: var(--simplex-success-border);
    background: var(--simplex-success-bg);
    color: var(--simplex-success);
}

.alert-danger {
    border-color: var(--simplex-danger-border);
    background: var(--simplex-danger-bg);
    color: var(--simplex-danger-text);
}

html[data-theme='dark'] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Modals
-------------------------------------------------- */
.modal-content {
    border: 1px solid var(--simplex-border-panel);
    border-radius: 20px;
    background: var(--simplex-surface-raised);
    box-shadow: var(--simplex-shadow-dialog);
    color: var(--simplex-text);
}

.modal-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--simplex-border-subtle);
}

.modal-title {
    font-size: 16px;
}

.modal-body {
    padding: 20px 22px;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--simplex-border-subtle);
    border-radius: 0 0 20px 20px;
    background: var(--simplex-surface-subtle);
}

.modal-body pre {
    margin: 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--simplex-surface-sunken);
    font-size: 12px;
    color: var(--simplex-text);
}

/* Pagination
-------------------------------------------------- */
.pagination {
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
}

.pagination .page-item .page-link {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--simplex-input-border);
    border-radius: 9px;
    background: var(--simplex-surface-raised);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--simplex-text);
}

.pagination .page-item .page-link:hover {
    border-color: var(--simplex-input-border-hover);
    background: var(--simplex-tint);
    color: var(--simplex-primary-text);
}

.pagination .page-item.active .page-link {
    border-color: var(--simplex-primary-button);
    background: var(--simplex-primary-button);
    color: var(--simplex-on-primary);
}

.pagination .page-item.disabled .page-link {
    border-color: var(--simplex-border-subtle);
    background: var(--simplex-surface-subtle);
    color: var(--simplex-muted);
}

/* Responsive
-------------------------------------------------- */
@media (max-width: 960px) {
    .portal-sidebar {
        transform: translateX(-100%);
    }

    body.nav-open .portal-sidebar {
        transform: none;
        box-shadow: 0 26px 80px rgba(16, 54, 49, .3);
    }

    body.nav-open .portal-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1035;
        display: block;
        background: rgba(7, 20, 18, .45);
    }

    .portal-main {
        margin-left: 0;
    }

    .portal-header {
        padding: 0 20px;
    }

    .nav-toggle {
        display: inline-grid;
    }

    .header-mark {
        display: block;
    }

    .portal-content {
        padding: 26px 24px 34px;
    }

    .portal-footer {
        left: 0;
        padding: 0 20px;
    }
}

@media (max-width: 600px) {
    .portal-header {
        height: 64px;
    }

    .portal-content {
        padding: 20px 16px 28px;
    }

    .page-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-header,
    .panel-body,
    .panel-footer,
    .toolbar {
        padding-right: 16px;
        padding-left: 16px;
    }

    .field-row,
    .detail-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-list {
        gap: 4px;
    }

    .detail-list dd {
        margin-bottom: 10px;
    }
}

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