﻿:root {
    --brand-navy: #001733;
    --brand-primary: #0c4e78;
    --brand-primary-dark: #043155;
    --brand-cyan: #29909f;
    --brand-green: #3caa8f;
    --brand-soft: #eaf5f6;
    --ink: #142d3d;
    --muted: #647681;
    --line: #d8e3e7;
    --surface: #ffffff;
    --surface-soft: #f3f7f8;
    --sidebar: #001733;
    --success: #2d8a6f;
    --danger: #c0392b;
    --warning: #d98200;
    --info: #1f6feb;
    --disabled: #7a828c;
}

* {
    letter-spacing: 0;
}

body {
    background: var(--surface-soft);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.portal-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    background: var(--sidebar);
    color: #fff;
    flex-direction: column;
    padding: 24px 18px;
}

.portal-offcanvas,
.portal-mobile-bar {
    background: var(--sidebar);
    color: #fff;
}

.sidebar-brand,
.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-brand {
    padding: 0 8px 28px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: var(--brand-primary);
    color: #fff;
    font-weight: 800;
}

.brand-mark.large {
    width: 58px;
    height: 58px;
    font-size: 1.1rem;
}

.brand-logo {
    position: relative;
    display: block;
    width: 46px;
    height: 46px;
    overflow: hidden;
    flex: 0 0 auto;
}

.brand-logo img {
    position: absolute;
    top: -12px;
    left: -13px;
    width: 132px;
    max-width: none;
    height: auto;
}

.brand-title {
    font-weight: 800;
}

.brand-subtitle,
.portal-kicker {
    color: #aeb6c1;
    font-size: .78rem;
    text-transform: uppercase;
    font-weight: 700;
}

.portal-kicker {
    color: var(--brand-primary);
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    color: #d8dee7;
    padding: 10px 12px;
    text-decoration: none;
    background: transparent;
    width: 100%;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .11);
}

.sidebar-link.active {
    box-shadow: inset 3px 0 0 var(--brand-cyan);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
}

.sidebar-logout {
    text-align: left;
}

.portal-main {
    flex: 1 0 auto;
    padding: 28px;
}

.portal-footer {
    flex: 0 0 auto;
    padding: 14px max(18px, calc((100vw - 1360px) / 2));
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    text-align: center;
    font-size: .78rem;
}

.portal-footer p {
    margin: 0;
}

.portal-footer strong {
    color: var(--ink);
    font-weight: 750;
}

.user-portal-shell {
    background: #f7f8fa;
}

.user-topbar {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
    align-items: center;
    min-height: 74px;
    padding: 12px max(24px, calc((100vw - 1360px) / 2));
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.user-brand,
.user-account,
.user-navigation,
.user-nav-link {
    display: flex;
    align-items: center;
}

button.user-nav-link {
    border: 0;
    background: transparent;
}

.user-brand {
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
}

.user-brand:hover {
    color: var(--ink);
}

.user-brand .brand-logo {
    width: 38px;
    height: 38px;
}

.user-brand .brand-logo img {
    top: -10px;
    left: -11px;
    width: 110px;
}

.user-brand strong,
.user-brand small {
    display: block;
}

.user-brand strong {
    font-size: .94rem;
}

.user-brand small {
    margin-top: 1px;
    color: var(--muted);
    font-size: .74rem;
}

.user-navigation {
    gap: 6px;
    justify-content: center;
}

.user-nav-link {
    min-height: 38px;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 750;
    text-decoration: none;
}

.user-nav-link:hover,
.user-nav-link.active {
    background: #f0f2f5;
    color: var(--ink);
}

.user-nav-link.active {
    box-shadow: inset 0 -2px 0 var(--brand-cyan);
}

.user-account {
    justify-content: flex-end;
    gap: 9px;
}

.language-switcher {
    display: grid;
    grid-template-columns: repeat(2, 34px);
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.language-switcher button {
    width: 34px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
}

.language-switcher button:hover {
    color: var(--ink);
}

.language-switcher button.active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(31, 36, 43, .12);
}

.theme-toggle {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #202830;
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
}

.user-name {
    max-width: 180px;
    overflow: hidden;
    font-size: .85rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-logout {
    width: 34px;
    height: 34px;
}

.admin-access-link {
    display: inline-flex;
    width: auto;
    height: 36px;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 750;
}

.site-launcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 200px));
    gap: 16px;
    justify-content: center;
}

.site-launcher-button {
    --launcher-accent: #0c4e78;
    --launcher-soft: #e8f0f5;
    position: relative;
    display: flex;
    aspect-ratio: 1;
    min-width: 0;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--launcher-accent);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    box-shadow: 0 5px 18px rgba(31, 36, 43, .045);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.site-launcher-button:nth-child(4n + 2) {
    --launcher-accent: #29909f;
    --launcher-soft: #e9f6f7;
}

.site-launcher-button:nth-child(4n + 3) {
    --launcher-accent: #3caa8f;
    --launcher-soft: #eaf7f2;
}

.site-launcher-button:nth-child(4n + 4) {
    --launcher-accent: #28739d;
    --launcher-soft: #ebf3f8;
}

.site-launcher-button:hover {
    border-color: #c7ced6;
    color: var(--ink);
    box-shadow: 0 10px 26px rgba(31, 36, 43, .09);
    transform: translateY(-2px);
}

.site-launcher-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: var(--launcher-soft);
    color: var(--launcher-accent);
}

.site-launcher-icon i {
    font-size: 1.7rem;
}

.site-launcher-button strong {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.site-category-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.application-launcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 190px));
    gap: 14px;
    justify-content: center;
}

.application-launcher-tile {
    position: relative;
    aspect-ratio: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 5px 18px rgba(31, 36, 43, .045);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.application-launcher-tile:hover {
    border-color: #c7ced6;
    box-shadow: 0 10px 26px rgba(31, 36, 43, .08);
    transform: translateY(-2px);
}

.application-launcher-target {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-rows: 76px minmax(2.2rem, auto) minmax(24px, auto);
    align-content: center;
    justify-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: inherit;
    color: var(--ink);
    text-align: center;
    text-decoration: none;
}

.application-launcher-target:hover {
    color: var(--ink);
}

.application-launcher-target h2 {
    align-self: center;
    margin: 0;
    font-size: .92rem;
    font-weight: 850;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.application-launcher-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand-primary);
    overflow: hidden;
    flex: 0 0 auto;
}

.application-launcher-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.application-launcher-icon i {
    font-size: 2rem;
}

.application-launcher-target .status-badge {
    max-width: 100%;
    min-height: 24px;
    justify-content: center;
    padding: 3px 8px;
    font-size: .7rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}

.application-launcher-tile.is-unavailable .application-launcher-icon {
    filter: grayscale(.35);
    opacity: .8;
}

.application-launcher-tile.is-unavailable {
    cursor: not-allowed;
}

.application-launcher-tile.is-unavailable:hover {
    border-color: var(--line);
    box-shadow: 0 5px 18px rgba(31, 36, 43, .045);
    transform: none;
}

.user-portal-main {
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 42px 28px 56px;
}

.admin-portal-main {
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 28px 56px;
}

.admin-page-heading {
    margin-bottom: 24px;
    text-align: center;
}

.admin-manage-menu {
    min-width: 210px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(31, 36, 43, .12);
}

.admin-manage-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    border-radius: 6px;
    font-size: .86rem;
}

.portal-topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.portal-page-title {
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    margin: 0;
    font-weight: 800;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.metric-card,
.filter-band,
.table-shell,
.form-shell,
.detail-shell,
.empty-state,
.history-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(31, 36, 43, .06);
}

.metric-card {
    min-height: 118px;
    padding: 18px;
    display: grid;
    align-content: space-between;
    border-top: 4px solid var(--ink);
}

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

.metric-card strong {
    font-size: 2rem;
    line-height: 1;
}

.compact-summary-grid {
    gap: 10px;
}

.compact-summary-grid .metric-card {
    min-height: 76px;
    padding: 12px 14px;
    border-top-width: 3px;
}

.compact-summary-grid .metric-card span {
    font-size: .76rem;
}

.compact-summary-grid .metric-card strong {
    font-size: 1.45rem;
}

.metric-online {
    border-top-color: var(--success);
}

.metric-offline {
    border-top-color: var(--danger);
}

.metric-maintenance {
    border-top-color: var(--warning);
}

.metric-development {
    border-top-color: var(--info);
}

.filter-band,
.form-shell,
.detail-shell,
.history-panel {
    padding: 20px;
}

.site-editor-form {
    width: 100%;
    max-width: 980px;
    margin-inline: auto;
}

.options-workspace {
    width: 100%;
    max-width: 920px;
    margin-inline: auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(31, 36, 43, .06);
}

.options-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.options-tab {
    display: grid;
    min-width: 0;
    min-height: 62px;
    grid-template-columns: 22px minmax(0, auto) 24px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 14px;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 800;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.options-tab:last-child {
    border-right: 0;
}

.options-tab:hover {
    background: var(--surface);
    color: var(--ink);
}

.options-tab.active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: inset 0 -3px 0 var(--brand-cyan);
}

.options-tab > i {
    color: var(--brand-primary);
    font-size: 1.05rem;
}

.options-tab > span:not(.option-total) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.options-panels {
    min-height: 390px;
}

.option-group {
    min-width: 0;
    padding: 24px;
}

.option-group:focus {
    outline: 0;
}

.option-total,
.option-usage {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    padding-inline: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
}

.option-add-form {
    display: grid;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 20px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
}

.option-add-form-category {
    max-width: none;
    grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1fr) auto;
}

.option-add-form .form-control,
.option-add-form .icon-code-control,
.option-add-form .icon-code-preview,
.option-form-actions > .icon-btn {
    min-height: 38px;
}

.option-form-actions,
.option-row-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.option-form-editing {
    padding: 10px;
    border: 1px solid var(--brand-cyan);
    border-radius: 7px;
    background: var(--brand-soft);
}

.option-list {
    display: grid;
    max-height: 470px;
    gap: 2px;
    overflow-y: auto;
    padding-right: 4px;
    border-top: 1px solid var(--line);
    scrollbar-width: thin;
}

.option-row {
    display: grid;
    min-height: 46px;
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    padding: 7px 5px;
    border-bottom: 1px solid var(--line);
}

.option-row-editing {
    background: var(--brand-soft);
}

.option-row:last-child {
    border-bottom: 0;
}

.option-row-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--brand-soft);
    color: var(--brand-primary);
}

.option-row strong {
    min-width: 0;
    font-size: .86rem;
    overflow-wrap: anywhere;
}

.option-row form {
    margin: 0;
}

.option-row .icon-btn {
    width: 32px;
    height: 32px;
}

.option-row .icon-btn:disabled {
    border-color: transparent;
    opacity: .35;
}

.option-empty {
    padding: 24px 8px;
    color: var(--muted);
    text-align: center;
    font-size: .84rem;
}

.icon-code-control {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: stretch;
}

.icon-code-control .form-control {
    border-radius: 0 6px 6px 0;
}

.icon-code-preview,
.admin-site-icon {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: var(--brand-soft);
    color: var(--brand-primary);
}

.icon-code-preview {
    min-height: 38px;
    border-right: 0;
    border-radius: 6px 0 0 6px;
}

.icon-code-preview i {
    font-size: 1.15rem;
}

.admin-site-icon {
    width: 38px;
    height: 38px;
    border-radius: 6px;
}

.admin-site-icon i {
    font-size: 1rem;
}

.compact-filter-band {
    padding: 14px;
}

.compact-filter-band .form-label {
    margin-bottom: 4px;
    font-size: .78rem;
    font-weight: 750;
    color: var(--muted);
}

.directory-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.directory-heading h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 850;
}

.directory-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

.directory-kicker {
    color: var(--brand-primary) !important;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

.directory-heading-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.directory-heading-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid #b9dadd;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand-primary);
    flex: 0 0 auto;
}

.directory-heading-mark i {
    font-size: 1.35rem;
}

.user-directory-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
    align-items: end;
    gap: 36px;
    padding: 10px 0 34px;
}

.user-directory-intro h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 850;
}

.user-directory-intro p:not(.directory-kicker) {
    max-width: 620px;
    margin: 8px 0 0;
    color: var(--muted);
}

.directory-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 6px 6px 6px 15px;
    border: 1px solid #cfd5dc;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 18px rgba(31, 36, 43, .05);
}

.directory-search > i {
    color: var(--muted);
}

.directory-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    font-size: .94rem;
}

.directory-search input::placeholder {
    color: #88919b;
}

.category-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.category-section-heading h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 850;
}

.category-section-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.user-all-sites-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand-primary-dark);
    font-size: .86rem;
    font-weight: 800;
    text-decoration: none;
}

.user-all-sites-link:hover {
    color: var(--brand-primary);
}

.category-folder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.category-folder {
    --folder-fill: #0c4e78;
    --folder-symbol-color: #fff;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: 12px;
    min-height: 120px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 5px 16px rgba(31, 36, 43, .045);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.category-folder:nth-child(4n + 2) {
    --folder-fill: #29909f;
    --folder-symbol-color: #fff;
}

.category-folder:nth-child(4n + 3) {
    --folder-fill: #3caa8f;
    --folder-symbol-color: #fff;
}

.category-folder:nth-child(4n + 4) {
    --folder-fill: #28739d;
    --folder-symbol-color: #fff;
}

.category-folder:hover {
    border-color: #c8cfd7;
    background: #fafbfc;
    color: inherit;
    box-shadow: 0 8px 22px rgba(31, 36, 43, .08);
    transform: translateY(-1px);
}

.folder-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--folder-fill);
    color: var(--folder-symbol-color);
}

.category-mark-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.category-folder-copy {
    min-width: 0;
}

.category-folder-copy h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-folder-copy p {
    display: -webkit-box;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.35;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.folder-count {
    align-self: start;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f4f6f8;
    color: var(--ink);
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.folder-arrow {
    color: var(--muted);
    font-size: .85rem;
    transition: transform .16s ease;
}

.category-folder:hover .folder-arrow {
    transform: translateX(2px);
}

.public-filter-shell {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 5px 16px rgba(31, 36, 43, .04);
}

.public-filter-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(170px, 220px) minmax(160px, 200px) auto;
    align-items: center;
    gap: 10px;
}

.public-filter-form.category-filter-form {
    grid-template-columns: minmax(240px, 1fr) minmax(160px, 200px) auto;
}

.public-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 40px;
    padding: 7px 11px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
}

.public-search-field:focus-within {
    border-color: #a7afb8;
    box-shadow: 0 0 0 3px rgba(38, 39, 43, .07);
}

.public-search-field i {
    color: var(--muted);
}

.public-search-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--ink);
}

.public-filter-form > .form-select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
}

.public-filter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

.application-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.application-card {
    min-height: 420px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.application-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.application-logo {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: #f0f2f5;
    display: grid;
    place-items: center;
    color: var(--brand-primary);
    overflow: hidden;
    flex: 0 0 auto;
}

.application-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.application-logo i {
    font-size: 1.7rem;
}

.application-card h2 {
    font-size: 1.12rem;
    margin: 0;
    font-weight: 800;
}

.application-card p {
    color: var(--muted);
    margin: 0;
    min-height: 48px;
}

.application-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.application-meta div {
    min-width: 0;
}

.application-meta dt {
    color: var(--muted);
    font-size: .74rem;
    text-transform: uppercase;
    font-weight: 800;
}

.application-meta dd {
    margin: 2px 0 0;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.application-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn-amcor {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-primary-dark);
    --bs-btn-hover-border-color: var(--brand-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

.icon-text-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.badge-status-online {
    background: var(--success);
}

.badge-status-offline {
    background: var(--danger);
}

.badge-status-maintenance {
    background: var(--warning);
}

.badge-status-development {
    background: var(--info);
}

.badge-status-disabled {
    background: var(--disabled);
}

.badge-status-custom {
    background: var(--brand-primary);
}

.table-shell {
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.directory-toolbar,
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.directory-toolbar {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.site-list {
    display: grid;
}

.site-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(260px, .45fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-row:last-child {
    border-bottom: 0;
}

.site-row:hover {
    background: #fafbfc;
}

.site-identity,
.app-overview-main,
.site-title-line,
.site-subline,
.site-row-actions,
.detail-actions {
    display: flex;
    align-items: center;
}

.site-identity {
    min-width: 0;
    gap: 12px;
}

.site-logo-sm {
    width: 42px;
    height: 42px;
}

.site-logo-sm i {
    font-size: 1.25rem;
}

.site-title-block {
    min-width: 0;
}

.site-title-line {
    gap: 10px;
    min-width: 0;
}

.site-title-line h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-subline {
    gap: 8px;
    margin-top: 4px;
    color: var(--muted);
    font-size: .82rem;
    min-width: 0;
}

.site-subline span:not(.badge) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-subline span:not(.badge) + span:not(.badge)::before {
    content: "/";
    margin-right: 8px;
    color: #a8b0ba;
}

.site-operations {
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 10px;
}

.site-operations span,
.parameter-grid dt {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.site-operations strong {
    display: block;
    margin-top: 2px;
    font-size: .86rem;
    overflow-wrap: anywhere;
}

.site-row-actions {
    justify-content: flex-end;
    gap: 8px;
}

.public-site-directory {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.public-site-directory .site-list {
    gap: 10px;
}

.public-site-directory .site-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(31, 36, 43, .035);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.public-site-directory .site-row:hover {
    border-color: #c8cfd7;
    box-shadow: 0 8px 22px rgba(31, 36, 43, .07);
    transform: translateY(-1px);
}

.public-site-directory .site-row:nth-child(4n + 2) .application-logo {
    background: #edf5fa;
    color: #2f6e9e;
}

.public-site-directory .site-row:nth-child(4n + 3) .application-logo {
    background: #eef7f1;
    color: #2e7750;
}

.public-site-directory .site-row:nth-child(4n + 4) .application-logo {
    background: #faeef0;
    color: #a63b49;
}

.user-site-row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 92px;
    padding: 14px 16px;
}

.user-site-description {
    max-width: 760px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.4;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.user-site-actions {
    min-width: 116px;
}

.compact-icon-btn {
    width: 34px;
    height: 34px;
}

.app-overview-shell {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.app-overview-main {
    min-width: 0;
    gap: 14px;
}

.detail-logo {
    width: 64px;
    height: 64px;
}

.app-overview-text {
    min-width: 0;
}

.app-overview-text h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 850;
}

.app-overview-text p {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 900px;
}

.detail-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.parameter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 0;
}

.parameter-grid div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbfc;
}

.parameter-grid dd {
    margin: 4px 0 0;
    font-weight: 650;
    overflow-wrap: anywhere;
}

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

.compact-history-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.compact-history-grid .history-state strong {
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.compact-table > :not(caption) > * > * {
    padding: .55rem .75rem;
}

.compact-empty-state {
    min-height: 180px;
    padding: 28px;
}

.table {
    margin-bottom: 0;
}

.table th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
}

.empty-state {
    min-height: 280px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 40px;
}

.empty-state i {
    color: var(--brand-primary);
    font-size: 2.5rem;
}

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(31, 36, 43, .92), rgba(31, 36, 43, .72)),
        linear-gradient(90deg, #f8f9fa 0 20%, #e6e9ed 20% 21%, #f8f9fa 21% 60%, #e6e9ed 60% 61%, #f8f9fa 61%);
}

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

.login-panel {
    width: min(480px, 100%);
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.login-brand {
    margin-bottom: 28px;
}

.login-brand h1 {
    font-size: 1.35rem;
    font-weight: 850;
    margin: 0;
}

.portal-toast .toast-body.success {
    border-left: 4px solid var(--success);
}

.portal-toast .toast-body.warning {
    border-left: 4px solid var(--warning);
}

.portal-toast .toast-body.error {
    border-left: 4px solid var(--danger);
}

.role-checks {
    display: grid;
    gap: 8px;
}

.history-state-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.history-state {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.history-state span {
    display: block;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
}

.history-state strong {
    font-size: 1.4rem;
}

.screenshot-preview {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

@media (max-width: 1199.98px) {
    .admin-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .admin-topbar .user-navigation {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: thin;
    }

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

    .site-row {
        grid-template-columns: 1fr auto;
    }

    .site-operations {
        grid-column: 1 / -1;
        grid-row: 2;
    }

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

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

    .public-filter-form {
        grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) minmax(150px, 180px) auto;
    }

    .public-filter-form.category-filter-form {
        grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) auto;
    }
}

@media (max-width: 767.98px) {
    .portal-main {
        padding: 18px;
    }

    .user-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        padding: 12px 18px;
    }

    .user-navigation {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }

    .user-portal-main {
        padding: 30px 18px 44px;
    }

    .admin-portal-main {
        padding: 24px 18px 44px;
    }

    .option-group {
        padding: 16px;
    }

    .options-tab {
        min-height: 56px;
        grid-template-columns: 20px minmax(0, 1fr);
        gap: 6px;
        padding: 8px;
        font-size: .78rem;
    }

    .options-tab .option-total {
        display: none;
    }

    .option-add-form-category {
        grid-template-columns: minmax(0, 1fr) 38px;
    }

    .option-add-form-category > :first-child {
        grid-column: 1 / -1;
    }

    .portal-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

    .user-directory-intro {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-bottom: 26px;
    }

    .user-directory-intro h1 {
        font-size: 1.7rem;
    }

    .directory-search {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .public-filter-form {
        grid-template-columns: minmax(0, 1fr) minmax(145px, 180px) auto;
    }

    .public-filter-form:not(.category-filter-form) .public-search-field {
        grid-column: 1 / -1;
    }

    .category-folder-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid,
    .application-grid,
    .history-state-grid {
        grid-template-columns: 1fr;
    }

    .application-meta {
        grid-template-columns: 1fr;
    }

    .app-overview-shell,
    .site-row {
        grid-template-columns: 1fr;
    }

    .user-site-description,
    .user-site-actions {
        grid-column: auto;
        grid-row: auto;
    }

    .app-overview-shell {
        flex-direction: column;
    }

    .site-operations,
    .parameter-grid,
    .compact-history-grid {
        grid-template-columns: 1fr;
    }

    .site-row-actions,
    .detail-actions {
        justify-content: flex-start;
    }

    .site-row-actions .btn-amcor,
    .site-row-actions .btn-secondary {
        flex: 1 1 auto;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 575.98px) {
    .user-topbar {
        padding-inline: 12px;
    }

    .user-brand > span:last-child {
        display: none;
    }

    .user-account {
        gap: 6px;
    }

    .admin-access-link {
        width: 36px;
        padding: 0;
        justify-content: center;
    }

    .admin-access-link span {
        display: none;
    }

    .site-launcher-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .site-launcher-button {
        padding: 15px;
    }

    .site-launcher-icon {
        width: 46px;
        height: 46px;
    }

    .application-launcher-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .application-launcher-tile {
        width: auto;
    }

    .application-launcher-target {
        grid-template-rows: 56px minmax(2rem, auto) minmax(24px, auto);
        gap: 5px;
        padding: 5px;
    }

    .application-launcher-icon {
        width: 56px;
        height: 56px;
    }

    .application-launcher-target h2 {
        font-size: .84rem;
    }

    .public-filter-form,
    .public-filter-form.category-filter-form {
        grid-template-columns: 1fr;
    }

    .public-filter-form .public-search-field,
    .public-filter-form:not(.category-filter-form) .public-search-field {
        grid-column: auto;
    }

    .public-filter-actions .btn {
        flex: 1 1 auto;
    }
}

html[data-theme="dark"] {
    --brand-primary: #8ec6bb;
    --brand-primary-dark: #6eb892;
    --brand-cyan: #29909f;
    --brand-green: #6eb892;
    --brand-soft: #18313a;
    --ink: #edf0f3;
    --muted: #aab2bc;
    --line: #3a424b;
    --surface: #1d2329;
    --surface-soft: #13181d;
    --sidebar: #12171c;
    --success: #35a76a;
    --danger: #dc5260;
    --warning: #d99a34;
    --info: #4c8bd8;
    --disabled: #78818b;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--surface-soft);
    --bs-secondary-color: var(--muted);
    color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .user-portal-shell {
    background: var(--surface-soft);
    color: var(--ink);
}

html[data-theme="dark"] .user-nav-link:hover,
html[data-theme="dark"] .user-nav-link.active,
html[data-theme="dark"] .application-logo,
html[data-theme="dark"] .application-launcher-icon {
    background: #293039;
}

html[data-theme="dark"] .site-launcher-button {
    --launcher-soft: #152b39;
}

html[data-theme="dark"] .site-launcher-button:nth-child(4n + 2) {
    --launcher-soft: #143137;
}

html[data-theme="dark"] .site-launcher-button:nth-child(4n + 3) {
    --launcher-soft: #15342c;
}

html[data-theme="dark"] .site-launcher-button:nth-child(4n + 4) {
    --launcher-soft: #172f3f;
}

html[data-theme="dark"] .directory-heading-mark {
    border-color: #315d6a;
    background: #18313a;
}

html[data-theme="dark"] .btn-amcor {
    --bs-btn-bg: #136998;
    --bs-btn-border-color: #136998;
    --bs-btn-hover-bg: #0c4e78;
    --bs-btn-hover-border-color: #0c4e78;
}

html[data-theme="dark"] .site-row:hover,
html[data-theme="dark"] .category-folder:hover,
html[data-theme="dark"] .parameter-grid div {
    background: #242b32;
}

html[data-theme="dark"] .public-search-field,
html[data-theme="dark"] .directory-search,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    border-color: var(--line);
    background-color: #181e23;
    color: var(--ink);
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .public-search-field input::placeholder,
html[data-theme="dark"] .directory-search input::placeholder {
    color: #89939d;
}

html[data-theme="dark"] .public-search-field input,
html[data-theme="dark"] .directory-search input {
    background: transparent;
    color: var(--ink);
}

html[data-theme="dark"] .table {
    --bs-table-color: var(--ink);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--line);
    --bs-table-striped-color: var(--ink);
    --bs-table-hover-color: var(--ink);
    --bs-table-hover-bg: #252c33;
}

html[data-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #d2d8de;
    --bs-btn-border-color: #626c76;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #4a535d;
    --bs-btn-hover-border-color: #66717c;
}

html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .toast-header {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}

html[data-theme="dark"] .dropdown-item {
    color: var(--ink);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
    background: #2a323a;
    color: #fff;
}

html[data-theme="dark"] .dropdown-divider,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: var(--line);
}

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

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .form-text {
    color: var(--muted) !important;
}

html[data-theme="dark"] .language-switcher button.active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
