/* ============================================
   GENERAL APP WRAPPER
   ============================================ */
.illyrix-app {
    width: 100%;
    max-width: 1400px;
    margin: 18px auto;
    padding: 10px;
    font-family: "Inter", Arial, sans-serif;
}

/* HEADER + FILTERS */
.illyrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffffd9;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.illyrix-header .filters { display:flex; gap:10px; align-items:center; }
.illyrix-header input, .illyrix-header select { padding:8px 10px; border-radius:6px; border:1px solid #d1d1d1; }

/* BUTTONS */
.illyrix-btn { padding:9px 14px; border-radius:8px; background:#1565C0; color:#fff; border:none; font-weight:700; cursor:pointer; }
.illyrix-btn:hover { background:#0d47a1; }
.illyrix-btn-secondary { padding:7px 12px; border-radius:8px; border:1px solid #ccc; background:#fff; cursor:pointer; }

/* TABLE */
.illyrix-table-wrap { border-radius:8px; border:1px solid #eee; overflow:auto; }
#illyrixTable { width:100%; border-collapse:collapse; min-width:900px; }
#illyrixTable thead th { background:#fafafa; position:sticky; top:0; z-index:3; padding:12px; text-align:left; font-weight:600; }
#illyrixTable td { padding:12px; border-bottom:1px solid #f1f1f1; vertical-align:middle; }
#illyrixTable tbody tr:nth-child(even){ background:#fbfbfb; }
#illyrixTable tbody tr:hover{ background:#f0f7ff; }

/* PRINT BUTTON */
.illyrix-print-btn { background:#1565C0; color:white; border:none; padding:8px 10px; border-radius:6px; cursor:pointer; }

/* MODAL BACKDROP */
#illyrixModal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.55); z-index:99998; padding:40px 0; overflow:hidden; }

/* MODAL BOX centered with internal scroll */
.illyrix-modal-box { width:500px !important; max-height:90vh !important; max-width:95vw; background:#fff; margin:auto; border-radius:14px; padding:28px; box-shadow:0 0 40px rgba(0,0,0,0.30); animation:fadeInScale .15s ease-out; position:relative; overflow-y:auto; }
@keyframes fadeInScale { from { opacity:0; transform:scale(.96);} to { opacity:1; transform:scale(1);} }

/* FORM FIELDS */
#illyrixForm input, #illyrixForm select, #illyrixForm textarea { width:100% !important; box-sizing:border-box; padding:9px 10px; margin-top:6px; border:1px solid #ddd; border-radius:6px; }
#illyrixForm textarea { height:110px; resize:none; }

/* CLOSE BUTTON */
#modalClose { position:absolute; top:12px; right:12px; background:#0D47A1; color:#fff; padding:6px 12px; border-radius:8px; border:none; font-size:18px; cursor:pointer; }

/* BTN ROW */
.illyrix-btn-row { display:flex; gap:10px; justify-content:flex-end; margin-top:14px; }
.btnPrimary { background:#1565C0; color:#fff; padding:10px 16px; border-radius:8px; border:none; cursor:pointer; }
.btnCancel { background:#eee; padding:10px 16px; border-radius:8px; border:none; cursor:pointer; }

/* Prevent modal from affecting rest of layout */
body.modal-open { overflow:hidden !important; }

/* RESPONSIVE */
@media (max-width:700px) {
    .illyrix-modal-box { width:92% !important; }
    #illyrixTable thead th, #illyrixTable td { font-size:13px; padding:8px; }
}

/* PRINT: A4 with two A5 copies, cut line in middle */
@media print {
    @page { size:A4 portrait; margin:8mm; }
    body { margin:0; -webkit-print-color-adjust:exact; }
    .container, .voucher { width:100%; }
    .voucher { box-sizing:border-box; height:148.5mm; padding:18mm; border:1px solid rgba(0,0,0,0.06); border-radius:8px; margin:0 auto; }
    .cut { border-top:1px dashed #999; margin:8px 0; }
    /* hide UI during print */
    #illyrixModal, .illyrix-modal-box, .illyrix-header, .illyrix-btn, .illyrix-print-btn, .illyrix-table-wrap { display:none !important; }
}
