/*
 * The PedalPro house style for the whole panel, matched to
 * bikemanager.pedalpro.eu (values read from that site on 2026-11-10) and the
 * dealer portal (theme "Bikemanager"). See docs/24-layout.md and ADR-0018.
 *
 * NOT in here: the colour palettes (primary, gray), the font, the sidebar
 * width, the missing topbar and the full content width. The
 * AdminPanelProvider sets those, so Filament applies them itself. This file
 * holds what Filament has no setting for: shapes, type sizes, the sidebar,
 * the page header card, the login screen, and the tokens of our own screens.
 *
 * Registered last, so the tokens below override the ones in board.css,
 * agenda.css, map.css, report.css and chat.css.
 */

:root {
    --pp-blue: #2563eb;
    --pp-blue-hover: #1d4ed8;
    --pp-blue-2: #1d3fb0;
    --pp-navy: #0a1230;
    --pp-navy-2: #16265e;
    --pp-slate: #3e4c63;
    --pp-tint: #eaf0fe;
    --pp-soft: #f2f5fa;
    --pp-line: #e1e8f5;
    --pp-line-2: #eff2f8;
    --pp-card-line: #e7ecf5;
    --pp-mute: #8a97ae;
    --pp-hover: #f7f9fd;
    --pp-heading: #0f172a;
    --pp-nav: #334155;
    --pp-group: #94a3b8;
    --pp-sub: #475569;
    --pp-ok: #0e7f58;
    --pp-wait: #9a5b06;
    --pp-no: #b4403e;
    --pp-sh-btn: 0 14px 32px rgba(37, 99, 235, 0.28);
    --pp-ring: 0 0 0 3px rgba(37, 99, 235, 0.15);

    /* Dark mode */
    --pp-d-page: #0a1230;
    --pp-d-card: rgba(24, 24, 27, 0.9);
    --pp-d-line: rgba(255, 255, 255, 0.1);
    --pp-d-text: #e8ecf7;
    --pp-d-sub: #a3adc7;
    --pp-d-blue: #60a5fa;
}

/* ── Page ─────────────────────────────────────────────────────────────── */

.fi-body {
    background: var(--pp-soft);
    color: var(--pp-navy);
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
}

.dark .fi-body {
    background: var(--pp-d-page);
    color: var(--pp-d-text);
}

/* Full width, 40px 32px on desktop, 32px 16px on a phone */
.fi-main {
    padding: 32px 16px;
}

@media (min-width: 1024px) {
    .fi-main {
        padding: 40px 32px;
    }
}

/* The header card sits at the top of the content, not 32px lower */
.fi-page-header-main-ctn {
    padding-top: 0;
}

/* The menu button on a small screen (there is no topbar) */
.fi-layout-sidebar-toggle-btn-ctn {
    background: #fff;
    border-bottom: 1px solid var(--pp-line);
}

.dark .fi-layout-sidebar-toggle-btn-ctn {
    background: var(--pp-d-page);
    border-bottom-color: var(--pp-d-line);
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */

.fi-sidebar {
    background: #fff;
    border-inline-end: 1px solid var(--pp-line);
}

.dark .fi-sidebar {
    background: var(--pp-d-page);
    border-inline-end-color: var(--pp-d-line);
}

.fi-sidebar-header {
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid var(--pp-line);
}

.dark .fi-sidebar-header {
    border-bottom-color: var(--pp-d-line);
}

.fi-sidebar-item-btn {
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
}

.fi-sidebar-item-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--pp-nav);
}

.fi-sidebar-item-btn:hover {
    background: var(--pp-hover);
}

/* Active: soft blue, navy text, a light shadow. No primary text, no bar. */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--pp-tint);
    box-shadow: 0 1px 2px rgba(10, 18, 48, 0.05);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label {
    color: var(--pp-navy);
    font-weight: 600;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-icon {
    color: var(--pp-blue-2);
}

.dark .fi-sidebar-item-label {
    color: rgba(255, 255, 255, 0.78);
}

.dark .fi-sidebar-item-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: rgba(91, 126, 240, 0.25);
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-icon {
    color: #fff;
}

/* Group headings: small, upper case, slate-400 */
.fi-sidebar-group-btn {
    padding: 8px 12px;
}

.fi-sidebar-group-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.55px;
    text-transform: uppercase;
    color: var(--pp-group);
}

.dark .fi-sidebar-group-label {
    color: rgba(255, 255, 255, 0.5);
}

/* User menu and search at the bottom of the sidebar, as in Bikemanager */
.fi-sidebar-footer {
    border-top: 1px solid var(--pp-line);
}

.dark .fi-sidebar-footer {
    border-top-color: var(--pp-d-line);
}

/* The generated avatar is navy: give it an edge on the navy sidebar */
.dark .fi-sidebar-footer .fi-avatar {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

/* "CRM" next to the logo (render hook SIDEBAR_LOGO_AFTER) */
.crm-brand-product {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-inline-start: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pp-nav);
    white-space: nowrap;
}

.crm-brand-product::before {
    content: "";
    width: 1px;
    height: 18px;
    background: var(--pp-line);
}

.dark .crm-brand-product {
    color: rgba(255, 255, 255, 0.78);
}

.dark .crm-brand-product::before {
    background: var(--pp-d-line);
}

/* ── Page header: a white card with eyebrow, title and intro ─────────── */

.fi-header {
    padding: 24px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(10, 18, 48, 0.05);
}

.dark .fi-header {
    background: var(--pp-d-card);
    border-color: var(--pp-d-line);
}

/* Eyebrow: the breadcrumbs on resource pages, our own line on the others
   (render hook PAGE_HEADER_HEADING_BEFORE). */
.crm-eyebrow,
.fi-header .fi-breadcrumbs {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--pp-blue-2);
}

.fi-header:has(.fi-breadcrumbs) .crm-eyebrow {
    display: none;
}

.fi-header .fi-breadcrumbs a,
.fi-header .fi-breadcrumbs span {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.dark .crm-eyebrow,
.dark .fi-header .fi-breadcrumbs {
    color: var(--pp-d-blue);
}

.fi-header-heading {
    font-size: 30.4px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--pp-heading);
}

.dark .fi-header-heading {
    color: #fff;
}

.fi-header-subheading {
    font-size: 14px;
    color: var(--pp-sub);
}

/* ── Cards, sections, widgets ─────────────────────────────────────────── */

.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-fo-tabs:not(.fi-contained),
.fi-in-entry-wrp .fi-section {
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 0 0 2px var(--pp-card-line);
}

.dark .fi-section,
.dark .fi-ta-ctn,
.dark .fi-wi-stats-overview-stat {
    background: var(--pp-d-card);
    box-shadow: 0 0 0 1px var(--pp-d-line);
}

.fi-section-header-heading {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--pp-heading);
}

.dark .fi-section-header-heading {
    color: #fff;
}

/* KPI cards: label 13/500, value 24/700 in blue-2 */
.fi-wi-stats-overview-stat {
    padding: 20px;
}

.fi-wi-stats-overview-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--pp-sub);
}

.fi-wi-stats-overview-stat-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--pp-blue-2);
}

.dark .fi-wi-stats-overview-stat-label {
    color: var(--pp-d-sub);
}

.dark .fi-wi-stats-overview-stat-value {
    color: var(--pp-d-blue);
}

/* ── Tables ───────────────────────────────────────────────────────────── */

.fi-ta-header-cell {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.275px;
    text-transform: uppercase;
    color: var(--pp-mute);
}

/* Sortable headings sit in a button with its own type: follow the cell */
.fi-ta-header-cell * {
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
}

/* Compact rows, about 36-40px: 8px 16px instead of Filament's 16px 12px */
.fi-ta-text,
.fi-ta-icon,
.fi-ta-color,
.fi-ta-image,
.fi-ta-toggle,
.fi-ta-select,
.fi-ta-text-input,
.fi-ta-checkbox {
    padding: 8px 16px;
}

.fi-ta-cell:has(> .fi-ta-record-checkbox),
.fi-ta-actions-cell {
    padding-block: 8px;
}

.fi-ta-cell {
    font-size: 13px;
    font-weight: 500;
    color: var(--pp-navy);
}

.fi-ta-row:hover {
    background: var(--pp-hover);
}

.fi-ta-row.fi-striped {
    background: rgba(234, 240, 254, 0.4);
}

.dark .fi-ta-cell {
    color: var(--pp-d-text);
}

.dark .fi-ta-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.dark .fi-ta-row.fi-striped {
    background: rgba(91, 126, 240, 0.08);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.fi-btn {
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Full-size buttons are 44px touch targets; the small ones in table rows
   and toolbars stay compact. */
.fi-btn.fi-size-md,
.fi-btn.fi-size-lg,
.fi-btn.fi-size-xl {
    min-height: 44px;
    padding: 10px 20px;
}

.fi-btn.fi-color-primary:not(.fi-outlined) {
    background: var(--pp-blue);
    color: #fff;
    box-shadow: var(--pp-sh-btn);
}

.fi-btn.fi-color-primary:not(.fi-outlined):hover {
    background: var(--pp-blue-hover);
}

/* Secondary: white with a 2px line */
.fi-btn.fi-color-gray,
.fi-btn.fi-outlined.fi-color-primary {
    background: #fff;
    color: var(--pp-navy);
    box-shadow: inset 0 0 0 2px var(--pp-line);
}

.dark .fi-btn.fi-color-gray,
.dark .fi-btn.fi-outlined.fi-color-primary {
    background: transparent;
    color: var(--pp-d-text);
    box-shadow: inset 0 0 0 2px var(--pp-d-line);
}

/* Ghost / link */
.fi-link {
    font-weight: 600;
}

.fi-link.fi-color-primary {
    color: var(--pp-blue-2);
}

.dark .fi-link.fi-color-primary {
    color: var(--pp-d-blue);
}

/* ── Fields ──────────────────────────────────────────────────────────── */

.fi-input-wrp {
    min-height: 44px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--pp-line);
}

.fi-input-wrp:focus-within {
    box-shadow: 0 0 0 1px var(--pp-blue), var(--pp-ring);
}

/* 16px stops iOS zooming in on focus */
.fi-input,
.fi-select-input {
    font-size: 16px;
    font-weight: 500;
}

@media (min-width: 1024px) {
    .fi-input,
    .fi-select-input {
        font-size: 15px;
    }
}

.dark .fi-input-wrp {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 1px var(--pp-d-line);
}

.dark .fi-input-wrp:focus-within {
    box-shadow: 0 0 0 1px var(--pp-d-blue), var(--pp-ring);
}

.fi-fo-field-label {
    font-size: 13px;
    font-weight: 600;
}

/* ── Badges ──────────────────────────────────────────────────────────── */

.fi-badge {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: none;
}

.fi-badge.fi-color-success {
    background: #e6f6ef;
    color: var(--pp-ok);
}

.fi-badge.fi-color-warning {
    background: #fdf2e2;
    color: var(--pp-wait);
}

.fi-badge.fi-color-danger {
    background: #fbeaea;
    color: var(--pp-no);
}

.fi-badge.fi-color-gray {
    background: #fff;
    color: var(--pp-navy);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--pp-line);
}

.dark .fi-badge.fi-color-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.dark .fi-badge.fi-color-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.dark .fi-badge.fi-color-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.dark .fi-badge.fi-color-gray {
    background: transparent;
    color: var(--pp-d-text);
    box-shadow: inset 0 0 0 1px var(--pp-d-line);
}

/* ── Tabs as filter pills ────────────────────────────────────────────── */

.fi-tabs {
    gap: 6px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.fi-tabs-item {
    padding: 4px 12px;
    border-radius: 999px;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--pp-line);
}

.fi-tabs-item-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--pp-navy);
}

.fi-tabs-item.fi-active {
    background: var(--pp-blue);
    box-shadow: none;
}

.fi-tabs-item.fi-active .fi-tabs-item-label,
.fi-tabs-item.fi-active .fi-icon {
    color: #fff;
}

.dark .fi-tabs-item {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--pp-d-line);
}

.dark .fi-tabs-item-label {
    color: var(--pp-d-text);
}

.dark .fi-tabs-item.fi-active {
    background: var(--pp-blue);
}

/* ── Modals and dropdowns ────────────────────────────────────────────── */

.fi-modal-window {
    border-radius: 22px;
}

.fi-dropdown-panel {
    border-radius: 14px;
}

.dark .fi-modal-window,
.dark .fi-dropdown-panel {
    background: #111a33;
}

/* ── Login ─────────────────────────────────────────────────────────────────
 * Navy background with an intro on the left (render hook SIMPLE_LAYOUT_START,
 * guests only) and the form on the right. Stacked on a small screen.
 */

.fi-simple-layout:has(> .crm-auth-intro) {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 32px;
    padding: 32px 16px;
    background: linear-gradient(135deg, var(--pp-slate) 0%, var(--pp-navy) 50%, var(--pp-navy-2) 100%);
}

.fi-simple-layout:has(> .crm-auth-intro)::before,
.fi-simple-layout:has(> .crm-auth-intro)::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
}

.fi-simple-layout:has(> .crm-auth-intro)::before {
    left: -12%;
    top: 18%;
    width: min(70vw, 32rem);
    height: min(70vw, 32rem);
    border-radius: 50%;
    background: rgba(234, 240, 254, 0.1);
    filter: blur(64px);
}

.fi-simple-layout:has(> .crm-auth-intro)::after {
    right: -6%;
    bottom: 18%;
    width: min(50vw, 22rem);
    height: min(50vw, 22rem);
    border-radius: 7rem;
    background: rgba(37, 99, 235, 0.1);
    transform: rotate(18deg);
}

.fi-simple-layout:has(> .crm-auth-intro) .fi-simple-main-ctn {
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fi-simple-layout:has(> .crm-auth-intro) .fi-simple-main {
    width: 100%;
    max-width: 26.5rem;
    margin: 0;
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(10, 18, 48, 0.08);
    background: #fff;
}

@media (min-width: 1024px) {
    .fi-simple-layout:has(> .crm-auth-intro) {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 26.5rem);
        column-gap: 80px;
        padding: 40px max(48px, calc((100vw - 1152px) / 2));
    }
}

.crm-auth-intro {
    color: #fff;
}

.crm-auth-intro__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 11px;
    font-weight: 700;
}

.crm-auth-intro__pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pp-blue);
}

.crm-auth-intro__logo {
    display: block;
    height: 20px;
    width: auto;
    margin-top: 28px;
}

.crm-auth-intro__bar {
    width: 64px;
    height: 3px;
    margin-top: 28px;
    border-radius: 999px;
    background: var(--pp-blue);
}

.crm-auth-intro__title {
    margin: 16px 0 0;
    font-size: clamp(1.75rem, 4.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.crm-auth-intro__lead {
    margin: 16px 0 0;
    max-width: 28rem;
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.8);
}

.crm-auth-intro__points {
    list-style: none;
    margin: 40px 0 0;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 1024px) {
    .crm-auth-intro__points {
        display: flex;
    }
}

.crm-auth-intro__points li {
    display: flex;
    gap: 12px;
}

.crm-auth-intro__icon {
    flex: none;
    width: 32px;
    height: 32px;
    margin-top: 2px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-auth-intro__icon svg {
    width: 16px;
    height: 16px;
}

.crm-auth-intro__point-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.crm-auth-intro__point-text {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
}

/* ── Tokens of our own screens ─────────────────────────────────────────────
 * Same names as in board.css and friends (docs/03-ui.md §4), Bikemanager values.
 */

.crm-board,
.crm-agenda,
.crm-map,
.crm-report {
    --surface: #ffffff;
    --surface-raised: #f7f9fd;
    --border: #e7ecf5;
    --text: #0a1230;
    --text-muted: #475569;
    --accent: #2563eb;
    --radius: 14px;
}

.crm-agenda {
    --line: #eff2f8;
    --open: #eaf0fe;
    --open-edge: #c9d7fa;
    --off: #f2f5fa;
}

.dark .crm-board,
.dark .crm-agenda,
.dark .crm-map,
.dark .crm-report {
    --surface: rgba(24, 24, 27, 0.9);
    --surface-raised: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.1);
    --text: #e8ecf7;
    --text-muted: #a3adc7;
    --accent: #60a5fa;
}

.dark .crm-agenda {
    --line: rgba(255, 255, 255, 0.06);
    --open: rgba(96, 165, 250, 0.12);
    --open-edge: rgba(96, 165, 250, 0.35);
    --off: rgba(255, 255, 255, 0.03);
}

/* Filters on the boards: a select is as wide as its longest option (a long
   customer name), which pushed the toolbar past a phone screen. */
.crm-field {
    max-width: 100%;
}

@media (min-width: 1024px) {
    .crm-field {
        max-width: 20rem;
    }
}

/* ── Light/dark switch at the bottom of the sidebar ──────────────────── */

.crm-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 16px;
}

.crm-theme-toggle__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.55px;
    text-transform: uppercase;
    color: var(--pp-group);
}

.crm-theme-toggle__options {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: var(--pp-soft);
    box-shadow: inset 0 0 0 1px var(--pp-line);
}

.crm-theme-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pp-sub);
}

.crm-theme-toggle__btn:focus-visible {
    outline: none;
    box-shadow: var(--pp-ring);
}

.crm-theme-toggle__btn--on {
    background: #fff;
    color: var(--pp-navy);
    box-shadow: 0 1px 2px rgba(10, 18, 48, 0.08);
}

.crm-theme-toggle__icon {
    width: 16px;
    height: 16px;
}

.dark .crm-theme-toggle__label {
    color: rgba(255, 255, 255, 0.5);
}

.dark .crm-theme-toggle__options {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px var(--pp-d-line);
}

.dark .crm-theme-toggle__btn {
    color: var(--pp-d-sub);
}

.dark .crm-theme-toggle__btn--on {
    background: var(--pp-blue);
    color: #fff;
}
