* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(17, 197, 244, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(139, 77, 255, 0.18), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%),
        var(--color-bg);
    color: var(--color-text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.theme-light {
    --color-bg: #eef4fb;
    --color-surface: #ffffff;
    --color-surface-2: #f3f7fc;
    --color-text: #152033;
}

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

a:hover {
    color: var(--color-accent-hover);
}

.app-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.app-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 18px;
    background:
        linear-gradient(180deg, rgba(17, 197, 244, 0.08), transparent 20%),
        linear-gradient(180deg, rgba(139, 77, 255, 0.08), transparent 58%),
        rgba(9, 15, 29, 0.92);
    border-right: 1px solid rgba(124, 153, 255, 0.12);
    backdrop-filter: blur(18px);
}

.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 32px 10px;
}

.topbar--compact {
    justify-content: flex-end;
}

.topbar__eyebrow,
.nav-section-label,
.sidebar-user__role,
.muted,
.stat-card__label,
.metric-card__label,
.item-meta,
.request-card__meta,
.history-list__meta {
    color: rgba(224, 232, 255, 0.64);
}

.topbar__eyebrow {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.topbar__title,
h1,
h2,
h3 {
    margin: 0;
}

.topbar__title {
    font-size: 2rem;
    line-height: 1.05;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-chip,
.tenant-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(15, 23, 39, 0.82);
    border: 1px solid rgba(118, 144, 255, 0.14);
    text-decoration: none;
    color: var(--color-text);
    position: relative;
}

.icon-chip:hover,
.tenant-chip:hover {
    border-color: rgba(17, 197, 244, 0.36);
}

.icon-chip__counter {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-secondary));
    color: #03121a;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-chip--hot {
    box-shadow: 0 0 0 1px rgba(17, 197, 244, 0.22), 0 8px 22px rgba(17, 197, 244, 0.18);
}

.content {
    padding: 10px 32px 36px;
}

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

.brand--sidebar {
    padding: 8px 10px 16px;
    border-bottom: 1px solid rgba(118, 144, 255, 0.12);
}

.brand__logo {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 12px 28px rgba(17, 197, 244, 0.18));
}

.brand-mark-wrap {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(118, 144, 255, 0.14);
    box-shadow: 0 14px 30px rgba(3, 9, 21, 0.22);
}

.brand-mark-wrap--auth {
    width: 72px;
    height: 72px;
    border-radius: 22px;
}

.brand__mark {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.brand-mark-wrap--auth .brand__mark {
    width: 44px;
    height: 44px;
}

.brand__title {
    font-weight: 800;
    font-size: 1.08rem;
}

.brand__subtitle {
    font-size: 12px;
    color: rgba(224, 232, 255, 0.64);
}

.sidebar-user__avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-secondary));
    color: #03121a;
    font-weight: 800;
}

.sidebar-user__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-section-label {
    margin: 4px 10px 0;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    color: rgba(240, 245, 255, 0.9);
    text-decoration: none;
    border: 1px solid transparent;
    transition: 0.18s ease;
}

.nav-link:hover,
.nav-link.is-active {
    background: linear-gradient(135deg, rgba(17, 197, 244, 0.14), rgba(139, 77, 255, 0.14));
    border-color: rgba(17, 197, 244, 0.24);
    color: #fff;
}

.nav-link i {
    font-size: 1rem;
    width: 18px;
}

.page-head,
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.page-subtitle {
    margin: 6px 0 0;
    color: rgba(224, 232, 255, 0.7);
}

.glass-panel,
.card,
.stat-card,
.metric-card,
.request-card,
.problem-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02)),
        rgba(12, 18, 33, 0.9);
    border: 1px solid rgba(118, 144, 255, 0.14);
    box-shadow: 0 18px 42px rgba(3, 9, 21, 0.28);
    backdrop-filter: blur(18px);
}

body.theme-light .app-sidebar {
    background:
        linear-gradient(180deg, rgba(17, 197, 244, 0.08), transparent 20%),
        linear-gradient(180deg, rgba(139, 77, 255, 0.06), transparent 58%),
        rgba(245, 249, 255, 0.94);
    border-right: 1px solid rgba(118, 144, 255, 0.18);
}

body.theme-light .glass-panel,
body.theme-light .card,
body.theme-light .stat-card,
body.theme-light .metric-card,
body.theme-light .request-card,
body.theme-light .problem-card,
body.theme-light .workflow-action,
body.theme-light .auth-panel,
body.theme-light .icon-chip,
body.theme-light .tenant-chip,
body.theme-light .info-box,
body.theme-light .history-list__item,
body.theme-light .detail-list__item,
body.theme-light .brand-mark-wrap {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(118, 144, 255, 0.16);
    box-shadow: 0 16px 34px rgba(54, 80, 122, 0.12);
}

body.theme-light .nav-link,
body.theme-light .icon-chip,
body.theme-light .tenant-chip,
body.theme-light a,
body.theme-light {
    color: #152033;
}

body.theme-light .nav-link:hover,
body.theme-light .nav-link.is-active,
body.theme-light .chip-tab.is-active,
body.theme-light .badge,
body.theme-light .status-pill {
    color: #0d1a2c;
}

body.theme-light .muted,
body.theme-light .topbar__eyebrow,
body.theme-light .nav-section-label,
body.theme-light .stat-card__label,
body.theme-light .metric-card__label,
body.theme-light .item-meta,
body.theme-light .request-card__meta,
body.theme-light .history-list__meta,
body.theme-light .page-subtitle,
body.theme-light .brand__subtitle {
    color: rgba(21, 32, 51, 0.68);
}

body.theme-light .btn--secondary,
body.theme-light .btn--ghost {
    color: #152033;
    background: rgba(226, 235, 247, 0.75);
    border-color: rgba(91, 118, 171, 0.28);
}

body.theme-light .author-card {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(118, 144, 255, 0.16);
}

body.theme-light .author-card__title {
    color: rgba(21, 32, 51, 0.6);
}

body.theme-light .profile-menu__toggle,
body.theme-light .profile-menu__panel {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(118, 144, 255, 0.16);
    color: #152033;
    box-shadow: 0 16px 34px rgba(54, 80, 122, 0.12);
}

body.theme-light .profile-menu__meta span {
    color: rgba(21, 32, 51, 0.68);
}

body.theme-light .profile-menu__item,
body.theme-light .profile-menu__item:hover {
    color: #152033;
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea {
    background: rgba(243, 247, 252, 0.95);
    color: #152033;
    border-color: rgba(91, 118, 171, 0.24);
}

body.theme-light select,
body.theme-light select option {
    color: #152033;
    background: #ffffff;
}

body.theme-light .request-card__title a,
body.theme-light .problem-card__title a,
body.theme-light .empty-state,
body.theme-light .alert,
body.theme-light .history-list__item,
body.theme-light .detail-list__item,
body.theme-light .workflow-action,
body.theme-light .table td,
body.theme-light .table a {
    color: #152033;
}

body.theme-light .empty-state {
    background: rgba(244, 248, 253, 0.96);
    border-color: rgba(91, 118, 171, 0.24);
}

body.theme-light .alert {
    background: rgba(17, 197, 244, 0.1);
    border-color: rgba(17, 197, 244, 0.22);
}

body.theme-light .chip-tab,
body.theme-light .badge,
body.theme-light .status-pill {
    background: rgba(226, 235, 247, 0.82);
    border-color: rgba(91, 118, 171, 0.24);
    color: #152033;
}

body.theme-light .chip-tab.is-active,
body.theme-light .badge--accent {
    background: rgba(17, 197, 244, 0.16);
    color: #0e4560;
    border-color: rgba(17, 197, 244, 0.28);
}

body.theme-light .badge--ghost {
    background: rgba(241, 245, 251, 0.96);
    color: #33425f;
}

body.theme-light .chip-tab:hover,
body.theme-light .nav-link:hover,
body.theme-light .nav-link.is-active {
    color: #10213a;
}

.card {
    border-radius: 24px;
    padding: 22px;
    margin-bottom: 20px;
}

.narrow {
    max-width: 760px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid > .card {
    min-width: 0;
}

.grid--2 {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
    gap: 20px;
}

.stats-grid,
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card,
.metric-card {
    border-radius: 22px;
    padding: 18px 20px;
}

.metric-card--compact {
    min-height: 0;
}

.metric-card--compact .metric-card__value {
    font-size: 1.6rem;
}

.metric-card__value--money {
    font-size: 1.45rem;
}

.stat-card__value,
.metric-card__value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 10px;
}

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-secondary));
    color: #03121a;
    text-decoration: none;
    cursor: pointer;
    font-weight: 800;
}

.btn:hover {
    color: #03121a;
    filter: brightness(1.04);
}

.link-button,
button.chip-tab {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.link-button {
    padding: 0;
    color: var(--color-accent);
    background: transparent;
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(118, 144, 255, 0.18);
    color: var(--color-text);
}

.btn--ghost {
    background: transparent;
    border-color: rgba(118, 144, 255, 0.18);
    color: rgba(240, 245, 255, 0.88);
}

.btn--danger {
    background: rgba(255, 95, 109, 0.12);
    border-color: rgba(255, 95, 109, 0.28);
    color: #ffd8dc;
}

.profile-menu {
    position: relative;
}

.profile-menu[open] summary {
    border-color: rgba(17, 197, 244, 0.32);
}

.profile-menu summary {
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu__toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 6px 14px 6px 8px;
    border-radius: 16px;
    background: rgba(15, 23, 39, 0.82);
    border: 1px solid rgba(118, 144, 255, 0.14);
    cursor: pointer;
    color: var(--color-text);
}

.profile-menu__avatar {
    width: 40px;
    height: 40px;
}

.profile-menu__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-menu__meta strong {
    font-size: 0.95rem;
    line-height: 1.2;
}

.profile-menu__meta span {
    font-size: 0.84rem;
    color: rgba(224, 232, 255, 0.64);
    line-height: 1.2;
}

.profile-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(12, 18, 33, 0.96);
    border: 1px solid rgba(118, 144, 255, 0.14);
    box-shadow: 0 18px 42px rgba(3, 9, 21, 0.28);
    z-index: 20;
}

.profile-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--color-text);
    text-decoration: none;
}

.profile-menu__item:hover {
    background: linear-gradient(135deg, rgba(17, 197, 244, 0.14), rgba(139, 77, 255, 0.14));
    color: var(--color-text);
}

.profile-menu__item--button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.chip-row,
.filters,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.workspace-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.workspace-toolbar__group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.workspace-toolbar__label {
    color: rgba(224, 232, 255, 0.64);
    font-size: 0.92rem;
    min-width: 110px;
}

.detail-meta-list,
.author-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chip-tab,
.badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(118, 144, 255, 0.18);
    text-decoration: none;
    color: rgba(240, 245, 255, 0.88);
    background: rgba(255, 255, 255, 0.04);
}

.chip-tab.is-active,
.badge,
.status-pill {
    background: rgba(17, 197, 244, 0.11);
    border-color: rgba(17, 197, 244, 0.28);
}

.badge--danger,
.status-pill--overdue {
    background: rgba(255, 95, 109, 0.12);
    border-color: rgba(255, 95, 109, 0.28);
    color: #ffd8dc;
}

.badge--accent {
    background: rgba(17, 197, 244, 0.16);
    border-color: rgba(17, 197, 244, 0.32);
    color: #d9f8ff;
}

.badge--ghost {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(118, 144, 255, 0.12);
}

.chip-tab:hover {
    color: #fff;
    border-color: rgba(17, 197, 244, 0.28);
}

.filters {
    margin-bottom: 16px;
}

.view-switch {
    display: inline-flex;
    gap: 8px;
    margin-left: auto;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(118, 144, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text);
    font: inherit;
}

select,
select option {
    color: #f5f8ff;
    background: #162033;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(17, 197, 244, 0.38);
    box-shadow: 0 0 0 3px rgba(17, 197, 244, 0.12);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.filters input[type="text"] {
    min-width: 260px;
}

.board-list,
.request-list,
.history-list,
.detail-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.request-card,
.problem-card {
    border-radius: 22px;
    padding: 18px 20px;
}

.request-card--dense,
.problem-card--manager {
    padding: 20px 22px;
}

.request-card__head,
.problem-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.request-card__title,
.problem-card__title {
    margin: 0 0 6px;
    font-size: 1.08rem;
}

.request-card__title a,
.problem-card__title a {
    color: #fff;
    text-decoration: none;
}

.request-card__title a:hover,
.problem-card__title a:hover {
    color: var(--color-accent-hover);
}

.request-card__desc,
.problem-card__desc {
    margin: 10px 0 0;
    color: rgba(224, 232, 255, 0.82);
}

.request-card__meta,
.problem-card__meta,
.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    font-size: 0.95rem;
}

.request-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.request-card--overdue {
    border-color: rgba(255, 95, 109, 0.3);
    box-shadow: 0 18px 42px rgba(59, 9, 17, 0.24);
}

.table-row--overdue td {
    border-bottom-color: rgba(255, 95, 109, 0.18);
}

.meta-alert {
    color: #ffb3bb;
    font-weight: 600;
}

.problem-card__manager-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.problem-card__manager {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(224, 232, 255, 0.82);
}

.problem-card__manager-label,
.table-submeta {
    color: rgba(224, 232, 255, 0.64);
}

.table-submeta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.9rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.detail-list__item--inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.detail-list__item--inline > :first-child {
    min-width: 0;
}

.author-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(118, 144, 255, 0.12);
}

.author-card__avatar {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #03121a;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-secondary));
}

.author-card__title {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(224, 232, 255, 0.62);
    margin-bottom: 6px;
}

.author-card__name {
    font-weight: 700;
}

.info-box {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(118, 144, 255, 0.12);
}

.info-box__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(224, 232, 255, 0.6);
    margin-bottom: 8px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.workflow-grid {
    display: grid;
    gap: 14px;
}

.workflow-action {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(118, 144, 255, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.workflow-action__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.workflow-action__icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(17, 197, 244, 0.22), rgba(139, 77, 255, 0.22));
}

.workflow-action textarea {
    min-height: 92px;
}

.form-field {
    margin-top: 12px;
}

.messages {
    margin-bottom: 18px;
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 10px;
    background: rgba(17, 197, 244, 0.12);
    border: 1px solid rgba(17, 197, 244, 0.2);
}

.history-list__item,
.detail-list__item {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(118, 144, 255, 0.12);
}

.history-list__item--muted {
    opacity: 0.72;
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-layout {
    width: min(1120px, calc(100vw - 32px));
    padding: 36px 0;
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 480px);
    gap: 20px;
    align-items: stretch;
}

.auth-panel,
.login-card {
    border-radius: 30px;
}

.auth-panel {
    padding: 34px;
    background:
        radial-gradient(circle at top left, rgba(17, 197, 244, 0.18), transparent 24%),
        radial-gradient(circle at bottom right, rgba(139, 77, 255, 0.18), transparent 24%),
        rgba(9, 15, 29, 0.86);
    border: 1px solid rgba(118, 144, 255, 0.14);
    box-shadow: 0 24px 60px rgba(3, 9, 21, 0.32);
}

.auth-hero__title {
    font-size: 2.4rem;
    line-height: 1.02;
    margin: 18px 0 12px;
}

.auth-hero__copy {
    font-size: 1.02rem;
    line-height: 1.65;
    color: rgba(224, 232, 255, 0.82);
}

.auth-points {
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.auth-points li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.auth-points i {
    color: var(--color-accent);
    margin-top: 2px;
}

.login-card {
    padding: 30px;
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-card form p {
    margin: 0 0 14px;
}

.login-card .helptext,
.login-card ul.errorlist {
    color: rgba(224, 232, 255, 0.66);
}

.auth-messages {
    width: min(1120px, calc(100vw - 32px));
}

.empty-state {
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(118, 144, 255, 0.18);
    color: rgba(224, 232, 255, 0.74);
}

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

.table th,
.table td {
    padding: 12px;
    border-bottom: 1px solid rgba(118, 144, 255, 0.1);
    text-align: left;
}

.table--workspace th {
    color: rgba(224, 232, 255, 0.64);
    font-weight: 600;
}

body.theme-light .workspace-toolbar__label,
body.theme-light .problem-card__manager,
body.theme-light .problem-card__manager-label,
body.theme-light .table-submeta,
body.theme-light .table--workspace th {
    color: rgba(21, 32, 51, 0.68);
}

body.theme-light .meta-alert {
    color: #b4232c;
}

body.theme-light .badge--accent {
    color: #0f4d68;
}

body.theme-light .badge--danger,
body.theme-light .status-pill--overdue {
    color: #7e1620;
}

button[disabled],
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.hub-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.hub-hero h1 {
    margin: 4px 0 8px;
    font-size: clamp(2rem, 4vw, 3.8rem);
    letter-spacing: -0.055em;
}

.hub-hero__eyebrow,
.product-placeholder__eyebrow {
    margin: 0;
    color: var(--color-accent);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

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

.hub-app-card {
    position: relative;
    display: flex;
    min-height: 250px;
    padding: 28px;
    overflow: hidden;
    border: 1px solid rgba(118, 144, 255, 0.16);
    border-radius: 24px;
    color: var(--color-text);
    background:
        radial-gradient(circle at 85% 15%, rgba(17, 197, 244, 0.17), transparent 34%),
        linear-gradient(145deg, rgba(22, 32, 51, 0.96), rgba(9, 17, 31, 0.98));
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.hub-app-card:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--color-accent) 70%, transparent);
    box-shadow: 0 30px 75px rgba(0, 0, 0, 0.28);
}

.hub-app-card--relations {
    background:
        radial-gradient(circle at 85% 15%, rgba(74, 214, 184, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(18, 41, 43, 0.96), rgba(8, 22, 28, 0.98));
}

.hub-app-card--workspace {
    background:
        radial-gradient(circle at 85% 15%, rgba(198, 149, 105, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(45, 33, 30, 0.96), rgba(23, 18, 23, 0.98));
}

.hub-app-card--factory {
    background:
        radial-gradient(circle at 85% 15%, rgba(123, 97, 255, 0.22), transparent 34%),
        linear-gradient(145deg, rgba(28, 24, 51, 0.96), rgba(14, 11, 31, 0.98));
}

.hub-app-card--factory .hub-app-card__icon {
    color: #9d86ff;
}

.hub-app-card--services {
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 122, 89, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(48, 30, 24, 0.96), rgba(26, 14, 11, 0.98));
}

.hub-app-card--services .hub-app-card__icon {
    color: #ff9a7e;
}

.hub-app-card--data_model {
    background:
        radial-gradient(circle at 85% 15%, rgba(0, 184, 212, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(16, 36, 46, 0.96), rgba(9, 20, 28, 0.98));
}

.hub-app-card--data_model .hub-app-card__icon {
    color: #34d3e6;
}

.hub-app-card__icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    color: var(--color-accent);
    background: rgba(255, 255, 255, 0.06);
    font-size: 1.65rem;
}

.hub-app-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: auto 0 0 -58px;
    padding-top: 82px;
}

.hub-app-card__name {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.hub-app-card__description {
    margin-top: 8px;
    color: rgba(245, 248, 255, 0.66);
    line-height: 1.55;
}

.hub-app-card__access {
    margin-top: 18px;
    color: rgba(245, 248, 255, 0.5);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hub-app-card__open {
    position: absolute;
    top: 28px;
    right: 28px;
    color: rgba(245, 248, 255, 0.5);
    font-size: 1.1rem;
}

body.theme-light .hub-app-card,
body.theme-light .hub-app-card:hover,
body.theme-light .hub-app-card__name {
    color: #f5f8ff;
}

body.theme-light .hub-app-card__description {
    color: rgba(245, 248, 255, 0.76);
}

body.theme-light .hub-app-card__access,
body.theme-light .hub-app-card__open {
    color: rgba(245, 248, 255, 0.62);
}

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

.hub-email-error {
    max-width: 520px;
    margin-top: 6px;
    color: #ff8e99;
    font-size: 0.78rem;
    line-height: 1.4;
}

.status-pill--failed,
.status-pill--retry {
    color: #ff8e99;
    background: rgba(255, 95, 109, 0.12);
    border-color: rgba(255, 95, 109, 0.26);
}

.status-pill--pending,
.status-pill--processing {
    color: #ffd27a;
    background: rgba(255, 174, 66, 0.12);
    border-color: rgba(255, 174, 66, 0.26);
}

.status-pill--sent {
    color: #79e4c8;
    background: rgba(74, 214, 184, 0.12);
    border-color: rgba(74, 214, 184, 0.26);
}

body.theme-light .hub-email-error {
    color: #a52f43;
}

body.theme-light .status-pill--failed,
body.theme-light .status-pill--retry {
    color: #8f2136;
    background: rgba(202, 48, 77, 0.1);
}

body.theme-light .status-pill--pending,
body.theme-light .status-pill--processing {
    color: #80520d;
    background: rgba(211, 139, 31, 0.12);
}

body.theme-light .status-pill--sent {
    color: #12644f;
    background: rgba(33, 163, 128, 0.11);
}

.organization-picker {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.organization-picker__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 18, 0.76);
    backdrop-filter: blur(16px);
}

.organization-picker__panel {
    position: relative;
    width: min(520px, 100%);
    padding: 34px;
    border: 1px solid rgba(118, 144, 255, 0.18);
    border-radius: 26px;
    background: linear-gradient(155deg, #172237, #0a1220);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.48);
}

.organization-picker__panel h2 {
    margin: 8px 0 6px;
    font-size: 2rem;
}

.organization-picker__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 24px;
    border-radius: 16px;
    color: #07111d;
    background: var(--color-accent);
    font-size: 1.4rem;
}

.organization-picker__list {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.organization-picker__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(118, 144, 255, 0.14);
    border-radius: 16px;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.035);
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease;
}

.organization-picker__option:hover {
    border-color: var(--color-accent);
    background: rgba(17, 197, 244, 0.08);
}

.organization-picker__option span {
    display: grid;
    gap: 4px;
}

.organization-picker__option small {
    color: rgba(245, 248, 255, 0.52);
}

.product-nav-empty {
    margin-top: 28px;
    padding: 20px 14px;
    color: rgba(245, 248, 255, 0.38);
    font-size: 0.82rem;
    line-height: 1.5;
}

.product-nav-empty__line {
    display: block;
    width: 36px;
    height: 2px;
    margin-bottom: 14px;
    background: var(--color-accent);
}

/* Drzewo assetow w lewym panelu Factory (Site->Area->Line->Station). */
.factory-tree { gap: 2px; }
.factory-tree details { margin: 0; }
.factory-tree summary.ftree-sum {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(245, 248, 255, 0.72);
    user-select: none;
}
.factory-tree summary.ftree-sum::-webkit-details-marker { display: none; }
.factory-tree summary.ftree-sum::before {
    content: "\25B8";              /* trojkat w prawo */
    font-size: 0.7rem;
    opacity: 0.55;
    transition: transform 0.15s ease;
}
.factory-tree details[open] > summary.ftree-sum::before { transform: rotate(90deg); }
.factory-tree summary.ftree-sum:hover { background: rgba(118, 144, 255, 0.1); }
.factory-tree summary.ftree-sum small { font-weight: 500; opacity: 0.5; }
.factory-tree .ftree-node--area { margin-left: 10px; }
.factory-tree .ftree-line {
    margin-left: 18px;
    padding: 5px 10px;
    font-size: 0.82rem;
}
.factory-tree .ftree-stations {
    margin: 0 0 6px 30px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-left: 1px solid rgba(118, 144, 255, 0.16);
    padding-left: 8px;
}
.factory-tree .ftree-station {
    display: block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    color: rgba(245, 248, 255, 0.55);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.factory-tree .ftree-station small { opacity: 0.55; }
.factory-tree .ftree-station:hover { background: rgba(118, 144, 255, 0.1); color: var(--color-text); }
.factory-tree .ftree-empty { padding: 10px; font-size: 0.8rem; opacity: 0.55; line-height: 1.5; }

.product-placeholder {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 210px);
    padding: 48px 24px;
    text-align: center;
}

.product-placeholder__mark {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    margin-bottom: 26px;
    border: 1px solid rgba(118, 144, 255, 0.18);
    border-radius: 28px;
    color: var(--color-accent);
    background: radial-gradient(circle at 30% 20%, rgba(17, 197, 244, 0.2), rgba(22, 32, 51, 0.9));
    font-size: 2.35rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.product-placeholder h1 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.06em;
}

.product-placeholder > p:last-child {
    color: rgba(245, 248, 255, 0.52);
    font-weight: 800;
    letter-spacing: 0.14em;
}

.relations-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.relations-company-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 170px;
    padding: 18px;
    border: 1px solid rgba(74, 214, 184, 0.18);
    border-radius: 20px;
    color: var(--color-text);
    background:
        radial-gradient(circle at top right, rgba(74, 214, 184, 0.12), transparent 38%),
        rgba(255, 255, 255, 0.03);
    text-decoration: none;
}

.relations-company-card:hover {
    color: var(--color-text);
    border-color: rgba(74, 214, 184, 0.42);
    transform: translateY(-2px);
}

.relations-company-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.relations-company-card__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #061a19;
    background: #4ad6b8;
}

.relations-company-card > strong {
    font-size: 1.12rem;
}

.relations-company-card > span:not(.relations-company-card__icon) {
    color: rgba(224, 232, 255, 0.68);
}

.relations-kanban {
    display: grid;
    grid-template-columns: repeat(9, minmax(260px, 1fr));
    gap: 14px;
    padding-bottom: 16px;
    overflow-x: auto;
}

.relations-kanban__column {
    min-height: 420px;
    padding: 14px;
    border: 1px solid rgba(118, 144, 255, 0.14);
    border-radius: 20px;
    background: rgba(12, 18, 33, 0.74);
}

.relations-kanban__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.relations-kanban__head span {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(74, 214, 184, 0.12);
}

.relations-kanban__items {
    display: grid;
    gap: 10px;
}

.relations-opportunity-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(118, 144, 255, 0.14);
    border-radius: 16px;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.relations-opportunity-card:hover {
    color: var(--color-text);
    border-color: rgba(74, 214, 184, 0.38);
}

.relations-opportunity-card > span,
.relations-opportunity-card small {
    color: rgba(224, 232, 255, 0.66);
}

.relations-opportunity-card__value {
    font-size: 1.1rem;
    font-weight: 800;
}

.relations-kanban__empty {
    padding: 22px 10px;
    color: rgba(224, 232, 255, 0.38);
    text-align: center;
}

.relations-item--overdue {
    border-color: rgba(255, 95, 109, 0.32);
}

.relations-task-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.relations-task-metrics .metric-card {
    color: var(--color-text);
    text-decoration: none;
}

.relations-task-metrics .metric-card.is-active {
    border-color: rgba(74, 214, 184, 0.62);
    box-shadow: inset 0 0 0 1px rgba(74, 214, 184, 0.18);
}

.relations-task-metrics .metric-card--danger .metric-card__value {
    color: #ff7785;
}

.relations-task-search {
    flex: 1;
}

.relations-task-search input {
    min-width: min(380px, 48vw);
}

.relations-task-board {
    padding: 8px 20px;
}

.relations-task-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px 4px;
    border-bottom: 1px solid rgba(118, 144, 255, 0.1);
}

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

.relations-task-row.is-overdue {
    box-shadow: inset 3px 0 0 #ff5f6d;
}

.relations-task-row.is-completed {
    opacity: 0.56;
}

.relations-task-row.is-completed strong {
    text-decoration: line-through;
}

.relations-task-check {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    color: #4ad6b8;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
}

.relations-task-row__body {
    min-width: 0;
}

.relations-task-row__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
}

.relations-task-row__body p {
    margin: 8px 0 0;
    color: rgba(224, 232, 255, 0.64);
}

.relations-priority {
    padding: 3px 8px;
    border-radius: 999px;
    color: rgba(224, 232, 255, 0.7);
    background: rgba(118, 144, 255, 0.1);
    font-size: 0.72rem;
    font-weight: 800;
}

.relations-priority--high {
    color: #ffc266;
    background: rgba(255, 174, 66, 0.12);
}

.relations-priority--urgent {
    color: #ff7785;
    background: rgba(255, 95, 109, 0.12);
}

.relations-notes {
    margin-top: 20px;
}

.relations-form p {
    margin: 0 0 18px;
}

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

.relations-form-grid__wide {
    grid-column: 1 / -1;
}

.relations-discovery-grid > .card {
    margin-bottom: 0;
}

.relations-discovery-section {
    position: relative;
    min-height: 220px;
    padding-top: 54px;
}

.relations-discovery-section__number {
    position: absolute;
    top: 18px;
    left: 20px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    color: #061a19;
    background: #4ad6b8;
    font-weight: 900;
}

.relations-discovery-section p {
    color: rgba(224, 232, 255, 0.8);
    line-height: 1.65;
}

.relations-sticky-actions {
    position: sticky;
    bottom: 16px;
    z-index: 10;
    display: flex;
    gap: 10px;
    width: fit-content;
    margin: 20px auto 0;
    padding: 10px;
    border: 1px solid rgba(118, 144, 255, 0.16);
    border-radius: 18px;
    background: rgba(9, 15, 29, 0.92);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}

.relations-output-section {
    margin-top: 28px;
}

.relations-output-card {
    min-width: 0;
}

.relations-output-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.relations-output-card__head i {
    color: #4ad6b8;
}

.relations-output-card pre {
    margin: 0;
    color: rgba(224, 232, 255, 0.82);
    font: inherit;
    line-height: 1.6;
    white-space: pre-wrap;
}

body.theme-light .relations-discovery-section p,
body.theme-light .relations-output-card pre {
    color: rgba(21, 32, 51, 0.76);
}

body.theme-light .relations-company-card,
body.theme-light .relations-kanban__column,
body.theme-light .relations-opportunity-card {
    color: #152033;
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(91, 118, 171, 0.18);
}

body.theme-light .relations-company-card > span:not(.relations-company-card__icon),
body.theme-light .relations-opportunity-card > span,
body.theme-light .relations-opportunity-card small,
body.theme-light .relations-kanban__empty {
    color: rgba(21, 32, 51, 0.64);
}

@media (max-width: 1180px) {
    .grid--2,
    .auth-grid {
        grid-template-columns: 1fr;
    }

    .hub-app-grid {
        grid-template-columns: 1fr;
    }

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

    .hub-app-card {
        min-height: 210px;
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(118, 144, 255, 0.12);
    }

    .topbar,
    .content {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .request-card__head,
    .problem-card__head,
    .page-head,
    .section-head {
        flex-direction: column;
    }

    .workspace-toolbar__label {
        min-width: 0;
        width: 100%;
    }

    .problem-card__manager-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar__actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .profile-menu__meta {
        max-width: 180px;
    }

    .hub-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .organization-picker__panel {
        padding: 26px 22px;
    }

    .relations-form-grid,
    .relations-discovery-grid {
        grid-template-columns: 1fr;
    }

    .relations-form-grid__wide {
        grid-column: auto;
    }

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

    .relations-task-search input {
        min-width: 100%;
    }

    .relations-task-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .relations-task-row > .btn {
        grid-column: 2;
        width: fit-content;
    }

    .hub-email-config {
        grid-template-columns: 1fr;
    }
}
