/* =========================
   SETTINGS / REPORT EXPORT
   ========================= */

.settings-page {
    padding: 28px 32px 40px;
}

.settings-heading {
    margin-bottom: 24px;
}

.settings-heading h1 {
    margin: 6px 0 4px;
}

.settings-heading p {
    color: var(--muted);
}


/* Main two-column layout */

.report-export-panel {
    display: block;
}

.report-options {
    width: 100%;
    max-width: 900px;
}


/* LEFT OPTIONS PANEL */

.report-options {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
}

.report-options h2 {
    margin: 6px 0 6px;
}

.report-description {
    color: var(--muted);
    margin-bottom: 20px;
}

.report-option-group {
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.report-option-group h3 {
    margin: 0 0 10px;
    font-size: 13px;
}

.report-orientation,
.report-check {
    display: flex;
    gap: 10px;
    align-items: center;
}

.report-check[hidden] {
    display: none;
}

.report-orientation {
    gap: 18px;
}

.report-orientation label,
.report-check {
    cursor: pointer;
}

.report-check {
    margin: 8px 0;
}

.report-check.fixed {
    opacity: 0.7;
    cursor: default;
}

/* =========================================
   REPORT BRANDING
========================================= */

.report-branding-field {
    display: flex;
    flex-direction: column;
    gap: 6px;

    margin-top: 12px;
}

.report-branding-field span {
    font-size: 12px;
    font-weight: 700;
}

.report-branding-field input {
    width: 100%;
    padding: 10px 12px;

    background: var(--background);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 8px;

    font: inherit;
    outline: none;
}

.report-branding-field input:focus {
    border-color: var(--accent);
}

.report-branding-field input::placeholder {
    color: var(--muted);
}


/* PRINT BUTTON */

.report-print-button {
    width: 100%;
    margin-top: 14px;
    padding: 12px 16px;

    border: 1px solid var(--accent);
    border-radius: 8px;

    background: var(--accent);
    color: white;

    font-weight: 700;
    cursor: pointer;
}


/* RIGHT PREVIEW */

.report-preview-area {
    min-width: 0;
}

.report-preview-heading {
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted);
}


/* Fake paper */

.report-preview-page {
    margin: 0 auto;

    background: #ffffff;
    color: #1f2933;

    border-radius: 4px;

    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.28);

    padding: 30px;

    transition:
        width 0.2s ease,
        min-height 0.2s ease;
}


/* Portrait sample */

.report-preview-page.portrait {
    width: min(100%, 520px);
    min-height: 700px;
}


/* Landscape sample */

.report-preview-page.landscape {
    width: min(100%, 760px);
    min-height: 470px;
}


/* Header */

.preview-report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.preview-report-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #5B7C99;
}

.preview-project-name {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 700;
}

.preview-date {
    margin-top: 4px;
    font-size: 11px;
    color: #68737d;
}


/* THIS IS THE IMPORTANT LOGO FIX */

.preview-report-logo {
    width: 110px;
    max-width: 110px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    transform: translateY(-25px);
}


/* Report content */

.preview-rule {
    height: 1px;
    margin: 22px 0;
    background: #d9dee3;
}

.preview-section-title {
    margin: 18px 0 9px;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;

    color: #5B7C99;
}

.preview-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.preview-summary-grid > div {
    border: 1px solid #dde2e6;
    border-radius: 5px;
    padding: 10px;
}

.preview-summary-grid span {
    display: block;
    font-size: 7px;
    color: #7b858e;
}

.preview-summary-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 13px;
}

.preview-space-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 18px;

    padding: 9px 0;

    border-bottom: 1px solid #e5e8eb;

    font-size: 10px;
}

.preview-space-row span {
    color: #68737d;
}

.preview-report-footer {
    margin-top: 28px;
    padding-top: 12px;

    border-top: 1px solid #e5e8eb;

    text-align: center;
    font-size: 8px;
    color: #8b949c;
}

.report-preview-note {
    margin-top: 10px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
}



/* Responsive */

@media (max-width: 950px) {

    .report-export-panel {
        grid-template-columns: 1fr;
    }

    .report-preview-page {
        width: 100% !important;
    }

}
.report-space-selection {
    margin: 4px 0 8px 24px;
}

.report-space-choice {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.report-space-picker {
    margin-top: 10px;
    max-height: 180px;
    overflow-y: auto;

    padding: 8px 10px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--background);
}

.report-space-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 6px 2px;

    font-size: 12px;
}

.report-space-picker-row + 
.report-space-picker-row {
    border-top: 1px solid var(--border);
}

.report-warning-overlay {
    position: fixed;
    inset: 0;

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

    padding: 20px;

    background: rgba(0, 0, 0, 0.65);

    z-index: 9999;
}

.report-warning-overlay[hidden] {
    display: none;
}

.report-warning-modal {
    width: min(100%, 420px);

    padding: 24px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.45);

    text-align: center;
}

.report-warning-modal h3 {
    margin: 0 0 12px;
    font-size: 22px;
}

.report-warning-modal p {
    margin: 0;

    color: var(--muted);
    line-height: 1.5;
}

.report-warning-actions {
    display: flex;
    justify-content: center;
    gap: 12px;

    margin-top: 22px;
}

.report-warning-cancel,
.report-warning-continue {
    min-width: 120px;
    padding: 10px 16px;

    border-radius: 8px;

    font-weight: 700;
    cursor: pointer;
}

.report-warning-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: inherit;
}

.report-warning-continue {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: white;
}

/* =========================================
   REPORT HELP
========================================= */

.report-option-with-help {
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-help-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.report-help-button {
    width: 18px;
    height: 18px;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: transparent;
    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
    cursor: help;
}

.report-help-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.report-help-popup {
    position: absolute;
    left: 26px;
    bottom: 50%;
    transform: translateY(50%);

    z-index: 100;

    width: 280px;
    padding: 10px 12px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;

    color: var(--text);
    font-size: 12px;
    line-height: 1.45;

    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.15s ease;
}

.deposit-help-wrap .report-help-popup {
    left: 75px;
    bottom: 10px;
    transform: none;
}

.cost-help-wrap .report-help-popup {
    left: 170px;
    bottom: -12px;
    transform: none;
}

.report-help-wrap:hover .report-help-popup,
.report-help-wrap:focus-within .report-help-popup {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   CALENDAR REPORT OPTIONS
========================================= */

.report-calendar-options {
    display: none;
    gap: 12px;
    margin: 8px 0 8px 22px;
}

.report-calendar-options.active {
    display: flex;
    flex-wrap: wrap;
}

.report-calendar-options label {
    display: flex;
    flex-direction: column;
    gap: 5px;

    color: var(--muted);
    font-size: 11px;
}

.report-calendar-options select {
    min-width: 170px;
    padding: 7px 9px;

    background: var(--background);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;

    font: inherit;
    outline: none;
}

.report-calendar-options select:focus {
    border-color: var(--accent);
}

.report-calendar-hint {
    flex-basis: 100%;
    margin-top: 10px;

    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.report-calendar-options select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* =========================================
   REPORT EXPORT - UI POLISH
========================================= */

.report-options {
    max-width: 900px;
    padding: 22x;

    border-radius: 12px;
}

.report-export-header {
    padding-bottom: 18px;
}

.report-export-header h2 {
    margin: 6px 0 5px;

    font-size: 26px;
}

.report-export-header .page-label {
    color: var(--accent);
}

.report-description {
    margin: 0;

    font-size: 15px;
}


/* =========================================
   SECTIONS
========================================= */

.report-section {
    padding: 16px 0;

    border-top: 1px solid var(--border);
}

.report-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 10px;
}

.report-section-heading h3 {
    margin: 0;

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

.report-section-heading p {
    margin: 4px 0 0;

    color: var(--muted);
    font-size: 12px;
}


/* =========================================
   CHECKS
========================================= */

.report-check {
    min-height: 26px;

    margin: 6px 0;

    font-size: 14px;
}

.report-check input {
    width: 16px;
    height: 16px;

    accent-color: var(--accent);
}


/* =========================================
   ORIENTATION
========================================= */

.report-orientation {
    display: flex;
    gap: 14px;

    margin-top: 12px;
}

.report-choice-card {
    display: flex;
    align-items: center;
    gap: 10px;

    min-width: 150px;

    padding: 11px 16px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--background);

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.report-choice-card:hover {
    border-color: var(--accent);
}

.report-choice-card:has(input:checked) {
    border-color: var(--accent);

    background:
        color-mix(
            in srgb,
            var(--accent) 8%,
            var(--background)
        );
}

.report-choice-card input {
    width: 17px;
    height: 17px;

    accent-color: var(--accent);
}


/* =========================================
   CALENDAR
========================================= */

.report-calendar-card {
    margin-top: 10px;

    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--background);
}

.report-calendar-title {
    font-size: 13px;
    font-weight: 700;
}

.report-calendar-description {
    margin-top: 3px;

    color: var(--muted);
    font-size: 11px;
}

.report-calendar-fields {
    display: grid;

    grid-template-columns:
        minmax(180px, 1fr)
        minmax(180px, 1fr)
        minmax(180px, 0.9fr);

    gap: 18px;

    align-items: end;

    margin-top: 14px;
}

.report-calendar-fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;

    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

#reportCalendarMonth1,
#reportCalendarMonth2 {
    width: 100%;

    padding: 10px 12px;

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 8px;

    font: inherit;
    outline: none;

    cursor: pointer;
}

#reportCalendarMonth1:focus,
#reportCalendarMonth2:focus {
    border-color: var(--accent);
}

#reportCalendarMonth2:disabled {
    opacity: 0.45;

    cursor: not-allowed;
}

.report-calendar-hint {
    margin: 0;
    padding-bottom: 9px;

    color: var(--muted);
    font-size: 11px;
}


/* =========================================
   SPACES
========================================= */

.report-space-selection {
    margin:
        10px 0
        12px
        24px;
}

.report-space-choice {
    gap: 9px;
}

.report-space-choice label {
    display: flex;
    align-items: center;
    gap: 8px;

    cursor: pointer;
}

.report-space-choice input {
    accent-color: var(--accent);
}

.report-space-picker {
    margin-top: 12px;

    max-height: 190px;

    padding: 6px 12px;

    background: var(--background);

    border-radius: 9px;
}

.report-space-picker-row {
    min-height: 32px;
}


/* =========================================
   BRANDING
========================================= */

.report-branding-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(0, 1fr);

    gap: 18px;
}

.report-branding-field {
    margin-top: 0;
}

.report-branding-field span {
    font-size: 12px;
}

.report-branding-field input {
    min-height: 42px;

    background: var(--background);
}


/* =========================================
   OTHER SECTIONS
========================================= */

.report-other-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}

.report-other-grid .report-check {
    margin: 0;
}


/* =========================================
   PRINT BUTTON
========================================= */

.report-print-button {
    min-height: 42px;

    margin-top: 8px;

    border-radius: 9px;

    font-size: 14px;

    transition:
        filter 0.15s ease,
        transform 0.15s ease;
}

.report-print-button:hover {
    filter: brightness(1.08);
}

.report-print-button:active {
    transform: translateY(1px);
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 800px) {

    .report-calendar-fields,
    .report-branding-grid,
    .report-other-grid {
        grid-template-columns: 1fr;
    }

    .report-calendar-hint {
        padding-bottom: 0;
    }

}

@media (max-width: 520px) {

    .settings-page {
        padding: 20px 14px 32px;
    }

    .report-options {
        padding: 20px 16px;
    }

    .report-orientation {
        flex-direction: column;
    }

    .report-choice-card {
        width: 100%;
    }

}
