
/* SCUZO RC6 REPORTS ONLY */

:is(#reportsView,#financialsPanel) {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Table readability */

:is(#reportsView,#financialsPanel) :is(.table-wrap,.report-table-wrap,
.table-responsive) {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

:is(#reportsView,#financialsPanel) table {
    table-layout: auto !important;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

:is(#reportsView,#financialsPanel) table :is(th,td) {
    padding: 10px 12px !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    vertical-align: middle !important;
    line-height: 1.45 !important;
    font-size: 13px !important;
}

:is(#reportsView,#financialsPanel) table :is(.right,.num,.numeric,
.amount,.text-right,[data-type="number"]) {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

:is(#reportsView,#financialsPanel) table :is(.product-name,.item-name) {
    white-space: normal !important;
    min-width: 140px !important;
}

/* Professional report controls */

:is(#reportsView,#financialsPanel) button {
    min-height: 44px !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    box-sizing: border-box !important;
    cursor: pointer;
}

:is(#reportsView,#financialsPanel) button:not(:disabled):is(
.primary,.btn-primary,[type="submit"]
) {
    background: #155E75 !important;
    color: #FFFFFF !important;
    border: 1px solid #155E75 !important;
}

:is(#reportsView,#financialsPanel) button:focus-visible {
    outline: 3px solid #38BDF8 !important;
    outline-offset: 2px;
}

:is(#reportsView,#financialsPanel) button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Save buttons and editable table rows */

:is(#reportsView,#financialsPanel) table button {
    min-width: 88px !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    flex-shrink: 0 !important;
}

:is(#reportsView,#financialsPanel) table input {
    min-width: 110px !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
}

:is(#reportsView,#financialsPanel) table input[type="number"] {
    text-align: right !important;
}

/* Accessible status contrast */

:is(#reportsView,#financialsPanel) :is(.success,.text-success,
.status-success,.alert-success,
.notice-success,.msg-success) {
    color: #DCFCE7 !important;
    background-color: #14532D !important;
}

:is(#reportsView,#financialsPanel) :is(.error,.text-danger,
.status-error,.alert-danger,
.notice-error,.msg-error) {
    color: #FEE2E2 !important;
    background-color: #7F1D1D !important;
}

/* Responsive reports */

@media (max-width: 768px) {

    :is(#reportsView,#financialsPanel) :is(.report-tabs,.report-actions,
    .financial-actions,.report-toolbar) {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        min-width: 0 !important;
    }

    :is(#reportsView,#financialsPanel) :is(.report-tabs,.report-actions,
    .financial-actions,.report-toolbar)
    button {
        flex: 1 1 auto;
    }

    :is(#reportsView,#financialsPanel) table {
        min-width: max-content !important;
    }

    :is(#reportsView,#financialsPanel) :not(.table-wrap,
    .report-table-wrap,
    .table-responsive) > table {
        display: block !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: auto !important;
    }

    :is(#reportsView,#financialsPanel) table button {
        min-width: 88px !important;
        white-space: nowrap !important;
    }
}


/* RC6.1 - consolidated report refinement */

:is(#reportsView,#financialsPanel) {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

:is(#reportsView,#financialsPanel) table {
    table-layout: auto !important;
    font-variant-numeric: tabular-nums;
}

:is(#reportsView,#financialsPanel) table th,
:is(#reportsView,#financialsPanel) table td {
    min-width: 64px;
    padding: 10px 12px !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    line-height: 1.45 !important;
    vertical-align: middle !important;
}

:is(#reportsView,#financialsPanel) table th:first-child,
:is(#reportsView,#financialsPanel) table td:first-child {
    min-width: 120px;
    text-align: left;
}

:is(#reportsView,#financialsPanel) table :is(
    .numeric,.num,.amount,.text-right,
    [data-type="number"]
) {
    white-space: nowrap !important;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

:is(#reportsView,#financialsPanel) table button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 88px !important;
    min-height: 44px !important;
    width: auto !important;
    padding: 10px 14px !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    flex-shrink: 0 !important;
}

:is(#reportsView,#financialsPanel) table input {
    min-width: 120px !important;
    min-height: 44px !important;
}

:is(#reportsView,#financialsPanel) button {
    border-radius: 8px !important;
    min-height: 44px !important;
    font-weight: 600 !important;
    letter-spacing: .1px;
    line-height: 1.3 !important;
}

#financialsPanel .fin-warning {
    color: #FEF3C7 !important;
    background: #422006 !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    line-height: 1.5 !important;
}

:is(#reportsView,#financialsPanel) :is(.success,.text-success,
.alert-success,.status-success) {
    color: #DCFCE7 !important;
    background: #14532D !important;
}

:is(#reportsView,#financialsPanel) :is(.error,.text-danger,
.alert-danger,.status-error) {
    color: #FEE2E2 !important;
    background: #7F1D1D !important;
}

@media (max-width: 768px) {

    :is(#reportsView,#financialsPanel) :is(.table-wrap,.report-table-wrap,
    .table-responsive) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    :is(#reportsView,#financialsPanel) :is(.table-wrap,.report-table-wrap,
    .table-responsive) > table {
        width: max-content !important;
        min-width: 100% !important;
    }

    :is(#reportsView,#financialsPanel) > table,
    :is(#reportsView,#financialsPanel) :not(.table-wrap,.report-table-wrap,
    .table-responsive) > table {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    :is(#reportsView,#financialsPanel) button {
        max-width: 100%;
    }
}



/* ===== RC6.1 Remaining Live Fixes ===== */

/* 1) Force readable report status text on blue/violet backgrounds */
#financialsPanel .fin-warning,
#financialsPanel .fin-msg,
#financialsPanel .fin-status,
#reportsView .fin-warning,
#reportsView .fin-msg,
#reportsView .fin-status,
#financialsPanel p[style*="color: green"],
#financialsPanel p[style*="color:green"],
#financialsPanel span[style*="color: green"],
#financialsPanel span[style*="color:green"],
#reportsView p[style*="color: green"],
#reportsView p[style*="color:green"],
#reportsView span[style*="color: green"],
#reportsView span[style*="color:green"] {
    color: #EAF4FF !important;
    background: rgba(9, 22, 60, 0.28) !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
    display: inline-block !important;
    max-width: 100% !important;
}

/* 2) Keep DRAFT / month / helper lines readable */
#financialsPanel .fin-warning,
#financialsPanel .draft,
#reportsView .draft {
    margin-top: 8px !important;
    margin-bottom: 10px !important;
}

/* 3) Add proper spacing between report sections/cards */
#financialsPanel > * + *,
#reportsView > * + * {
    margin-top: 12px !important;
}

#financialsPanel .table-wrap,
#financialsPanel .report-table-wrap,
#financialsPanel .table-responsive,
#reportsView .table-wrap,
#reportsView .report-table-wrap,
#reportsView .table-responsive,
#financialsPanel .card,
#financialsPanel .report-card,
#financialsPanel .summary-card,
#reportsView .card,
#reportsView .report-card,
#reportsView .summary-card,
#financialsPanel .panel,
#reportsView .panel,
#financialsPanel .box,
#reportsView .box {
    margin-bottom: 12px !important;
}

/* 4) Ensure card grids do not visually stick */
#financialsPanel [class*="grid"],
#financialsPanel [class*="cards"],
#financialsPanel [class*="summary"],
#reportsView [class*="grid"],
#reportsView [class*="cards"],
#reportsView [class*="summary"] {
    gap: 12px !important;
}

/* 5) White information boxes below Paid sales only / helper panels */
#financialsPanel .info-box,
#financialsPanel .note-box,
#financialsPanel .helper-box,
#reportsView .info-box,
#reportsView .note-box,
#reportsView .helper-box,
#financialsPanel > div,
#reportsView > div {
    box-sizing: border-box !important;
}

/* 6) Mobile-specific spacing refinement */
@media (max-width: 768px) {
    #financialsPanel > * + *,
    #reportsView > * + * {
        margin-top: 14px !important;
    }

    #financialsPanel [class*="grid"],
    #financialsPanel [class*="cards"],
    #financialsPanel [class*="summary"],
    #reportsView [class*="grid"],
    #reportsView [class*="cards"],
    #reportsView [class*="summary"] {
        gap: 14px !important;
    }

    #financialsPanel .fin-warning,
    #financialsPanel .fin-msg,
    #financialsPanel .fin-status,
    #reportsView .fin-warning,
    #reportsView .fin-msg,
    #reportsView .fin-status,
    #financialsPanel p[style*="color: green"],
    #financialsPanel p[style*="color:green"],
    #reportsView p[style*="color: green"],
    #reportsView p[style*="color:green"] {
        margin-top: 6px !important;
        margin-bottom: 10px !important;
    }
}


/* RC6.2 Exact report presentation */

:is(#financialsPanel#financialsPanel,
#reportsView#reportsView)
[data-scuzo-rc62="status"] {
 color: #FFFFFF !important;
 background-color: #142B54 !important;
 font-weight: 600 !important;
 line-height: 1.5 !important;
 padding: 8px 10px !important;
 border-radius: 8px !important;
 overflow-wrap: break-word !important;
}

:is(#financialsPanel#financialsPanel,
#reportsView#reportsView)
[data-scuzo-rc62="download"] {
 color: #FFFFFF !important;
 font-weight: 600 !important;
}

:is(#financialsPanel#financialsPanel,
#reportsView#reportsView)
:is([data-scuzo-rc62="pnl"],
[data-scuzo-rc62="operations"],
[data-scuzo-rc62="comparison"])
:not(:disabled):not([aria-disabled="true"]) {
 background: #176B87 !important;
 color: #FFFFFF !important;
 border: 1px solid #75C8DD !important;
 border-radius: 10px !important;
 box-shadow: none !important;
 text-shadow: none !important;
 min-height: 48px !important;
 font-weight: 600 !important;
 line-height: 1.4 !important;
}

@media (max-width:768px) {

 [data-scuzo-rc62-bottom="yes"] {
  padding-bottom:
   calc(112px + env(safe-area-inset-bottom,0px))
   !important;
  scroll-padding-bottom: 112px !important;
 }

 [data-scuzo-rc62="operations"] {
  margin-bottom: 18px !important;
  scroll-margin-bottom: 112px !important;
 }

 [data-scuzo-rc62="back"] {
  margin-top: 16px !important;
 }
}
