/* =========================================================
   RideMonkey Bike Settings — Page Styling
   ========================================================= */

.rm-service-setup {
    width: 100%;
}

.rm-service-setup .rm-page-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.rm-service-schedule-card {
    width: 100%;
    padding: 18px;

    background: #ffffff;

    border: 1px solid #dddddd;
    border-radius: 14px;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.rm-service-schedule-intro {
    margin: 0 0 16px;

    color: #666666;

    font-size: 13px;
    line-height: 1.5;
}

.rm-service-schedule-note {
    padding: 10px 12px;

    background: #fdf4ea;
    border-radius: 8px;

    color: #8a5a00;
}

.rm-service-schedule-reminder-section {
    margin-top: 8px;
    padding-top: 16px;

    border-top: 2px solid #f0f0f0;
}

.rm-service-schedule-row {
    display: flex;

    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;

    padding: 12px 0;

    border-bottom: 1px solid #f0f0f0;
}

.rm-service-schedule-row:last-of-type {
    border-bottom: none;
}

/* The Schedule tab's rows are <details> elements (expandable),
   while the reminder-lead-time row further down reuses this
   same class as a plain <div> — this override only applies to
   the genuine <details> ones, stacking summary above the
   inputs instead of placing them side by side. */
details.rm-service-schedule-row {
    display: block;
}

.rm-service-schedule-row-summary {
    display: flex;

    align-items: center;
    justify-content: space-between;
    gap: 12px;

    cursor: pointer;
    list-style: none;
}

.rm-service-schedule-row-summary::-webkit-details-marker {
    display: none;
}

.rm-service-schedule-toggle-label {
    display: flex;
    flex-shrink: 0;

    align-items: center;
    gap: 3px;

    color: #ff4b00;
    white-space: nowrap;

    font-size: 12px;
    font-weight: 600;
}

.rm-service-schedule-toggle-label::after {
    content: '▾';

    font-size: 9px;
}

details[open] > .rm-service-schedule-row-summary .rm-service-schedule-toggle-label::after {
    content: '▴';
}

details.rm-service-schedule-row .rm-service-schedule-inputs {
    margin-top: 10px;
}

.rm-service-schedule-type {
    flex: 1 1 120px;

    color: #222222;

    font-size: 14px;
    font-weight: 600;
}

.rm-service-schedule-inputs {
    display: flex;

    gap: 10px;
}

.rm-service-schedule-input-group {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

.rm-service-schedule-input-group span {
    color: #666666;

    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.rm-service-schedule-input-group input {
    width: 72px;
    padding: 8px 10px;

    background: #ffffff;

    border: 1px solid #dddddd;
    border-radius: 8px;

    color: #222222;

    font-size: 14px;
}

.rm-service-schedule-input-group input:focus {
    outline: none;

    border-color: #ff4b00;
}


/* ---------------------------------------------------------
   Add custom service type
   --------------------------------------------------------- */

.rm-add-custom-type-form {
    margin-bottom: 20px;
    padding-bottom: 16px;

    border-bottom: 1px solid #f0f0f0;
}

.rm-add-custom-type-row {
    display: flex;

    gap: 8px;
    margin-top: 6px;
}

.rm-add-custom-type-row input {
    flex: 1;
    padding: 9px 12px;

    background: #ffffff;

    border: 1px solid #dddddd;
    border-radius: 8px;

    color: #222222;

    font-size: 14px;
}

.rm-add-custom-type-row button {
    padding: 9px 16px;

    background: #faf9f6;

    border: 1px solid #dddddd;
    border-radius: 8px;

    color: #222222;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.rm-add-custom-type-row button:hover {
    border-color: #ff4b00;

    color: #ff4b00;
}


/* ---------------------------------------------------------
   Custom types list — delete
   --------------------------------------------------------- */

.rm-custom-types-list {
    margin-bottom: 20px;
    padding-bottom: 16px;

    border-bottom: 1px solid #f0f0f0;
}

.rm-delete-custom-type-form {
    display: flex;

    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    padding: 8px 12px;

    background: #faf9f6;

    border: 1px solid #eeeeee;
    border-radius: 8px;
}

.rm-custom-type-name {
    color: #222222;

    font-size: 13px;
    font-weight: 600;
}

.rm-delete-custom-type-button {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;
    padding: 0;

    background: none;

    border: 1px solid #dddddd;
    border-radius: 50%;

    color: #666666;

    font-size: 12px;
    line-height: 1;

    cursor: pointer;
}

.rm-delete-custom-type-button:hover {
    border-color: #c0392b;

    background: #fdecea;
    color: #c0392b;
}


/* ---------------------------------------------------------
   "Usually also covers" — per-row configuration
   --------------------------------------------------------- */

.rm-service-schedule-covers {
    width: 100%;
    margin-top: 8px;
}

.rm-service-schedule-covers summary {
    color: #666666;
    cursor: pointer;

    font-size: 12px;
    font-weight: 600;
}

.rm-service-schedule-covers-options {
    display: flex;
    flex-wrap: wrap;

    gap: 6px 16px;
    margin-top: 8px;
}

.rm-covers-checkbox {
    display: flex;

    align-items: center;
    gap: 6px;

    color: #222222;

    font-size: 13px;
}


/* ---------------------------------------------------------
   Tabs — pure CSS, radio-driven, no JS
   --------------------------------------------------------- */

.rm-tab-radio {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.rm-tab-labels {
    display: flex;

    gap: 0;
    margin-bottom: 20px;
    padding-bottom: 14px;

    border-bottom: 2px solid #f0f0f0;
}

.rm-tab-label {
    flex: 1;
    padding: 8px 12px;

    background: #faf9f6;

    border: 1px solid #dddddd;
    border-radius: 8px;

    color: #222222;
    cursor: pointer;
    text-align: center;

    font-size: 13px;
    font-weight: 600;
}

.rm-tab-label:first-of-type {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.rm-tab-label:last-of-type {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.rm-tab-panel {
    display: none;
}

#rm-tab-schedule:checked ~ .rm-tab-panel-schedule {
    display: block;
}

#rm-tab-services:checked ~ .rm-tab-panel-services {
    display: block;
}

#rm-tab-schedule:checked ~ .rm-tab-labels label[for="rm-tab-schedule"],
#rm-tab-services:checked ~ .rm-tab-labels label[for="rm-tab-services"] {
    background: #ff4b00;
    border-color: #ff4b00;

    color: #ffffff;
}


/* ---------------------------------------------------------
   Interval hints (informational only, not auto-filled)
   --------------------------------------------------------- */

.rm-service-schedule-hint {
    display: block;
    margin-top: 2px;

    color: #999999;

    font-size: 11px;
    font-weight: 400;
    font-style: italic;
}


/* ---------------------------------------------------------
   Services Setup — coverage rows (no interval inputs, just
   the covers checkboxes)
   --------------------------------------------------------- */

.rm-service-coverage-row {
    padding: 14px 0;

    border-bottom: 1px solid #f0f0f0;
}

.rm-service-coverage-row:last-of-type {
    border-bottom: none;
}

.rm-service-coverage-row .rm-service-schedule-type {
    display: block;
    margin-bottom: 8px;
}


/* ---------------------------------------------------------
   Services Setup — tier cards (name/hint + expand-to-covers)
   --------------------------------------------------------- */

.rm-service-tier-card {
    margin-bottom: 12px;
    padding: 14px 16px;

    background: #faf9f6;

    border: 1px solid #eeeeee;
    border-radius: 12px;
}

.rm-service-tier-card-header {
    display: flex;
    align-items: center;
}

.rm-service-tier-covers-expand {
    margin-top: 10px;
    padding-top: 10px;

    border-top: 1px solid #eeeeee;
}

.rm-service-tier-covers-expand summary {
    color: #ff4b00;
    cursor: pointer;

    font-size: 13px;
    font-weight: 600;
}

.rm-service-tier-covers-expand .rm-service-schedule-covers-options {
    margin-top: 10px;
}


/* ---------------------------------------------------------
   Services Setup — section headings
   --------------------------------------------------------- */

.rm-service-setup-heading {
    margin: 0 0 14px;
    padding-bottom: 8px;

    border-bottom: 2px solid #ff4b00;

    color: #222222;

    font-size: 15px;
    font-weight: 700;
}

.rm-service-setup-heading-secondary {
    margin-top: 24px;
}


/* ---------------------------------------------------------
   Services Setup — save button (centred, smaller, orange —
   scoped to this button only, not the shared .rm-form-submit
   used elsewhere throughout the app)
   --------------------------------------------------------- */

.rm-coverage-save-row {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.rm-coverage-save-button {
    padding: 10px 28px;

    background: #ff4b00 !important;

    border: none !important;
    border-radius: 20px !important;

    color: #ffffff !important;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.rm-coverage-save-button:hover {
    background: #e04300 !important;
}


/* ---------------------------------------------------------
   Services Setup — inner sub-tabs (Standard / Custom)
   --------------------------------------------------------- */

.rm-subtab-labels {
    display: flex;

    gap: 0;
    margin-bottom: 16px;
}

.rm-subtab-labels .rm-tab-label {
    border-radius: 8px;
}

.rm-subtab-labels .rm-tab-label:first-of-type {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.rm-subtab-labels .rm-tab-label:last-of-type {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.rm-subtab-panel {
    display: none;
}

#rm-subtab-standard:checked ~ .rm-subtab-panel-standard {
    display: block;
}

#rm-subtab-custom:checked ~ .rm-subtab-panel-custom {
    display: block;
}

#rm-subtab-standard:checked ~ .rm-subtab-labels label[for="rm-subtab-standard"],
#rm-subtab-custom:checked ~ .rm-subtab-labels label[for="rm-subtab-custom"] {
    background: #ff4b00;
    border-color: #ff4b00;

    color: #ffffff;
}


/* ---------------------------------------------------------
   Custom services — create card and per-service edit/delete
   --------------------------------------------------------- */

.rm-custom-service-create-card {
    margin-bottom: 20px;
    padding: 16px;

    background: #ffffff;

    border: 1px solid #dddddd;
    border-radius: 14px;
}

.rm-custom-service-create-card .rm-form-field {
    margin-bottom: 14px;
}

.rm-delete-custom-type-button-full {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;

    background: #ffffff;

    border: 1px solid #c0392b;
    border-radius: 8px;

    color: #c0392b;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.rm-delete-custom-type-button-full:hover {
    background: #fdecea;
}


/* ---------------------------------------------------------
   Service History Report — generate form
   --------------------------------------------------------- */

.rm-report-generate-row {
    display: flex;
    flex-wrap: wrap;

    gap: 16px;
    margin-bottom: 12px;
}

.rm-report-generate-radio {
    display: flex;

    align-items: center;
    gap: 6px;

    color: #222222;

    font-size: 13px;
    font-weight: 600;
}

.rm-report-generate-costs {
    margin-bottom: 4px;
}

@media (max-width: 767px) {

    .rm-service-schedule-card {
        padding: 14px;
    }

    .rm-service-schedule-input-group input {
        width: 64px;
    }

}