/* =========================================================================
 * Pimbury Dental – portal refresh (CSS-only override)
 * Brand: blue #0072FF · green #00D180 · navy #001070
 * Load AFTER bootstrap.min.css and themes/pimbury/assets/css/style.css.
 * Works on the existing October CMS markup – no template changes needed.
 * ========================================================================= */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    /* Refreshed palette (keeps the existing variable names) */
    --pimbury-navy:        #001070;
    --pimbury-navy-deep:   #000A4D;
    --pimbury-blue:        #0072FF;
    --pimbury-blue-dark:   #005ACC;
    --pimbury-blue-light:  #E6F1FF;
    --pimbury-blue-soft:   #C2DCFF;
    --pimbury-teal:        #00D180;
    --pimbury-green:       #00D180;
    --pimbury-green-dark:  #00804F;
    --pimbury-red:         #B42318;
    --pimbury-amber:       #E08A00;

    --pimbury-grey-900:    #001070;
    --pimbury-grey-700:    #334155;
    --pimbury-grey-500:    #5B6B82;
    --pimbury-grey-300:    #D5DDE8;
    --pimbury-grey-200:    #E3E8EF;
    --pimbury-grey-100:    #EEF1F5;
    --pimbury-grey-50:     #F5F7FB;

    /* Bootstrap 5.3 tokens */
    --bs-body-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bs-body-color:       #001070;
    --bs-body-bg:          #F5F7FB;
    --bs-secondary-color:  #5B6B82;
    --bs-border-color:     #D5DDE8;
    --bs-border-radius:    8px;
    --bs-border-radius-lg: 10px;
    --bs-primary:          #0072FF;
    --bs-primary-rgb:      0, 114, 255;
    --bs-link-color:       #0072FF;
    --bs-link-color-rgb:   0, 114, 255;
    --bs-link-hover-color: #005ACC;
}

body {
    background: var(--pimbury-grey-50);
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------------
 * Sidebar
 * ------------------------------------------------------------------------- */
.sidebar {
    width: 248px !important;
    flex: none;
    background: #1C2B3F !important; /* same as dark tiles */
    padding: 12px 12px 24px;
}
.sidebar > .border-bottom { border-color: rgba(255,255,255,.08) !important; padding: 12px 8px 20px !important; }
/* Turn the white logo box into a clean white-on-navy logo */
.sidebar > .border-bottom > div { background: transparent !important; padding: 0 !important; }
.sidebar > .border-bottom img { filter: brightness(0) invert(1); max-width: 190px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    border-radius: 8px;
    padding: 10px 12px !important;
    font-size: 14px !important;
    font-weight: 500;
    color: rgba(255,255,255,.75) !important;
    margin-top: 2px !important;
}
.sidebar-link:hover { background: rgba(255,255,255,.06) !important; color: #fff !important; }
.sidebar-link.active { background: rgba(255,255,255,.1) !important; color: #fff !important; font-weight: 600; }

.submenu { background: transparent !important; padding: 4px 0 8px; }
.submenu a {
    border-radius: 6px;
    padding: 7px 12px 7px 24px !important;
    font-size: 13px !important;
    color: rgba(255,255,255,.6) !important;
}
.submenu a:hover { background: rgba(255,255,255,.06) !important; color: #fff !important; }
.submenu a.active, .submenu a.active:hover {
    background: transparent !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--pimbury-teal);
}

/* -------------------------------------------------------------------------
 * Page frame and header
 * ------------------------------------------------------------------------- */
#content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px clamp(16px, 4vw, 48px) 64px !important;
}
#content h1 { font-size: 30px; font-weight: 700 !important; letter-spacing: -0.02em; margin-bottom: 6px !important; }
#content h1 + p, #content .text-muted { color: var(--pimbury-grey-500) !important; font-size: 15px; }
#content > .mb-5:first-child, #content > .mb-4:first-child { margin-bottom: 28px !important; }
#content h2, #content h3, #content h4, #content h5 { font-weight: 600; letter-spacing: -0.01em; }
#content h3, #content h4 { font-size: 16px; }

/* Settings forms become a white card */
#content form > .row.g-4,
#content form > .row.g-3 {
    background: #fff;
    border: 1px solid var(--pimbury-grey-200);
    border-radius: 14px;
    padding: 24px 24px 28px;
    margin: 0 0 24px;
    --bs-gutter-x: 1rem;
}
#content hr { border-color: var(--pimbury-grey-200); opacity: 1; }

/* -------------------------------------------------------------------------
 * Forms
 * ------------------------------------------------------------------------- */
.form-label { font-size: 13px; font-weight: 600 !important; color: var(--pimbury-navy); margin-bottom: 6px; }
.form-text { font-size: 12px; color: var(--pimbury-grey-500); }

.form-control, .form-select {
    border-color: var(--pimbury-grey-300);
    border-radius: 8px;
    font-size: 14px;
    color: var(--pimbury-navy);
    background-color: #fff;
    min-height: 40px;
}
.form-control-lg, .form-select-lg {
    min-height: 44px;
    padding: 9px 12px;
    font-size: 14px !important;
    border-radius: 8px !important;
}
.form-control::placeholder { color: #6B7A90; }
.form-control:focus, .form-select:focus {
    border-color: var(--pimbury-blue);
    box-shadow: 0 0 0 3px rgba(0,114,255,.15);
}
.form-check-input { border-color: #B7C2D1; }
.form-check-input:checked { background-color: var(--pimbury-blue); border-color: var(--pimbury-blue); }
.form-switch .form-check-input { width: 2.6em; height: 1.45em; cursor: pointer; }
.form-switch .form-check-label { font-weight: 600; font-size: 14px; padding-left: 6px; }

/* Select2 to match */
.select2-container .select2-selection--single { height: 40px !important; border-color: var(--pimbury-grey-300) !important; border-radius: 8px !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px !important; }

/* Quill editors */
.ql-toolbar.ql-snow { border-color: var(--pimbury-grey-300); border-radius: 8px 8px 0 0; background: #F8FAFD; }
.ql-container.ql-snow { border-color: var(--pimbury-grey-300); border-radius: 0 0 8px 8px; font-family: inherit; font-size: 14px; }

/* -------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------- */
.btn { border-radius: 10px; font-weight: 600; font-size: 14px; padding: 9px 18px; }
.btn-lg { font-size: 14px; padding: 11px 22px; border-radius: 10px; }
.btn-primary { background: var(--pimbury-blue); border-color: var(--pimbury-blue); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--pimbury-blue-dark) !important; border-color: var(--pimbury-blue-dark) !important; }
.btn-success { background: var(--pimbury-blue); border-color: var(--pimbury-blue); }
.btn-success:hover { background: var(--pimbury-blue-dark); border-color: var(--pimbury-blue-dark); }
.btn-outline-primary, .btn-outline-secondary {
    background: #fff;
    color: var(--pimbury-navy) !important;
    border-color: var(--pimbury-grey-300) !important;
}
.btn-outline-primary:hover, .btn-outline-secondary:hover { background: #F1F4F9 !important; color: var(--pimbury-navy) !important; }
.btn-outline-danger, .btn-danger.btn-sm { border-radius: 8px; }

/* -------------------------------------------------------------------------
 * Cards, tables, alerts
 * ------------------------------------------------------------------------- */
.card { border: 1px solid var(--pimbury-grey-200); border-radius: 14px; box-shadow: none !important; }
.card-body { padding: 20px 24px; }
.table { --bs-table-border-color: var(--pimbury-grey-100); font-size: 14px; }
.table thead th { font-size: 12px; font-weight: 600; color: var(--pimbury-grey-500); background: #FAFBFD; text-transform: none; }
.alert { border-radius: 12px; }
.alert-success { background: #E5FAF1; border-color: #A8EBCF; color: var(--pimbury-green-dark); }
.alert-danger, .alert-error { background: #FDECEC; border-color: #F3C4C4; color: var(--pimbury-red); }
.alert-info { background: var(--pimbury-blue-light); border-color: var(--pimbury-blue-soft); color: var(--pimbury-blue-dark); }

/* -------------------------------------------------------------------------
 * Account setup hub tiles → white cards with icon chip
 * ------------------------------------------------------------------------- */
.setup-tile {
    background: #fff !important;
    color: var(--pimbury-navy) !important;
    border: 1px solid var(--pimbury-grey-200);
    border-radius: 12px;
    box-shadow: none;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 14px;
    padding: 18px;
    font-size: 15px;
    font-weight: 600;
    min-height: 76px;
}
.setup-tile i {
    flex: none;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--pimbury-blue-light);
    color: var(--pimbury-blue);
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
}
.setup-tile::after {
    content: "";
    margin-left: auto;
    width: 8px; height: 8px;
    border-right: 2px solid #9AA8BC; border-top: 2px solid #9AA8BC;
    transform: rotate(45deg);
}
.setup-tile:hover {
    background: #fff !important;
    color: var(--pimbury-navy) !important;
    border-color: #B9CCF2;
    box-shadow: 0 6px 18px rgba(0,16,112,.06);
    transform: translateY(-1px);
}
/* MyPimbury tile: Pimbury logo mark (bi-stethoscope doesn't exist in the loaded Bootstrap Icons, so the icon was blank) */
.setup-tile[href*="/account-setup/my-pimbury?"] i::before {
    content: "" !important; width: 22px; height: 22px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 59.53 59.53'%3E%3Cpath fill-rule='evenodd' d='M29.76,59.53C13.35,59.53,0,46.18,0,29.77S13.35,0,29.76,0s29.76,13.35,29.76,29.77-13.35,29.76-29.76,29.76h0ZM29.76,4.46C15.81,4.46,4.46,15.81,4.46,29.77s11.35,25.3,25.31,25.3,25.3-11.35,25.3-25.3S43.72,4.46,29.76,4.46h0Z'/%3E%3Cpath fill-rule='evenodd' d='M29.12,45.21c-.04-.05-.07-.1-.11-.16-1.19-3.54-2.69-5.15-2.59-8.12.12-3.47,3.46-6.5,1.22-9.93-1.35,1.63-3.83,2.5-2.4,4.74-1.03,1.59-2.7,1.54-4.18,1.61-.44-.61-.88-1.22-1.32-1.84,1.39-2.79-.1-6.05,1.05-8.88-1.31.4-2.28-1.51-2.66-2.73,1.83,1.19,2.65.19,4.47-.89,1.46-.87,2.86-.16,4.27-.52.69-.25.16-.69.7-.97.5.44.29.77.35,1.14,1.65-1,3.14-1.05,4.45.05.46.75-.8,0-1.14.35.84.52,2.09.09,3.29,1.35.65.68.82,1.82,1.49,2.41.85.74,2.17.41,2.76,1.26.56.81.12,1.55.18,2.19-.44-.56-1.05-2.26-2.3-1.59,1.84.38,1.34,3.74,2.36,4.57.88.72,2.78.07,1.24-1.82,1.94-.68,2.11,2.18.47,2.91.99.35,2.38-.87,1.66-1.89,1.86,1.81-.96,2.82-2.11,3.84-.39.34-.53.96-.89,1.34-1.22,1.23-2.45,1.25-3.39,1.74-4.23,2.22-4.94,6.22-6.87,9.81Z'/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 59.53 59.53'%3E%3Cpath fill-rule='evenodd' d='M29.76,59.53C13.35,59.53,0,46.18,0,29.77S13.35,0,29.76,0s29.76,13.35,29.76,29.77-13.35,29.76-29.76,29.76h0ZM29.76,4.46C15.81,4.46,4.46,15.81,4.46,29.77s11.35,25.3,25.31,25.3,25.3-11.35,25.3-25.3S43.72,4.46,29.76,4.46h0Z'/%3E%3Cpath fill-rule='evenodd' d='M29.12,45.21c-.04-.05-.07-.1-.11-.16-1.19-3.54-2.69-5.15-2.59-8.12.12-3.47,3.46-6.5,1.22-9.93-1.35,1.63-3.83,2.5-2.4,4.74-1.03,1.59-2.7,1.54-4.18,1.61-.44-.61-.88-1.22-1.32-1.84,1.39-2.79-.1-6.05,1.05-8.88-1.31.4-2.28-1.51-2.66-2.73,1.83,1.19,2.65.19,4.47-.89,1.46-.87,2.86-.16,4.27-.52.69-.25.16-.69.7-.97.5.44.29.77.35,1.14,1.65-1,3.14-1.05,4.45.05.46.75-.8,0-1.14.35.84.52,2.09.09,3.29,1.35.65.68.82,1.82,1.49,2.41.85.74,2.17.41,2.76,1.26.56.81.12,1.55.18,2.19-.44-.56-1.05-2.26-2.3-1.59,1.84.38,1.34,3.74,2.36,4.57.88.72,2.78.07,1.24-1.82,1.94-.68,2.11,2.18.47,2.91.99.35,2.38-.87,1.66-1.89,1.86,1.81-.96,2.82-2.11,3.84-.39.34-.53.96-.89,1.34-1.22,1.23-2.45,1.25-3.39,1.74-4.23,2.22-4.94,6.22-6.87,9.81Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* -------------------------------------------------------------------------
 * Chart archive – filter
 * ------------------------------------------------------------------------- */
form[data-request="onFilterData"] .card-body h5 { color: var(--pimbury-navy) !important; font-size: 16px; font-weight: 600; }
form[data-request="onFilterData"] .form-label { text-transform: lowercase; }
form[data-request="onFilterData"] .form-label::first-letter { text-transform: uppercase; }

.filter-pill {
    background: var(--pimbury-grey-100) !important;
    color: var(--pimbury-grey-500) !important;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 14px;
    opacity: 1 !important;
}
.filter-pill input[type="checkbox"] { accent-color: var(--pimbury-blue); }
.filter-pill:has(input:checked) {
    background: #fff !important;
    color: var(--pimbury-navy) !important;
    border-color: var(--pimbury-grey-300);
    box-shadow: 0 1px 2px rgba(0,16,112,.12);
}

/* -------------------------------------------------------------------------
 * Chart archive – tiles (layout shared by light and dark)
 * Live-portal layout: number + date at top, client + horse low down,
 * price and payment pill in a strip along the bottom, status icons
 * overlapping the top edge.
 * ------------------------------------------------------------------------- */

/* Grid: tiles never narrower than 220px, extra room above each row for the icons */
.row:has(> [class*="col"] > .chart-card) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 26px 16px;
    margin: 0;
    padding-top: 12px;
}
.row:has(> [class*="col"] > .chart-card) > [class*="col"] { width: auto; max-width: none; padding: 0; margin: 0 !important; }

.chart-card {
    border-radius: 14px;
    padding: 14px 16px 0;
    min-height: 210px;
}
.chart-card:hover { transform: translateY(-2px); }
.chart-link { margin-top: 0; }
.chart-content { display: flex; flex-direction: column; flex: 1; }
.chart-number { font-size: 16px; font-weight: 700; padding-right: 28px; }
.chart-date   { font-size: 12px; margin-top: 2px; }
.chart-client {
    font-size: 17px; font-weight: 600; line-height: 1.25;
    margin: auto 0 2px; padding-top: 28px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chart-horse  {
    font-size: 14px; font-weight: 600; margin-bottom: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chart-footer {
    margin: 0 -16px;
    padding: 10px 16px;
    gap: 8px;
    border-top: 0;
    border-radius: 0 0 12px 12px;
}
.chart-price { font-size: 15px; font-weight: 700; }
.status { font-size: 12px; font-weight: 600; padding: 4px 10px; white-space: nowrap; }

/* Status icons (PDF uploaded / sent): overlapping the top edge, checkbox stays in the corner */
.chart-top-right { top: -12px; right: 44px; gap: 4px; }
.chart-symbol {
    width: 24px; height: 24px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--pimbury-grey-50);
}
.chart-check {
    position: absolute; top: 24px; right: -32px;
    width: 18px; height: 18px; margin: 0;
}
.paid-submenu { border: 1px solid var(--pimbury-grey-200); border-radius: 10px; }
#content:has(.chart-card) { max-width: 1320px; }

/* ---- Light tiles (default) ---- */
.chart-card {
    background: #fff;
    color: var(--pimbury-navy);
    border: 2px solid var(--pimbury-grey-200);
    box-shadow: 0 1px 2px rgba(0,16,112,.04);
}
.chart-card:hover { box-shadow: 0 10px 24px rgba(0,16,112,.08); }
.chart-card:has(.chart-check:checked) { border-color: var(--pimbury-blue); box-shadow: 0 0 0 3px rgba(0,114,255,.15); }
.chart-number { color: var(--pimbury-navy); }
.chart-date   { color: var(--pimbury-grey-500); }
.chart-client { color: var(--pimbury-navy); }
.chart-horse  { color: var(--pimbury-blue); }
.chart-footer { background: #F1F4F9; }
.chart-price  { color: var(--pimbury-navy); }
.status.paid   { background: rgba(0,209,128,.12); color: var(--pimbury-green-dark); box-shadow: inset 0 0 0 1px rgba(0,209,128,.3); }
.status.unpaid { background: rgba(224,138,0,.12); color: #8A4B00; box-shadow: inset 0 0 0 1px rgba(224,138,0,.3); }
.chart-check  { accent-color: var(--pimbury-blue); }

/* ---- Dark tiles are the DEFAULT. To use light tiles instead, add class "light-tiles" to <body> ---- */
body:not(.light-tiles) .chart-card {
    background: #1C2B3F;
    color: #fff;
    border-color: #1C2B3F;
    box-shadow: 0 2px 6px rgba(0,16,112,.12);
}
body:not(.light-tiles) .chart-card:hover { box-shadow: 0 10px 24px rgba(0,16,112,.25); }
body:not(.light-tiles) .chart-card:has(.chart-check:checked) { border-color: var(--pimbury-teal); box-shadow: 0 0 0 3px rgba(0,209,128,.2); }
body:not(.light-tiles) .chart-number { color: #fff; }
body:not(.light-tiles) .chart-date   { color: rgba(255,255,255,.65); }
body:not(.light-tiles) .chart-client { color: #fff; }
body:not(.light-tiles) .chart-horse  { color: #8FB8F5; }
body:not(.light-tiles) .chart-footer { background: #273B57; }
body:not(.light-tiles) .chart-price  { color: #fff; }
body:not(.light-tiles) .status.paid   { background: rgba(0,209,128,.18); color: #4DE8A8; box-shadow: inset 0 0 0 1px rgba(0,209,128,.35); }
body:not(.light-tiles) .status.unpaid { background: rgba(255,176,32,.18); color: #FFCB73; box-shadow: inset 0 0 0 1px rgba(255,176,32,.35); }
body:not(.light-tiles) .chart-check   { accent-color: var(--pimbury-teal); }
body:not(.light-tiles) .chart-symbol  { box-shadow: none; }

/* -------------------------------------------------------------------------
 * Chart archive – filter panel layout
 * Order: Search | Client | Horse  /  From | To | Payment | Filter button
 * ------------------------------------------------------------------------- */
form[data-request="onFilterData"] .card { margin-bottom: 28px !important; }
form[data-request="onFilterData"] .card-body { padding: 16px 20px 20px; }
form[data-request="onFilterData"] .card-body > .d-flex:first-child { margin-bottom: 12px !important; }
form[data-request="onFilterData"] .card-body h5 { font-size: 15px !important; }
form[data-request="onFilterData"] .card-body small { font-size: 13px; color: var(--pimbury-grey-500); }
form[data-request="onFilterData"] .card-body small a { font-weight: 600; }

form[data-request="onFilterData"] .row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px 14px;
    margin: 0;
    align-items: end;
}
form[data-request="onFilterData"] .row > [class*="col"] { width: auto; max-width: none; padding: 0; margin: 0; }
form[data-request="onFilterData"] .row > :nth-child(3) { grid-column: span 5; order: 1; } /* search */
form[data-request="onFilterData"] .row > :nth-child(1) { grid-column: span 4; order: 2; } /* client */
form[data-request="onFilterData"] .row > :nth-child(2) { grid-column: span 3; order: 3; } /* horse  */
form[data-request="onFilterData"] .row > :nth-child(4) { grid-column: span 3; order: 4; } /* from   */
form[data-request="onFilterData"] .row > :nth-child(5) { grid-column: span 3; order: 5; } /* to     */
form[data-request="onFilterData"] .row > :nth-child(6) { grid-column: span 3; order: 6; } /* paid   */
form[data-request="onFilterData"] .row > :nth-child(7) { grid-column: span 3; order: 7; } /* button */

form[data-request="onFilterData"] .form-label { margin-bottom: 6px; font-size: 12px; color: var(--pimbury-grey-500); font-weight: 600 !important; }
form[data-request="onFilterData"] .form-control,
form[data-request="onFilterData"] .form-select { height: 40px; min-height: 40px; }


/* Search icon */
form[data-request="onFilterData"] input[name="search"] {
    padding-left: 38px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B82' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 16px;
}

/* Payment toggle as a segmented control */
form[data-request="onFilterData"] .row > :nth-child(6) .d-flex {
    display: flex; gap: 2px !important;
    padding: 3px; height: 40px; box-sizing: border-box;
    background: var(--pimbury-grey-100); border-radius: 9px;
}
form[data-request="onFilterData"] .filter-pill {
    flex: 1; justify-content: center;
    height: 34px; padding: 0 12px;
    border-radius: 7px; border: 0;
    background: transparent !important;
}
form[data-request="onFilterData"] .filter-pill:has(input:checked) { background: #fff !important; }

form[data-request="onFilterData"] button[type="submit"] { height: 40px; padding: 0 16px; }

@media (max-width: 991px) {
    form[data-request="onFilterData"] .row > [class*="col"] { grid-column: span 6 !important; }
    form[data-request="onFilterData"] .row > :nth-child(3),
    form[data-request="onFilterData"] .row > :nth-child(7) { grid-column: span 12 !important; }
}
@media (max-width: 575px) {
    form[data-request="onFilterData"] .row > [class*="col"] { grid-column: span 12 !important; }
}

/* -------------------------------------------------------------------------
 * Chart archive – day headings (inserted by pimbury-day-groups.js)
 * ------------------------------------------------------------------------- */
.chart-day-heading {
    grid-column: 1 / -1;
    display: flex; align-items: baseline; gap: 10px;
    margin: 8px 0 -10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pimbury-grey-200);
    font-size: 15px; font-weight: 700;
    color: var(--pimbury-navy);
}
.chart-day-heading:first-child { margin-top: 0; }
.chart-day-heading span { font-size: 13px; font-weight: 500; color: var(--pimbury-grey-500); }

/* -------------------------------------------------------------------------
 * Chart archive – make the filter panel stand out
 * ------------------------------------------------------------------------- */
form[data-request="onFilterData"] .card {
    border: 1px solid #C2DCFF;
    box-shadow: 0 8px 24px rgba(0,16,112,.07) !important;
    overflow: hidden;
}
form[data-request="onFilterData"] .card-body > .d-flex:first-child {
    margin: -16px -20px 16px !important;
    padding: 12px 20px;
    background: var(--pimbury-blue-light);
    border-bottom: 1px solid #C2DCFF;
}
form[data-request="onFilterData"] .card-body h5 {
    display: flex; align-items: center; gap: 10px;
    font-size: 16px !important; font-weight: 700 !important;
}
form[data-request="onFilterData"] .card-body h5::before {
    content: "";
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--pimbury-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16l-6 8v5l-4 2v-7z'/%3E%3C/svg%3E") no-repeat center / 16px;
}
form[data-request="onFilterData"] .card-body small,
form[data-request="onFilterData"] .card-body small a { color: var(--pimbury-blue-dark); }

/* Tile spacing and corner radius */
.row:has(> [class*="col"] > .chart-card) { gap: 34px 22px; }
.chart-card { border-radius: 18px; }
.chart-footer { border-radius: 0 0 16px 16px; }

/* -------------------------------------------------------------------------
 * Sidebar – clearer hierarchy: icons on main links, guide line on sub-items,
 * stronger active states, Upgrade highlighted, Logout separated
 * ------------------------------------------------------------------------- */
.sidebar nav { gap: 4px; }
.sidebar-link {
    display: flex !important; align-items: center; gap: 12px;
    font-size: 15px !important; font-weight: 600 !important;
    color: rgba(255,255,255,.88) !important;
    padding: 11px 12px !important;
}
.sidebar-link::before {
    content: ""; flex: none; width: 18px; height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon) no-repeat center / contain; mask: var(--icon) no-repeat center / contain;
    opacity: .85;
}
.sidebar-link[href*="chart-archive"]   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E"); }
.sidebar-link[href*="account-setup"]   { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h10M18 7h2M4 17h4M12 17h8'/%3E%3Ccircle cx='16' cy='7' r='2'/%3E%3Ccircle cx='10' cy='17' r='2'/%3E%3C/svg%3E"); }
.sidebar-link[href*="account-upgrade"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E"); }
.sidebar-link[data-request="onLogout"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h3M16 16l4-4-4-4M20 12H10'/%3E%3C/svg%3E"); }

.sidebar-link.active {
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--pimbury-green);
}
.sidebar-link.active::before { opacity: 1; color: var(--pimbury-green); background: var(--pimbury-green); }

/* Sub-items: indented under their parent with a guide line */
.submenu {
    margin: 4px 0 8px 20px;
    padding: 2px 0 2px 10px !important;
    border-left: 1px solid rgba(255,255,255,.14);
}
.submenu a {
    font-size: 13.5px !important; font-weight: 500;
    color: rgba(255,255,255,.7) !important;
    padding: 7px 10px !important;
}
.submenu a.active, .submenu a.active:hover {
    background: rgba(255,255,255,.1) !important;
    color: #fff !important;
    box-shadow: none;
    font-weight: 600;
}
.submenu a.active::before {
    content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--pimbury-green); margin-right: 8px; vertical-align: middle;
}

/* Upgrade highlighted, Logout separated and quieter */
.sidebar-link[href*="account-upgrade"] {
    margin-top: 12px !important;
    color: var(--pimbury-green) !important;
    background: rgba(0,209,128,.1);
    box-shadow: inset 0 0 0 1px rgba(0,209,128,.25);
}
.sidebar-link[href*="account-upgrade"]:hover { background: rgba(0,209,128,.16) !important; color: var(--pimbury-green) !important; }
.sidebar-link[data-request="onLogout"] {
    margin-top: 12px !important;
    padding-top: 14px !important;
    border-top: 1px solid rgba(255,255,255,.1);
    border-radius: 0;
    font-weight: 500 !important;
    color: rgba(255,255,255,.6) !important;
}
.sidebar-link[data-request="onLogout"]:hover { background: transparent !important; color: #fff !important; }

/* Sidebar accents in brand blue (lighter tint for icons/text on the dark menu) */
.sidebar-link.active { box-shadow: inset 3px 0 0 var(--pimbury-blue); }
.sidebar-link.active::before { color: #4D9CFF; background: #4D9CFF; }
.submenu a.active::before { background: #4D9CFF; }
.sidebar-link[href*="account-upgrade"] {
    color: #7AB4FF !important;
    background: rgba(0,114,255,.16);
    box-shadow: inset 0 0 0 1px rgba(0,114,255,.4);
}
.sidebar-link[href*="account-upgrade"]:hover { background: rgba(0,114,255,.24) !important; color: #A3CBFF !important; }

/* -------------------------------------------------------------------------
 * Login / register / forgotten password (login.css pages)
 * White card on the dark menu colour, white logo sitting above the card
 * ------------------------------------------------------------------------- */
body:has(.login-container) {
    background: #1C2B3F radial-gradient(1200px 600px at 50% 0%, rgba(0,114,255,.28), transparent 60%) !important;
    color: var(--pimbury-navy);
    font-family: var(--bs-body-font-family);
    padding: 120px 16px 40px;
    box-sizing: border-box;
    min-height: 100vh; height: auto;
}
.login-container {
    max-width: 400px;
    background: #fff;
    border: 0;
    border-radius: 20px;
    padding: 36px 32px 28px;
    box-shadow: 0 24px 60px rgba(0,8,40,.35);
    color: var(--pimbury-navy);
    text-align: left;
}
.login-container .logo {
    position: absolute;
    top: -84px; left: 50%; transform: translateX(-50%);
    width: 240px; margin: 0;
}
.login-container h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; color: var(--pimbury-navy); }
.login-container > p { color: var(--pimbury-grey-500); font-size: 14px; margin: 0 0 24px; }
.login-container .form-group { margin-bottom: 16px; }
.login-container .form-group label { font-size: 13px; font-weight: 600; color: var(--pimbury-navy); margin-bottom: 6px; }
.login-container .form-group input {
    height: 44px; padding: 0 12px; box-sizing: border-box;
    background: #fff; color: var(--pimbury-navy);
    border: 1px solid var(--pimbury-grey-300); border-radius: 10px; font-size: 15px;
}
.login-container .form-group input::placeholder { color: #6B7A90; }
.login-container .form-group input:focus { border-color: var(--pimbury-blue); box-shadow: 0 0 0 3px rgba(0,114,255,.15); }
.login-container .options-row { align-items: center; margin: 4px 0 20px; font-size: 13px; color: var(--pimbury-grey-700); }
.login-container .options-row span { display: inline-flex; align-items: center; gap: 8px; }
.login-container .options-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--pimbury-blue); }
.login-container .options-row a,
.login-container .signup-text a { color: var(--pimbury-blue); font-weight: 600; }
.login-container .btn-primary {
    display: block; width: 100%; height: 46px; padding: 0;
    border-radius: 10px; background: var(--pimbury-blue); font-size: 15px; font-weight: 600;
}
.login-container .btn-primary:hover { background: var(--pimbury-blue-dark); }
.login-container .signup-text {
    margin: 22px -32px -28px; padding: 16px 32px;
    border-top: 1px solid var(--pimbury-grey-100);
    background: #F8FAFD; border-radius: 0 0 20px 20px;
    font-size: 14px; color: var(--pimbury-grey-500);
}

/* Paid / unpaid popup (opens above the tile) – clearer menu */
.chart-card:hover { z-index: 20; }
.paid-submenu {
    left: 8px; right: 8px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--pimbury-grey-200);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0,16,112,.22), 0 2px 6px rgba(0,16,112,.08);
}
.paid-submenu::after { /* small pointer towards the tile */
    content: ""; position: absolute; left: 50%; bottom: -6px;
    width: 12px; height: 12px; background: #fff;
    border-right: 1px solid var(--pimbury-grey-200); border-bottom: 1px solid var(--pimbury-grey-200);
    transform: translateX(-50%) rotate(45deg);
}
.paid-submenu::before { /* invisible bridge so the menu stays open while moving onto it */
    content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
}
.paid-submenu-content { padding: 6px; }
.switch-paid {
    display: flex !important; align-items: center; gap: 10px;
    padding: 9px 10px !important;
    border-radius: 8px;
    font-size: 14px; font-weight: 600;
    color: var(--pimbury-navy) !important;
}
.switch-paid::before {
    content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
    background: var(--pimbury-green);
}
.switch-paid[data-action="unpaid"]::before { background: var(--pimbury-amber); }
.switch-paid:hover { background: var(--pimbury-blue-light) !important; color: var(--pimbury-blue-dark) !important; }

/* -------------------------------------------------------------------------
 * Settings grouping and order (sidebar sub-menu + Account Setup tiles)
 * Groups: Settings / Account / Client portal / Export / Import.
 * Order and spacing only – no added text, so translations are unaffected.
 * Remove this section once the order is changed in the templates.
 * ------------------------------------------------------------------------- */
#accountSetup .submenu { display: flex; flex-direction: column; }
#accountSetup .submenu a[href*="/account-setup/chart-setup?"] { order: 1; }
#accountSetup .submenu a[href*="/account-setup/treatments?"] { order: 2; }
#accountSetup .submenu a[href*="/account-setup/sedations?"] { order: 3; }
#accountSetup .submenu a[href*="/account-setup/payment-types?"] { order: 4; }
#accountSetup .submenu a[href*="/account-setup/advanced?"] { order: 5; }
#accountSetup .submenu a[href*="/account-setup/emails?"] { order: 6; }
#accountSetup .submenu a[href*="/account-setup/xero-details?"] { order: 7; }
#accountSetup .submenu a[href*="/account-setup/your-details?"] { order: 8; margin-top: 14px; }
#accountSetup .submenu a[href*="/account-setup/billing-details?"] { order: 9; }
#accountSetup .submenu a[href*="/account-setup/users?"] { order: 10; }
#accountSetup .submenu a[href*="/account-setup/my-pimbury?"] { order: 11; margin-top: 14px; }
#accountSetup .submenu a[href*="/account-setup/chart-export-setup?"] { order: 12; margin-top: 14px; }
#accountSetup .submenu a[data-request="onClientExport"] { order: 13; }
#accountSetup .submenu a[href*="/account-setup/client-import?"] { order: 14; margin-top: 14px; }
#accountSetup .submenu a[href*="/account-setup/horse-import?"] { order: 15; }
.row:has(> div > .setup-tile) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; }
.row:has(> div > .setup-tile) > div { width: auto; max-width: none; padding: 0; margin: 0; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/chart-setup?"]) { order: 1; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/treatments?"]) { order: 2; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/sedations?"]) { order: 3; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/payment-types?"]) { order: 4; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/advanced?"]) { order: 5; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/emails?"]) { order: 6; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/xero-details?"]) { order: 7; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/your-details?"]) { order: 8; grid-column-start: 1; margin-top: 22px; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/billing-details?"]) { order: 9; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/users?"]) { order: 10; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/my-pimbury?"]) { order: 11; grid-column-start: 1; margin-top: 22px; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/chart-export-setup?"]) { order: 12; grid-column-start: 1; margin-top: 22px; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/client-import?"]) { order: 13; grid-column-start: 1; margin-top: 22px; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/horse-import?"]) { order: 14; }
.row:has(> div > .setup-tile) { align-items: end; }
@media (max-width: 991px) { .row:has(> div > .setup-tile) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .row:has(> div > .setup-tile) { grid-template-columns: minmax(0, 1fr); } }

/* -------------------------------------------------------------------------
 * Sign-up / registration flow (register.css pages: plan, details, terms,
 * payment, welcome) – matches the login screen
 * ------------------------------------------------------------------------- */
body:has(.body-container) {
    background: #1C2B3F radial-gradient(1200px 600px at 50% 0%, rgba(0,114,255,.28), transparent 60%) !important;
    font-family: var(--bs-body-font-family) !important;
    font-weight: 400 !important;
    color: var(--pimbury-navy);
}
.body-container { justify-content: center; padding: 24px 16px 48px; box-sizing: border-box; }
.form-side { flex: 0 1 760px; background: transparent !important; padding: 16px 0 !important; }
.form-side > .row:first-child img { filter: brightness(0) invert(1); width: 220px !important; }
.form-side .card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0,8,40,.35);
    padding: 32px 32px 28px !important;
}
.form-side .card h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--pimbury-navy); margin-bottom: 20px !important; }
.form-side .text-muted { color: var(--pimbury-grey-500) !important; }

/* Stepper */
.pimbury-stepper { margin: 4px 0 28px; }
.pimbury-stepper::before { top: 15px; height: 2px; background: var(--pimbury-grey-200); }
.pimbury-stepper li { font-size: 12px; font-weight: 600; color: var(--pimbury-grey-500); }
.pimbury-stepper li::before {
    width: 32px; height: 32px; line-height: 28px; margin-bottom: 8px;
    border: 2px solid var(--pimbury-grey-300); background: #fff; color: var(--pimbury-grey-500); font-size: 13px;
}
.pimbury-stepper li.is-complete { color: var(--pimbury-grey-700); }
.pimbury-stepper li.is-complete::before { background: var(--pimbury-green); border-color: var(--pimbury-green); color: #fff; }
.pimbury-stepper li.is-active { color: var(--pimbury-blue); }
.pimbury-stepper li.is-active::before {
    background: var(--pimbury-blue); border-color: var(--pimbury-blue); color: #fff;
    box-shadow: 0 0 0 5px rgba(0,114,255,.15);
}

/* Order summary box */
.form-side .card .border.rounded {
    background: #F8FAFD !important;
    border-color: var(--pimbury-grey-200) !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
}
.form-side .card .border.rounded > .d-flex { padding: 6px 0; font-size: 14px; }
.form-side .card .border.rounded > .d-flex strong { font-weight: 500; color: var(--pimbury-grey-500); }
.form-side .card .border.rounded > .d-flex > span:last-child { font-weight: 600; color: var(--pimbury-navy); }
.form-side .card .border.rounded hr { margin: 8px 0 !important; border-color: var(--pimbury-grey-200); opacity: 1; }
.form-side .card .border.rounded > .d-flex:last-child { font-size: 16px; }
.form-side .card .border.rounded > .d-flex:last-child strong { color: var(--pimbury-navy); font-weight: 700; }
.form-side .card .border.rounded > .d-flex:last-child > span:last-child { font-weight: 700; }

/* Buttons and secure note */
.form-side .btn-lg { height: 48px; padding: 0 32px !important; border-radius: 10px; font-size: 15px; }
/* Back is a link styled as a button: centre its text like the Continue button */
.form-side .btn-lg { display: inline-flex !important; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.form-side .btn-outline-secondary {
    border: 1px solid var(--pimbury-grey-300) !important; background: #fff !important;
    color: var(--pimbury-navy) !important; font-weight: 600;
}
.form-side .btn-outline-secondary::before {
    content: ""; width: 16px; height: 16px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
}
.form-side .btn-outline-secondary:hover { border-color: var(--pimbury-blue-soft) !important; background: var(--pimbury-blue-light) !important; color: var(--pimbury-blue) !important; }
.form-side .btn-lg.btn-outline-secondary { padding: 0 22px 0 16px !important; }
.form-side p.small { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.form-side p.small::before {
    content: ""; flex: none; width: 16px; height: 16px; background: var(--pimbury-green);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* Stepper colours need !important: the page's own stepper styles load after this file */
.pimbury-stepper li { color: var(--pimbury-grey-500) !important; }
.pimbury-stepper li::before { border-color: var(--pimbury-grey-300) !important; background: #fff !important; color: var(--pimbury-grey-500) !important; }
.pimbury-stepper li.is-complete { color: var(--pimbury-grey-700) !important; }
.pimbury-stepper li.is-complete::before { background: var(--pimbury-green) !important; border-color: var(--pimbury-green) !important; color: #fff !important; }
.pimbury-stepper li.is-active { color: var(--pimbury-blue) !important; }
.pimbury-stepper li.is-active::before { background: var(--pimbury-blue) !important; border-color: var(--pimbury-blue) !important; color: #fff !important; }

/* -------------------------------------------------------------------------
 * Sign-up: Choose your plan (register step 1) – matches the Upgrade plan tiles
 * The page's own plan styles load after this file, hence the !important
 * ------------------------------------------------------------------------- */
.form-side .card h2#heading {
    text-transform: none !important; color: var(--pimbury-navy) !important;
    font-size: 24px !important; font-weight: 700 !important; letter-spacing: -0.02em; margin-bottom: 6px !important;
}
.form-side .card h2#heading + .text-muted { font-size: 14px; margin-bottom: 24px !important; }
.form-side .card .form-label { font-size: 13px; font-weight: 600 !important; color: var(--pimbury-grey-700); margin-bottom: 6px; }
.form-side .card #currency-select {
    height: 44px; max-width: 220px; padding: 0 40px 0 14px;
    border: 1px solid var(--pimbury-grey-300); border-radius: 10px; background-color: #fff;
    font-size: 15px; font-weight: 500; color: var(--pimbury-navy);
}
.form-side .card #currency-select:focus { border-color: var(--pimbury-blue); box-shadow: 0 0 0 4px rgba(0,114,255,.14); }

.plans-list { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px !important; }
.plan-box {
    display: flex !important;
    border: 2px solid var(--pimbury-grey-200) !important;
    border-radius: 16px !important;
    background: #fff;
    transition: border-color .15s, box-shadow .15s, transform .15s !important;
}
.plan-box:hover { border-color: var(--pimbury-blue-soft) !important; box-shadow: 0 10px 24px rgba(0,16,112,.08); transform: translateY(-2px); }
.plan-content {
    flex: 1; position: relative;
    padding: 20px 20px 18px !important;
    border-radius: 14px !important;
    background: #fff !important; color: var(--pimbury-navy) !important;
    text-align: left;
    display: flex; flex-direction: column;
}
/* radio indicator, top right */
.plan-content::after {
    content: ""; position: absolute; top: 18px; right: 18px;
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #B7C2D1; box-sizing: border-box; background: #fff;
}
.plan-content h3 {
    font-size: 17px !important; font-weight: 700 !important; line-height: 1.3;
    color: var(--pimbury-navy); margin: 0 32px 0 0 !important;
}
.plan-content hr { display: none; }
.plan-content p { flex: 1; display: flex; flex-direction: column; gap: 14px; margin: 8px 0 0 !important; font-size: 13px; line-height: 1.5; color: var(--pimbury-grey-700); }
.plan-content p br { display: none; }
.plan-content p strong {
    display: block; margin-top: auto; padding-top: 12px;
    border-top: 1px solid var(--pimbury-grey-100);
    font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--pimbury-navy);
}
/* selected plan: blue outline and filled radio instead of a solid blue tile */
.plan-box:has(input:checked), .plans-list .plan-box.level-current {
    border-color: var(--pimbury-blue) !important;
    box-shadow: 0 0 0 4px rgba(0,114,255,.14);
}
.plan-box input[type="radio"]:checked + .plan-content,
.plans-list .plan-box.level-current .plan-content { background: #F5F9FF !important; color: var(--pimbury-navy) !important; }
.plan-box input[type="radio"]:checked + .plan-content::after,
.plans-list .plan-box.level-current .plan-content::after {
    border-color: var(--pimbury-blue);
    background: var(--pimbury-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") no-repeat center / 12px;
}
@media (max-width: 575px) {
    .plans-list { grid-template-columns: minmax(0, 1fr); gap: 12px !important; }
    .form-side .card #currency-select { max-width: none; }
}

/* -------------------------------------------------------------------------
 * Account plans (upgrade page) – plan tiles
 * ------------------------------------------------------------------------- */
.upgrade-plans-list { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.upgrade-plan-box {
    display: flex;
    border: 2px solid var(--pimbury-grey-200) !important;
    border-radius: 16px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.upgrade-plan-box:hover { border-color: var(--pimbury-blue-soft) !important; box-shadow: 0 10px 24px rgba(0,16,112,.08); transform: translateY(-2px); }
.upgrade-plan-content {
    flex: 1;
    display: flex; flex-direction: column;
    padding: 22px 22px 20px !important;
    border-radius: 14px;
    background: #fff !important;
    color: var(--pimbury-navy) !important;
    position: relative;
}
/* radio indicator, top right */
.upgrade-plan-content::after {
    content: ""; position: absolute; top: 20px; right: 20px;
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #B7C2D1; box-sizing: border-box; background: #fff;
}
.upgrade-plan-content h4 { font-size: 18px; font-weight: 700; color: var(--pimbury-navy); margin: 0 32px 2px 0 !important; }
.upgrade-plan-content > small { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--pimbury-grey-500) !important; }
.upgrade-plan-content hr { display: none; }
.upgrade-plan-content > div { margin-top: 14px; font-size: 14px; line-height: 1.5; color: var(--pimbury-grey-700); flex: 1; }
.upgrade-plan-content > p {
    margin-top: 18px !important; padding-top: 14px;
    border-top: 1px solid var(--pimbury-grey-100);
}
.upgrade-plan-content > p strong { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--pimbury-navy); }
.upgrade-plan-content > p strong small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--pimbury-grey-500); }

/* selected plan: blue outline and filled radio instead of a solid blue tile */
.upgrade-plan-box:has(input:checked) {
    border-color: var(--pimbury-blue) !important;
    box-shadow: 0 0 0 4px rgba(0,114,255,.14);
}
.upgrade-plan-box input[type="radio"]:checked + .upgrade-plan-content { background: #F5F9FF !important; color: var(--pimbury-navy) !important; }
.upgrade-plan-box input[type="radio"]:checked + .upgrade-plan-content::after {
    border-color: var(--pimbury-blue);
    background: var(--pimbury-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") no-repeat center / 12px;
}

/* current plan badge (text comes from the theme) */
.upgrade-plan-box.is-current::before {
    top: -12px !important; left: 18px !important;
    background: var(--pimbury-green) !important; color: var(--pimbury-navy) !important; /* navy text on brand green for contrast */
    padding: 3px 10px !important; border-radius: 999px !important;
    font-size: 11px !important; font-weight: 600; letter-spacing: .02em;
}

/* -------------------------------------------------------------------------
 * Chart archive filter – date fields (native date inputs)
 * Larger, rounder, teal calendar icon and teal highlight on the
 * day / month / year segments instead of the system (orange) highlight
 * ------------------------------------------------------------------------- */
form[data-request="onFilterData"] input[type="date"] {
    box-sizing: border-box;
    height: 44px !important; min-height: 44px !important;
    /* explicit top/bottom padding: Safari doesn't centre date text vertically on its own */
    padding: 10px 46px 10px 14px;
    line-height: 20px;
    border-radius: 12px;
    font-size: 14px; font-weight: 500;
    color: var(--pimbury-navy);
    color-scheme: light;
    /* calendar chip drawn on the field itself, so it also shows in Safari (which has no picker icon) */
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Crect width='28' height='28' rx='8' fill='%2300D180' fill-opacity='.14'/%3E%3Cg fill='none' stroke='%2300A866' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7.5' y='8.5' width='13' height='12' rx='1.6'/%3E%3Cpath d='M7.5 12.5h13M11 6.5v3M17 6.5v3'/%3E%3C/g%3E%3C/svg%3E") no-repeat right 8px center / 28px 28px;
    -webkit-appearance: none; appearance: none;
    text-align: left;
}
form[data-request="onFilterData"] input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
form[data-request="onFilterData"] input[type="date"]:focus {
    border-color: var(--pimbury-green);
    box-shadow: 0 0 0 3px rgba(0,209,128,.2);
}
form[data-request="onFilterData"] input[type="date"]::-webkit-datetime-edit { padding: 0; }
form[data-request="onFilterData"] input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
form[data-request="onFilterData"] input[type="date"]::-webkit-datetime-edit-day-field,
form[data-request="onFilterData"] input[type="date"]::-webkit-datetime-edit-month-field,
form[data-request="onFilterData"] input[type="date"]::-webkit-datetime-edit-year-field { padding: 2px 3px; border-radius: 5px; }
form[data-request="onFilterData"] input[type="date"]::-webkit-datetime-edit-day-field:focus,
form[data-request="onFilterData"] input[type="date"]::-webkit-datetime-edit-month-field:focus,
form[data-request="onFilterData"] input[type="date"]::-webkit-datetime-edit-year-field:focus {
    background: var(--pimbury-green);
    color: var(--pimbury-navy);
    outline: none;
}
/* Chrome/Edge: keep the browser's picker button but make it invisible, sitting over the chip */
form[data-request="onFilterData"] input[type="date"] { position: relative; }
form[data-request="onFilterData"] input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; margin: 0; padding: 0;
    opacity: 0; cursor: pointer;
}
form[data-request="onFilterData"] input[type="date"]:hover { background-color: #FBFDFF; }
/* keep every filter control the same height as the date fields */
form[data-request="onFilterData"] .form-control,
form[data-request="onFilterData"] .form-select { height: 44px; min-height: 44px; border-radius: 12px; }
form[data-request="onFilterData"] .row > :nth-child(6) .d-flex { height: 44px; border-radius: 12px; }
form[data-request="onFilterData"] .filter-pill { height: 38px; border-radius: 9px; }
form[data-request="onFilterData"] button[type="submit"] { height: 44px; border-radius: 12px; }

/* Stronger hover shadow on chart tiles */
.chart-card:hover { box-shadow: 0 18px 40px rgba(0,16,112,.18), 0 4px 10px rgba(0,16,112,.08); transform: translateY(-3px); }
body:not(.light-tiles) .chart-card:hover { box-shadow: 0 18px 40px rgba(0,16,112,.38), 0 4px 10px rgba(0,16,112,.18); }

/* Day heading chart count badge (number only) */
.chart-day-heading { align-items: center; }
.chart-day-heading .chart-day-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 22px; padding: 0 8px; box-sizing: border-box;
    border-radius: 999px;
    background: var(--pimbury-blue-light); color: var(--pimbury-blue-dark);
    font-size: 12px; font-weight: 700;
}

/* =========================================================================
 * Mobile / small tablet (below 768px)
 * The sidebar becomes a compact bar across the top: logo, main links in a
 * row, and the open section's sub-menu as a horizontally scrolling strip.
 * ========================================================================= */
@media (max-width: 767.98px) {
    body:has(.sidebar) { flex-direction: column; }
    .sidebar {
        width: 100% !important;
        min-height: 0 !important;
        padding: 10px 12px 8px !important;
        gap: 0;
    }
    .sidebar > .border-bottom { padding: 4px 4px 10px !important; border-bottom: 0 !important; }
    .sidebar > .border-bottom img { max-width: 150px; }

    .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 6px; margin-top: 0 !important; }
    .sidebar nav > .sidebar-link { order: 1; }
    .sidebar nav > .collapse { order: 2; flex: 0 0 100%; min-width: 0; max-width: 100%; }
    .sidebar nav > .collapse > .submenu { min-width: 0; max-width: 100%; }
    .sidebar-link {
        font-size: 13px !important;
        padding: 8px 10px !important;
        margin: 0 !important;
        gap: 8px;
    }
    .sidebar-link::before { width: 16px; height: 16px; }
    .sidebar-link[href*="account-upgrade"] { margin-top: 0 !important; }
    .sidebar-link[data-request="onLogout"] {
        margin: 0 0 0 auto !important; padding: 8px 10px !important;
        border-top: 0; border-radius: 8px;
    }

    /* open section's sub-menu: one scrolling row of pills */
    .sidebar .submenu {
        display: flex !important; flex-direction: row !important;
        gap: 6px;
        margin: 4px 0 2px !important; padding: 0 0 6px !important;
        border-left: 0;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar .submenu::-webkit-scrollbar { display: none; }
    .sidebar .submenu a {
        flex: none; white-space: nowrap;
        padding: 6px 12px !important;
        border-radius: 999px;
        background: rgba(255,255,255,.07);
        margin-top: 0 !important;
    }
    /* group gaps become horizontal gaps */
    #accountSetup .submenu a[href*="/account-setup/your-details?"],
    #accountSetup .submenu a[href*="/account-setup/my-pimbury?"],
    #accountSetup .submenu a[href*="/account-setup/chart-export-setup?"],
    #accountSetup .submenu a[href*="/account-setup/client-import?"] { margin-top: 0 !important; margin-left: 12px; }

    /* page content */
    #content { padding: 20px 16px 48px !important; }
    #content h1 { font-size: 24px; }
    #content form > .row.g-4, #content form > .row.g-3 { padding: 18px 16px 20px; }
    #content > .mb-5:first-child.d-flex, #content > .mb-4:first-child.d-flex { flex-wrap: wrap; gap: 12px; }

    /* chart archive */
    form[data-request="onFilterData"] .card-body > .d-flex:first-child { flex-wrap: wrap; gap: 6px; }
    .row:has(> [class*="col"] > .chart-card) { grid-template-columns: minmax(0, 1fr); gap: 30px; }
    .chart-card { min-height: 170px; }
    .chart-client { padding-top: 16px; }

    /* login / registration */
    body:has(.login-container) { padding-top: 104px; }
    .login-container { padding: 28px 20px 24px; }
    .login-container .signup-text { margin: 20px -20px -24px; padding: 14px 20px; }
    .form-side .card { padding: 24px 18px 22px !important; }
    .pimbury-stepper li { font-size: 10px; }
    .pimbury-stepper li::before { width: 26px; height: 26px; line-height: 22px; font-size: 11px; }
    .pimbury-stepper::before { top: 12px; }
}

/* Client Export tile (added to the Account Setup page by the developers) – place it in the Export group */
.row:has(> div > .setup-tile) > div:has(> .setup-tile[data-request="onClientExport"]) { order: 13; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/client-import?"]) { order: 14; }
.row:has(> div > .setup-tile) > div:has(> .setup-tile[href*="/account-setup/horse-import?"]) { order: 15; }

/* Tablet (768–991px): allow two chart tiles per row beside the sidebar */
@media (min-width: 768px) and (max-width: 991.98px) {
    .row:has(> [class*="col"] > .chart-card) { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* -------------------------------------------------------------------------
 * Collapsible filter panel (behaviour from pimbury-day-groups.js)
 * ------------------------------------------------------------------------- */
form[data-request="onFilterData"] .card-body > .d-flex[data-collapsible] { cursor: pointer; user-select: none; }
form[data-request="onFilterData"] .card-body > .d-flex[data-collapsible] h5::after {
    content: ""; width: 10px; height: 10px; margin-left: 2px;
    border-right: 2px solid var(--pimbury-blue-dark); border-bottom: 2px solid var(--pimbury-blue-dark);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .2s;
}
form[data-request="onFilterData"] .card.is-collapsed .card-body > .d-flex[data-collapsible] h5::after { transform: rotate(-45deg); }
form[data-request="onFilterData"] .card.is-collapsed .card-body { padding-bottom: 0; }
form[data-request="onFilterData"] .card.is-collapsed .card-body > .d-flex:first-child { margin-bottom: 0 !important; border-bottom: 0; }
form[data-request="onFilterData"] .card.is-collapsed .card-body > .d-flex:first-child ~ * { display: none !important; }
form[data-request="onFilterData"] .card-body > .d-flex[data-collapsible]:focus-visible { outline: 2px solid var(--pimbury-blue); outline-offset: -2px; }

/* -------------------------------------------------------------------------
 * Mobile menu drawer (below 768px)
 * The script in pimbury-day-groups.js adds the menu button and the
 * `has-drawer` class on <body>. Without the script, the compact top bar
 * above (links in a row + sub-menu pills) is used instead.
 * ------------------------------------------------------------------------- */
.pr-menu-btn, .pr-menu-backdrop { display: none; }
@media (max-width: 767.98px) {
body.has-drawer .sidebar {
    position: sticky; top: 0; z-index: 60;
    flex-direction: row !important; align-items: center; justify-content: space-between;
    padding: 8px 12px !important;
}
body.has-drawer .sidebar > .border-bottom { padding: 4px !important; }
body.has-drawer .pr-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 0; border-radius: 10px;
    background: rgba(255,255,255,.08); color: #fff; cursor: pointer;
}
body.has-drawer .pr-menu-btn::before {
    content: ""; width: 20px; height: 20px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") no-repeat center / contain;
}
body.has-drawer .sidebar nav {
    position: fixed !important; top: 0; bottom: 0; left: 0; z-index: 80;
    width: 290px; max-width: 85vw;
    padding: 20px 14px 32px; margin: 0 !important;
    background: #1C2B3F;
    flex-direction: column !important; flex-wrap: nowrap !important; gap: 4px !important;
    overflow-y: auto;
    /* closed: fully off screen, no shadow, and hidden from keyboard/screen readers */
    transform: translateX(-100%); visibility: hidden; box-shadow: none;
    transition: transform .25s ease, box-shadow .25s ease, visibility 0s linear .25s;
}
body.has-drawer.nav-open .sidebar nav {
    transform: translateX(0); visibility: visible;
    box-shadow: 12px 0 40px rgba(0,8,40,.35);
    transition: transform .25s ease, box-shadow .25s ease, visibility 0s;
}
body.has-drawer .pr-menu-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55; border: 0; /* below the sidebar's stacking layer (60), so it never covers the drawer */
    background: rgba(0,8,40,.5); opacity: 0; pointer-events: none; transition: opacity .25s;
}
body.has-drawer.nav-open .pr-menu-backdrop { opacity: 1; pointer-events: auto; }
body.has-drawer.nav-open { overflow: hidden; }
/* inside the drawer, restore the desktop sidebar look */
body.has-drawer .sidebar nav > .sidebar-link,
body.has-drawer .sidebar nav > .collapse { order: 0 !important; flex: none !important; }
body.has-drawer .sidebar-link { font-size: 15px !important; padding: 11px 12px !important; }
body.has-drawer .sidebar-link[href*="account-upgrade"] { margin-top: 12px !important; }
body.has-drawer .sidebar-link[data-request="onLogout"] {
    margin: 12px 0 0 !important; padding-top: 14px !important;
    border-top: 1px solid rgba(255,255,255,.1); border-radius: 0;
}
body.has-drawer .sidebar .submenu {
    flex-direction: column !important; flex-wrap: nowrap;
    overflow: visible; gap: 0;
    margin: 4px 0 8px 20px !important; padding: 2px 0 2px 10px !important;
    border-left: 1px solid rgba(255,255,255,.14);
}
body.has-drawer .sidebar .submenu a { background: transparent; border-radius: 6px; padding: 7px 10px !important; }
body.has-drawer #accountSetup .submenu a[href*="/account-setup/your-details?"],
body.has-drawer #accountSetup .submenu a[href*="/account-setup/my-pimbury?"],
body.has-drawer #accountSetup .submenu a[href*="/account-setup/chart-export-setup?"],
body.has-drawer #accountSetup .submenu a[href*="/account-setup/client-import?"] { margin-left: 0; margin-top: 14px !important; }
}
