/* Scoped to IKOM: no changes to existing portal forms or PWA menus. */
#ikom-view, .ikom-create-dialog { font-family: var(--font); }
#ikom-view button, #ikom-view input, #ikom-view select, #ikom-view textarea,
.ikom-create-dialog button, .ikom-create-dialog input, .ikom-create-dialog select, .ikom-create-dialog textarea { font-family: inherit; }
#ikom-view [hidden] { display: none !important; }
#ikom-detail { padding: 24px; margin-top: 16px; min-width: 0; }
#ikom-detail h2, #ikom-detail h3 { margin: 20px 0 12px; }
.ikom-toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.ikom-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ikom-wide { grid-column: 1 / -1; }
.ikom-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin: 18px 0; min-width: 0; }
.ikom-fieldset legend { padding: 0 8px; font-weight: 600; }
#ikom-detail .input-group { min-width: 0; margin-bottom: 12px; }
#ikom-detail input, #ikom-detail select, #ikom-detail textarea { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }
#ikom-detail textarea { resize: vertical; }
#ikom-detail fieldset:disabled input, #ikom-detail fieldset:disabled textarea, #ikom-detail fieldset:disabled select { opacity: 1; color: var(--text-primary); }
.ikom-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.ikom-drop { border: 2px dashed var(--border); border-radius: 10px; padding: 16px; display: grid; gap: 12px; }
.ikom-drop.drag-over { border-color: var(--accent); }
.ikom-drop small { overflow-wrap: anywhere; }
.ikom-submit-status { margin: 0; padding: 12px 22px; flex: 0 0 auto; overflow-wrap: anywhere; }
.ikom-submit-status[hidden] { display: none !important; }
.ikom-submit-status[data-state="error"] { color: #ffb7b7; background: #43232b; }
.ikom-signature-preview { max-width: 260px; max-height: 100px; background: white; object-fit: contain; }
.ikom-history { padding-left: 22px; }
.ikom-history li { margin: 12px 0; }
.ikom-history small { display: block; color: var(--text-secondary); }
#ikom-detail details li { overflow-wrap: anywhere; }
.ikom-fingerprint { display: block; overflow-wrap: anywhere; margin: 8px 0; }
.ikom-table-wrap { overflow-x: auto; width: 100%; max-width: 100%; border: 1px solid var(--border); border-radius: 12px; }
.ikom-table { width: 100%; min-width: 1000px; border-collapse: collapse; }
.ikom-table th, .ikom-table td { padding: 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.ikom-table th { background: #1a1f33; white-space: nowrap; }
.ikom-table td { min-width: 125px; max-width: 250px; }
.ikom-table td small { display: block; margin-top: 6px; color: var(--text-secondary); }
.ikom-table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ikom-table tr.ikom-awaiting-engineer { opacity: .55; background: #20232d; }
.ikom-awaiting-engineer button { cursor: not-allowed; }
.ikom-delete { color: #ff6868; border-color: #a83b48; }
#ikom-show-deleted-label { display: inline-flex; gap: 8px; align-items: center; }
.ikom-create-dialog { box-sizing: border-box; width: min(92vw, 850px); height: min(90dvh, 800px); max-height: 90dvh; max-width: 92vw; margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 16px; color: var(--text-primary); background: #111525; overflow: hidden; }
.ikom-create-dialog[open] { display: flex; flex-direction: column; }
.ikom-create-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.ikom-modal-header, .ikom-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; flex: 0 0 auto; }
.ikom-modal-header { border-bottom: 1px solid var(--border); }
.ikom-modal-header h2 { margin: 0; font-size: 1.35rem; }
.ikom-modal-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }
.ikom-modal-body { padding: 22px; overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; }
.ikom-modal-footer { border-top: 1px solid var(--border); justify-content: flex-end; }
.ikom-create-dialog .input-group { min-width: 0; }
.ikom-create-dialog input, .ikom-create-dialog select, .ikom-create-dialog textarea { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }
.ikom-create-dialog textarea { resize: vertical; }
.ikom-retention label { display: flex; align-items: flex-start; gap: 10px; }
.ikom-retention input[type="checkbox"] { width: 18px; flex: 0 0 18px; margin-top: 2px; }
.ikom-retention p { color: var(--text-secondary); font-size: .9rem; line-height: 1.5; }
@media (max-width: 700px) {
    .ikom-form { grid-template-columns: minmax(0, 1fr); }
    #ikom-detail { padding: 12px; }
}
/* Mobile menu rollout is separate; do not introduce the new module there yet. */
@media (max-width: 840px) {
    body .nav-menu .nav-item[data-target="ikom-view"] { display: none !important; }
}
.ikom-attachment-dialog { width: min(96vw, 1050px); max-height: 92vh; }
.ikom-attachment-body { overflow: auto; max-height: calc(92vh - 155px); padding: 1rem; text-align: center; }
.ikom-attachment-body img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
