/* ═══════════════════════════════════════════════════════════════
   REVISE DIFF MODAL — revise-diff.css
   Before / After side-by-side comparison
═══════════════════════════════════════════════════════════════ */

/* Backdrop — full screen overlay */
.rdm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rdm-backdrop.hidden {
    display: none;
}

/* Modal sizing */
#revise-diff-modal .rdm-wrap {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(15, 23, 42, .22), 0 0 0 1px rgba(33, 191, 117, .12);
    width: 900px;
    max-width: 96vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: rdmSlideIn .28s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes rdmSlideIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Header */
.rdm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(to right, #f8fffe, #fff);
    flex-shrink: 0;
}

.rdm-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rdm-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #18a562, #21bf75);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(33, 191, 117, .25);
    flex-shrink: 0;
}

.rdm-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -.3px;
}

.rdm-subtitle {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 2px;
}

.rdm-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.rdm-close-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
    transform: rotate(90deg);
}

/* Column Labels */
.rdm-cols-header {
    display: grid;
    grid-template-columns: 1fr 36px 1fr;
    gap: 0;
    padding: 10px 24px 0;
    background: #fafffe;
    flex-shrink: 0;
}

.rdm-col-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-family: 'JetBrains Mono', monospace;
    padding-bottom: 8px;
    border-bottom: 2px solid transparent;
}

.rdm-col-before {
    color: #ef4444;
    border-color: #fca5a5;
}

.rdm-col-after {
    color: #21bf75;
    border-color: #86efac;
}

.rdm-col-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rdm-dot-before {
    background: #ef4444;
}

.rdm-dot-after {
    background: #21bf75;
}

/* Body scroll area */
.rdm-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 24px 20px;
    background: #fafffe;
    scrollbar-width: thin;
    scrollbar-color: #d1fae5 transparent;
}

.rdm-body::-webkit-scrollbar {
    width: 5px;
}

.rdm-body::-webkit-scrollbar-thumb {
    background: #d1fae5;
    border-radius: 4px;
}

/* Section title */
.rdm-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    padding: 12px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid #f1f5f9;
    margin-top: 8px;
}

/* Field list (for flat obj diffs) */
.rdm-field-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rdm-field-row {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    background: white;
}

.rdm-field-changed {
    border-color: #fde68a;
    background: #fffbeb;
}

.rdm-field-name {
    padding: 6px 12px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.rdm-field-changed .rdm-field-name {
    background: #fef9e7;
    color: #b45309;
}

/* Two-col cell layout */
.rdm-field-vals {
    display: grid;
    grid-template-columns: 1fr 36px 1fr;
    align-items: center;
    min-height: 40px;
}

/* Cells */
.rdm-cell {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    word-break: break-word;
    min-height: 40px;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
}

.rdm-cell-before {
    border-right: 1px solid #f1f5f9;
}

.rdm-cell-after {
    border-left: 1px solid #f1f5f9;
}

.rdm-cell-old {
    background: #fff5f5;
}

.rdm-cell-new {
    background: #f0fdf4;
}

/* Value styles */
.rdm-val-old {
    color: #b91c1c;
    text-decoration: line-through;
    font-size: 13px;
}

.rdm-val-new {
    color: #15803d;
    font-size: 13px;
    font-weight: 700;
}

.rdm-val-same {
    color: #64748b;
    font-size: 13px;
}

/* Arrow / equals */
.rdm-cell-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #cbd5e1;
    padding: 4px;
}

.rdm-arrow {
    color: #f59e0b;
    font-size: 13px;
}

.rdm-eq {
    color: #d1d5db;
    font-size: 11px;
}

/* Actions rows */
.rdm-actions-row {
    border: none;
    background: transparent;
}

.rdm-list-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;
    padding: 10px 12px;
}

.rdm-act-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #475569;
    padding: 5px 10px;
    border-radius: 7px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

.rdm-item-added {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.rdm-item-changed {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.rdm-act-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e8faf2;
    border: 1.5px solid #d1fae5;
    color: #128050;
    font-size: 9px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rdm-act-type {
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    background: #e8faf2;
    color: #128050;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

/* Array diff rows */
.rdm-array-diff {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rdm-array-row {
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    background: white;
    overflow: hidden;
}

.rdm-row-added {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.rdm-row-removed {
    border-color: #fca5a5;
    background: #fff5f5;
}

.rdm-row-changed {
    border-color: #fde68a;
    background: #fffbeb;
}

.rdm-row-same {
    opacity: .65;
}

.rdm-arr-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    align-items: stretch;
}

.rdm-arr-field {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    color: #475569;
}

.rdm-arr-field-changed {
    color: #15803d;
    font-weight: 700;
}

.rdm-arr-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
    min-width: 72px;
}

.rdm-arr-val {
    word-break: break-word;
}

.rdm-cell-empty {
    font-size: 12px;
    color: #d1d5db;
    font-style: italic;
    padding: 10px 14px;
}

.rdm-cell-deleted {
    color: #fca5a5;
}

/* Badges */
.rdm-badge-added {
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.rdm-badge-removed {
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    font-family: 'JetBrains Mono', monospace;
}

/* No diff */
.rdm-no-diff {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
}

/* Footer */
.rdm-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    background: white;
    flex-shrink: 0;
}

.rdm-footer-info {
    flex: 1;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
}

.rdm-has-changes {
    color: #f59e0b;
}

.rdm-btn-discard {
    padding: 9px 20px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 7px;
}

.rdm-btn-discard:hover {
    border-color: #fca5a5;
    color: #ef4444;
    background: #fef2f2;
}

.rdm-btn-accept {
    padding: 9px 28px;
    border-radius: 12px;
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: white;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 14px rgba(33, 191, 117, .3);
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 7px;
}

.rdm-btn-accept:hover {
    background: linear-gradient(135deg, #128050, #18a562);
    box-shadow: 0 6px 20px rgba(33, 191, 117, .4);
    transform: translateY(-1px);
}

/* ── Dependent Section rows in diff ─────────────────────── */
.rdm-ds-row {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 6px 0;
}

.rdm-ds-row.rdm-row-added {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.rdm-ds-row.rdm-row-removed {
    border-color: #fecaca;
    background: #fff5f5;
}

.rdm-ds-row.rdm-row-changed {
    border-color: #fde68a;
    background: #fffbeb;
}

.rdm-ds-row.rdm-row-same {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.rdm-ds-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.rdm-ds-header i {
    color: #64748b;
    font-size: 13px;
}

.rdm-ds-meta {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    margin-left: auto;
}

.rdm-ds-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.rdm-ds-attr {
    font-size: 11px;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.rdm-badge-changed {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 700;
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
    border-radius: 3px;
    padding: 1px 5px;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════
   AI Modal — Generate / Revise Mode Toggle
═══════════════════════════════════════════════════════════════ */

.aim-mode-btn {
    cursor: pointer;
    border: 1.5px solid transparent;
    background: transparent;
    border-radius: 10px;
    transition: all .2s ease;
}

.aim-mode-btn:hover:not(.aim-mode-active) {
    background: #f1f5f9;
    color: #475569;
}

.aim-mode-btn.aim-mode-active[id="aim-mode-gen"] {
    background: linear-gradient(135deg, #e8faf2, #dcfce7);
    color: #128050;
    border-color: #bbf7d0;
    box-shadow: 0 2px 8px rgba(33, 191, 117, .15);
}

.aim-mode-btn.aim-mode-active[id="aim-mode-rev"] {
    background: linear-gradient(135deg, #fef3c7, #fef9e7);
    color: #b45309;
    border-color: #fde68a;
    box-shadow: 0 2px 8px rgba(245, 158, 11, .15);
}

/* ═══════════════════════════════════════════════════════════════
   DEPARTMENT LIST REVISE — Operations Review Modal
═══════════════════════════════════════════════════════════════ */

.dlr-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dlr-backdrop.hidden {
    display: none;
}

.dlr-wrap {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(15, 23, 42, .22);
    width: 960px;
    max-width: 96vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: rdmSlideIn .28s cubic-bezier(.4, 0, .2, 1) both;
}

.dlr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(to right, #f8fffe, #fff);
    flex-shrink: 0;
}

.dlr-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dlr-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, .25);
}

.dlr-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: #fafffe;
}

.dlr-summary {
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    font-size: 13px;
    color: #128050;
    font-weight: 600;
    margin-bottom: 16px;
}

.dlr-op-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: white;
    transition: all 0.15s;
}

.dlr-op-card:hover {
    border-color: #d1fae5;
    box-shadow: 0 2px 8px rgba(33, 191, 117, .08);
}

.dlr-op-card.dlr-delete {
    border-color: #fca5a5;
    background: #fff5f5;
}

.dlr-op-card.dlr-compress {
    border-color: #fde68a;
    background: #fffbeb;
}

.dlr-op-card.dlr-enlarge {
    border-color: #93c5fd;
    background: #eff6ff;
}

.dlr-op-card.dlr-modify {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.dlr-op-card.dlr-add_process,
.dlr-op-card.dlr-add_object {
    border-color: #86efac;
    background: #f0fdf4;
}

.dlr-op-card.dlr-remove_process,
.dlr-op-card.dlr-remove_object {
    border-color: #fca5a5;
    background: #fef2f2;
}

.dlr-op-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dlr-op-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'JetBrains Mono', monospace;
}

.dlr-badge-delete {
    background: #fee2e2;
    color: #dc2626;
}

.dlr-badge-compress {
    background: #fef3c7;
    color: #d97706;
}

.dlr-badge-enlarge {
    background: #dbeafe;
    color: #2563eb;
}

.dlr-badge-modify {
    background: #f3e8ff;
    color: #7c3aed;
}

.dlr-badge-add_process,
.dlr-badge-add_object {
    background: #dcfce7;
    color: #16a34a;
}

.dlr-badge-remove_process,
.dlr-badge-remove_object {
    background: #fee2e2;
    color: #dc2626;
}

.dlr-badge-modify_process,
.dlr-badge-modify_object {
    background: #f3e8ff;
    color: #7c3aed;
}

.dlr-op-target {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.dlr-op-reason {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.5;
}

.dlr-op-details {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.dlr-op-details .dlr-detail-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
}

.dlr-op-details .dlr-detail-value {
    font-size: 12px;
    color: #475569;
    font-weight: 600;
}

.dlr-op-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    cursor: pointer;
}

.dlr-op-toggle input[type="checkbox"] {
    accent-color: #21bf75;
    width: 16px;
    height: 16px;
}

.dlr-op-toggle label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
}

.dlr-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    background: white;
    flex-shrink: 0;
}

.dlr-footer-info {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
}

.dlr-btn-cancel {
    padding: 9px 20px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}

.dlr-btn-cancel:hover {
    border-color: #fca5a5;
    color: #ef4444;
    background: #fef2f2;
}

.dlr-btn-apply {
    padding: 9px 28px;
    border-radius: 12px;
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: white;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 14px rgba(33, 191, 117, .3);
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 7px;
}

.dlr-btn-apply:hover {
    background: linear-gradient(135deg, #128050, #18a562);
    transform: translateY(-1px);
}

.dlr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    flex-direction: column;
    gap: 12px;
}

.dlr-loading-spinner {
    font-size: 28px;
    color: #21bf75;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════════
   AI ERROR HANDLER — Inline + Toast + Panel styles
═══════════════════════════════════════════════════════════════ */

/* ── Inline error (inside AI modal) ── */
.aie-inline {
    margin: 0 0 12px;
    border: 1.5px solid #fca5a5;
    border-radius: 12px;
    background: #fef2f2;
    overflow: hidden;
    animation: aieSlideIn 0.2s ease both;
}

@keyframes aieSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.aie-inline-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
}

.aie-inline-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fee2e2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.aie-inline-content {
    flex: 1;
    min-width: 0;
}

.aie-inline-title {
    font-size: 13px;
    font-weight: 800;
    color: #991b1b;
    margin-bottom: 2px;
}

.aie-inline-msg {
    font-size: 12px;
    color: #b91c1c;
    line-height: 1.5;
    font-weight: 600;
}

.aie-detail {
    margin-top: 6px;
    padding: 6px 10px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: #991b1b;
    word-break: break-word;
    max-height: 60px;
    overflow-y: auto;
}

.aie-detail i {
    margin-right: 4px;
    font-size: 9px;
}

.aie-inline-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #fca5a5;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.aie-inline-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.aie-inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 10px;
    border-top: 1px solid #fecaca;
    background: #fff5f5;
}

.aie-retry-btn {
    padding: 6px 16px;
    border-radius: 8px;
    background: #dc2626;
    color: white;
    border: none;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
}

.aie-retry-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.aie-hint {
    font-size: 10px;
    color: #b91c1c;
    font-weight: 600;
    font-style: italic;
}

/* ── Toast (floating bottom) ── */
.aie-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    max-width: 480px;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.aie-toast.aie-toast-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.aie-toast-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: #1e293b;
    border: 1.5px solid #334155;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.aie-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.aie-toast-body {
    flex: 1;
    min-width: 0;
}

.aie-toast-msg {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.4;
}

.aie-toast-detail {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 3px;
    font-family: 'JetBrains Mono', monospace;
    word-break: break-word;
}

.aie-toast-retry {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
}

.aie-toast-retry:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.aie-toast-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.aie-toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

/* ── Panel error (inside DeptListRevise modal) ── */
.aie-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px;
    text-align: center;
}

.aie-panel-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.aie-panel-title {
    font-size: 17px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
}

.aie-panel-msg {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    max-width: 400px;
    margin-bottom: 16px;
    font-weight: 600;
}

.aie-panel-query {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.aie-panel-query-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
}

.aie-panel-query-text {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
    font-style: italic;
    line-height: 1.5;
    word-break: break-word;
}

.aie-panel-actions {
    display: flex;
    gap: 10px;
}

.aie-panel-retry {
    padding: 10px 22px;
    border-radius: 10px;
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: white;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(33, 191, 117, 0.25);
}

.aie-panel-retry:hover {
    background: linear-gradient(135deg, #128050, #18a562);
    transform: translateY(-1px);
}

.aie-panel-edit {
    padding: 10px 22px;
    border-radius: 10px;
    background: white;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.aie-panel-edit:hover {
    border-color: #cbd5e1;
    color: #475569;
    background: #f8fafc;
}