/* ==========================================================================
   UNIFIED REPORT CSS - static/css/unified_report.css
   Complete all-in-one CSS file for LedgerDock financial reports
   Replaces both base-structure.css and unified_report.css
   ========================================================================== */

/* ===== GOOGLE FONTS IMPORT ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ===== COMPLETE CSS VARIABLES SYSTEM ===== */
:root {
    /* TYPOGRAPHY - Professional System */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    --font-serif: 'Charter', 'Georgia', 'Times New Roman', serif;

    /* FONT SIZES - Professional Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 0.9rem;
    --text-lg: 1rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;

    /* FONT WEIGHTS */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height: 1.4;

    /* COLORS - Professional LedgerDock Theme */
    --primary-color: #334155;
    --primary-light: #475569;
    --primary-dark: #1e293b;
    --accent-blue: #3b82f6;
    --accent-beige: #f8f4e8;
    --surface-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-lighter: #f1f5f9;

    /* TEXT COLORS */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.8);

    /* BORDERS */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #475569;
    --border-white: rgba(255, 255, 255, 0.2);
    --border-white-hover: rgba(255, 255, 255, 0.4);

    /* SPACING SYSTEM */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 3rem;

    /* TABLE SPACING - Professional Financial Reports */
    --table-padding-vertical: 0.375rem;
    --table-padding-horizontal: 0.75rem;
    --table-text-end-padding-right: 1rem;
    --subtotal-padding-vertical: 0.5rem;
    --subtotal-padding-horizontal: 0.75rem;
    --grand-total-padding-vertical: 0.625rem;
    --grand-total-padding-horizontal: 0.75rem;
    --separator-padding: 0.25rem 0;

    /* INDENTATION SYSTEM - Clear Hierarchy */
    --main-header-indent: 20px;
    --sub-header-indent: 35px;
    --item-row-indent: 50px;
    --sub-main-header-indent: 40px;
    --opening-line-indent: 10px;

    /* REPORT LAYOUT - Professional Margins and Spacing */
    --report-margin-desktop: 20%;
    --report-margin-tablet: 15%;
    --report-margin-mobile: 10%;
    --report-padding-desktop: 3rem 3.5rem 2rem 3.5rem;
    --report-padding-tablet: 2.5rem 3rem 2rem 3rem;
    --report-padding-mobile: 1.5rem 2rem 1rem 2rem;
    --report-title-margin-bottom: 3rem;
    --report-title-padding-bottom: 1.5rem;

    /* HEADER SYSTEM */
    --header-height: 80px;
    --control-width: 140px;
    --logo-size: 48px;
    --button-height: 44px;

    /* EFFECTS */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-INDEX SYSTEM - Critical for Dropdown */
    --z-dropdown: 2147483647;
    --z-header: 999998;
    --z-picker-container: 999999;
    --z-content: 1;

    /* RESPONSIVE BREAKPOINTS */
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 1024px;
}

/* ===== BASE RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-lighter) 100%);
    min-height: 100vh;
    position: relative;
}

/* =================================================================
   PROFESSIONAL TABLE STRUCTURE - Financial Reports
   ================================================================= */

table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-primary);
    line-height: var(--line-height);
    font-size: var(--text-base);
    margin: 0;
}

/* All table cells - consistent professional padding */
th, td {
    padding: var(--table-padding-vertical) var(--table-padding-horizontal);
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

/* Right-aligned amounts - proper spacing */
.text-end {
    text-align: right;
    padding-right: var(--table-text-end-padding-right);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-primary);
}

/* Separator rows - clean spacing */
.separator {
    border-bottom: none;
}

.separator td {
    padding: var(--separator-padding);
    border-bottom: none;
}

/* Subtotal rows - professional emphasis */
.subtotal {
    font-weight: var(--font-weight-semibold);
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-light);
}

.subtotal td {
    padding: var(--subtotal-padding-vertical) var(--subtotal-padding-horizontal);
    font-weight: var(--font-weight-semibold);
}

/* Total headers - clear hierarchy */
.total-header {
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.total-header td {
    padding: var(--table-padding-vertical) var(--table-padding-horizontal) var(--table-padding-vertical) var(--main-header-indent);
    font-weight: var(--font-weight-bold);
}

/* Main headers - professional positioning */
.main-header {
    text-align: left;
    font-weight: var(--font-weight-bold);
    font-size: var(--text-base);
    background-color: var(--bg-light);
}

.main-header td {
    padding: var(--subtotal-padding-vertical) var(--table-padding-horizontal) var(--subtotal-padding-vertical) var(--main-header-indent);
    font-weight: var(--font-weight-bold);
    border-top: 1px solid var(--border-light);
}

/* Sub headers - clear indentation */
.sub-header {
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.sub-header td {
    padding: var(--table-padding-vertical) var(--table-padding-horizontal) var(--table-padding-vertical) var(--sub-header-indent);
    font-weight: var(--font-weight-semibold);
}

/* Item rows - proper indentation */
.item-row td:first-child {
    padding: var(--table-padding-vertical) var(--table-padding-horizontal) var(--table-padding-vertical) var(--item-row-indent);
    font-family: var(--font-primary);
    font-weight: var(--font-weight-normal);
}

/* Sub-main headers - deeper hierarchy */
.sub_main_header {
    text-align: left;
    font-weight: var(--font-weight-semibold);
}

.sub_main_header td {
    padding: var(--table-padding-vertical) var(--table-padding-horizontal) var(--table-padding-vertical) var(--sub-main-header-indent);
    font-weight: var(--font-weight-semibold);
}

/* Opening line - special P&L header */
.opening_line {
    text-align: left;
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
}

.opening_line td {
    padding: var(--grand-total-padding-vertical) var(--table-padding-horizontal) var(--grand-total-padding-vertical) var(--opening-line-indent);
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
}

/* Grand totals - maximum professional emphasis */
.grand-total {
    font-weight: var(--font-weight-bold);
    background-color: var(--bg-lighter);
    border-top: 2px solid var(--text-primary);
    border-bottom: 2px solid var(--text-primary);
}

.grand-total td {
    padding: var(--grand-total-padding-vertical) var(--grand-total-padding-horizontal);
    font-weight: var(--font-weight-bold);
}

/* =================================================================
   REPORT LAYOUT - Professional Spacing
   ================================================================= */

/* Report content container - professional spacing */
.report-content {
    margin: 2rem var(--report-margin-desktop) 2rem var(--report-margin-desktop) !important;
    padding: var(--report-padding-desktop) !important;
    line-height: var(--line-height);
    font-family: var(--font-primary);
    background: var(--surface-white);
    border-radius: 16px;
    box-shadow: var(--shadow-sm), var(--shadow-md);
    position: relative;
    z-index: var(--z-content);
    overflow: hidden;
}

/* Decorative top border - only visible on screen, NOT in print */
.report-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-blue) 50%, var(--accent-beige) 100%);
}

/* Report title section - professional spacing */
.report-title-section {
    text-align: center;
    margin-bottom: var(--report-title-margin-bottom) !important;
    padding-bottom: var(--report-title-padding-bottom) !important;
    border-bottom: 2px solid var(--border-light);
}

.company-name {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-bold);
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-family: var(--font-primary);
}

.report-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-semibold);
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-family: var(--font-primary);
}

.report-period {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
    font-family: var(--font-primary);
}

.report-metadata {
    display: flex;
    justify-content: center;
    gap: 3rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

/* Financial table container */
.financial-table-container {
    margin-top: 1.5rem;
}

.content-body {
    max-width: none;
}

/* ===== UNIFIED HEADER SYSTEM ===== */
.unified-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--text-white);
    box-shadow: var(--shadow-sm), 0 8px 32px rgba(51, 65, 85, 0.15);
    position: relative;
    z-index: var(--z-header) !important;
    padding: var(--space-lg) var(--space-2xl);
    border-radius: var(--radius-xl);
    margin: var(--space-2xl);
    overflow: visible !important;
    animation: headerSlideIn 0.6s ease-out;
}

/* Subtle background pattern */
.unified-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(248, 244, 232, 0.15) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0.7;
}

@keyframes headerSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== HEADER CONTAINER ===== */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: var(--header-height);
    gap: var(--space-2xl);
    position: relative;
    z-index: 2;
    flex-wrap: wrap; /* Allow natural wrapping */
}

/* ===== LEFT SECTION - BRAND ===== */
.brand-section {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-shrink: 0;
    min-width: 250px;
}

.brand-logo {
    width: var(--logo-size);
    height: var(--logo-size);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-white);
    border: 2px solid var(--border-white);
    backdrop-filter: blur(15px);
    flex-shrink: 0;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.brand-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(51, 65, 85, 0.3);
}

.report-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: var(--logo-size);
}

.report-info h1 {
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.report-meta {
    font-size: var(--text-sm);
    opacity: 0.9;
    line-height: 1.2;
    margin: 0;
    color: var(--text-muted);
}

/* ===== CENTER SECTION - CONTROLS ===== */
.header-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
    flex: 1;
    min-height: var(--header-height);
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: var(--header-height);
    transition: transform 0.2s ease;
}

.control-group:hover {
    transform: translateY(-2px);
}

.control-label {
    font-size: var(--text-xs);
    font-weight: 700;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* ===== UNIVERSAL CONTROL STYLING ===== */
.header-select,
.period-picker-trigger,
.action-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid var(--border-white);
    border-radius: var(--radius-lg);
    color: var(--text-white);
    padding: 0.6rem 1.2rem;
    font-size: var(--text-sm);
    font-weight: 600;
    min-width: var(--control-width);
    height: var(--button-height);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    cursor: pointer;
    font-family: var(--font-primary);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.header-select option {
    background: var(--surface-white) !important;
    color: var(--text-primary) !important;
    font-weight: 500 !important;
    padding: 0.5rem !important;
}

.header-select:hover,
.period-picker-trigger:hover,
.action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--border-white-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.header-select:focus,
.period-picker-trigger:focus,
.action-btn:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* ===== RIGHT SECTION - ACTIONS ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    flex-shrink: 0;
    min-width: 250px;
    justify-content: flex-end;
}

.action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: var(--header-height);
}

.group-label {
    font-size: var(--text-xs);
    font-weight: 700;
    opacity: 0.9;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

/* ===== PERIOD PICKER - CRITICAL Z-INDEX SYSTEM ===== */
.period-picker-container {
    position: relative;
    z-index: var(--z-picker-container) !important;
}

.period-picker-trigger {
    justify-content: space-between;
    gap: var(--space-lg);
    min-width: 190px;
    position: relative;
}

.period-picker-trigger.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.period-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.period-label {
    color: var(--text-muted) !important;
    font-size: var(--text-xs) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.period-value {
    color: var(--text-white) !important;
    font-size: var(--text-sm) !important;
    font-weight: 700 !important;
}

.period-chevron {
    color: var(--text-muted) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.period-picker-trigger.active .period-chevron {
    transform: rotate(180deg);
}

/* ===== PERIOD DROPDOWN - MAXIMUM Z-INDEX ===== */
.period-dropdown {
    position: fixed !important;
    background: var(--surface-white) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg), 0 20px 40px rgba(0, 0, 0, 0.15) !important;
    z-index: var(--z-dropdown) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-15px) scale(0.95) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    backdrop-filter: blur(20px) !important;
    min-width: 320px !important;
}

.period-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

.period-section {
    padding: 1.2rem !important;
    background: var(--surface-white) !important;
    color: var(--text-primary) !important;
}

.period-section:not(:last-child) {
    border-bottom: 1px solid var(--border-light) !important;
}

.period-section-title {
    color: var(--text-secondary) !important;
    font-size: var(--text-xs) !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 var(--space-lg) 0 !important;
}

.period-options {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--space-md) !important;
}

.period-option {
    background: var(--surface-white) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-light) !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--space-md) !important;
    padding: var(--space-lg) 1.2rem !important;
    border-radius: var(--radius-lg) !important;
    cursor: pointer !important;
    width: 100% !important;
    text-align: left !important;
    font-size: var(--text-sm) !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-family: var(--font-primary) !important;
}

.period-option:hover {
    background: var(--primary-color) !important;
    color: var(--text-white) !important;
    border-color: var(--primary-color) !important;
    transform: translateX(4px) !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.25) !important;
}

.period-option.active {
    background: var(--primary-color) !important;
    color: var(--text-white) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.25) !important;
}

.period-option-icon {
    color: var(--text-primary) !important;
    width: 20px !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
}

.period-option:hover .period-option-icon,
.period-option.active .period-option-icon {
    color: var(--text-white) !important;
}

.period-option-text {
    color: var(--text-primary) !important;
    font-size: var(--text-sm) !important;
    font-weight: 600 !important;
    font-family: var(--font-primary) !important;
}

.period-option:hover .period-option-text,
.period-option.active .period-option-text {
    color: var(--text-white) !important;
}

/* ===== CUSTOM RANGE SECTION ===== */
.custom-range {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-lighter) 100%) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-lg) !important;
}

.custom-range-inputs {
    display: flex !important;
    gap: var(--space-lg) !important;
    margin-bottom: 1.2rem !important;
}

.date-input-group {
    flex: 1 !important;
}

.date-input-label {
    color: var(--text-secondary) !important;
    font-size: var(--text-xs) !important;
    font-weight: 700 !important;
    display: block !important;
    margin-bottom: var(--space-sm) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.date-input {
    color: var(--text-primary) !important;
    background: var(--surface-white) !important;
    border: 2px solid var(--border-light) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.6rem !important;
    width: 100% !important;
    font-size: var(--text-sm) !important;
    font-weight: 600 !important;
    transition: var(--transition) !important;
    font-family: var(--font-primary) !important;
}

.date-input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.1) !important;
}

.custom-range-actions {
    display: flex !important;
    gap: var(--space-md) !important;
}

.btn--period {
    padding: 0.6rem 1.2rem !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer !important;
    font-size: var(--text-sm) !important;
    font-weight: 700 !important;
    transition: var(--transition) !important;
    border: none !important;
    font-family: var(--font-primary) !important;
}

.btn--primary {
    background: var(--primary-color) !important;
    color: var(--text-white) !important;
}

.btn--primary:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.3) !important;
}

.btn--outline {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border: 2px solid var(--border-light) !important;
}

.btn--outline:hover {
    background: var(--bg-lighter) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

/* =================================================================
   RESPONSIVE DESIGN - Professional at all screen sizes
   ================================================================= */

/* When header wraps, center the items */
@media (max-width: 1200px) {
    .header-container {
        justify-content: center;
        gap: var(--space-lg);
    }

    .brand-section {
        order: 1;
        width: 100%;
        justify-content: center;
    }

    .header-controls {
        order: 2;
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    .header-actions {
        order: 3;
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-md);
    }
}

/* Tablet responsiveness */
@media (max-width: 1024px) {
    .report-content {
        margin: 2rem var(--report-margin-tablet) 2rem var(--report-margin-tablet) !important;
        padding: var(--report-padding-tablet) !important;
    }

    .report-metadata {
        gap: 2rem;
    }

    .header-container {
        gap: var(--space-lg);
    }

    .header-controls {
        gap: var(--space-lg);
    }

    .header-actions {
        gap: var(--space-lg);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .report-content {
        margin: 1rem var(--report-margin-mobile) 1rem var(--report-margin-mobile) !important;
        padding: var(--report-padding-mobile) !important;
        border-radius: 12px;
    }

    /* Adjust table spacing for mobile */
    th, td {
        padding: calc(var(--table-padding-vertical) * 0.8) calc(var(--table-padding-horizontal) * 0.8);
        font-size: 0.825rem;
    }

    /* Reduce indentation on mobile */
    .item-row td:first-child {
        padding-left: 25px;
    }

    .sub-header td {
        padding-left: 20px;
    }

    .main-header td {
        padding-left: 15px;
    }

    .report-title-section {
        margin-bottom: 2rem !important;
        padding-bottom: 1rem !important;
    }

    .company-name {
        font-size: 1.5rem;
    }

    .report-title {
        font-size: 1.25rem;
    }

    .report-metadata {
        flex-direction: column;
        gap: 0.75rem;
        font-size: 0.75rem;
    }

    /* Header mobile styles */
    .unified-header {
        padding: var(--space-md) var(--space-lg);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        margin: 0 0 var(--space-lg) 0;
    }

    .header-container {
        flex-direction: column;
        gap: var(--space-lg);
        min-height: auto;
    }

    .brand-section {
        min-width: auto;
        width: 100%;
        justify-content: center;
    }

    .header-controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-lg);
        width: 100%;
    }

    .header-actions {
        min-width: auto;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-lg);
    }

    .control-group {
        min-height: auto;
    }

    .header-select,
    .period-picker-trigger,
    .action-btn {
        min-width: 120px;
        height: 40px;
        font-size: var(--text-xs);
        padding: var(--space-sm) var(--space-lg);
    }

    .brand-logo {
        width: 44px;
        height: 44px;
    }

    .custom-range-inputs {
        flex-direction: column !important;
        gap: var(--space-lg) !important;
    }
}

@media (max-width: 480px) {
    .unified-header {
        margin: 0;
        border-radius: 0;
    }

    .brand-section {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    .action-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* =================================================================
   PRINT STYLES - Professional print layout with NO TOP LINE
   ================================================================= */

@media print {
    .unified-header {
        display: none !important;
    }

    /* CRITICAL FIX: Remove the decorative top line in print */
    .report-content::before {
        display: none !important;
    }

    body {
        background: white !important;
        color: #000 !important;
        font-family: var(--font-serif) !important;
        font-size: 12pt !important;
        line-height: 1.2 !important;
    }

    .report-content {
        margin: 0 8% !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: white !important;
    }

    .report-title-section {
        border-bottom: 3px solid #000 !important;
        margin-bottom: 2rem !important;
        padding-bottom: 1rem !important;
        page-break-after: avoid !important;
    }

    .company-name,
    .report-title,
    .report-period {
        color: #000 !important;
    }

    .report-metadata {
        color: #333 !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        font-size: 0.75rem !important;
    }

    table {
        page-break-inside: auto !important;
        width: 100% !important;
    }

    .item-row,
    .main-header,
    .sub-header,
    .subtotal,
    .grand-total {
        page-break-inside: avoid !important;
    }

    /* Clean print spacing */
    th, td {
        padding: 0.25rem 0.5rem !important;
        border-bottom: 1px solid #ccc !important;
        font-size: 0.8rem !important;
    }

    .subtotal,
    .grand-total {
        background-color: #f8f8f8 !important;
        border-top: 2px solid #000 !important;
        border-bottom: 2px solid #000 !important;
        font-weight: bold !important;
        page-break-inside: avoid !important;
    }

    .main-header td {
        background-color: #f0f0f0 !important;
        border-top: 1px solid #000 !important;
        font-weight: bold !important;
    }

    .text-end {
        text-align: right !important;
    }
}

/* ===== ACCESSIBILITY ===== */
.header-select:focus,
.period-picker-trigger:focus,
.action-btn:focus,
.period-option:focus,
.date-input:focus,
.btn--period:focus {
    outline: 2px solid var(--text-white);
    outline-offset: 2px;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.no-print { display: block; }

@media print {
    .no-print { display: none !important; }
}