@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Roboto+Slab:wght@100;300;700&display=swap');

/**
 * Dataline brand tokens (Dataline Brand Guidelines, Dec 2025) and the app shell of the dataline-360 /app section,
 * applied on top of stock Bootstrap 5 (no Sass build: AssetMapper serves Bootstrap's precompiled CSS as-is).
 * Bootstrap 5.3's root custom properties (--bs-primary, --bs-link-color, ...) cover most utilities/components, but a
 * few components (buttons, form checks) bake their own colors into component-scoped variables, so those are
 * overridden explicitly below.
 *
 * Keep this in line with dataline-360 and multipress-marketing (assets/styles/app.css) so the applications look the same.
 */
:root {
    --bs-primary: #0000ff;
    --bs-primary-rgb: 0, 0, 255;
    --bs-primary-text-emphasis: #00008a;
    --bs-primary-bg-subtle: #d6d6ff;
    --bs-primary-border-subtle: #adadff;

    --bs-link-color: #0000ff;
    --bs-link-color-rgb: 0, 0, 255;
    --bs-link-hover-color: #0000cc;
    --bs-link-hover-color-rgb: 0, 0, 204;

    --bs-focus-ring-color: rgba(0, 0, 255, 0.25);

    --bs-body-font-family: 'Roboto', system-ui, sans-serif;
    --bs-body-color: #231f20;

    --bs-border-radius: 0.5rem;
    --bs-border-radius-lg: 0.75rem;

    --db-heading-font: 'Roboto Slab', ui-serif, Georgia, serif;
    --db-accent-cyan: #00aeef;
    --db-accent-pink: #ff178a;
    --db-accent-purple: #7c1983;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--db-heading-font);
}

.btn-primary {
    --bs-btn-bg: #0000ff;
    --bs-btn-border-color: #0000ff;
    --bs-btn-hover-bg: #0000cc;
    --bs-btn-hover-border-color: #0000bf;
    --bs-btn-active-bg: #0000bf;
    --bs-btn-active-border-color: #0000b3;
    --bs-btn-focus-shadow-rgb: 51, 51, 255;
    --bs-btn-disabled-bg: #0000ff;
    --bs-btn-disabled-border-color: #0000ff;
}

.btn-outline-primary {
    --bs-btn-color: #0000ff;
    --bs-btn-border-color: #0000ff;
    --bs-btn-hover-bg: #0000ff;
    --bs-btn-hover-border-color: #0000ff;
    --bs-btn-active-bg: #0000cc;
    --bs-btn-active-border-color: #0000cc;
    --bs-btn-focus-shadow-rgb: 51, 51, 255;
}

.form-check-input:checked {
    background-color: #0000ff;
    border-color: #0000ff;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

footer.bg-primary {
    color: #fff;
}

/* ==========================================================================
 * Login pages (security/login, dev/login): same as the dataline-360 login.
 * ========================================================================== */
.login-header {
    border-bottom: 1px solid var(--bs-border-color);
}

.brand-bar {
    height: 0.25rem;
    width: 4rem;
}

/* ==========================================================================
 * Authenticated app (templates/layout.html.twig): sidebar app shell and list/detail building blocks, as the
 * dataline-360 /app section. Colours derive from the brand tokens above; nothing here applies outside
 * body.app-layout.
 * ========================================================================== */
.app-layout {
    --app-sidebar-width: 16.5rem;
    --app-sidebar-bg: #0b0b3b;
    --app-sidebar-color: rgba(255, 255, 255, 0.72);
    --app-sidebar-hover-bg: rgba(255, 255, 255, 0.08);
    --app-sidebar-active-bg: rgba(0, 174, 239, 0.18);
    --app-surface: #f5f6fa;
    --app-card-border: #e4e6ef;

    background: var(--app-surface);
}

.app-layout .min-w-0 {
    min-width: 0;
}

/* Bootstrap 5.3 underlines every link; in an app UI that's noise in tables, cards and menus. */
.app-layout a:not(.btn) {
    text-decoration: none;
}

.app-layout .app-content a:not(.btn):not(.card):not(.nav-link):hover {
    text-decoration: underline;
}

.app-layout .app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar ---------------------------------------------------------------- */
/* !important: from the lg breakpoint up, Bootstrap's .offcanvas-lg forces background-color: transparent !important. */
.app-layout .app-sidebar {
    --bs-offcanvas-width: var(--app-sidebar-width);
    --bs-offcanvas-bg: var(--app-sidebar-bg);
    background-color: var(--app-sidebar-bg) !important;
    color: var(--app-sidebar-color);
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .app-layout .app-sidebar {
        position: sticky;
        top: 0;
        width: var(--app-sidebar-width);
        height: 100vh;
        flex-shrink: 0;
        overflow-y: auto;
    }
}

.app-layout .sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
}

.app-layout .brand-wordmark {
    font-family: var(--db-heading-font);
    /* dataline-360 uses 1.35rem; "Trend Analysis" is longer than "Dataline 360" and has to fit on one line */
    font-size: 1.15rem;
    white-space: nowrap;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.app-layout .brand-wordmark span {
    color: var(--db-accent-cyan);
}

.app-layout .sidebar-nav {
    padding: 0.25rem 0.75rem 1.5rem;
}

.app-layout .sidebar-heading {
    margin: 1.1rem 0.75rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* The heading of the module of the current page. */
.app-layout .sidebar-heading.is-current {
    color: rgba(255, 255, 255, 0.8);
}

.app-layout .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--app-sidebar-color);
    text-decoration: none;
    font-size: 0.925rem;
}

.app-layout .sidebar-link:hover,
.app-layout .sidebar-link:focus-visible {
    background: var(--app-sidebar-hover-bg);
    color: #fff;
}

.app-layout .sidebar-link.active {
    background: var(--app-sidebar-active-bg);
    color: #fff;
    font-weight: 500;
    box-shadow: inset 3px 0 0 var(--db-accent-cyan);
}

/* Main column ------------------------------------------------------------ */
.app-layout .app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-layout .app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--app-card-border);
}

@media (min-width: 992px) {
    .app-layout .app-topbar {
        padding: 0.5rem 2rem;
    }
}

.app-layout .app-topbar .breadcrumb {
    font-size: 0.9rem;
}

.app-layout .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.6rem;
    border: 0;
    border-radius: 0.5rem;
    color: var(--bs-secondary-color);
}

.app-layout .btn-icon:hover,
.app-layout .btn-icon:focus-visible {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.app-layout .user-button {
    padding: 0.25rem;
    border: 0;
}

.app-layout .app-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 600;
}

.app-layout .app-content {
    flex: 1 0 auto;
    display: block;
    width: 100%;
    padding: 1.5rem 1rem 3rem;
}

@media (min-width: 992px) {
    .app-layout .app-content {
        padding: 2rem 2rem 4rem;
    }
}

/* Cards, lists, details -------------------------------------------------- */
.app-layout .card {
    border-color: var(--app-card-border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.app-layout .card-header {
    background: #fff;
    border-bottom-color: var(--app-card-border);
    font-weight: 500;
}

.app-layout .page-title {
    font-weight: 700;
}

.app-layout .filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--app-card-border);
}

.app-layout .data-table {
    margin-bottom: 0;
    font-size: 0.925rem;
}

.app-layout .data-table thead th {
    background: #fafbfd;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border-bottom-color: var(--app-card-border);
}

.app-layout .data-table td {
    vertical-align: middle;
    border-color: #eef0f5;
}

.app-layout .data-table tr[data-href] {
    cursor: pointer;
}

.app-layout .data-table tbody tr[data-href]:hover > * {
    background: var(--bs-primary-bg-subtle);
}

.app-layout .empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-size: 1.5rem;
}

.app-layout .detail-fields {
    display: flex;
    flex-wrap: wrap;
    row-gap: 1rem;
    margin: 0;
}

.app-layout .detail-fields > div {
    padding-right: 1rem;
}

/* .card is a flex column; these cards are a row (icon + text). */
.app-layout .stat-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    color: inherit;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.app-layout a.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
}

.app-layout .stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    font-size: 1.25rem;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.app-layout .stat-icon.tone-cyan {
    background: rgba(0, 174, 239, 0.12);
    color: #007fae;
}

.app-layout .stat-icon.tone-pink {
    background: rgba(255, 23, 138, 0.1);
    color: #c40063;
}

.app-layout .stat-icon.tone-purple {
    background: rgba(124, 25, 131, 0.1);
    color: var(--db-accent-purple);
}

@media (max-width: 575.98px) {
    .app-layout .stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.9rem;
    }
}

/* Home: a card per module, with links to its pages */
.app-layout .module-links li + li {
    margin-top: 0.35rem;
}

.app-layout .module-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.925rem;
}

.app-layout .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.app-layout .nav-tabs {
    border-bottom-color: var(--app-card-border);
}

/*
 * Underline tabs: the 2px line of the active tab sits on the 1px bottom border of the list (not below it), and the
 * tabs are spaced by a gap instead of padding so the line is as wide as the label and count.
 */
.app-layout .nav-tabs {
    gap: 1.5rem;
}

.app-layout .nav-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: -1px;
    padding: 0.65rem 0.1rem;
    color: var(--bs-secondary-color);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.app-layout .nav-tabs .nav-link:hover {
    color: var(--bs-body-color);
    border-bottom-color: #c9ccd8;
}

.app-layout .nav-tabs .nav-link:focus-visible {
    box-shadow: none;
    outline: 2px solid var(--bs-focus-ring-color);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.app-layout .nav-tabs .nav-link.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
    font-weight: 500;
}

.app-layout .nav-count {
    min-width: 1.5rem;
    padding: 0.1rem 0.45rem;
    border-radius: 50rem;
    background: #eef0f5;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.app-layout .nav-link.active .nav-count {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

.app-layout .form-section + .form-section {
    margin-top: 1.5rem;
}

.app-layout .form-section-title {
    font-family: var(--bs-body-font-family);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.75rem;
}

/* Collapsible card (<details class="card">), e.g. "not shown" on the view as user page */
.app-layout details.card > summary {
    cursor: pointer;
    list-style: none;
}

.app-layout details.card > summary::-webkit-details-marker {
    display: none;
}

.app-layout details.card > summary .details-chevron {
    transition: transform .15s ease;
}

.app-layout details.card[open] > summary .details-chevron {
    transform: rotate(90deg);
}

.app-layout details.card:not([open]) > summary {
    border-bottom: 0;
}

.app-layout .sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--app-card-border);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 -4px 12px rgba(16, 24, 40, 0.05);
}

/* Tooltip of the chart marks ([data-tooltip], see assets/js/chart_tooltip.js) */
.chart-tooltip {
    position: fixed;
    z-index: 1080;
    padding: 0.35rem 0.6rem;
    border-radius: 0.375rem;
    background: #231f20;
    color: #fff;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 0.5rem));
}
