/* Reports page – Farm Manager brand palette */

:root {
    --fm-green-dark: #234f2e;
    --fm-green: #2f6b2f;
    --fm-text: #1f2520;
    --fm-muted: #566052;
    --fm-page-bg: #eef1e6;
    --fm-green-soft: #e6efe2;
    --fm-surface: #ffffff;
    --fm-surface-soft: #f8f9f4;
    --fm-border: #cfd8c6;
    --fm-amber: #d99a24;
    --fm-alert: #b42318;
}

body {
    background: var(--fm-page-bg);
    background-image: none;
    color: var(--fm-text);
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

body::before {
    display: none;
}

@supports (padding: max(0px)) {
    body {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
}

#app-content {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0.75rem;
}

.reports-container {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
    width: min(calc(100% - 1.5rem), 1440px);
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.25rem 0 7.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    box-sizing: border-box;
}

.reports-container > * {
    box-sizing: border-box;
}

.reports-container .content-container {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    background: transparent;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
}

.reports-page-hero,
.report-controls,
.report-output,
#report-container {
    width: 100%;
}

.app-page-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.reports-page-hero {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #e6efe2 100%);
    border: 1px solid var(--fm-border);
    border-radius: 24px;
    padding: 1.6rem 2rem;
    box-shadow: 0 14px 30px rgba(31, 37, 32, 0.08);
}

.reports-page-hero__brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.reports-page-hero__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.brand-logo--app-page {
    display: block;
    max-width: 220px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.page-kicker {
    margin: 0 0 0.35rem;
    color: var(--fm-green);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.reports-page-title {
    margin: 0;
    padding-bottom: 0;
    color: var(--fm-green-dark);
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.055em;
    line-height: 0.95;
    text-align: left;
    text-shadow: none;
    text-transform: none;
    display: block;
}

.reports-page-title::after {
    display: none;
}

.page-subtitle {
    margin: 0.75rem 0 0;
    color: var(--fm-muted);
    font-size: clamp(0.98rem, 1.5vw, 1.08rem);
    line-height: 1.5;
    font-weight: 400;
    max-width: 760px;
}

.report-controls,
.reports-controls,
.filter-panel,
.date-filter-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    background: var(--fm-surface);
    border: 1px solid var(--fm-border);
    border-radius: 20px;
    padding: 1.2rem;
    box-shadow: 0 10px 24px rgba(31, 37, 32, 0.06);
}

.date-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    grid-column: span 2;
}

#generate-report {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 52px;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 0;
}

.form-group label,
label {
    display: block;
    margin-bottom: 5px;
    color: var(--fm-green-dark);
    font-weight: 750;
    font-size: 0.9rem;
}

.form-control,
input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--fm-border);
    border-radius: 12px;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    color: var(--fm-text);
    box-sizing: border-box;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(47, 107, 47, 0.25);
    border-color: var(--fm-green);
}

/* Custom dropdown arrow */
select.form-control {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%232c3e50" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.help-text {
    font-size: 0.8rem;
    color: var(--fm-muted);
    margin-top: 4px;
    display: block;
}

.action-button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 999px;
    min-height: 50px;
    padding: 0.85rem 1.15rem;
    font-weight: 850;
    line-height: 1.2;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
    text-transform: none;
    box-shadow: none;
}

.action-button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(31, 37, 32, 0.10);
}

.btn-primary,
.btn-success,
.primary-button {
    background: var(--fm-green-dark);
    color: #ffffff;
    border-color: var(--fm-green-dark);
}

.btn-primary:hover,
.btn-success:hover,
.primary-button:hover {
    background: var(--fm-green);
    border-color: var(--fm-green);
}

.btn-secondary {
    background: var(--fm-surface);
    color: var(--fm-green-dark);
    border-color: var(--fm-border);
}

.btn-secondary:hover {
    background: var(--fm-green-soft);
    border-color: var(--fm-green);
}

.btn-warning {
    background: var(--fm-surface);
    color: #7a5200;
    border-color: rgba(217, 154, 36, 0.45);
}

.btn-danger {
    background: var(--fm-surface);
    color: var(--fm-alert);
    border-color: rgba(180, 35, 24, 0.35);
}

#report-container {
    min-height: 200px;
    display: block !important;
}

.report-output,
.report-content,
.reports-output {
    background: var(--fm-surface);
    border: 1px solid var(--fm-border);
    border-radius: 20px;
    padding: 1.35rem;
    box-shadow: 0 10px 24px rgba(31, 37, 32, 0.07);
    overflow-x: auto;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 5;
    min-height: 300px;
}

.report-loading {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 1.5rem;
}

.report-loading .spinner {
    border: 4px solid var(--fm-border);
    border-top: 4px solid var(--fm-green-dark);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: report-spin 2s linear infinite;
}

@keyframes report-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#empty-report-message,
.empty-report-message {
    display: none;
    text-align: center;
    padding: 1.5rem;
    background: var(--fm-surface-soft);
    border-radius: 16px;
    border: 1px solid var(--fm-border);
}

#empty-report-message h3,
.empty-report-message h3 {
    color: var(--fm-muted);
    margin: 0 0 0.5rem;
}

.empty-state {
    text-align: center;
    color: var(--fm-muted);
    padding: 1.5rem;
    font-style: italic;
    background: var(--fm-surface-soft);
    border-radius: 16px;
    border: 1px dashed var(--fm-border);
    margin: 0;
}

.report-summary {
    margin-bottom: 20px;
}

.summary-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.summary-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.summary-card h4 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.report-table th,
.report-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
}

.report-table th {
    background-color: var(--fm-green-soft);
    color: var(--fm-green-dark);
    font-weight: 850;
    border-bottom: 1px solid var(--fm-border);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.report-table tr:nth-child(even) td {
    background-color: var(--fm-surface-soft);
}

.positive-value,
.positive-change {
    color: var(--fm-green);
}

.negative-value,
.negative-change {
    color: var(--fm-alert);
}

/* Portrait mode adjustments */
@media screen and (orientation: portrait) {
    .reports-container {
        padding: 10px;
        padding-bottom: 7.75rem;
    }
    
    .report-controls {
        padding: 12px;
    }
    
    .report-content {
        padding: 12px;
    }
    
    .report-table {
        font-size: 0.85rem;
        width: 100%;
        table-layout: fixed;
    }
    
    .report-table th,
    .report-table td {
        padding: 8px 6px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Adjust column widths for better readability in portrait */
    .report-table th:nth-child(1),
    .report-table td:nth-child(1) {  /* Date column */
        width: 20%;
    }
    
    .report-table th:nth-child(2),
    .report-table td:nth-child(2) {  /* Type column */
        width: 20%;
    }
    
    .report-table th:nth-child(3),
    .report-table td:nth-child(3) {  /* Category column */
        width: 20%;
    }
    
    .report-table th:nth-child(4),
    .report-table td:nth-child(4) {  /* Details column */
        width: 40%;
    }
    
    /* Make report table container take full width but keep scrolling if needed */
    .report-table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Better scrolling on iOS */
    }
    
    /* Only set min-width when absolutely needed */
    .report-table {
        min-width: auto;
    }
}

/* Landscape mode adjustments */
@media screen and (orientation: landscape) {
    .date-range {
        flex-direction: row;
    }
    
    .summary-cards {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* Discrepancy report styling */
.unresolved-discrepancy {
    background-color: var(--fm-surface-soft);
}

.resolved-discrepancy {
    background-color: var(--fm-green-soft);
}

.resolution {
    background-color: var(--fm-surface-soft);
}

.resolving-count {
    background-color: var(--fm-green-soft);
}

.resolution-text {
    color: #28a745;
    font-weight: bold;
}

.unresolved-text {
    color: #dc3545;
    font-weight: bold;
}

.final-count {
    color: #28a745;
    display: inline-block;
    margin-left: 10px;
}

.counter-name {
    color: #666;
    font-style: italic;
    display: inline-block;
    margin-top: 4px;
    padding-left: 4px;
    border-left: 2px solid #ddd;
}

.notes {
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

/* Row styles */
.resolution {
    background-color: var(--fm-green-soft);
    border-left: 4px solid var(--fm-green);
}

.unresolved-discrepancy {
    background-color: var(--fm-surface-soft);
    border-left: 4px solid var(--fm-alert);
}

.resolving-count {
    background-color: var(--fm-green-soft);
    border-left: 4px solid var(--fm-green);
}

/* Table styles for better readability */
.report-table td {
    padding: 10px;
    vertical-align: top;
}

.report-table tr.resolution td,
.report-table tr.unresolved-discrepancy td,
.report-table tr.resolving-count td {
    padding: 15px 10px;
}

/* Add spacing between lines in details cell */
.report-table td span {
    display: block;
    margin: 2px 0;
}

.report-table td span:first-child {
    margin-top: 0;
}

.report-table td span:last-child {
    margin-bottom: 0;
}

.resolved-badge {
    display: inline-block;
    background-color: #e8f5e9;
    color: #28a745;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    margin-left: 8px;
}

/* Stock count styling */
.stock-count-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Row styles for feed transaction types */
.purchase-row {
    background-color: rgba(52, 152, 219, 0.05);
}

.usage-row {
    background-color: rgba(155, 89, 182, 0.05);
}

/* Color swatches for the notes */
.purchase-note {
    background-color: rgba(52, 152, 219, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.usage-note {
    background-color: rgba(155, 89, 182, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Style for calculated costs */
.calculated-cost {
    position: relative;
    display: inline-block;
    color: #e67e22;
    font-style: italic;
    padding-right: 5px;
}

.calculated-cost::after {
    content: "*";
    position: absolute;
    top: -5px;
    right: -2px;
    font-size: 1.1em;
    color: #e67e22;
    font-weight: bold;
}

/* Explanation for calculated costs */
.cost-explanation {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Change for net change values */
.positive-change {
    color: #2ecc71;
}

.negative-change {
    color: #e74c3c;
}

/* Add a subtle highlight to the total row */
.total-row {
    background-color: rgba(236, 240, 241, 0.5);
    font-weight: bold;
}

/* Styling for month separators in reports */
.month-separator {
    background-color: #f4f6f7;
}

.month-separator td {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    padding: 8px;
}

/* Report notes section styling */
.report-notes {
    margin-top: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9em;
    color: #555;
}

.report-notes p {
    margin: 0 0 10px 0;
}

.report-notes p:last-child {
    margin-bottom: 0;
}

.report-notes strong {
    color: #333;
}

/* Report sections styling */
.report-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.report-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.report-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Report header styling */
.report-header {
    margin-bottom: 20px;
}

.report-header h2 {
    margin-bottom: 10px;
}

.report-summary {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.report-summary p {
    margin: 5px 0;
    font-size: 0.95rem;
}

/* Make notes and explanations more readable on mobile */
@media screen and (max-width: 600px) {
    .report-notes {
        padding: 12px;
    }
    
    .report-notes li {
        font-size: 0.85rem;
    }
    
    .report-summary p {
        font-size: 0.9rem;
    }
}

/* Summary table styling */
.summary-table {
    margin-bottom: 15px;
}

.summary-table th {
    background-color: #f0f3f6;
    color: #2c3e50;
    font-weight: bold;
    padding: 10px;
    text-align: left;
    white-space: nowrap;
}

.summary-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.summary-table tr:last-child td {
    border-bottom: none;
}

.summary-table tr:hover {
    background-color: #f8f9fa;
}

/* Empty report state */
.report-empty {
    text-align: center;
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
    color: #777;
}

.report-empty p:first-child {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #555;
}

.report-empty p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .report-empty {
        padding: 30px 15px;
    }
}

/* Print styling improvements */
@media print {
    .reports-container {
        padding: 0;
    }
    
    .report-controls,
    .mobile-nav,
    .report-actions button {
        display: none !important;
    }
    
    .report-content {
        box-shadow: none;
        padding: 0;
    }
    
    .report-table {
        width: 100%;
        border-collapse: collapse;
    }
    
    .report-table th {
        background-color: #f5f5f5 !important;
        color: #000 !important;
    }
    
    .calculated-cost {
        color: #000 !important;
    }
    
    .calculated-cost::after {
        color: #000 !important;
    }
}

/* Generated report action buttons */
.report-actions,
.generated-report-actions,
.report-output-actions,
.export-actions,
.export-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 1rem 0 1.25rem;
}

.report-action-button,
.report-actions button,
.generated-report-actions button,
.report-output-actions button,
.export-actions button,
.export-options button,
.report-actions a,
.generated-report-actions a,
.report-output-actions a,
.export-actions a,
.export-options a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.report-action-button:hover,
.report-actions button:hover,
.generated-report-actions button:hover,
.report-output-actions button:hover,
.export-actions button:hover,
.export-options button:hover,
.report-actions a:hover,
.generated-report-actions a:hover,
.report-output-actions a:hover,
.export-actions a:hover,
.export-options a:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(31, 37, 32, 0.10);
}

.report-action-button--primary,
.report-actions .btn-primary,
.generated-report-actions .btn-primary,
.report-output-actions .btn-primary,
.export-actions .btn-primary {
    background: #234f2e;
    color: #ffffff;
    border-color: #234f2e;
}

.report-action-button--primary:hover,
.report-actions .btn-primary:hover,
.generated-report-actions .btn-primary:hover,
.report-output-actions .btn-primary:hover,
.export-actions .btn-primary:hover {
    background: #2f6b2f;
    border-color: #2f6b2f;
    color: #ffffff;
}

.report-action-button--secondary,
.report-actions .btn-secondary,
.generated-report-actions .btn-secondary,
.report-output-actions .btn-secondary,
.export-actions .btn-secondary {
    background: #ffffff;
    color: #234f2e;
    border-color: #cfd8c6;
}

.report-action-button--secondary:hover,
.report-actions .btn-secondary:hover,
.generated-report-actions .btn-secondary:hover,
.report-output-actions .btn-secondary:hover,
.export-actions .btn-secondary:hover {
    background: #e6efe2;
    border-color: #2f6b2f;
    color: #234f2e;
}

.report-action-button--danger {
    background: #ffffff;
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.35);
}

.report-action-button--danger:hover {
    background: #ffffff;
    color: #b42318;
    border-color: #b42318;
}

/* Defensive overrides for legacy generated button classes */
.reports-container .btn-info,
.reports-container .btn-blue,
.reports-container .btn-export,
.reports-container .export-btn,
.reports-container .download-btn,
.reports-container .csv-btn,
.reports-container .pdf-btn,
.reports-container .btn-export-csv,
.reports-container .btn-export-pdf {
    background: #ffffff !important;
    color: #234f2e !important;
    border: 1px solid #cfd8c6 !important;
    border-radius: 999px !important;
    box-shadow: none;
}

.reports-container .print-btn,
.reports-container .btn-print {
    background: #234f2e !important;
    color: #ffffff !important;
    border-color: #234f2e !important;
}

.reports-container .btn-info:hover,
.reports-container .btn-blue:hover,
.reports-container .btn-export:hover,
.reports-container .export-btn:hover,
.reports-container .download-btn:hover,
.reports-container .csv-btn:hover,
.reports-container .pdf-btn:hover,
.reports-container .btn-export-csv:hover,
.reports-container .btn-export-pdf:hover {
    background: #e6efe2 !important;
    color: #234f2e !important;
    border-color: #2f6b2f !important;
}

.reports-container .print-btn:hover,
.reports-container .btn-print:hover {
    background: #2f6b2f !important;
    color: #ffffff !important;
}

.print-button::before,
.export-button::before {
    content: none;
}

/* Improve the report type headers */
.report-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.report-type-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .report-type-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .report-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .inventory-summary,
    .low-stock-alerts {
        padding: 10px;
    }
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.status-good {
    background-color: #28a745;
}

.status-low {
    background-color: #ffc107;
}

.status-critical {
    background-color: #dc3545;
}

/* Inventory summary styles */
.inventory-summary {
    margin-top: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.inventory-summary h4 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.summary-item {
    background-color: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-item .label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.summary-item .value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.summary-item .value.positive {
    color: #28a745;
}

.summary-item .value.negative {
    color: #dc3545;
}

/* Low Stock Alerts */
.low-stock-alerts {
    margin-top: 20px;
    background-color: var(--fm-surface-soft);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid var(--fm-border);
    border-left: 4px solid var(--fm-alert);
    margin-bottom: 20px;
}

.low-stock-alerts h4 {
    color: var(--fm-alert);
    margin-top: 0;
    margin-bottom: 10px;
}

.low-stock-alerts table {
    width: 100%;
}

/* Days remaining indicators */
.days-critical {
    color: #dc3545;
    font-weight: bold;
}

.days-warning {
    color: #f0ad4e;
    font-weight: bold;
}

.days-good {
    color: #28a745;
}

/* Print specific styles */
@media print {
    .inventory-summary, 
    .low-stock-alerts,
    .report-section {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .report-actions {
        display: none;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .inventory-summary,
    .low-stock-alerts {
        padding: 10px;
    }
}

/* Inventory report additional styles */
.inventory-table .feed-type {
    font-weight: 500;
}

.inventory-table .supplier {
    font-style: italic;
    color: #666;
}

/* Print styles refinements */
@media print {
    .report {
        margin: 0;
        padding: 0;
    }
    
    .report-header {
        margin-bottom: 20px;
    }
    
    .report-actions {
        display: none;
    }
    
    .status-indicator {
        border: 1px solid #333;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .table th {
        background-color: #f0f0f0 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .report-notes {
        margin-top: 20px;
        font-size: 0.9em;
        border-top: 1px solid #ddd;
        padding-top: 15px;
    }
}

/* Feed Calculation Cards Styling */
.report-section .calculation-card, 
.feed-calculation-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.report-section .calculation-card .card-header,
.feed-calculation-card .card-header {
    background-color: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-section .calculation-card .card-header h4,
.feed-calculation-card .card-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.report-section .calculation-card .calculation-date,
.feed-calculation-card .calculation-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.report-section .calculation-card .card-body,
.feed-calculation-card .card-body {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px;
}

.report-section .calculation-card .feed-details,
.report-section .calculation-card .cost-details,
.feed-calculation-card .feed-details,
.feed-calculation-card .cost-details {
    flex: 1;
    min-width: 200px;
}

.report-section .calculation-card p,
.feed-calculation-card p {
    margin: 8px 0;
}

.report-section .calculation-card strong,
.feed-calculation-card strong {
    color: #2c3e50;
}

.text-right {
    text-align: right;
}

.total-row {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Responsive adjustments for feed calculations */
@media (max-width: 768px) {
    .report-section .calculation-card .card-body {
        flex-direction: column;
    }
    
    .report-section .calculation-card .feed-details,
    .report-section .calculation-card .cost-details {
        width: 100%;
    }
}

/* Style adjustments for print */
@media print {
    .report-section .calculation-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Status column styles in reports */
.unresolved {
    color: #e74c3c;
    font-weight: bold;
}

.resolved {
    color: #27ae60;
    font-weight: bold;
}

/* Animal discrepancy report specific styles */
.animal-discrepancy .addition {
    color: #27ae60;
}

.animal-discrepancy .reduction {
    color: #e74c3c;
}

.animal-discrepancy .no-change {
    color: var(--fm-muted);
}

/* Brand overrides – beat legacy main.css on this page */
.reports-container .action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    margin-bottom: 0;
    white-space: normal;
    word-break: break-word;
}

.reports-container .action-button:before {
    display: none;
}

.reports-container .action-button:active {
    transform: none;
    box-shadow: none;
    border-bottom: none;
}

.table-wrapper,
.report-table-wrapper,
.report-table-container {
    width: 100%;
    overflow-x: auto;
}

/* Responsive layout */
@media (max-width: 1100px) {
    .report-controls,
    .reports-controls,
    .filter-panel,
    .date-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .date-range {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .reports-page-hero {
        grid-template-columns: 1fr;
        gap: 1.1rem;
        padding: 1.35rem 1.25rem;
        text-align: center;
    }

    .reports-page-hero__copy {
        text-align: center;
        align-items: center;
    }

    .reports-page-title {
        font-size: clamp(2.3rem, 12vw, 3.4rem);
        text-align: center;
    }

    .page-subtitle {
        max-width: 34rem;
    }

    .brand-logo--app-page {
        max-width: 180px;
    }
}

@media (max-width: 700px) {
    .reports-container {
        width: min(calc(100% - 1rem), 100%);
        padding-top: 0.9rem;
        padding-bottom: 7.75rem;
    }
}

@media (max-width: 620px) {
    .report-actions,
    .generated-report-actions,
    .report-output-actions,
    .export-actions,
    .export-options {
        display: grid;
        grid-template-columns: 1fr;
    }

    .report-action-button,
    .report-actions button,
    .generated-report-actions button,
    .report-output-actions button,
    .export-actions button,
    .export-options button,
    .report-actions a,
    .generated-report-actions a,
    .report-output-actions a,
    .export-actions a,
    .export-options a {
        width: 100%;
    }

    .report-controls,
    .reports-controls,
    .filter-panel,
    .date-filter-panel {
        grid-template-columns: 1fr;
    }

    .date-range {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
}