/**
 * Print Styles for רוז סטודיו CRM
 * Provides clean, formatted print layouts for customer profiles,
 * order details, and financial reports.
 */

@media print {

    /* ============================================================
       Page Setup
       ============================================================ */
    @page {
        margin: 1.5cm 2cm;
        size: A4;
    }

    /* ============================================================
       Hide non-printable elements
       ============================================================ */
    .sidebar,
    .topbar,
    .app-footer,
    .hamburger,
    .sidebar-toggle,
    .search-box,
    .pagination-controls,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-icon,
    .btn-danger,
    .btn-close,
    .modal-close,
    .view-header button,
    .header-actions,
    .card-actions,
    .confirm-overlay,
    .modal-overlay,
    .toast,
    #sidebar-toggle,
    #hamburger-btn,
    #aria-announcer,
    .empty-state-card button,
    .sidebar-actions,
    .sidebar-brand,
    .sidebar-user {
        display: none !important;
    }

    /* ============================================================
       Layout Reset
       ============================================================ */
    body {
        background: white !important;
        color: #1a1a1a !important;
        font-size: 11pt;
        line-height: 1.5;
    }

    .app-layout {
        display: block !important;
    }

    .main-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    #main-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ============================================================
       Print Branding Header
       ============================================================ */
    #main-content::before {
        content: "רוז סטודיו CRM";
        display: block;
        text-align: center;
        font-size: 16pt;
        font-weight: 700;
        color: #b76e79;
        border-bottom: 2px solid #b76e79;
        padding-bottom: 0.5cm;
        margin-bottom: 0.75cm;
    }

    /* ============================================================
       General Typography
       ============================================================ */
    h2, h3 {
        color: #333 !important;
        page-break-after: avoid;
    }

    h2 {
        font-size: 14pt;
        margin-bottom: 0.5cm;
    }

    h3 {
        font-size: 12pt;
    }

    /* ============================================================
       Cards
       ============================================================ */
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
        margin-bottom: 0.5cm;
        padding: 0.4cm;
    }

    .card-header {
        background: #f5f5f5 !important;
        color: #333 !important;
        font-weight: 600;
        border-bottom: 1px solid #ccc;
        padding: 0.3cm;
    }

    /* ============================================================
       Tables (shared across views)
       ============================================================ */
    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
    }

    th, td {
        border: 1px solid #999;
        padding: 4pt 6pt;
        text-align: right;
    }

    th {
        background: #f0f0f0 !important;
        font-weight: 600;
    }

    tr {
        page-break-inside: avoid;
    }

    /* Remove clickable row styling */
    .clickable-row,
    .clickable-card {
        cursor: default !important;
    }

    /* ============================================================
       Stat Cards (Dashboard)
       ============================================================ */
    .stats-grid {
        display: flex !important;
        flex-wrap: wrap;
        gap: 0.3cm;
    }

    .stat-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: white !important;
        flex: 1 1 22%;
        padding: 0.3cm;
        break-inside: avoid;
        cursor: default !important;
    }

    .stat-card-icon {
        display: none;
    }

    /* ============================================================
       Customer Profile View
       ============================================================ */
    .customer-detail .measurements-table,
    .customer-detail table {
        border: 1px solid #999;
    }

    .customer-detail .measurements-table th,
    .customer-detail .measurements-table td {
        border: 1px solid #999;
        padding: 4pt 6pt;
    }

    /* ============================================================
       Financial View
       ============================================================ */
    .financial-summary {
        border: 1px solid #ccc;
        padding: 0.3cm;
        margin-bottom: 0.5cm;
    }

    .financial-row {
        display: flex;
        justify-content: space-between;
        padding: 2pt 0;
        border-bottom: 1px dotted #ddd;
    }

    .financial-row.total {
        border-top: 2px solid #333;
        border-bottom: none;
        font-weight: 700;
        padding-top: 4pt;
        margin-top: 4pt;
    }

    .amount.positive {
        color: #27ae60 !important;
    }

    .amount.negative {
        color: #c0392b !important;
    }

    /* ============================================================
       Badges
       ============================================================ */
    .badge {
        border: 1px solid #999;
        padding: 1pt 4pt;
        font-size: 9pt;
    }

    /* ============================================================
       Dress Catalog Grid
       ============================================================ */
    .dress-grid {
        display: block !important;
    }

    .dress-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
        margin-bottom: 0.4cm;
        padding: 0.3cm;
    }

    .inventory-table {
        font-size: 9pt;
    }

    .inventory-cell {
        text-align: center;
    }

    /* ============================================================
       Links
       ============================================================ */
    a {
        color: #333 !important;
        text-decoration: none !important;
    }

    /* ============================================================
       Prevent page breaks inside key elements
       ============================================================ */
    .stat-card,
    .dress-card,
    .card,
    tr {
        page-break-inside: avoid;
    }

    /* ============================================================
       Alert banners
       ============================================================ */
    .alert {
        border: 1px solid #999 !important;
        background: #f9f9f9 !important;
        color: #333 !important;
    }
}
