.exceptions-shell {
    padding: 24px;
    background: linear-gradient(180deg, #f7f7f2 0%, #fffdf8 100%);
    border-radius: 24px;
}

.exceptions-view-hidden {
    display: none !important;
}

.exceptions-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.exceptions-header h3 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    color: #1f2937;
}

.exceptions-header p {
    margin: 0;
    color: #6b7280;
    max-width: 760px;
}

.exceptions-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 18px;
    margin-bottom: 18px;
}

.exceptions-detail-header h3 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    color: #1f2937;
}

.exceptions-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.exception-summary-card {
    padding: 18px 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.exception-summary-card .label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.exception-summary-card strong {
    font-size: 1.8rem;
    color: #111827;
}

.exception-summary-card.danger {
    background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
    border-color: rgba(239, 68, 68, 0.2);
}

.exceptions-toolbar {
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    margin-bottom: 18px;
}

.exceptions-filter-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(140px, 1fr));
    gap: 12px;
}

.exceptions-filter-grid input,
.exceptions-filter-grid select,
.exception-detail-form input,
.exception-detail-form textarea {
    
    min-height: 44px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: #111827;
}

.exceptions-table-wrap {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

#exceptions-table thead th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    background: #f8fafc;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

#exceptions-table tbody tr {
    cursor: pointer;
}

#exceptions-table tbody tr:hover {
    background: #fffdf2;
}

#exceptions-table tbody tr.exception-po-row {
    background: linear-gradient(90deg, rgba(254, 242, 242, 0.7) 0%, rgba(255, 255, 255, 1) 58%);
}

.exception-po-focus {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.exception-po-focus-desc {
    color: #9a3412;
    font-weight: 600;
}

.exception-chip,
.exception-status-badge,
.exception-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.exception-priority-high {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
}

.exception-priority-medium {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.exception-priority-low {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.exception-status-open {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.exception-status-in-progress {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.exception-status-resolved {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.exception-status-rejected {
    background: rgba(71, 85, 105, 0.16);
    color: #334155;
}

.exception-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.95fr);
    gap: 18px;
}

.exception-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: #fff;
    padding: 18px;
}

.exception-panel h5,
.exception-panel h6 {
    margin: 0 0 12px;
    color: #111827;
}

.exception-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.exception-badge-row {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.exception-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exception-field label,
.exception-meta-item .label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.exception-meta-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.exception-meta-item .value {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-weight: 600;
}

.exception-compare-list,
.exception-log-list,
.exception-comment-list {
    display: grid;
    gap: 10px;
}

.exception-compare-item,
.exception-log-item,
.exception-comment-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.exception-compare-item strong,
.exception-log-item strong,
.exception-comment-item strong {
    display: block;
    margin-bottom: 4px;
    color: #111827;
}

.exception-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.exception-note-box {
    min-height: 96px;
    margin-top: 12px;
}

.exception-empty {
    padding: 18px;
    border-radius: 14px;
    background: #f8fafc;
    color: #6b7280;
    text-align: center;
}

.exception-loading-state {
    padding: 24px;
    text-align: center;
    color: #6b7280;
}

.exception-document-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    font-size: 0.76rem;
    font-weight: 700;
}

.exception-updated-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 700;
}

.exception-detail-form input.is-exception-edited,
.exception-detail-form textarea.is-exception-edited {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.exception-change-summary {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
    padding: 12px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 14px;
    background: rgba(239, 246, 255, 0.82);
}

.exception-change-summary-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
}

.exception-change-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.38fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 10px;
    border-radius: 12px;
    background: #ffffff;
}

.exception-change-row > span {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.exception-change-row div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.exception-change-row del {
    color: #b91c1c;
    font-weight: 700;
}

.exception-change-row strong {
    color: #047857;
    font-weight: 700;
}

.exception-change-row small {
    flex-basis: 100%;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
}

.exception-document-preview {
    margin-bottom: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
}

.exception-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.exception-preview-header strong {
    display: block;
    color: #111827;
    overflow-wrap: anywhere;
}

.exception-preview-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.exception-preview-frame-wrap {
    height: clamp(340px, 52vh, 720px);
    background: #e5e7eb;
}

.exception-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #ffffff;
}

.exception-preview-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 24px;
    color: #6b7280;
    text-align: center;
}

.exception-preview-empty i {
    font-size: 2rem;
    color: #94a3b8;
}

.exception-assign-dialog {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    transform: none !important;
}

#exception-assign-modal .modal-dialog-centered {
    min-height: calc(100% - 3.5rem);
    display: flex;
    align-items: center;
}

.exception-assign-modal {
    overflow: hidden;
    border: 0;
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
    font-weight: 700;
}

.exception-assign-modal * {
    font-weight: 700 !important;
}

.exception-assign-hero {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: flex-start;
    padding: 26px 28px 22px;
    background:
        radial-gradient(circle at 14% 12%, rgba(168, 85, 247, 0.22), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f6f3ff 52%, #eef6ff 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.exception-assign-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    box-shadow: 0 16px 34px rgba(124, 58, 237, 0.32);
}

.exception-assign-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #7c3aed;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.exception-assign-hero h5 {
    margin: 0;
    color: #111827;
    font-size: 1.35rem;
    font-weight: 700;
}

.exception-assign-hero p {
    margin: 7px 0 0;
    color: #64748b;
    line-height: 1.45;
}

.exception-assign-close {
    margin-top: 2px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.exception-assign-body {
    display: grid;
    gap: 18px;
    padding: 24px 28px;
    background: #ffffff;
}

.exception-assign-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.exception-assign-field {
    margin: 0;
}

.exception-assign-field label {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.exception-select-shell {
    position: relative;
}

.exception-select-shell i {
    position: absolute;
    left: 14px;
    top: 50%;
    z-index: 1;
    color: #7c3aed;
    transform: translateY(-50%);
}

.exception-select-shell select {
    width: 100%;
    min-height: 48px;
    padding: 0 42px 0 42px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 15px;
    color: #111827;
    background: #f8fafc;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.exception-select-shell select:focus {
    border-color: rgba(124, 58, 237, 0.55);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.11);
}

.exception-assign-preview {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.exception-assign-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.9);
}

.exception-assign-preview-head span {
    display: block;
    margin-bottom: 2px;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.exception-assign-preview-head strong {
    color: #172033;
    font-size: 0.95rem;
}

.exception-assign-preview-head i {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.exception-assign-user-list {
    max-height: 210px;
    overflow-y: auto;
    display: grid;
    gap: 10px;
    padding: 14px;
}

.exception-assign-user-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.exception-assign-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6, #0ea5e9);
    font-weight: 700;
}

.exception-assign-user-card strong {
    display: block;
    color: #111827;
    font-size: 0.93rem;
}

.exception-assign-user-card small {
    display: block;
    margin-top: 2px;
    color: #64748b;
    overflow-wrap: anywhere;
}

.exception-assign-footer {
    gap: 10px;
    padding: 18px 28px 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    background: #ffffff;
}

.exception-assign-secondary,
.exception-assign-primary {
    min-height: 44px;
    border-radius: 14px;
    font-weight: 700;
    padding-inline: 18px;
}

.exception-assign-primary {
    border: 0;
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    box-shadow: 0 14px 26px rgba(124, 58, 237, 0.3);
}

@media (max-width: 1200px) {
    .exceptions-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .exception-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .exceptions-shell {
        padding: 18px;
    }

    .exceptions-header,
    .exceptions-summary {
        grid-template-columns: 1fr;
        display: grid;
    }

    .exceptions-filter-grid,
    .exception-detail-grid,
    .exception-action-grid {
        grid-template-columns: 1fr;
    }

    .exception-preview-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .exception-preview-frame-wrap {
        height: 420px;
    }

    .exception-assign-grid {
        grid-template-columns: 1fr;
    }

    .exception-assign-hero {
        grid-template-columns: auto 1fr;
    }

    .exception-assign-close {
        position: absolute;
        right: 18px;
        top: 18px;
    }
}
