/* Compact + modern base styling for Razor Pages layout (works well with DevExtreme classes).
   Goals: tighter spacing, better typography, modern grey surfaces, clearer separation lines.
   Keep the original menu accent color (#3194b5). */

:root {
    color-scheme: light;

    /* Surfaces / greys */
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --surface-3: #e9edf2;

    --text: #1f2937;
    --muted: #6b7280;

    --border: rgba(17, 24, 39, 0.12);
    --border-strong: rgba(17, 24, 39, 0.18);

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 10px 26px rgba(16, 24, 40, 0.10);

    /* IMPORTANT: keep old menu/accent color */
    --accent: #3194b5;
    --accent-2: #2a7f9a;

    --radius-sm: 8px;
    --radius-md: 12px;

    /* Typography: less “fat Helvetica” */
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

html, body {
    margin: 0;
    min-height: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-2);
    text-decoration: underline;
}

.row-element-container {
    margin-bottom: 18px;
}

#app-side-nav-outer-toolbar {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Header: clearer separation line, slightly “dashboard-like” */
.layout-header {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 1501;
    padding: 8px 12px;
    background: linear-gradient(to bottom, var(--surface), var(--surface-2));
    border-bottom: 1px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
}

/* Toolbar menu button keeps accent */
.dx-toolbar .dx-toolbar-item.menu-button {
    width: 52px;
    text-align: center;
    padding: 0;
}

.dx-toolbar .dx-toolbar-item.menu-button > .dx-toolbar-item-content .dx-icon {
    color: var(--accent);
}

/* DevExtreme Toolbar: Container soll keinen eigenen (weißen) Hintergrund haben,
   damit der linear-gradient von `.layout-header` durchscheint. */

.layout-header .dx-toolbar  {
    background: transparent !important;
}

/* Falls DevExtreme zusätzlich den Content-Bereich weiß färbt */
.layout-header .dx-toolbar .dx-toolbar-item-content {
    background: transparent !important;
}

/* Dashboard cards: more “panel” look with border lines */
.dx-card {
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: none; /* more compact/flat */
    margin: 10px;
}

.dx-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.dx-card.wide-card {
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    border-right: 0;
    border-left: 0;
}

/* Layout body */
.with-footer > div > div > .dx-scrollable-content {
    height: 100%;
}

.with-footer > div > div > .dx-scrollable-content > .dx-scrollview-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.layout-body {
    flex: 1;
    height: 100%;
    min-height: 0;
    background: var(--bg);
}

/* Dashboard split: menu (surface) vs content (grey) */
.layout-body .menu-container {
    height: 100%;
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border-strong);
}

.layout-body .content {
    flex-grow: 1;
    height: 100%;
    line-height: 1.35;
}

/* Headings: compact, no extra “panel” separation */
.layout-body .content h1,
.layout-body .content h2,
.layout-body .content h3 {
    font-family: var(--font);
    letter-spacing: -0.1px;
    color: #111827;
    margin: 0 0 8px 0;
}

.layout-body .content h2 {
    font-size: 20px;
    font-weight: 600;
}

/* Content blocks: keep as spacing helper */
.layout-body .content-block {
    margin: 14px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

/* New: wrapper that groups heading + grid/table into one rounded panel */
.page-panel {
    margin: 0px; /* was 14px */
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    /* neu: sehr leichter Schatten nach innen */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),
                inset 0 -1px 0 rgba(17, 24, 39, 0.06);
}

.page-panel > h2,
.page-panel > h3 {
    margin: 0 0 10px 0;
}

.page-panel .row-element-container {
    margin-bottom: 14px;
}

.page-panel .row-element-container:last-child {
    margin-bottom: 0;
}

/* If you need spacing around the actual content inside content-block, wrap it in a dx-card or add a container. */
.layout-body .content-block .dx-card {
    margin: 10px 0;
}

.layout-body .content-footer {
    display: block;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding-top: 14px;
    padding-bottom: 16px;
    background: transparent;
}

.layout-body .responsive-paddings {
    padding: 14px;
}

.layout-body-hidden {
    visibility: hidden;
}

/* Tighter grid spacing */
.row div {
    margin-bottom: 10px;
}

/* Menu / treeview: keep accent color; add clearer hover/selection blocks */
.menu-container .dx-widget {
    color: #374151;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font);
    line-height: 24px;
}

.menu-container .dx-treeview {
    white-space: nowrap;
}

.menu-container .dx-treeview .dx-treeview-item {
    padding-left: 0;
    padding-right: 0;
    border-radius: var(--radius-sm);
}

/* Slightly smaller icons */
.menu-container .dx-treeview .dx-treeview-item .dx-icon {
    width: 44px !important;
    margin: 0 !important;
    color: #6b7280;
}

.menu-container .dx-treeview .dx-treeview-node {
    padding: 0 !important;
}

.menu-container .dx-treeview .dx-treeview-toggle-item-visibility {
    right: 10px;
    left: auto;
}

.menu-container .dx-treeview .dx-rtl .dx-treeview-toggle-item-visibility {
    left: 10px;
    right: auto;
}

.menu-container .dx-treeview .dx-treeview-node[aria-level="1"] {
    font-weight: 700;
    border-top: 1px solid rgba(17, 24, 39, 0.06); /* subtle separators */
}

.menu-container .dx-treeview .dx-treeview-node[aria-level="1"]:first-child {
    border-top: 0;
}

.menu-container .dx-treeview .dx-treeview-node[aria-level="2"] .dx-treeview-item-content {
    font-weight: 500;
    padding: 0 52px;
    color: #4b5563;
}

/* Selected: accent text + grey block background (accent preserved) */
.menu-container .dx-treeview .dx-treeview-node-container .dx-treeview-node.dx-state-selected:not(.dx-state-focused) > .dx-treeview-item {
    background: linear-gradient(to right, rgba(49, 148, 181, 0.16), rgba(49, 148, 181, 0.06));
    border-left: 3px solid var(--accent);
}

.menu-container .dx-treeview .dx-treeview-node-container .dx-treeview-node.dx-state-selected > .dx-treeview-item * {
    color: var(--accent);
}

/* Hover: grey highlight, keep text dark */
.menu-container .dx-treeview .dx-treeview-node-container .dx-treeview-node:not(.dx-state-focused) > .dx-treeview-item.dx-state-hover {
    background: rgba(17, 24, 39, 0.04);
    color: #111827;
}

/* Generic focus ring (accessible, uses accent) */
:focus-visible {
    outline: 2px solid rgba(49, 148, 181, 0.55);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Responsive tweaks */
@media screen and (min-width: 600px) {
    .layout-body .content-block {
        margin-left: 14px;
        margin-right: 14px;
    }

    .page-panel {
        margin-left: 7px;  /* was 14px */
        margin-right: 7px; /* was 14px */
    }
}

@media screen and (min-width: 1280px) {
    .layout-body .responsive-paddings {
        padding: 16px;
    }
}

/* ===== Nested panels (outer grey container + inner white panels) ===== */
.page-panel {
    /* outer container should be a subtle grey between background and inner panels */
    background: var(--surface-2);
    border-color: var(--border);

    /* inset shadow an allen Kanten */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -1px 0 rgba(17, 24, 39, 0.06),
        inset 1px 0 0 rgba(255, 255, 255, 0.35),
        inset -1px 0 0 rgba(17, 24, 39, 0.04);
}

/* inner panel (white) */
.element-panel {
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

/* headings inside element panel should visually belong to the grid */
.element-panel > h2,
.element-panel > h3 {
    margin: 0 0 10px 0;
}

/* Splitter: use nested panels with spacing; avoid vertical scrollbars via flex */
.split-panel.page-panel {
    margin: 0 10px;
    height: 100%;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.split-panel.page-panel > h2 {
    flex: 0 0 auto;
    margin: 0 0 10px 0;
}

/* inner content in split panel fills remaining space */
.split-panel.page-panel > .element-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* grid container fills remaining height in inner element-panel */
.split-panel.page-panel > .element-panel > #tours-grid,
.split-panel.page-panel > .element-panel > #workspaces-grid {
    flex: 1 1 auto;
    min-height: 0;
}

/* Abstand zwischen äußerem Rahmen (#workspaces-master-container) und Splitter */
#workspaces-master-container #workspaces-splitter {
    margin: 10px;
    box-sizing: border-box;
}

/* Split-bar spacing */
#workspaces-master-container .dx-splitter-bar {
    padding: 0 6px;
}

/* TreeView: Selektierter Eintrag soll links bündig anliegen (keine abgerundete linke Kante) */
.menu-container .dx-treeview .dx-treeview-node.dx-state-selected > .dx-treeview-item {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    padding-left: 0 !important; /* verhindert "Einzug" durch item-padding */
}

/* Optional: auch beim Hover bündig (wirkt konsistent mit Selected) */
.menu-container .dx-treeview .dx-treeview-node > .dx-treeview-item.dx-state-hover {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    padding-left: 0 !important;
}

/* Falls der Content selbst noch Innenabstand links hat */
.menu-container .dx-treeview .dx-treeview-node.dx-state-selected > .dx-treeview-item .dx-treeview-item-content {
    padding-left: 0 !important;
}

/* Page header: Title left, action button right */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px 0;
}

/* verhindert Extra-Abstand durch `.content-block` am h2 */
.page-header-row > h2.content-block {
    margin: 0;
}

/* Popup Titlebar: eigener Header mit rechter Close-Aktion */
.popup-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.popup-titlebar__title {
    font-weight: 600;
}

/* Runder Close-Button (Kreis + X Icon) */
.popup-close-round.dx-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.6);
}

.popup-close-round.dx-button .dx-button-content {
    padding: 0;            /* kein rechteckiges Padding */
    height: 100%;
}

.popup-close-round.dx-button .dx-icon {
    margin: 0;             /* Icon zentrieren */
}

