:root {
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    /* Light Theme Core */
    --c-canvas: #F0F4F8;
    --c-surface: rgba(255, 255, 255, 0.75);
    --c-surface-solid: #FFFFFF;
    --c-border: rgba(226, 232, 240, 0.8);
    --c-border-s: #CBD5E1;
    --c-ink: #0F172A;
    --c-ink-2: #334155;
    --c-ink-3: #64748B;

    /* Vibrant Premium Accents (Chatbot Green) */
    --c-primary: #8FCC33;
    --c-primary-h: #7AB628;
    --c-primary-lt: #F4F9EA;
    --gradient-primary: linear-gradient(135deg, #8FCC33 0%, #7AB628 100%);
    --gradient-hover: linear-gradient(135deg, #9DE03D 0%, #8FCC33 100%);

    /* Status Colors */
    --c-critical: #EF4444;
    --c-review: #F59E0B;
    --c-ok: #10B981;

    /* Radii & Effects */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    --shadow-float: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 15px rgba(143, 204, 51, 0.4);
    --glass-blur: blur(16px);

    /* Layout */
    --header-h: 70px;
    --sidebar-w: 280px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bouncy: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--c-canvas);
    background-image:
        radial-gradient(at 0% 0%, rgba(143, 204, 51, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.03) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--c-ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---------------- HEADER ---------------- */
#app-header {
    height: var(--header-h);
    background: var(--c-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-soft);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: default;
    transition: var(--transition-smooth);
}

.header-brand:hover {
    transform: scale(1.02);
}

.brand-icon {
    height: 40px;
    object-fit: contain;
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--c-ink);
    letter-spacing: -0.5px;
    display: block;
    line-height: 1.1;
}

.brand-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---------------- MAIN LAYOUT ---------------- */
#main-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: calc(100vh - var(--header-h));
    background-color: #fff;
}

#content-area {
    min-width: 0;
}

#panel-workflow {
    padding: 40px 32px;
    height: calc( 100vh - var(--header-h) );
    overflow-y: auto;
}

/* ---------------- SIDEBAR ---------------- */
#sidebar {
    width: var(--sidebar-w);
    height: 100vh ;
    /* background: var(--c-surface-solid); */
    background: #143d2b;
    border-right: 1px solid var(--c-border);
    padding: 14px 13px;
    position: sticky;
    /* top: var(--header-h); */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 50;
    scrollbar-width: none;
}

#sidebar .sb-label {
    color: rgba(255, 255, 255, 0.5);
}

#sidebar .sb-credits-number {
    color: #8FCC33;
}

#sidebar .sb-buy-btn {
    color: #8FCC33;
    border-color: #8FCC33;
}

#sidebar .sb-buy-btn:hover {
    background: #8FCC33;
    color: #fff;
}

#sidebar .sb-credits-subtext {
    color: rgba(255, 255, 255, 0.5);
}

#sidebar .sb-credits-bar-track {
    background: rgba(255, 255, 255, 0.1);
}

#sidebar .sb-history-item {
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

#sidebar .sb-history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(143, 204, 51, 0.3);
}

#sidebar .sb-history-date {
    color: rgba(255, 255, 255, 0.45);
}

#sidebar .sb-history-acts {
    color: rgba(255, 255, 255, 0.85);
}

#sidebar .sb-history-status {
    background: rgba(143, 204, 51, 0.15);
    color: #8FCC33;
    border-color: rgba(143, 204, 51, 0.3);
}

#sidebar .sb-empty {
    color: rgba(255, 255, 255, 0.4);
}

#sidebar .sb-search-input {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

#sidebar .sb-search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

#sidebar .sb-search-input:focus {
    border-color: #8FCC33;
    background: rgba(255, 255, 255, 0.1);
}

#sidebar .sb-search-icon {
    color: rgba(255, 255, 255, 0.4);
}

#sidebar .sb-search-clear {
    color: rgba(255, 255, 255, 0.4);
}

#sidebar .support-item {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
}

#sidebar .support-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(143, 204, 51, 0.4);
    color: #8FCC33;
}

#sidebar::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.sb-section {
    padding-bottom: 12px;
}

.sb-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.sb-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #94a3b8;
    margin-bottom: 12px;
}

.sb-credits-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sb-credits-number {
    font-size: 28px;
    font-weight: 800;
    color: #8FCC33;
    line-height: 1;
}

.sb-buy-btn {
    font-size: 12px;
    font-weight: 700;
    color: #8FCC33;
    border: 1.5px solid #8FCC33;
    background: transparent;
    border-radius: 20px;
    padding: 5px 14px;
    cursor: pointer;
    transition: background .2s, color .2s;
    font-family: inherit;
}

.sb-buy-btn:hover {
    background: #8FCC33;
    color: #fff;
}

.sb-credits-bar-track {
    height: 4px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}

.sb-credits-bar-fill {
    height: 100%;
    background: #8FCC33;
    border-radius: 99px;
    transition: width .5s ease, background .3s ease;
}

.sb-credits-subtext {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.sb-history-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
    border: 1px solid var(--c-border);
    margin-bottom: 8px;
}

.sb-history-item:last-child {
    margin-bottom: 0;
}

.sb-history-item:hover {
    background: var(--c-primary-lt);
    border-color: rgba(143, 204, 51, .3);
}

.sb-history-date {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.sb-history-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.sb-history-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.sb-history-badge.no-report {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde68a;
}

.sb-empty {
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
    padding: 24px 0;
}

/* ---------------- PANELS ---------------- */
/* .panel {
    background: var(--c-surface-solid);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 30px;
    margin-bottom: 20px;
} */

.panel-head {
    margin-bottom: 30px;
}

.panel-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--c-ink);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.panel-desc {
    color: var(--c-ink-3);
    font-size: 15px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: var(--shadow-soft) !important;
    border-radius: var(--radius-lg) !important;
}

/* ---------------- DROPZONE ---------------- */
.dropzone {
    border: 2px dashed var(--c-border-s) !important;
    border-radius: var(--radius) !important;
    background: var(--c-canvas) !important;
    transition: var(--transition-smooth) !important;
    min-height: 180px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--c-ink-3) !important;
    font-family: inherit !important;
}

.dropzone:hover {
    border-color: var(--c-primary) !important;
    background: var(--c-primary-lt) !important;
}

.dropzone .dz-message {
    font-weight: 600 !important;
    font-size: 16px !important;
}

/* Custom Dropzone Preview UX */
.dropzone .dz-preview {
    margin: 16px !important;
}

.dropzone .dz-preview .dz-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    color: var(--c-critical);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    line-height: 24px;
    text-align: center;
    font-size: 0;
    /* Hide default "Remove file" text */
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 30;
    border: 1px solid var(--c-border);
    transition: var(--transition-smooth);
}

.dropzone .dz-preview .dz-remove::after {
    content: "\2716";
    font-size: 14px;
    font-weight: bold;
}

.dropzone .dz-preview .dz-remove:hover {
    background: var(--c-critical);
    color: white;
    border-color: var(--c-critical);
    transform: scale(1.1);
}

.dropzone .dz-preview .dz-error-message {
    top: 140px !important;
}

/* Fix Dropzone filename overflow */
.dropzone .dz-preview .dz-details {
    max-width: 120px;
    overflow: hidden;
}

.dropzone .dz-preview .dz-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.dropzone .dz-preview .dz-filename span {
    background-color: rgba(255, 255, 255, 0.8) !important;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* ---------------- BUTTONS ---------------- */
button {
    cursor: pointer;
}

.btn-primary,
.btn-next {
    padding: 12px 24px;
    background: var(--gradient-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-bouncy);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(143, 204, 51, 0.4) !important;
    cursor: pointer;
}

.btn-primary:hover,
.btn-next:hover {
    transform: translateY(-2px);
    background: var(--gradient-hover) !important;
    box-shadow: 0 6px 20px rgba(143, 204, 51, 0.6) !important;
}

.btn-primary:active,
.btn-next:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(143, 204, 51, 0.4) !important;
}

.btn-primary.disabled,
.btn-primary:disabled,
.btn-next:disabled {
    background: var(--c-border-s) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 12px 24px;
    background: #fff !important;
    color: var(--c-ink-2) !important;
    border: 1px solid var(--c-border-s) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: var(--c-canvas) !important;
    color: var(--c-ink) !important;
}

/* ---------------- EXTRACTED DATA ---------------- */
.extracted-data-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.extracted-list-item {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-border);
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition-smooth);
}

.extracted-list-item:nth-child(even) {
    background: #f8fafc;
}

.extracted-list-item:last-child {
    border-bottom: none;
}

.extracted-list-item:hover {
    background: var(--c-primary-lt);
}

.extracted-item-key {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.extracted-item-val {
    font-size: 15px;
    color: var(--c-ink);
    line-height: 1.5;
}

.extracted-item-conf {
    display: flex;
    justify-content: flex-end;
}

.confidence-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.confidence-high {
    background: #dcfce7;
    color: #166534;
}

.confidence-medium {
    background: #fef9c3;
    color: #854d0e;
}

.confidence-low {
    background: #fee2e2;
    color: #991b1b;
}

/* ---------------- SELECT2 OVERRIDES ---------------- */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--multiple {
    background-color: #fff !important;
    border: 1px solid var(--c-border-s) !important;
    border-radius: var(--radius-sm) !important;
    min-height: 48px !important;
    padding: 4px 8px !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--c-primary) !important;
    box-shadow: 0 0 0 3px rgba(143, 204, 51, 0.1) !important;
}

/* .select2-selection__choice {
    background-color: var(--c-primary-lt) !important;
    border: 1px solid rgba(143, 204, 51, 0.3) !important;
    color: var(--c-primary-h) !important;
    border-radius: 20px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
} */

.select2-selection__choice {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row-reverse !important;
    gap: 6px !important;
    background-color: var(--c-primary-lt) !important;
    border: 1px solid rgba(143, 204, 51, 0.3) !important;
    color: var(--c-primary-h) !important;
    border-radius: 20px !important;
    padding: 5px 10px 5px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.select2-selection__choice__remove {
    color: var(--c-primary-h) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    cursor: pointer !important;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.select2-selection__choice__remove:hover {
    opacity: 1;
    color: var(--c-critical) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    left: 3px !important;
    top: 5px !important;
}

/* ---------------- QUESTIONS ---------------- */
.question-block {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 24px;
    margin-bottom: 20px;
    transition: var(--transition-smooth);
}

.question-block:hover {
    border-color: var(--c-primary);
    box-shadow: var(--shadow-float);
}

.question-block.answered {
    opacity: 0.7;
    background: var(--c-canvas);
    pointer-events: none;
}

.question-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--c-ink);
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--c-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    margin-right: 10px;
}

.question-block input[type="text"],
.question-block textarea,
.question-block select {
    width: 100%;
    border: 1px solid var(--c-border-s);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: var(--transition-smooth);
}

.question-block input[type="text"]:focus,
.question-block textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(143, 204, 51, 0.15);
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

/* .radio-inline, .checkbox-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--c-ink-2);
}
input[type="radio"], input[type="checkbox"] {
    accent-color: var(--c-primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
} */

.radio-inline,
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--c-ink-2);
    line-height: 1;
}

input[type="radio"],
input[type="checkbox"] {
    accent-color: var(--c-primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
    position: relative;
    top: 0;
}

/* ---------------- MARKDOWN / COMPLIANCE LIST ---------------- */
.markdown-body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--c-ink-2);
    line-height: 1.7;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    color: var(--c-ink);
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 700;
}

.markdown-body h2 {
    font-size: 1.25rem;
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 8px;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.markdown-body li {
    margin-bottom: 6px;
}

.markdown-body p {
    margin-bottom: 16px;
}

/* .markdown-body strong {
    color: var(--c-ink);
    font-weight: 700;
} */

.markdown-body strong {
    color: var(--c-ink);
    font-weight: 700;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse !important;
    margin: 16px 0 20px;
    font-size: 14px;
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid #d1d5db !important;
    padding: 10px 12px !important;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
    line-height: 1.5;
}

.markdown-body table thead th {
    background-color: #8FCC33 !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 13px;
}

.markdown-body table tbody tr:nth-child(even) td {
    background-color: #f9fafb;
}

.markdown-body table tbody tr:hover td {
    background-color: #eff6ff;
    transition: background 0.15s ease;
}

/* ---------------- ANIMATIONS ---------------- */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------- TOAST NOTIFICATIONS ---------------- */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--c-surface-solid);
    color: var(--c-ink);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-float);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
    animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border-left: 4px solid var(--c-ink-3);
    transition: opacity 0.3s;
}

.toast i {
    font-size: 18px;
}

.toast.success {
    border-color: var(--c-ok);
}

.toast.success i {
    color: var(--c-ok);
}

.toast.error {
    border-color: var(--c-critical);
}

.toast.error i {
    color: var(--c-critical);
}

.toast.warning {
    border-color: var(--c-review);
}

.toast.warning i {
    color: var(--c-review);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ---------------- LOGIN SCREEN ---------------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .brand-icon {
    height: 64px;
    object-fit: contain;
    margin-bottom: 15px;
    display: inline-block;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.login-card .form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-card .form-control {
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    transition: all 0.2s ease;
}

.login-card .form-control:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-lt);
    background: #ffffff;
}

/* Better Button Styling */
#btnLoginSubmit,
#btnLoginLoading {
    padding: 12px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 6px rgba(143, 204, 51, 0.2);
    transition: all 0.3s ease;
}

#btnLoginSubmit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(143, 204, 51, 0.3);
}

#app-header .btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
    background-color: transparent;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

#app-header .btn-outline-danger:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

/* ---------------- MOBILE RESPONSIVE ---------------- */
@media (max-width: 768px) {
    #main-layout {
        grid-template-columns: 1fr;
    }

    #sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--c-border);
        padding: 16px;
        overflow-y: visible;
    }

    #panel-workflow {
        padding: 20px 15px;
    }

    #app-header {
        padding: 0 16px;
    }

    .brand-name {
        font-size: 18px;
    }

    .brand-tag {
        font-size: 10px;
    }

    .panel {
        padding: 20px 15px;
    }

    .panel-title {
        font-size: 22px;
    }

    .extracted-data-grid {
        grid-template-columns: 1fr;
    }

    .question-block {
        padding: 16px;
    }

    .toast-container {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-next {
        width: 100%;
        justify-content: center;
    }

    .d-flex.justify-content-end.mt-3.mb-4 {
        flex-direction: column;
        gap: 10px;
    }

    .d-flex.justify-content-end.mt-3.mb-4 .ml-2 {
        margin-left: 0 !important;
    }

    #stepCompliance .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    #stepCompliance .card-header div {
        display: flex;
        width: 100%;
        gap: 10px;
    }

    #stepCompliance .card-header div button {
        flex: 1;
        margin-left: 0 !important;
    }
}

/* ---------------- RAG PROGRESS ---------------- */
#ragProgressWrap {
    background: var(--c-surface-solid);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-top: 20px;
}

#ragProgressWrap .rag-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-ink-3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 14px;
}

#ragProgressWrap .rag-act-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-ink);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#ragProgressWrap .rag-bar-track {
    height: 6px;
    background: var(--c-border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
}

#ragProgressWrap .rag-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

#ragProgressWrap .rag-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
}

#ragProgressWrap .rag-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--c-ink-3);
    transition: color 0.2s;
}

#ragProgressWrap .rag-step.active {
    color: var(--c-ink);
    font-weight: 600;
}

#ragProgressWrap .rag-step.done {
    color: var(--c-ok);
}

#ragProgressWrap .rag-step .rag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-border-s);
    flex-shrink: 0;
    transition: background 0.2s;
}

#ragProgressWrap .rag-step.active .rag-dot {
    background: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(143, 204, 51, 0.25);
}

#ragProgressWrap .rag-step.done .rag-dot {
    background: var(--c-ok);
}

#ragProgressWrap .rag-counter {
    font-size: 12px;
    color: var(--c-ink-3);
    text-align: right;
    margin-top: 6px;
}

/* ---------------- COMPLIANCE SKELETON ---------------- */
#complianceSkeleton {
    padding: 8px 4px;
}

.skel-line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: skelShimmer 1.4s infinite;
}

.skel-line.mt-2 {
    margin-top: 10px;
}

.skel-line.mt-4 {
    margin-top: 22px;
}

.skel-line.w-40 {
    width: 40%;
}

.skel-line.w-45 {
    width: 45%;
}

.skel-line.w-50 {
    width: 50%;
}

.skel-line.w-60 {
    width: 60%;
}

.skel-line.w-65 {
    width: 65%;
}

.skel-line.w-70 {
    width: 70%;
}

.skel-line.w-75 {
    width: 75%;
}

.skel-line.w-80 {
    width: 80%;
}

@keyframes skelShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ---------------- BUTTON SPINNER (Continue / Analyzing states) ---------------- */
.btn-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: btnSpin 0.7s linear infinite;
    flex-shrink: 0;
}

.btn-spinner.hidden {
    display: none;
}

@keyframes btnSpin {
    to {
        transform: rotate(360deg);
    }
}

.btn-next:disabled {
    cursor: not-allowed;
    opacity: 0.85;
    transform: none;
}

.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
}

@keyframes ragShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 150%;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------------- SIDEBAR SUPPORT ---------------- */
.sidebar-support {
    margin-top: 5px;
    flex-shrink: 0;
    padding-top: 16px;
}

.support-divider {
    height: 1px;
    background: var(--c-border);
    margin: 0 0 16px;
}

.sidebar-support a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.support-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    color: var(--c-ink-2);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.support-item .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--c-ink-3);
    transition: color 0.2s ease;
}

.support-item .support-text {
    line-height: 1;
}

.support-item:hover {
    background: var(--c-primary-lt);
    border-color: rgba(143, 204, 51, 0.45);
    color: var(--c-primary-h);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(143, 204, 51, 0.35);
}

.support-item:hover .icon {
    color: var(--c-primary);
}

.support-item:active {
    transform: translateY(0);
    box-shadow: none;
}

.sb-history-item.active {
    /* background: var(--c-primary-lt) !important; */
    border-color: rgba(143, 204, 51, 0.5) !important;
    border-left: 4px solid var(--c-primary) !important;
    padding-left: 9px;
    box-shadow: 0 2px 8px rgba(143, 204, 51, 0.15);
}

.sb-history-item.active .sb-history-date {
    color: var(--c-primary-h);
    font-weight: 600;
}

.sb-history-item.active .sb-history-acts {
    color: var(--c-ink);
}

/* ---------------- BUY CREDITS MODAL ---------------- */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop.open {
    display: flex;
}

.modal-dialog {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 32px 28px 28px;
    width: 460px;
    max-width: 92%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--c-ink);
}

.modal-header {
    margin-bottom: 24px;
}

.modal-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--c-primary);
    margin: 0 0 6px;
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
}

.modal-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.modal-footer-note {
    font-size: 11px;
    color: #94a3b8;
    margin: 20px 0 0;
    text-align: center;
}

.plans-loading {
    text-align: center;
    padding: 32px 0;
}

.plans-loading i {
    font-size: 24px;
    color: var(--c-primary);
}

.plans-loading p {
    margin: 12px 0 0;
    font-size: 13px;
    color: #94a3b8;
}

#plansList {
    display: none;
    flex-direction: column;
    gap: 12px;
}

/* ── Sidebar History Section ───────────────────────── */
.sb-history-section {
    display: flex;
    flex-direction: column;
    min-height: 0;          
    flex: 1;              
    padding-bottom: 12px;
}

/* Scrollable list */
.sb-history-scroll {
    overflow-y: auto;
    padding-right: 2px;    
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

.sb-history-scroll::-webkit-scrollbar {
    width: 4px;
}
.sb-history-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.sb-history-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}
.sb-history-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Search input wrapper */
.sb-search-wrap {
    position: relative;
    margin-bottom: 10px;
}

.sb-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 12px;
    pointer-events: none;
}

.sb-search-input {
    width: 100%;
    padding: 8px 30px 8px 30px;
    border: 1px solid var(--c-border-s);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    color: var(--c-ink);
    background: var(--c-canvas);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sb-search-input::placeholder {
    color: #b0bec5;
}

.sb-search-input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(143, 204, 51, 0.12);
    background: #fff;
}

.sb-search-clear {
    position: absolute;
    right: 10px;
    top: 42%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: none;        
    transition: color 0.15s;
}

.sb-search-clear:hover {
    color: var(--c-critical);
}

.sb-history-acts {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.sb-history-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.sb-search-clear { display: none; }
.sb-search-clear.visible { display: block; }

#complianceList h1{
    font-size: 1.7rem;
    font-weight: 600;
}

/* ---------------- AUDIT PROGRESS PANEL ---------------- */
.ap-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #94a3b8;
    padding: 6px 0;
    transition: color 0.3s;
}

.ap-step.active {
    color: #0f172a;
    font-weight: 600;
}

.ap-step.done {
    color: #10B981;
}

.ap-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}

.ap-step.active .ap-dot {
    background: #8FCC33;
    box-shadow: 0 0 0 3px rgba(143, 204, 51, 0.25);
}

.ap-step.done .ap-dot {
    background: #10B981;
    box-shadow: none;
}

.ap-step.done .ap-step-text::after {
    content: " ✓";
    font-size: 11px;
}