/*
 * Operation Hub — visueller Refresh 2026
 * Nutzt ausschließlich die bestehenden tenantgebundenen KoSch-Farben.
 */

body.oh-system-shell {
    --radius-control: 10px;
    --radius-input: 10px;
    --radius-button: 10px;
    --radius-menu: 12px;
    --radius-panel: 16px;
    --radius-card: 16px;
    --radius-dialog: 18px;
    --oh-radius-sm: 8px;
    --oh-radius: 14px;
    --oh-radius-lg: 18px;
    --oh-color-border: rgba(15, 23, 42, 0.09);
    --oh-color-soft: #f7f9fc;
    --oh-color-soft-hover: rgba(25, 77, 133, 0.065);
    --oh-shadow: 0 1px 2px rgba(15, 23, 42, 0.035), 0 8px 24px rgba(15, 23, 42, 0.055);
    --oh-shadow-hover: 0 4px 10px rgba(15, 23, 42, 0.06), 0 18px 42px rgba(15, 23, 42, 0.11);
    --oh-shadow-focus: 0 0 0 4px var(--oh-focus-ring);
    --oh-shell-gutter: clamp(1rem, 2.3vw, 2.25rem);
    --oh-header-height: 88px;
    background-color: color-mix(in srgb, var(--oh-color-primary) 7%, #f4f7fb);
    background-image:
        radial-gradient(circle at 8% -8%, color-mix(in srgb, var(--oh-color-primary) 10%, transparent) 0, transparent 28rem),
        radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--oh-color-accent) 9%, transparent) 0, transparent 24rem),
        linear-gradient(180deg, color-mix(in srgb, var(--oh-color-primary) 8%, rgba(255, 255, 255, 0.8)) 0, rgba(238, 243, 248, 0.94) 30rem);
    background-attachment: fixed;
}

body.oh-system-shell::selection {
    background: var(--oh-color-primary);
    color: #fff;
}

.oh-skip-link {
    position: fixed;
    z-index: 2000;
    top: 0.75rem;
    left: 50%;
    transform: translate(-50%, -180%);
    padding: 0.65rem 1rem;
    border-radius: var(--radius-button);
    background: var(--oh-color-primary);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.16s ease;
}

.oh-skip-link:focus {
    color: #fff;
    transform: translate(-50%, 0);
}

/* App shell */
body.oh-system-shell .crm-header {
    min-height: var(--oh-header-height);
    background: color-mix(in srgb, var(--oh-color-primary) 11%, rgba(255, 255, 255, 0.9));
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85), 0 10px 30px rgba(15, 23, 42, 0.065);
    backdrop-filter: blur(20px) saturate(150%);
}

body.oh-system-shell .crm-header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--oh-color-primary), var(--oh-color-accent), var(--oh-color-primary));
    opacity: 0.92;
}

body.oh-system-shell .header-nav {
    min-height: var(--oh-header-height);
    padding: 0.45rem var(--oh-shell-gutter);
}

body.oh-system-shell .logo-img {
    height: clamp(50px, 4vw, 60px);
    max-width: min(30vw, 270px);
    filter: drop-shadow(0 5px 10px rgba(15, 23, 42, 0.08));
}

body.oh-system-shell .hub-search {
    width: min(42vw, 40rem);
}

body.oh-system-shell .hub-search__form {
    position: relative;
}

body.oh-system-shell .hub-search__icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--oh-color-muted);
    pointer-events: none;
}

body.oh-system-shell .hub-search__input {
    min-height: 46px;
    padding: 0.65rem 3rem 0.65rem 2.75rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    background: rgba(244, 247, 251, 0.88);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.035), 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: width 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.oh-system-shell .hub-search__input:focus {
    border-color: color-mix(in srgb, var(--oh-color-primary) 58%, white);
    background: #fff;
    box-shadow: var(--oh-shadow-focus), 0 12px 26px rgba(15, 23, 42, 0.08);
}

body.oh-system-shell .hub-search__results {
    top: calc(100% + 0.75rem);
    border-radius: var(--radius-panel);
    box-shadow: var(--oh-shadow-hover);
}

body.oh-system-shell .user-button {
    min-height: 44px;
    padding: 0.3rem 0.75rem 0.3rem 0.35rem;
    border: 1px solid color-mix(in srgb, var(--oh-color-primary) 82%, black);
    border-radius: 999px;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--oh-color-primary) 20%, transparent);
}

.user-button__avatar {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.user-button__chevron {
    font-size: 0.65rem;
    opacity: 0.72;
    transition: transform 0.16s ease;
}

.user-dropdown:hover .user-button__chevron,
.user-dropdown:focus-within .user-button__chevron {
    transform: rotate(180deg);
}

body.oh-system-shell .user-dropdown-menu {
    width: min(290px, calc(100vw - 2rem));
    padding: 0.4rem;
    border-radius: var(--radius-menu);
    box-shadow: var(--oh-shadow-hover);
}

body.oh-system-shell .user-dropdown-header,
body.oh-system-shell .user-dropdown-link {
    border-radius: 8px;
}

body.oh-system-shell .user-dropdown-divider {
    margin: 0.35rem 0;
}

body.oh-system-shell .crm-layout {
    min-height: calc(100vh - var(--oh-header-height));
}

body.oh-system-shell .crm-sidebar {
    top: var(--oh-header-height);
    width: 248px;
    min-width: 248px;
    height: calc(100vh - var(--oh-header-height));
    background: color-mix(in srgb, var(--oh-color-primary) 9%, rgba(255, 255, 255, 0.82));
    border-right: 1px solid rgba(15, 23, 42, 0.075);
    box-shadow: 12px 0 34px rgba(15, 23, 42, 0.035);
    backdrop-filter: blur(18px);
}

body.oh-system-shell .sidebar-nav-scroll {
    padding: 0.8rem 0.65rem;
}

body.oh-system-shell .sidebar-primary {
    display: grid;
    gap: 0.2rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

body.oh-system-shell .sidebar-primary__title {
    padding: 0.3rem 0.75rem 0.4rem;
    color: #8793a3;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.085em;
    text-transform: uppercase;
}

body.oh-system-shell .crm-sidebar .sidebar-link--primary {
    min-height: 43px;
    padding-inline: 0.85rem;
    font-weight: 680;
}

body.oh-system-shell .sidebar-nav-group {
    margin: 0 0 0.5rem;
    padding: 0.25rem;
    border: 1px solid transparent;
    border-radius: 13px;
}

body.oh-system-shell .sidebar-nav-group.is-open {
    border-color: rgba(15, 23, 42, 0.055);
    background: color-mix(in srgb, var(--oh-color-primary) 7%, rgba(255, 255, 255, 0.78));
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.035);
}

body.oh-system-shell .crm-sidebar .sidebar-link--disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

body.oh-system-shell .crm-sidebar .sidebar-link--disabled:hover {
    border-color: transparent;
    transform: none;
}

.sidebar-link__status {
    padding: 0.16rem 0.38rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--oh-color-primary) 15%, transparent);
    color: color-mix(in srgb, var(--oh-color-primary) 78%, #334155);
    font-size: 0.58rem;
    font-weight: 750;
    white-space: nowrap;
}

body.oh-system-shell .sidebar-nav-group__summary {
    min-height: 40px;
    padding: 0.55rem 0.65rem;
    border-radius: 9px;
    font-size: 0.69rem;
    letter-spacing: 0.055em;
}

.sidebar-nav-group__title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.sidebar-nav-group__chevron {
    color: #94a3b8;
    font-size: 0.62rem;
    transition: transform 0.16s ease, color 0.16s ease;
}

.sidebar-nav-group.is-open .sidebar-nav-group__chevron {
    color: var(--oh-color-primary);
    transform: rotate(180deg);
}

body.oh-system-shell .sidebar-nav-group__links {
    gap: 0.2rem;
    padding: 0.2rem 0 0.35rem;
}

body.oh-system-shell .crm-sidebar .sidebar-link {
    position: relative;
    min-height: 41px;
    margin: 0;
    padding: 0.58rem 0.65rem 0.58rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.84rem;
    overflow: hidden;
}

body.oh-system-shell .crm-sidebar .sidebar-link::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--oh-color-accent);
    transform: scaleY(0);
    transition: transform 0.16s ease;
}

body.oh-system-shell .crm-sidebar .sidebar-link:hover {
    border-color: color-mix(in srgb, var(--oh-color-primary) 12%, transparent);
    transform: translateX(2px);
}

body.oh-system-shell .crm-sidebar .sidebar-link.active {
    background: linear-gradient(135deg, var(--oh-color-primary), color-mix(in srgb, var(--oh-color-primary) 82%, #0f172a));
    border-color: color-mix(in srgb, var(--oh-color-primary) 75%, black);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--oh-color-primary) 20%, transparent);
}

body.oh-system-shell .crm-sidebar .sidebar-link.active::before {
    transform: scaleY(1);
}

.sidebar-link__label {
    min-width: 0;
    flex: 1;
}

/* Native operating-system emoji: no image or third-party webfont required. */
.oh-emoji {
    display: inline-grid;
    flex: 0 0 1.55rem;
    width: 1.55rem;
    place-items: center;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.05rem;
    line-height: 1;
}

.sidebar-nav-group__title .oh-emoji {
    margin-right: 0.05rem;
}

.sidebar-link__arrow {
    font-size: 0.58rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.sidebar-link:hover .sidebar-link__arrow,
.sidebar-link.active .sidebar-link__arrow {
    opacity: 0.72;
    transform: translateX(0);
}

body.oh-system-shell .sidebar-utility {
    display: grid;
    gap: 0.2rem;
    padding: 0.55rem 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.86);
}

body.oh-system-shell .sidebar-utility .sidebar-link__icon {
    width: 1.6rem;
    display: inline-grid;
    place-items: center;
}

body.oh-system-shell .crm-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(1rem, 2.2vw, 2.25rem) var(--oh-shell-gutter) 2.5rem;
}

/* Hierarchy and surfaces */
body.oh-system-shell :where(.page-header, .oh-page-header, .settings-page-header, .webmin-hero, .nc-hero, .npm-hero, .proxy-hero) {
    position: relative;
    overflow: hidden;
    padding: clamp(1.25rem, 2.4vw, 2rem);
    border: 1px solid rgba(15, 23, 42, 0.075);
    border-radius: var(--radius-panel);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--oh-color-primary) 7%, white), rgba(255, 255, 255, 0.98) 46%),
        #fff;
    box-shadow: var(--oh-shadow);
}

body.oh-system-shell :where(.page-header, .oh-page-header, .settings-page-header, .webmin-hero, .nc-hero, .npm-hero, .proxy-hero)::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--oh-color-primary), var(--oh-color-accent));
}

body.oh-system-shell :where(.page-header, .oh-page-header, .settings-page-header, .webmin-hero, .nc-hero, .npm-hero, .proxy-hero) h1 {
    font-size: clamp(1.55rem, 2.3vw, 2rem);
    letter-spacing: -0.025em;
}

body.oh-system-shell main.crm-container :where(.card, .oh-card, .crm-card, .management-card, .webmin-card, .nc-card, .npm-card, .table-container, .settings-sidebar, .settings-content) {
    border-color: rgba(15, 23, 42, 0.075);
    border-radius: var(--radius-card);
    box-shadow: var(--oh-shadow);
}

body.oh-system-shell main.crm-container :where(.card-header, .oh-card__header, .crm-card-header, .management-card__header) {
    background: linear-gradient(180deg, #fff 0%, var(--oh-color-soft) 100%);
    border-bottom-color: rgba(15, 23, 42, 0.07);
    padding: 1rem 1.25rem;
}

body.oh-system-shell main.crm-container :where(.card-body, .oh-card__body, .crm-card-body, .management-card__body) {
    padding: clamp(1rem, 1.8vw, 1.35rem);
}

body.oh-system-shell :where(.oh-stat-card, .stat-card, .kpi-card, .dashboard-widget, .management-kpi, .webmin-stat, .nc-stat, .npm-stat) {
    position: relative;
    min-height: 126px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--radius-card);
    background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--oh-color-primary) 4%, white));
    box-shadow: var(--oh-shadow);
}

body.oh-system-shell :where(.oh-stat-card, .stat-card, .kpi-card, .dashboard-widget, .management-kpi, .webmin-stat, .nc-stat, .npm-stat)::after {
    content: "";
    position: absolute;
    top: -34px;
    right: -30px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--oh-color-accent) 10%, transparent);
    pointer-events: none;
}

body.oh-system-shell :where(.oh-stat-card__value, .stat-value, .kpi-value, .management-kpi__value, .webmin-stat-value, .nc-stat-value, .npm-stat-value) {
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    letter-spacing: -0.035em;
}

/* Controls */
body.oh-system-shell :where(.oh-button, .btn, .btn-crm, .button, .object-tools a) {
    min-height: 42px;
    padding: 0.58rem 1rem;
    border-radius: var(--radius-button);
    font-weight: 750;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

body.oh-system-shell :where(.oh-button, .btn, .btn-crm, .button, .object-tools a):hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

body.oh-system-shell :where(.btn-primary, .oh-button--primary, .oh-button-primary, .btn-crm-primary) {
    background: linear-gradient(135deg, var(--oh-color-primary), color-mix(in srgb, var(--oh-color-primary) 80%, #0f172a));
    border-color: var(--oh-color-primary);
}

body.oh-system-shell :where(.form-control, .form-select, .oh-form input, .oh-form select, .oh-form textarea, input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], input[type="search"], textarea, select) {
    min-height: 44px;
    border: 1px solid rgba(15, 23, 42, 0.13);
    border-radius: var(--radius-input);
    background-color: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.025);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

body.oh-system-shell :where(.form-control, .form-select, .oh-form input, .oh-form select, .oh-form textarea, input, textarea, select):focus {
    border-color: var(--oh-color-primary);
    background-color: #fff;
    box-shadow: var(--oh-shadow-focus);
}

body.oh-system-shell main.crm-container label {
    color: #334155;
    font-size: 0.82rem;
    font-weight: 750;
}

body.oh-system-shell input[type="checkbox"],
body.oh-system-shell input[type="radio"] {
    accent-color: var(--oh-color-primary);
}

/* Tables */
body.oh-system-shell :where(.oh-table-wrap, .ohub-table-auto, .table-responsive, .table-container, .nc-table-wrap) {
    border-radius: var(--radius-card);
    border-color: rgba(15, 23, 42, 0.075);
    box-shadow: var(--oh-shadow);
}

body.oh-system-shell main.crm-container table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, #f9fbfd, #f3f6fa);
    color: #475569;
    border-bottom: 1px solid rgba(15, 23, 42, 0.09);
    font-size: 0.72rem;
    letter-spacing: 0.045em;
}

body.oh-system-shell main.crm-container table tbody td,
body.oh-system-shell main.crm-container table tbody th {
    padding: 0.88rem 1rem;
    border-bottom-color: rgba(15, 23, 42, 0.055);
}

body.oh-system-shell main.crm-container table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

body.oh-system-shell main.crm-container table tbody tr {
    transition: background 0.14s ease, box-shadow 0.14s ease;
}

body.oh-system-shell main.crm-container table tbody tr:hover {
    background: color-mix(in srgb, var(--oh-color-primary) 7%, white);
    box-shadow: inset 3px 0 0 var(--oh-color-primary);
}

/* Settings */
body.oh-system-shell .settings-layout {
    grid-template-columns: minmax(235px, 260px) minmax(0, 1fr);
    gap: clamp(1rem, 2vw, 1.75rem);
}

body.oh-system-shell .settings-sidebar {
    top: calc(var(--oh-header-height) + 1rem);
    padding: 0.65rem;
    background: rgba(255, 255, 255, 0.9);
}

body.oh-system-shell .settings-sidebar-group {
    margin-top: 0.75rem;
    padding: 0.35rem 0.7rem;
    letter-spacing: 0.055em;
}

body.oh-system-shell .settings-sidebar a {
    min-height: 42px;
    margin: 0.12rem 0;
    padding: 0.58rem 0.72rem;
    border-radius: 9px;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

body.oh-system-shell .settings-sidebar a:hover {
    transform: translateX(2px);
}

body.oh-system-shell .settings-sidebar a.active {
    background: linear-gradient(135deg, var(--oh-color-primary), color-mix(in srgb, var(--oh-color-primary) 82%, #0f172a));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--oh-color-primary) 18%, transparent);
}

body.oh-system-shell .settings-content {
    padding: clamp(1rem, 2.5vw, 2rem);
}

/* Feedback, menus and empty states */
body.oh-system-shell .alert {
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
}

body.oh-system-shell :where(.dropdown-menu, .modal-content, .cookie-modal-content) {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-dialog);
    box-shadow: var(--oh-shadow-hover);
}

body.oh-system-shell :where(.oh-empty-state, .empty-state, .nc-empty, .webmin-empty, .npm-empty) {
    border-radius: var(--radius-card);
    background: linear-gradient(145deg, #fff, var(--oh-color-soft));
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

body.oh-system-shell .crm-footer {
    margin-top: 0;
    padding: 1.15rem 0;
    background: linear-gradient(135deg, var(--footer-bg, var(--oh-color-primary)), color-mix(in srgb, var(--footer-bg, var(--oh-color-primary)) 78%, #0f172a));
    border-top: 3px solid var(--oh-color-accent);
}

/* Django administration uses the same visual language. */
body.ohub-admin .ohub-admin-main {
    padding: clamp(1rem, 2.2vw, 2.25rem) var(--oh-shell-gutter) 2.5rem;
}

body.ohub-admin .ohub-admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid color-mix(in srgb, var(--oh-color-primary) 18%, rgba(15, 23, 42, 0.08));
    border-radius: 14px;
    background: linear-gradient(125deg, color-mix(in srgb, var(--oh-color-primary) 11%, #fff), rgba(255, 255, 255, 0.9));
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
}

body.ohub-admin .ohub-admin-bar__identity {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

body.ohub-admin .ohub-admin-bar__icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    background: var(--oh-color-primary);
    box-shadow: 0 7px 16px color-mix(in srgb, var(--oh-color-primary) 24%, transparent);
    font-size: 1.05rem;
}

body.ohub-admin .ohub-admin-bar strong,
body.ohub-admin .ohub-admin-bar span {
    display: block;
}

body.ohub-admin .ohub-admin-bar strong {
    color: var(--oh-color-text);
    font-size: 0.96rem;
    font-weight: 850;
}

body.ohub-admin .ohub-admin-bar__identity div span {
    margin-top: 0.08rem;
    color: var(--oh-color-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

body.ohub-admin .ohub-admin-bar__back {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.45rem 0.7rem;
    border: 1px solid color-mix(in srgb, var(--oh-color-primary) 18%, transparent);
    border-radius: 9px;
    color: var(--oh-color-primary);
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

body.ohub-admin .ohub-admin-bar__back:hover {
    background: color-mix(in srgb, var(--oh-color-primary) 11%, #fff);
    color: var(--oh-color-text);
}

body.ohub-admin #content > h1 {
    margin: 0 0 1.25rem;
    color: var(--oh-color-text);
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    font-weight: 850;
    letter-spacing: -0.035em;
}

body.ohub-admin div.breadcrumbs {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 1rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.035);
}

body.ohub-admin .module,
body.ohub-admin #content-related,
body.ohub-admin .inline-group {
    border: 1px solid rgba(15, 23, 42, 0.075);
    border-radius: var(--radius-card);
    box-shadow: var(--oh-shadow);
}

body.ohub-admin .module caption,
body.ohub-admin .module h2,
body.ohub-admin .inline-group h2,
body.ohub-admin #content-related h2 {
    background: linear-gradient(180deg, #fff, var(--oh-color-soft));
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    padding: 0.95rem 1.1rem;
}

body.ohub-admin .form-row {
    padding: 1rem 1.1rem;
    border-bottom-color: rgba(15, 23, 42, 0.055);
}

body.ohub-admin .submit-row {
    padding: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.075);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--oh-shadow);
}

body.ohub-admin ul.messagelist li {
    margin-bottom: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.045);
}

@media (max-width: 600px) {
    body.ohub-admin .ohub-admin-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Attention component */
.attention-panel {
    margin: 0 0 1.75rem;
    padding: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.075);
    border-radius: var(--radius-panel);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--oh-shadow);
}

.attention-panel__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.attention-panel__eyebrow {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--oh-color-primary);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.attention-panel h2 {
    margin: 0;
    color: var(--oh-color-text);
    font-size: 1.05rem;
    font-weight: 800;
}

.attention-panel__count {
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    background: var(--oh-accent-soft);
    color: var(--oh-color-primary);
    font-size: 0.72rem;
    font-weight: 800;
}

.attention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.attention-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 82px;
    padding: 0.8rem 0.9rem;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 12px;
    background: linear-gradient(145deg, #fff, #f8fafc);
    color: var(--oh-color-text);
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.attention-card::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--oh-color-primary);
}

.attention-card--critical::before,
.attention-card--error::before { background: var(--oh-color-danger); }
.attention-card--warning::before { background: var(--oh-color-accent); }
.attention-card--success::before { background: var(--oh-color-success); }

.attention-card:hover {
    color: var(--oh-color-text);
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--oh-color-primary) 22%, transparent);
    box-shadow: var(--oh-shadow-hover);
}

.attention-card__icon,
.attention-empty__icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 11px;
    background: var(--oh-accent-soft);
    font-size: 1.3rem;
}

.attention-card__body {
    display: grid;
    min-width: 0;
    gap: 0.2rem;
}

.attention-card__body strong {
    font-size: 0.82rem;
    line-height: 1.35;
}

.attention-card__body small {
    color: var(--oh-color-muted);
    font-size: 0.7rem;
}

.attention-card__value {
    color: var(--oh-color-primary);
    font-size: 1.3rem;
    font-weight: 850;
}

.attention-card__arrow {
    color: var(--oh-color-muted);
    font-size: 0.7rem;
    transition: transform 0.16s ease;
}

.attention-card:hover .attention-card__arrow { transform: translateX(3px); }

.attention-empty {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(22, 163, 74, 0.16);
    border-radius: 12px;
    background: rgba(22, 163, 74, 0.065);
    color: #166534;
}

.attention-empty > span:last-child { display: grid; gap: 0.15rem; }
.attention-empty small { color: #3f7250; }
.attention-empty__icon { background: rgba(22, 163, 74, 0.12); }

@media (prefers-reduced-motion: no-preference) {
    body.oh-system-shell .page-header,
    body.oh-system-shell .oh-page-header,
    body.oh-system-shell .dashboard-header {
        animation: oh-surface-enter 0.32s ease both;
    }

    @keyframes oh-surface-enter {
        from { opacity: 0; transform: translateY(7px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (max-width: 1100px) {
    body.oh-system-shell .crm-sidebar {
        width: 224px;
        min-width: 224px;
    }

    body.oh-system-shell .hub-search { width: min(38vw, 31rem); }
}

@media (max-width: 900px) {
    body.oh-system-shell .crm-sidebar {
        top: 0;
        width: min(292px, 86vw);
        min-width: min(292px, 86vw);
        height: 100vh;
        left: min(-292px, -86vw);
    }

    body.oh-system-shell .crm-sidebar.open { left: 0; }

    body.oh-system-shell .settings-layout { grid-template-columns: 1fr; }
    body.oh-system-shell .settings-sidebar { position: static; }
}

@media (max-width: 720px) {
    body.oh-system-shell {
        --oh-header-height: 68px;
        --oh-shell-gutter: 0.9rem;
    }

    body.oh-system-shell .header-nav { min-height: var(--oh-header-height); }
    body.oh-system-shell .logo-img { height: 50px; max-width: 44vw; }
    .user-button__name { display: none; }
    body.oh-system-shell .user-button { padding-right: 0.45rem; }
    body.oh-system-shell .crm-container { padding-top: 1rem; }

    .attention-panel { padding: 1rem; }
    .attention-panel__header { align-items: flex-start; flex-direction: column; }
    .attention-grid { grid-template-columns: 1fr; }
}

/* 2026-08 unified module polish: the same visual hierarchy is applied to
   legacy Django modules without changing their routes or navigation order. */
body.oh-system-shell main.crm-container > .card,
body.oh-system-shell main.crm-container > form > .card,
body.oh-system-shell main.crm-container .module-card {
    overflow: clip;
    border: 1px solid color-mix(in srgb, var(--oh-color-primary) 11%, #d8dee8);
    border-radius: 14px;
    background: color-mix(in srgb, #fff 97%, var(--oh-color-primary));
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.055);
}

body.oh-system-shell main.crm-container .card-header {
    min-height: 3.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--oh-color-primary) 10%, #e5e7eb);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--oh-color-primary) 8%, white),
        color-mix(in srgb, var(--oh-color-accent) 6%, white));
}

body.oh-system-shell main.crm-container .card-header :is(h1, h2, h3, h4, h5, h6) {
    margin: 0;
    color: var(--oh-color-text);
    font-size: clamp(0.98rem, 1vw, 1.12rem);
    font-weight: 760;
    letter-spacing: -0.015em;
}

body.oh-system-shell main.crm-container .card-body { padding: clamp(0.9rem, 1.5vw, 1.25rem); }

body.oh-system-shell main.crm-container :is(.form-control, .form-select) {
    min-height: 2.65rem;
    border-color: #d7dee8;
    border-radius: 9px;
    background-color: #fff;
}

body.oh-system-shell main.crm-container :is(.form-control, .form-select):focus {
    border-color: color-mix(in srgb, var(--oh-color-primary) 66%, white);
    box-shadow: 0 0 0 0.22rem var(--oh-focus-ring);
}

body.oh-system-shell main.crm-container .table-container,
body.oh-system-shell main.crm-container .table-responsive,
body.oh-system-shell main.crm-container .ohub-table-auto {
    border: 1px solid #e3e8ef;
    border-radius: 11px;
    background: #fff;
}

body.oh-system-shell main.crm-container table { margin-bottom: 0; }
body.oh-system-shell main.crm-container table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom-width: 1px;
    background: #f7f9fc;
    color: #526070;
    font-size: 0.72rem;
    font-weight: 760;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

body.oh-system-shell main.crm-container table tbody tr { transition: background 0.14s ease; }
body.oh-system-shell main.crm-container table tbody tr:hover { background: var(--oh-accent-soft); }

body.oh-system-shell main.crm-container .btn {
    min-height: 2.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    border-radius: 9px;
    font-weight: 680;
}

body.oh-system-shell .sidebar-nav-group__links {
    padding: 0.2rem 0.45rem 0.55rem;
}

body.oh-system-shell .sidebar-link {
    min-height: 2.5rem;
    border-radius: 9px;
}

body.oh-system-shell .sidebar-link.active {
    box-shadow: inset 3px 0 0 var(--oh-color-accent);
}

@media (max-width: 720px) {
    body.oh-system-shell main.crm-container .card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    body.oh-system-shell main.crm-container .btn { width: 100%; }
    body.oh-system-shell main.crm-container .btn-group .btn { width: auto; }
}
