/*
 * Operation Hub design system
 * Shared component classes for application, management and technical admin views.
 */

:root {
    --oh-color-primary: var(--primary-color, #194d85);
    --oh-color-accent: var(--secondary-color, #f5a623);
    --oh-color-text: #0f172a;
    --oh-color-muted: #64748b;
    --oh-color-border: rgba(15, 23, 42, 0.08);
    --oh-color-surface: #ffffff;
    --oh-color-soft: #f8fafc;
    --oh-color-danger: #dc2626;
    --oh-color-success: #16a34a;
    --oh-color-warning: #d97706;
    --oh-radius-sm: 6px;
    --oh-radius: 8px;
    --oh-radius-lg: 12px;
    --oh-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    --oh-shadow-hover: 0 10px 24px rgba(15, 23, 42, 0.10);
    --oh-space-1: 0.25rem;
    --oh-space-2: 0.5rem;
    --oh-space-3: 0.75rem;
    --oh-space-4: 1rem;
    --oh-space-5: 1.25rem;
    --oh-space-6: 1.5rem;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --radius-sm: var(--oh-radius-sm);
    --radius-md: var(--oh-radius);
    --radius-lg: var(--oh-radius-lg);
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --shadow-sm: var(--oh-shadow);
    --shadow-md: var(--oh-shadow);
    --shadow-lg: var(--oh-shadow-hover);
    --shadow-xl: 0 18px 38px rgba(15, 23, 42, 0.14);
    --shadow-2xl: 0 25px 50px rgba(15, 23, 42, 0.18);
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: var(--oh-color-text);
    --text-secondary: var(--oh-color-muted);
    --text-muted: #94a3b8;
    --border-primary: var(--oh-color-border);
    --color-primary-500: #2563eb;
    --color-primary-600: var(--oh-color-primary);
    --color-primary-700: #1d4ed8;
    --color-secondary-500: var(--oh-color-accent);
    --font-weight-medium: 600;
    --font-weight-semibold: 700;
    --font-weight-bold: 800;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --line-height-tight: 1.15;
    --transition-fast: 0.12s ease;
    --transition-normal: 0.18s ease;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--oh-color-text);
    background: #f5f7fa;
}

.oh-app-shell,
.oh-system-shell {
    min-height: 100vh;
}

.oh-page-header,
.settings-page-header,
.webmin-hero,
.nc-hero,
.npm-hero,
.proxy-hero,
.ohub-dash-welcome {
    background: var(--oh-color-surface);
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow);
    padding: var(--oh-space-6);
    margin-bottom: var(--oh-space-6);
}

.oh-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--oh-space-4);
}

.oh-page-header__body {
    min-width: 0;
}

.oh-page-header__title,
.oh-page-header h1,
.settings-page-header h1,
.webmin-hero h1,
.nc-hero h1,
.npm-hero h1 {
    color: var(--oh-color-text);
    font-size: 1.65rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.oh-page-header__subtitle,
.settings-page-header p,
.webmin-hero p,
.nc-hero p,
.npm-hero p {
    color: var(--oh-color-muted);
    font-size: 0.95rem;
    margin: 0.45rem 0 0;
}

.oh-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--oh-space-2);
}

.oh-card,
.card,
.crm-card,
.management-card,
.webmin-card,
.nc-card,
.npm-card,
.table-container {
    background: var(--oh-color-surface);
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow);
    overflow: hidden;
}

.oh-card__header,
.card-header,
.crm-card-header,
.management-card__header {
    padding: var(--oh-space-4) var(--oh-space-5);
    border-bottom: 1px solid var(--oh-color-border);
    background: var(--oh-color-soft);
}

.oh-card__body,
.card-body,
.crm-card-body,
.management-card__body {
    padding: var(--oh-space-5);
}

.oh-stat-grid,
.stat-grid,
.stats-grid,
.kpi-grid,
.management-kpi-grid,
.webmin-stats,
.nc-stats,
.npm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: var(--oh-space-4);
    margin-bottom: var(--oh-space-6);
}

.oh-stat-card,
.stat-card,
.kpi-card,
.dashboard-widget,
.management-kpi,
.webmin-stat,
.nc-stat,
.npm-stat {
    min-height: 110px;
    background: var(--oh-color-surface);
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow);
    padding: var(--oh-space-5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--oh-space-2);
}

.oh-stat-card__label,
.stat-label,
.kpi-label,
.dashboard-widget .widget-label,
.management-kpi__label,
.webmin-stat-label,
.nc-stat-label,
.npm-stat-label {
    color: var(--oh-color-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.oh-stat-card__value,
.stat-value,
.kpi-value,
.dashboard-widget .widget-value,
.management-kpi__value,
.webmin-stat-value,
.nc-stat-value,
.npm-stat-value {
    color: var(--oh-color-text);
    font-size: 1.45rem;
    line-height: 1.15;
    font-weight: 800;
}

.oh-button,
.btn,
.btn-crm,
.button,
.object-tools a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 38px;
    border-radius: var(--oh-radius-sm);
    border: 1px solid transparent;
    padding: 0.48rem 0.9rem;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.oh-button--primary,
.oh-button-primary,
.btn-primary,
.btn-crm-primary,
input[type="submit"].default {
    background: var(--oh-color-accent);
    border-color: var(--oh-color-accent);
    color: #ffffff;
}

.oh-button--primary:hover,
.btn-primary:hover,
input[type="submit"].default:hover {
    background: #e09000;
    border-color: #e09000;
    color: #ffffff;
}

.oh-button--secondary,
.oh-button-secondary,
.btn-secondary,
.btn-crm-secondary,
.btn-outline-secondary,
.button {
    background: #ffffff;
    border-color: var(--oh-color-border);
    color: var(--oh-color-text);
}

.oh-button--secondary:hover,
.btn-secondary:hover,
.btn-outline-secondary:hover,
.button:hover {
    background: var(--oh-color-soft);
    color: var(--oh-color-primary);
}

.oh-button--danger,
.oh-button-danger,
.btn-danger,
.deletelink {
    background: var(--oh-color-danger);
    border-color: var(--oh-color-danger);
    color: #ffffff;
}

.oh-button--ghost {
    background: transparent;
    color: var(--oh-color-primary);
}

.oh-button--expert,
.expert-action {
    min-height: 32px;
    padding: 0.35rem 0.65rem;
    background: #ffffff;
    border-color: var(--oh-color-border);
    color: var(--oh-color-muted);
    font-size: 0.78rem;
}

.oh-table-wrap,
.ohub-table-auto,
.table-responsive,
.table-crm,
.nc-table-wrap {
    width: 100%;
    overflow-x: auto;
    background: var(--oh-color-surface);
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow);
}

.oh-table,
.oh-table-wrap table,
.ohub-table-auto table,
.table-container table,
.table-responsive table,
.nc-table-wrap table,
.ohub-admin-main table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.oh-table thead th,
.oh-table-wrap thead th,
.ohub-table-auto thead th,
.table-container thead th,
.table-responsive thead th,
.nc-table-wrap thead th,
.ohub-admin-main table thead th {
    background: var(--oh-color-soft);
    color: #334155;
    border-bottom: 1px solid var(--oh-color-border);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.78rem 0.9rem;
    white-space: nowrap;
}

.oh-table tbody td,
.oh-table tbody th,
.oh-table-wrap tbody td,
.oh-table-wrap tbody th,
.ohub-table-auto tbody td,
.ohub-table-auto tbody th,
.table-container tbody td,
.table-container tbody th,
.table-responsive tbody td,
.table-responsive tbody th,
.nc-table-wrap tbody td,
.nc-table-wrap tbody th,
.ohub-admin-main table tbody td,
.ohub-admin-main table tbody th {
    border-bottom: 1px solid rgba(15, 23, 42, 0.055);
    padding: 0.78rem 0.9rem;
    color: #334155;
    vertical-align: middle;
}

.oh-table tbody tr:hover,
.oh-table-wrap tbody tr:hover,
.ohub-table-auto tbody tr:hover,
.table-container tbody tr:hover,
.table-responsive tbody tr:hover,
.nc-table-wrap tbody tr:hover,
.ohub-admin-main table tbody tr:hover {
    background: rgba(245, 166, 35, 0.06);
}

.oh-status-badge,
.oh-badge,
.badge,
.status-badge,
.webmin-status,
.nc-status,
.npm-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.oh-status-badge--success,
.oh-badge-success,
.badge-success,
.status-ok,
.status-online {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.oh-status-badge--warning,
.oh-badge-warning,
.badge-warning,
.status-warning {
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
}

.oh-status-badge--danger,
.oh-badge-danger,
.badge-danger,
.status-error,
.status-offline {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.oh-status-badge--neutral,
.badge-secondary,
.status-neutral {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.oh-tabs,
.tabs,
.webmin-tabs,
.npm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--oh-space-2);
    border-bottom: 1px solid var(--oh-color-border);
    margin-bottom: var(--oh-space-4);
}

.oh-tab-button,
.tab-button,
.webmin-tab,
.npm-tab {
    border: 0;
    background: transparent;
    color: var(--oh-color-muted);
    padding: 0.7rem 0.9rem;
    font-weight: 800;
    border-bottom: 2px solid transparent;
}

.oh-tab-button.active,
.tab-button.active,
.webmin-tab.active,
.npm-tab.active {
    color: var(--oh-color-primary);
    border-bottom-color: var(--oh-color-accent);
}

.oh-empty-state,
.empty-state,
.nc-empty,
.webmin-empty,
.npm-empty {
    background: var(--oh-color-surface);
    border: 1px dashed rgba(100, 116, 139, 0.35);
    border-radius: var(--oh-radius);
    padding: var(--oh-space-6);
    text-align: center;
    color: var(--oh-color-muted);
}

.oh-card-grid,
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--oh-space-4);
}

.oh-status-card,
.metric-card,
.action-card,
.alert-card,
.chart-container,
.invoice-form {
    background: var(--oh-color-surface);
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow);
    padding: var(--oh-space-5);
}

.action-card {
    display: block;
    color: var(--oh-color-text);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.action-card:hover {
    color: var(--oh-color-primary);
    border-color: var(--oh-color-accent);
    box-shadow: var(--oh-shadow-hover);
    transform: translateY(-2px);
}

.action-icon,
.kpi-icon,
.dashboard-widget .widget-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--oh-radius);
    display: inline-grid;
    place-items: center;
    background: rgba(25, 77, 133, 0.08);
    color: var(--oh-color-primary);
    font-size: 1.25rem;
    margin-bottom: var(--oh-space-3);
}

.action-title,
.chart-title,
.section-title,
.card-title {
    color: var(--oh-color-text);
    font-weight: 800;
}

.action-description,
.entry-meta {
    color: var(--oh-color-muted);
    font-size: 0.9rem;
}

.accounting-header,
.main-header {
    background: var(--oh-color-surface);
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow);
    padding: var(--oh-space-6);
    margin-bottom: var(--oh-space-6);
}

.form-section {
    margin-bottom: var(--oh-space-6);
    padding-bottom: var(--oh-space-5);
    border-bottom: 1px solid var(--oh-color-border);
}

.form-section:last-child {
    border-bottom: 0;
}

.oh-form,
.form-grid {
    display: grid;
    gap: var(--oh-space-4);
}

.oh-form-row,
.form-group {
    display: grid;
    gap: var(--oh-space-2);
}

.form-control,
.form-select,
.oh-form input,
.oh-form select,
.oh-form textarea {
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: var(--oh-radius-sm);
    padding: 0.52rem 0.7rem;
}

.form-control:focus,
.form-select:focus,
.oh-form input:focus,
.oh-form select:focus,
.oh-form textarea:focus {
    border-color: var(--oh-color-primary);
    box-shadow: 0 0 0 3px rgba(25, 77, 133, 0.12);
    outline: 0;
}

.settings-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.settings-sidebar,
.settings-content {
    background: var(--oh-color-surface);
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow);
}

.settings-sidebar {
    padding: 8px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.settings-sidebar-group {
    padding: 6px 10px;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
    margin-top: 6px;
}

.settings-sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #475569;
    text-decoration: none;
    border-radius: var(--oh-radius-sm);
    font-size: 14px;
    font-weight: 650;
}

.settings-sidebar a:hover {
    background: #f1f5f9;
    color: var(--oh-color-primary);
}

.settings-sidebar a.active {
    background: var(--oh-color-primary);
    color: #ffffff;
}

.settings-sidebar a .ind {
    margin-left: auto;
    font-size: 10px;
    color: #cbd5e1;
}

.settings-sidebar a.active .ind {
    color: rgba(255,255,255,.7);
}

.settings-sidebar a .ind.ok {
    color: #10b981;
}

.settings-content {
    padding: 24px;
    min-width: 0;
}

@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
}

.crm-sidebar .sidebar-section {
    color: #94a3b8;
}

.crm-sidebar .sidebar-link {
    border-radius: var(--oh-radius);
}

.crm-sidebar .sidebar-link.active {
    box-shadow: none;
}

.oh-sidebar,
.crm-sidebar {
    width: 220px;
    min-width: 220px;
    background: #ffffff;
    border-right: 1px solid var(--oh-color-border);
    padding: 1rem 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.oh-sidebar-group,
.crm-sidebar .sidebar-section {
    padding: 0.4rem 0.75rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-top: 0.5rem;
}

.oh-sidebar-link,
.crm-sidebar .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    margin: 1px 0.5rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 650;
    border-radius: var(--oh-radius);
    transition: background 0.15s ease, color 0.15s ease;
}

.oh-sidebar-link:hover,
.crm-sidebar .sidebar-link:hover {
    background: var(--nav-hover-bg, rgba(25, 77, 133, 0.1));
    color: var(--oh-color-primary);
}

.oh-sidebar-link.active,
.crm-sidebar .sidebar-link.active {
    background: var(--nav-active-bg, var(--oh-color-primary));
    color: var(--nav-active-text, #ffffff);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    z-index: 1040;
}

.sidebar-backdrop.open {
    display: block;
}

.sidebar-collapse-btn {
    display: none;
}

.sidebar-hidden .crm-sidebar {
    display: none;
}

.sidebar-show-btn {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 1100;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: var(--btn-primary-bg, var(--oh-color-accent));
    color: #ffffff;
    place-items: center;
}

.sidebar-hidden .sidebar-show-btn {
    display: grid;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 1100;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: var(--btn-primary-bg, var(--oh-color-accent));
    color: #ffffff;
    place-items: center;
}

.crm-layout {
    display: flex;
    min-height: calc(100vh - 140px);
}

.crm-container {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 1.5rem 2rem;
}

.oh-page {
    flex: 1 1 auto;
    min-width: 0;
}

.page-header {
    background: var(--oh-color-surface);
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow);
    padding: var(--oh-space-6);
    margin-bottom: var(--oh-space-6);
}

.page-header h1 {
    color: var(--oh-color-text);
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0;
}

.page-header .subtitle {
    color: var(--oh-color-muted);
    margin: 0.4rem 0 0;
}

.crm-footer {
    background: var(--footer-bg, var(--oh-color-primary));
    color: #ffffff;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.85rem;
}

.alert {
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.crm-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--header-border-color, var(--oh-color-primary));
}

.oh-header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 2px solid var(--header-border-color, var(--oh-color-primary));
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 1.25rem;
}

.crm-logo,
.crm-logo:hover {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--oh-color-primary);
    text-decoration: none;
    min-width: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-img {
    display: block;
    width: auto;
    height: clamp(32px, 3vw, 44px);
    max-width: min(22vw, 180px);
    object-fit: contain;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--oh-color-primary), var(--oh-color-accent));
    border-radius: 10px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.1rem;
}

.brand-line {
    color: var(--oh-color-text);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.brand-subline {
    color: var(--oh-color-muted);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-left: auto;
    min-width: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link,
.utility-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #334155;
    text-decoration: none;
    font-weight: 700;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.04);
    white-space: nowrap;
}

.nav-link:hover,
.utility-link:hover {
    color: var(--oh-color-primary);
    background: var(--nav-hover-bg, rgba(25, 77, 133, 0.1));
}

.nav-link.active,
.utility-link.active {
    background: var(--nav-active-bg, var(--oh-color-primary));
    color: var(--nav-active-text, #ffffff);
}

.hub-search {
    position: relative;
    width: min(36vw, 34rem);
    min-width: 16rem;
}

.hub-search__form {
    margin: 0;
}

.hub-search__input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.95);
    color: var(--oh-color-text);
    font-size: 0.86rem;
    padding: 0.55rem 0.95rem;
    outline: none;
}

.hub-search__input:focus {
    border-color: var(--oh-color-primary);
    box-shadow: 0 0 0 3px rgba(25, 77, 133, 0.12);
    background: #ffffff;
}

.hub-search__results {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    z-index: 1200;
    background: #ffffff;
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow-hover);
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}

.hub-search__results[hidden] {
    display: none;
}

.hub-search__empty,
.hub-search__link {
    display: block;
    padding: 0.8rem 0.95rem;
}

.hub-search__link {
    color: var(--oh-color-text);
    text-decoration: none;
    border-top: 1px solid rgba(15, 23, 42, 0.055);
}

.hub-search__link:first-child {
    border-top: 0;
}

.hub-search__link:hover {
    background: rgba(245, 166, 35, 0.06);
}

.hub-search__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hub-search__title {
    font-size: 0.9rem;
    font-weight: 800;
}

.hub-search__subtitle,
.hub-search__meta {
    color: var(--oh-color-muted);
    font-size: 0.76rem;
    margin-top: 0.15rem;
}

.hub-search__badge {
    background: rgba(25, 77, 133, 0.1);
    color: var(--oh-color-primary);
    border-radius: 999px;
    padding: 0.2rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
}

.hub-search__badge--nextcloud {
    background: rgba(245, 166, 35, 0.14);
    color: #92400e;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    width: 240px;
    background: #ffffff;
    border: 1px solid var(--oh-color-border);
    border-radius: var(--oh-radius);
    box-shadow: var(--oh-shadow-hover);
    overflow: hidden;
    z-index: 1200;
}

.user-dropdown:hover .user-dropdown-menu,
.user-dropdown:focus-within .user-dropdown-menu {
    display: block;
}

.user-dropdown-header {
    padding: 0.75rem 0.9rem;
    background: var(--oh-color-soft);
    color: var(--oh-color-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.user-dropdown-link {
    display: block;
    padding: 0.72rem 0.9rem;
    color: #334155;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 650;
}

.user-dropdown-link:hover {
    background: rgba(245, 166, 35, 0.08);
    color: var(--oh-color-primary);
}

.user-dropdown-divider {
    border-top: 1px solid var(--oh-color-border);
}

.user-button {
    background: var(--btn-primary-bg, var(--oh-color-accent));
    color: #ffffff;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    border: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.user-button:hover {
    color: #ffffff;
    background: var(--btn-primary-hover, #e09000);
}

body.ohub-admin {
    font-family: "Inter", sans-serif;
    background: #f5f7fa;
}

body.ohub-admin .crm-layout {
    display: flex;
    min-height: calc(100vh - 140px);
}

body.ohub-admin .ohub-admin-main {
    flex: 1 1 auto;
    width: 100%;
    padding: 1.5rem 2rem;
    background: transparent;
}

body.ohub-admin #container,
body.ohub-admin #content,
body.ohub-admin #content-main {
    max-width: none !important;
    width: 100% !important;
}

body.ohub-admin #container > #header,
body.ohub-admin #nav-sidebar,
body.ohub-admin #toggle-nav-sidebar,
body.ohub-admin .sticky.toggle-nav-sidebar,
body.ohub-admin #container > #footer {
    display: none !important;
}

body.ohub-admin .module,
body.ohub-admin #content-related {
    border-radius: var(--oh-radius) !important;
    border: 1px solid var(--oh-color-border) !important;
    box-shadow: var(--oh-shadow) !important;
    background: #ffffff !important;
    overflow: hidden;
}

body.ohub-admin .module caption,
body.ohub-admin .module h2,
body.ohub-admin .inline-group h2,
body.ohub-admin #content-related h2 {
    background: var(--oh-color-soft) !important;
    color: var(--oh-color-text) !important;
    border-bottom: 1px solid var(--oh-color-border);
    padding: 0.85rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
}

body.ohub-admin div.breadcrumbs {
    background: transparent !important;
    color: var(--oh-color-muted) !important;
    padding: 0 0 1rem !important;
    border: 0 !important;
}

@media (max-width: 900px) {
    .oh-page-header {
        flex-direction: column;
    }

    .oh-page-header__actions {
        justify-content: flex-start;
        width: 100%;
    }

    body.ohub-admin .ohub-admin-main {
        padding: 0.75rem;
    }

    .crm-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100vh;
        z-index: 1050;
        transition: left 0.25s ease;
        box-shadow: 4px 0 25px rgba(15, 23, 42, 0.16);
    }

    .crm-sidebar.open {
        left: 0;
    }

    .sidebar-collapse-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        margin: 0 0.75rem 0.75rem auto;
        border: 1px solid var(--oh-color-border);
        border-radius: var(--oh-radius-sm);
        background: #ffffff;
        color: var(--oh-color-muted);
    }

    .hub-search {
        display: none;
    }

    .nav-links-utility {
        display: none;
    }
}
