/* C.C. Buchner DAM, public Figma prototype l92wTEznvjzFwGmhTuT2jo.
   Loaded through moreplugincss AFTER RS 11 core CSS. Colours sampled from the
   reference; geometry follows its desktop canvas. See doc/FIGMA_IMPLEMENTATION.md. */
@font-face {
    font-family: "BVG DAM";
    src: url("../fonts/Roboto-variable.ttf") format("truetype");
    font-weight: 100 900;
    font-stretch: 75% 100%;
    font-display: swap;
}

/* UI tokens: assets/css/tokens.css (loaded first via moreplugincss) */

body:has(header:not(.LoginHeader)) {
    color: var(--bvg-ui-text);
    background: var(--bvg-ui-background);
    font-size: 14px;
}

body:has(header:not(.LoginHeader)),
body:has(header:not(.LoginHeader)) :where(h1, h2, h3, h4, h5, h6, input, select, textarea, button) {
    font-family: "BVG DAM", Arial, sans-serif;
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 2px solid var(--bvg-primary);
    outline-offset: 3px;
}

header:not(.LoginHeader) { border-bottom: 1px solid var(--bvg-ui-border); }

/* Reorder existing grid areas; the native menus, search and actions remain live. */
@media (min-width: 1200px) {
    header #header-container {
        display: grid;
        grid-template-columns: 215px minmax(340px, 1fr) minmax(240px, 404px) auto;
        grid-template-areas: "logo navigation search actions";
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 10px 16px;
    }
    #header-container > .primary-navigation { grid-area: navigation; justify-self: start; }
    #header-container .header-search-field { grid-area: search; width: 100%; }
    #header-container .actions { grid-area: actions; justify-self: end; justify-content: flex-end; }
    #header-container .actions > .get-menu-content { order: 2; width: 28px; height: 32px; min-height: 32px; padding: 4px; background: transparent; }
    #header-container .actions > .get-menu-content .wrap-icon { font-size: 18px; }
    #header-container .actions > .bvg-pilot-header-material-button { order: 0; }
    #header-container .actions > .UploadButton { order: 1; }
}
@media (min-width: 1600px) {
    header #header-container { grid-template-columns: 215px 400px 404px auto; gap: 16px; }
}
@media (min-width: 1200px) and (max-width: 1399px) {
    header #header-container {
        grid-template-columns: 215px minmax(0, 1fr) auto;
        grid-template-areas: "logo navigation actions" "search search search";
        gap: 12px;
    }
}

header #header-container .logo { justify-self: start; height: 42px; }
header #header-container .logo a {
    width: auto;
    min-height: 42px;
    padding-left: 54px;
    background-size: 42px 42px;
    text-decoration: none;
    color: var(--bvg-ui-text);
}
header #header-container .logo img { position: absolute; width: 42px; height: 42px; }
.bvg-design-wordmark { display: flex; flex-direction: column; text-align: left; line-height: 1.4; }
.bvg-design-wordmark strong { font-size: 14px; }
.bvg-design-wordmark small { font-size: 12px; font-weight: 400; }
#header-container .primary-navigation > ul { gap: 24px; }
#header-container .primary-navigation a { font-size: 14px; font-weight: 600; }
#header-container .actions { gap: 12px; align-items: center; }
#header-container .actions a.bvg-pilot-header-material-button,
#header-container .actions a.UploadButton {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 16px;
    font-size: 14px;
}
#header-container .actions a.UploadButton span { font-size: 14px; }
header .actions a.bvg-pilot-header-material-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--bvg-primary);
    border-radius: 6px;
    background: var(--bvg-ui-surface);
    color: var(--bvg-primary);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
}
header .actions a.bvg-pilot-header-material-button:hover,
header .actions a.bvg-pilot-header-material-button:focus {
    background: #fff5f6;
    color: var(--bvg-primary);
}
header .actions a.UploadButton {
    background: var(--bvg-primary);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
}
header .actions a.UploadButton:hover {
    background: #a50d26;
    color: #fff;
    box-shadow: none;
}
header nav.primary-navigation a:hover,
header nav.primary-navigation a[aria-current="page"] {
    color: var(--bvg-primary);
    box-shadow: inset 0 -2px 0 var(--bvg-primary);
    text-decoration: none;
}
@media (max-width: 499px) {
    header .actions a.bvg-pilot-header-material-button {
        width: var(--space-48, 48px);
        height: var(--space-48, 48px);
        padding: 0;
        justify-content: center;
        gap: 0;
    }
    header .actions a.bvg-pilot-header-material-button span { display: none; }
    header .actions a.bvg-pilot-header-material-button i { font-size: 18px; }
}

#header-container .header-search-field .input-wrapper {
    min-width: 0;
    height: 38px;
    gap: 8px;
    padding: 0 6px 0 10px;
    background: var(--bvg-ui-background);
    border-color: var(--bvg-ui-border);
    border-radius: 4px;
}
#header-container .header-search-field .input-wrapper:focus-within { outline: 2px solid var(--bvg-primary); outline-offset: 2px; }
#header-container .header-search-field .input-wrapper input {
    order: 1;
    background: transparent;
    color: var(--bvg-ui-text);
    font-size: 13px;
}
#header-container .header-search-field .input-wrapper > button {
    height: 28px;
    min-width: 24px;
    width: 24px;
    padding: 4px;
    border: 0;
    color: var(--bvg-ui-muted);
    background: transparent;
    font-size: 16px;
}
#header-container .header-search-field .input-wrapper > button:first-of-type { order: 0; }
#header-container .header-search-field .input-wrapper > button:last-of-type { order: 2; background: var(--bvg-ui-surface); border-radius: 4px; }

/* Home hook supplies the hero and real quick links. Keep other home configurations intact. */
#CentralSpace:has(.bvg-dashboard-intro) > #hero_banner { display: none; }
.bvg-dashboard-intro { max-width: var(--bvg-ui-width); margin: 0 auto; padding: 18px 24px 0; }
.bvg-dashboard-breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; font-size: 11px; color: var(--bvg-ui-muted); }
.bvg-dashboard-breadcrumb a { color: inherit; text-decoration: none; }
.bvg-dashboard-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 208px;
    box-sizing: border-box;
    padding: 24px 26px 54px;
    border: 1px solid var(--bvg-ui-border);
    border-radius: 8px;
    background: var(--bvg-ui-hero);
}
.bvg-dashboard-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 0 auto;
    width: 418px;
    background: url('../images/dashboard-triangles.png') left center / cover no-repeat;
    transform: scaleX(-1);
    opacity: .8;
}
.bvg-dashboard-hero h1 { max-width: 950px; margin: 0 0 10px; padding: 0; color: var(--bvg-ui-text); font-size: clamp(26px, 2.4vw, 36px); font-weight: 700; line-height: 1.35; }
.bvg-dashboard-hero p { max-width: 900px; padding: 0; color: var(--bvg-ui-text); font-size: 13px; }
.bvg-dashboard-shortcuts { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin: -24px 24px 0; }
.bvg-dashboard-shortcut { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 70px; box-sizing: border-box; padding: 10px; border: 1px solid var(--bvg-ui-border); border-radius: 4px; background: var(--bvg-ui-surface); color: var(--bvg-ui-text); text-decoration: none; }
.bvg-dashboard-shortcut:hover { border-color: var(--bvg-primary); color: var(--bvg-ui-text); text-decoration: none; }
.bvg-dashboard-shortcut strong, .bvg-dashboard-shortcut small { display: block; }
.bvg-dashboard-shortcut strong { font-size: 14px; line-height: 1.5; }
.bvg-dashboard-shortcut small { color: var(--bvg-ui-muted); font-size: 12px; }
.bvg-dashboard-shortcut > .icon-arrow-right { margin-left: auto; color: var(--bvg-ui-muted); }
.bvg-design-icon { display: inline-flex; flex: 0 0 48px; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 4px; background: var(--bvg-ui-tint); color: var(--bvg-primary); font-size: 18px; }
.bvg-dashboard-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 52px; }
.bvg-dashboard-heading h2 { padding: 0; color: var(--bvg-ui-text); font-size: 24px; font-weight: 700; }
.bvg-dashboard-heading p { margin-top: 6px; padding: 0; font-size: 13px; }
/* Dashboard view toggle → assets/css/components/tabs.css */

#CentralSpace:has(.bvg-dashboard-intro) #HomePanelContainer { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 24px; max-width: var(--bvg-ui-width); box-sizing: content-box; padding: 18px 24px 40px; }
/* One !important is needed to override the existing pilot card border rule. */
#HomePanelContainer .HomePanel.DashTile {
    border-color: var(--bvg-ui-border) !important;
    background: var(--bvg-ui-surface);
    box-shadow: none;
    color: var(--bvg-ui-text);
}
#HomePanelContainer .HomePanel.DashTile:hover { box-shadow: 0 2px 8px #101b260a; }
#HomePanelContainer .tile-freetext { border-top: 0; min-height: 132px; box-sizing: border-box; }
#HomePanelContainer .tile-desc h2 { font-size: 16px; }
#HomePanelContainer .tile-desc p { margin-top: 4px; font-size: 13px; }
#HomePanelContainer .DashTileActions { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bvg-ui-background); }
#HomePanelContainer .DashTileActions .tool { width: 28px; height: 28px; background: transparent; color: var(--bvg-ui-muted); }
#HomePanelContainer .DashTileActions .tool:has(.icon-trash-2) { color: var(--bvg-primary); }
#HomePanelContainer .HomePanel.DashTile.bvg-pilot-dash-bn-tile .HomePanelIN { padding: 16px; border-top: 3px solid var(--bvg-primary); gap: 12px; }
#HomePanelContainer .bvg-pilot-dash-bn-tile h2 { font-size: 16px; }
.bvg-pilot-dash-bn-tile .bvg-design-icon { margin-bottom: 4px; }
.bvg-pilot-dash-bn-description { font-size: 13px; padding: 0; }
.bvg-pilot-dash-bn-selector label { display: block; margin: 2px 0 6px; font-size: 12px; font-weight: 600; }
#HomePanelContainer .bvg-pilot-dash-bn-select { height: 40px; padding: 8px 12px; border: 1px solid var(--bvg-ui-border); border-radius: 4px; background: var(--bvg-ui-surface); color: var(--bvg-ui-text); }
.bvg-pilot-dash-bn-hint { display: block; margin: 8px 0 24px; color: var(--bvg-ui-muted); font-size: 11px; }
#HomePanelContainer .bvg-pilot-dash-bn-actions { gap: 10px; }
#HomePanelContainer .bvg-pilot-dash-bn-actions .bvg-pilot-dash-btn { min-height: 40px; border: 1px solid var(--bvg-ui-border); background: var(--bvg-ui-surface); color: var(--bvg-ui-text); font-size: 14px; }
#HomePanelContainer .bvg-pilot-dash-bn-actions .bvg-pilot-dash-btn-secondary { border-color: var(--bvg-primary); background: var(--bvg-primary); color: #fff; }
#CentralSpace:has(.bvg-dashboard-intro) #HomePanelContainer.bvg-dashboard-list { grid-template-columns: minmax(0, 1fr); }
#HomePanelContainer.bvg-dashboard-list .DoubleWidthDashTile { grid-column: auto; }
#HomePanelContainer.bvg-dashboard-list .tile-freetext { min-height: 0; }
#HomePanelContainer.bvg-dashboard-list .bvg-pilot-dash-bn-selector { max-width: 520px; width: 100%; }

/* Resource list cards (BN/FC PM → components/pm-catalog.css, pm-fc-assets.css). */
.page-title h1 { font-size: 36px; font-weight: 700; color: var(--bvg-ui-text); }
.main-content { padding-top: 24px; }
#CentralSpaceResources .Listview { border: 1px solid var(--bvg-ui-border); }
.ResourcePanel, .ResourcePanelLarge { border: 1px solid var(--bvg-ui-border); border-radius: var(--bvg-ui-radius); background: var(--bvg-ui-surface); }
.ResourcePanel .ResourcePanelTitle { color: var(--bvg-ui-text); font-weight: 600; }
/* Collection bar: assets/css/collections.css */

@media (max-width: 1199px) {
    #CentralSpace:has(.bvg-dashboard-intro) #HomePanelContainer { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bvg-dashboard-hero h1 { max-width: 75%; }
    .bvg-dashboard-hero p { max-width: 72%; }
    .bvg-dashboard-hero::after { opacity: .45; }
}
@media (max-width: 900px) {
    #CentralSpace:has(.bvg-dashboard-intro) #HomePanelContainer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bvg-dashboard-shortcuts { gap: 12px; margin-left: 12px; margin-right: 12px; }
    .bvg-dashboard-hero h1, .bvg-dashboard-hero p { max-width: 100%; }
    .bvg-dashboard-hero::after { opacity: .12; }
    .bvg-dashboard-heading { margin-top: 32px; }
}
@media (max-width: 599px) {
    .bvg-dashboard-intro { padding: 16px 16px 0; }
    .bvg-dashboard-hero { padding: 20px; }
    .bvg-dashboard-hero h1 { font-size: 26px; }
    .bvg-dashboard-shortcuts { grid-template-columns: minmax(0, 1fr); margin: 12px 0 0; }
    .bvg-dashboard-heading { align-items: flex-start; flex-direction: column; }
    .bvg-dashboard-heading h2 { font-size: 22px; }
    #CentralSpace:has(.bvg-dashboard-intro) #HomePanelContainer { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; }
    #HomePanelContainer .DoubleWidthDashTile { grid-column: auto; }
    .page-title h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    #HomePanelContainer .HomePanel.DashTile { transition: none; }
}
