/* ========================================
   FICHAS DE SEPARAÇÃO DE MATERIAIS
   Styles for material separation cards
======================================== */

/* Container */
.fichas-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Individual Card */
.ficha-card {
    border: 2px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    page-break-after: always;
    page-break-inside: avoid;
}

/* Card Header */
.ficha-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.ficha-header-left {
    flex: 1;
    min-width: 0;
}

.ficha-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.ficha-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 500;
}

.ficha-header-right {
    flex-shrink: 0;
}

.ficha-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.ficha-badge-lab {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Info Grid */
.ficha-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
}

.ficha-info-item {
    padding: 10px 20px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ficha-info-item:nth-child(2n) {
    border-right: none;
}

.ficha-info-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.ficha-info-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ficha-info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

/* Materials Section */
.ficha-materials {
    padding: 16px 20px;
    border-bottom: 2px solid #e2e8f0;
}

.ficha-materials-header {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #0f172a;
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ficha-count {
    font-weight: 600;
    color: #64748b;
    font-size: 0.7rem;
    letter-spacing: 0;
}

.ficha-section {
    margin-bottom: 14px;
}

.ficha-section:last-child {
    margin-bottom: 0;
}

.ficha-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #cbd5e1;
}

.ficha-section-icon {
    font-size: 1rem;
}

/* Checklist */
.ficha-checklist {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ficha-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 6px;
    font-size: 0.85rem;
    color: #1e293b;
    cursor: default;
    border-radius: 4px;
    line-height: 1.4;
}

.ficha-checklist-item:hover {
    background: #f8fafc;
}

.ficha-checkbox {
    display: inline-block;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid #94a3b8;
    border-radius: 3px;
    margin-top: 2px;
    flex-shrink: 0;
}

.ficha-no-materials {
    font-style: italic;
    color: #94a3b8;
    font-size: 0.85rem;
    padding: 8px 0;
}

/* Observations */
.ficha-observations {
    padding: 14px 20px;
    border-bottom: 2px solid #e2e8f0;
}

.ficha-obs-text {
    font-size: 0.85rem;
    color: #334155;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-top: 6px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Footer: Separation Status */
.ficha-footer {
    padding: 14px 20px;
    background: #f8fafc;
}

.ficha-status {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
}

.ficha-status-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    cursor: default;
}

.ficha-checkbox-large {
    display: inline-block;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2.5px solid #64748b;
    border-radius: 4px;
}

.ficha-separator-line {
    font-size: 0.8rem;
    color: #64748b;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

/* ========================================
   DARK MODE for on-screen preview
======================================== */
.dark .ficha-card {
    border-color: #475569;
    background: #1e293b;
}

.dark .ficha-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.dark .ficha-info-grid {
    border-bottom-color: #334155;
}

.dark .ficha-info-item {
    border-color: #334155;
}

.dark .ficha-info-label {
    color: #94a3b8;
}

.dark .ficha-info-value {
    color: #e2e8f0;
}

.dark .ficha-materials {
    border-bottom-color: #334155;
}

.dark .ficha-materials-header {
    background: #0f172a;
    color: #e2e8f0;
}

.dark .ficha-count {
    color: #94a3b8;
}

.dark .ficha-section-title {
    color: #e2e8f0;
    border-bottom-color: #475569;
}

.dark .ficha-checklist-item {
    color: #cbd5e1;
}

.dark .ficha-checklist-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dark .ficha-checkbox {
    border-color: #64748b;
}

.dark .ficha-observations {
    border-bottom-color: #334155;
}

.dark .ficha-obs-text {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
}

.dark .ficha-footer {
    background: #0f172a;
}

.dark .ficha-status-check {
    color: #e2e8f0;
}

.dark .ficha-checkbox-large {
    border-color: #94a3b8;
}

.dark .ficha-separator-line {
    color: #94a3b8;
    border-top-color: #334155;
}

/* ========================================
   PRINT STYLES
   Optimized for A4 paper
======================================== */
@media print {
    /* Hide everything except print content */
    body > *:not(.print-content):not(#rh-modal) {
        display: none !important;
    }

    /* Reset the modal container for print */
    .print-content {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .print-hide {
        display: none !important;
    }

    /* Force white backgrounds for print */
    .ficha-card {
        border: 2px solid #000 !important;
        border-radius: 8px !important;
        background: white !important;
        page-break-after: always;
        page-break-inside: avoid;
        margin: 0 !important;
    }

    .ficha-card:last-child {
        page-break-after: auto;
    }

    .fichas-container {
        gap: 0 !important;
    }

    .ficha-header {
        background: #1a1a1a !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 12px 16px !important;
    }

    .ficha-badge-lab {
        background: rgba(255, 255, 255, 0.15) !important;
        color: white !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .ficha-info-grid {
        border-color: #333 !important;
    }

    .ficha-info-item {
        border-color: #ccc !important;
        padding: 8px 14px !important;
    }

    .ficha-info-label {
        color: #555 !important;
        font-size: 0.65rem !important;
    }

    .ficha-info-value {
        color: #000 !important;
        font-size: 0.85rem !important;
    }

    .ficha-materials {
        border-color: #333 !important;
        padding: 12px 16px !important;
    }

    .ficha-materials-header {
        background: #eee !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .ficha-section-title {
        color: #000 !important;
        border-bottom-color: #999 !important;
    }

    .ficha-checklist-item {
        color: #000 !important;
        padding: 3px 4px !important;
    }

    .ficha-checkbox {
        border-color: #000 !important;
        border-width: 2px !important;
    }

    .ficha-observations {
        border-color: #333 !important;
        padding: 10px 16px !important;
    }

    .ficha-obs-text {
        background: #f5f5f5 !important;
        color: #000 !important;
        border-color: #ccc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .ficha-footer {
        background: #f5f5f5 !important;
        padding: 10px 16px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .ficha-status-check {
        color: #000 !important;
    }

    .ficha-checkbox-large {
        border-color: #000 !important;
        border-width: 2.5px !important;
    }

    .ficha-separator-line {
        color: #333 !important;
        border-top-color: #ccc !important;
    }

    /* Tighter spacing in print */
    .ficha-title {
        font-size: 1.1rem !important;
    }

    .ficha-subtitle {
        color: #aaa !important;
    }

    .ficha-section {
        margin-bottom: 10px !important;
    }
}

/* ========================================
   CONFERÊNCIA DIGITAL - CLASS LIST
======================================== */

/* List Items */
.conf-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}

.conf-list-item:hover {
    background: #e2e8f0;
}

.conf-list-item.conf-list-active {
    background: #ecfdf5;
    border-left: 3px solid #10b981;
}

.conf-list-item.conf-list-complete {
    opacity: 0.7;
}

.conf-list-item.conf-list-complete .conf-list-title {
    text-decoration: line-through;
    color: #64748b;
}

.dark .conf-list-item {
    border-bottom-color: #334155;
}

.dark .conf-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dark .conf-list-item.conf-list-active {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}

/* Status Badge */
.conf-list-status {
    flex-shrink: 0;
    padding-top: 2px;
}

.conf-list-check-pending {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .conf-list-check-pending {
    background: #334155;
    color: #94a3b8;
}

.conf-list-check-done {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Info Block */
.conf-list-info {
    flex: 1;
    min-width: 0;
}

.conf-list-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.dark .conf-list-title {
    color: #e2e8f0;
}

.conf-list-meta {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* Mini Progress Bar */
.conf-list-progress-bar {
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    border-radius: 9999px;
    margin-top: 6px;
    overflow: hidden;
}

.dark .conf-list-progress-bar {
    background: #334155;
}

.conf-list-progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* ========================================
   CONFERÊNCIA DIGITAL - FICHA INTERATIVA
======================================== */

.conf-ficha {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.dark .conf-ficha {
    border-color: #475569;
    background: #1e293b;
}

/* Materials Area */
.conf-materials-area {
    padding: 0;
}

/* Each Section */
.conf-section {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.conf-section:last-child {
    border-bottom: none;
}

.conf-section.conf-section-done {
    background: #f0fdf4;
}

.dark .conf-section {
    border-bottom-color: #334155;
}

.dark .conf-section.conf-section-done {
    background: rgba(16, 185, 129, 0.08);
}

/* Section Header */
.conf-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.dark .conf-section-header {
    background: rgba(15, 23, 42, 0.4);
    border-bottom-color: #334155;
}

.conf-section-check-area {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

.conf-section-check-area input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #10b981;
    cursor: pointer;
    flex-shrink: 0;
}

.conf-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dark .conf-section-title {
    color: #e2e8f0;
}

.conf-section-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    background: #e2e8f0;
    padding: 3px 10px;
    border-radius: 9999px;
    flex-shrink: 0;
}

.dark .conf-section-count {
    background: #334155;
    color: #94a3b8;
}

/* Items List */
.conf-items-list {
    padding: 6px 20px 6px 52px;
}

.conf-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.conf-item-row:hover {
    background: #f1f5f9;
}

.dark .conf-item-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.conf-item-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #10b981;
    cursor: pointer;
    flex-shrink: 0;
}

.conf-item-text {
    font-size: 0.85rem;
    color: #334155;
    transition: all 0.15s ease;
}

.dark .conf-item-text {
    color: #cbd5e1;
}

.conf-item-row.conf-item-done .conf-item-text {
    text-decoration: line-through;
    color: #94a3b8;
}

/* Section Observation Textarea */
.conf-section-obs {
    padding: 6px 20px 14px 52px;
}

.conf-obs-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
}

.conf-obs-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.conf-obs-input::placeholder {
    color: #94a3b8;
    font-style: italic;
}

.dark .conf-obs-input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.dark .conf-obs-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.dark .conf-obs-input::placeholder {
    color: #64748b;
}

/* ========================================
   RELATÓRIOS - TABLE STYLES
======================================== */

.rpt-table {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.dark .rpt-table {
    border-color: #334155;
}

.rpt-table th {
    white-space: nowrap;
}

.rpt-table td, .rpt-table th {
    border-bottom: 1px solid #f1f5f9;
}

.dark .rpt-table td, .dark .rpt-table th {
    border-bottom-color: #1e293b;
}

/* Print header: hidden on screen, shown on print */
#report-print-header {
    display: none !important;
}

@media print {
    #report-print-header {
        display: block !important;
    }

    .rpt-table {
        border: 1px solid #333 !important;
        font-size: 11px !important;
    }

    .rpt-table th {
        background: #eee !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .rpt-table td {
        border-bottom-color: #ccc !important;
        color: #000 !important;
    }

    #rpt-print-title {
        font-size: 18px !important;
        color: #000 !important;
    }

    #rpt-print-subtitle {
        color: #555 !important;
    }
}
