.notes-page { padding: 18px 20px; color: #263747; }
.notes-page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.notes-page-header > i { background: #e1eff5; color: #126e91; padding: 12px; border-radius: 10px; }
.notes-page-header h1 { font-size: 21px; font-weight: 650; margin: 0; }
.notes-page-header p { color: #697b88; margin: 4px 0 0; font-size: 13px; }
.notes-panel { background: white; border: 1px solid #dae4eb; border-radius: 10px; box-shadow: 0 3px 12px #17364b06; overflow: hidden; }
.notes-filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(135px, 1fr)) minmax(155px, 1fr) auto; gap: 12px; align-items: end; padding: 16px; border-bottom: 1px solid #e5ecf0; }
.notes-filters label { display: block; margin: 0; color: #526674; font-size: 12px; font-weight: 600; }
.notes-filters input, .notes-filters select { display: block; width: 100%; min-width: 0; height: 36px; margin-top: 5px; padding: 6px 10px; border: 1px solid #cbd8e1; border-radius: 5px; background: white; font-size: 13px; color: #263747; }
.notes-filters select { min-width: 155px; }
.notes-page .btn { border-radius: 5px; font-size: 12px; padding: 7px 12px; }
.notes-filters .btn { height: 36px; margin: 0; background: #147da4; border-color: #147da4; }
#registered-notes-message:empty { display: none; }
#registered-notes-message { margin: 12px 16px; color: #805018; }
.notes-table-wrap { overflow: auto; }
.notes-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 0; }
.notes-table thead { background: #f4f7fa; }
.notes-table th { color: #617584; font-weight: 600; font-size: 11px; padding: 12px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid #dde6ec; }
.notes-table td { padding: 8px 12px; vertical-align: middle; border-bottom: 1px solid #edf1f5; }
.notes-table tbody tr:hover { background: #fafcfe; }
.notes-table .note-number { color: #176c8e; font-weight: 650; white-space: nowrap; }
.notes-table .note-customer { min-width: 150px; max-width: 240px; }
.notes-table .note-money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 650; }
.note-date { white-space: nowrap; }
.note-date small { display: block; color: #7d8d98; margin-top: 3px; }
.note-status { display: inline-block; border-radius: 20px; padding: 4px 9px; background: #edf1f5; color: #566b7d; white-space: nowrap; font-size: 11px; font-weight: 600; }
.note-status-issued { background: #e6f5ed; color: #257149; }
.note-status-pending_dgii { background: #fff2da; color: #8c5a0a; }
.note-status-rejected { background: #fdeaea; color: #a23535; }
.note-actions { min-width: 170px; white-space: nowrap; }
.note-actions > a, .note-actions > button { margin: 0 4px 0 0; }
.note-actions .btn { padding: 5px 9px; }
#registered-note-dialog { width: 430px; max-width: calc(100vw - 28px); max-height: 80vh; padding: 0; border: 1px solid #dce5eb; border-radius: 10px; color: #2a4253; box-shadow: 0 20px 70px #102a4340; }
#registered-note-dialog::backdrop { background: #142c4355; }
#registered-note-dialog header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: #f4f8fb; border-bottom: 1px solid #e0e8ef; }
#registered-note-dialog h2 { font-size: 16px; margin: 0; }
#registered-note-dialog header button { border: 0; background: transparent; font-size: 23px; color: #637a8a; cursor: pointer; }
#registered-note-dialog-content { padding: 16px 18px; font-size: 13px; overflow-wrap: anywhere; overflow-y: auto; max-height: 55vh; }
#registered-note-dialog-content h3 { font-size: 14px; margin: 0 0 12px; }
#registered-note-dialog-content p { margin: 0 0 10px; line-height: 1.5; }
.note-dgii-message { white-space: pre-wrap; line-height: 1.6; background: #fff4e8; border-left: 3px solid #d59642; padding: 10px 12px; border-radius: 4px; }
#registered-note-dialog footer { text-align: right; padding: 10px 18px; border-top: 1px solid #e5edf2; }
#registered-note-dialog footer .btn { padding: 7px 14px; border: 1px solid #cedbe5; border-radius: 5px; font-size: 12px; color: #36566c; background: #f5f8fb; cursor: pointer; }
#registered-note-dialog {
    position: fixed !important;
    inset: 0 !important;
    margin: auto !important;
    transform: none !important;
    width: 430px !important;
    height: fit-content !important;
    min-height: 0 !important;
    max-width: calc(100vw - 28px) !important;
    max-height: calc(100dvh - 40px) !important;
}
#registered-note-dialog header { width: 100%; position: static; flex-wrap: nowrap; gap: 16px; }
#registered-note-dialog header .note-detail-close { flex: 0 0 30px; width: 30px; height: 30px; padding: 0; margin: 0 0 0 auto; line-height: 30px; }
#registered-note-dialog header .note-detail-close:focus-visible { outline: 2px solid #147da4; outline-offset: 2px; border-radius: 4px; }
.note-actions summary { color: #526d80; cursor: pointer; font-size: 12px; white-space: nowrap; }
.note-actions details[open] { min-width: 200px; max-width: 280px; }
.note-actions details p { margin: 8px 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
.notes-footer { padding: 12px 16px; color: #71828e; font-size: 12px; display: flex; justify-content: space-between; align-items: center; }
.credit-note-dialog { max-width: calc(100vw - 20px) !important; border-radius: 12px !important; border: 1px solid #dbe4eb !important; box-shadow: 0 16px 60px #102a4330 !important; }
.credit-note-dialog .dialog-title { background: #f5f8fb; color: #21455c; font-size: 17px; border-bottom: 1px solid #e0e8ee; padding: 14px 20px !important; }
.credit-note-dialog .dialog-content { overflow-y: auto !important; padding: 16px 20px !important; }
.credit-note-dialog .credit-note-help { color: #728390; font-size: 12px; margin-bottom: 12px !important; }
.credit-note-dialog .credit-note-invoice { background: #eaf3f8; border-left: 3px solid #1c83aa; padding: 10px 12px; border-radius: 4px; color: #25526b; font-size: 13px; margin-bottom: 14px; }
.credit-note-dialog .credit-note-label { display: block; font-size: 12px; font-weight: 600; color: #526776; margin: 9px 0 5px; }
.credit-note-dialog select, .credit-note-dialog textarea, .credit-note-dialog input[type=number] { border: 1px solid #cbd8e1 !important; border-radius: 5px; font-size: 13px; padding: 7px 10px; }
.credit-note-dialog select { width: 100%; height: 36px; margin-bottom: 14px !important; }
.credit-note-dialog #credit-note-lines { padding: 0 12px; border-radius: 6px; max-height: 28vh; }
.credit-note-dialog .credit-note-line { display: grid !important; grid-template-columns: minmax(0, 1fr) 100px 100px; gap: 12px; margin: 0 !important; padding: 12px 0 !important; }
.credit-note-dialog .credit-note-line > div { width: auto !important; max-width: none !important; flex: none !important; padding: 0 !important; }
.credit-note-dialog .credit-note-line strong { font-size: 13px; line-height: 1.4; }
.credit-note-dialog .credit-note-line > div:last-child { align-self: center; font-size: 13px; font-weight: 600; }
.credit-note-dialog .credit-note-quantity-help { font-size: 11px; line-height: 1.5; margin-top: 4px; }
.credit-note-dialog .credit-note-quantity { width: 100%; height: 34px; text-align: right; }
.credit-note-dialog #credit-note-reason { width: 100%; min-height: 64px; max-height: 100px; resize: vertical; }
.credit-note-dialog #credit-note-inventory-box { background: #f5f8fa; border-radius: 5px; padding: 10px; font-size: 12px; gap: 6px; }
.credit-note-dialog .dialog-actions { border-top: 1px solid #e3eaf0; background: #fafcfd; padding: 12px 20px !important; display: flex; justify-content: flex-end; gap: 8px; }
.credit-note-dialog .dialog-actions button { border-radius: 5px; font-size: 13px; }
.credit-note-dialog #issue-credit-note { background: #147da4; color: white; }
@media (max-width: 1100px) {
    .notes-filters { grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(130px, 1fr)); }
    .notes-filters .notes-status-filter { grid-column: 1 / 3; }
}
@media (max-width: 600px) {
    .notes-page { padding: 12px 8px; }
    .notes-page-header h1 { font-size: 18px; }
    .notes-filters { grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
    .notes-search-filter { grid-column: 1 / -1; }
    .notes-filters .notes-status-filter { grid-column: auto; }
    .credit-note-dialog .credit-note-line { grid-template-columns: 1fr 90px; }
    .credit-note-dialog .credit-note-line > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .notes-table thead { display: none; }
    .notes-table, .notes-table tbody { display: block; }
    .notes-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; margin: 12px; border: 1px solid #dee7ed; border-radius: 7px; overflow: hidden; }
    .notes-table td { display: block; padding: 9px 12px; min-width: 0; max-width: none !important; border: 0; }
    .notes-table td::before { content: attr(data-label); display: block; font-size: 10px; color: #788a97; font-weight: 400; margin-bottom: 5px; }
    .notes-table .note-money { text-align: left; }
    .notes-table .note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; grid-column: 1 / -1; background: #f8fafc; border-top: 1px solid #e6ecf1; }
    .notes-table .note-actions::before { display: none; }
    .note-actions > a, .note-actions > button { margin-top: 0; }
    .note-actions details[open] { width: 100%; max-width: none; }
}
