/* ============================================================
   TRUEVENCE DESIGN SYSTEM - COMPONENTS
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13.5px;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform var(--transition-fast), opacity var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
    user-select: none;
    white-space: nowrap;
    cursor: pointer;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--ink);
    color: #fff;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, var(--navy), var(--violet));
    transform: translateX(-101%);
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
    z-index: -1;
}

.btn-primary:hover::before {
    transform: translateX(0);
}

.btn-ghost {
    background: #fff;
    color: var(--ink);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--slate);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(197, 48, 48, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 7px 13px;
    font-size: 12.5px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    background: #fff;
    border: 1.5px solid var(--border);
    color: var(--slate);
}

.btn-icon:hover {
    border-color: var(--violetlt);
    color: var(--violet);
}

.btn.is-loading {
    position: relative;
    color: transparent !important;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.theme-toggle-btn:hover {
    background: var(--paper);
}

.theme-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow);
    transition: background 0.3s, border-color 0.3s, transform var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .lbl {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.stat-card .val {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 26px;
    color: var(--text-primary);
}

.stat-card .sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-card.accent-violet .val { color: var(--violet); }
.stat-card.accent-warning .val { color: var(--violet-600); }
.stat-card.accent-danger .val { color: var(--ink); }
.stat-card.accent-success .val { color: var(--violet); }
.stat-card.accent-info .val { color: var(--violetlt); }

/* ============================================================
   PANEL
   ============================================================ */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: background 0.3s, border-color 0.3s;
}

.panel-head {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.panel-body {
    padding: 18px 22px;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.search-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--paper);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    min-width: 220px;
    flex: 1;
    max-width: 400px;
}

.search-input input {
    border: none;
    background: none;
    outline: none;
    font-size: 13.5px;
    width: 100%;
    color: var(--ink);
}

.search-input svg {
    color: var(--slate-lt);
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.filter-select {
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 8px 30px 8px 14px;
    font-size: 13px;
    background: var(--bg-card);
    color: var(--ink);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23545A78' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:hover {
    border-color: var(--slate-lt);
}

.filter-select:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-weight: 600;
}

.data-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: var(--paper);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.cell-primary {
    font-weight: 700;
    color: var(--text-primary);
}

.cell-sub {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.cell-mono {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.empty-row {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
    font-size: 13.5px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-new {
    background: #EDE9FE;
    color: #5B21B6;
}
.badge-new .badge-dot { background: #5B21B6; }

.badge-progress {
    background: #DDD6FE;
    color: #5B21B6;
}
.badge-progress .badge-dot { background: #5B21B6; }

.badge-discrepancy {
    background: #0B1230;
    color: #FFFFFF;
}
.badge-discrepancy .badge-dot { background: #FFFFFF; }

.badge-completed {
    background: #7C3AED;
    color: #FFFFFF;
}
.badge-completed .badge-dot { background: #FFFFFF; }

.badge-hold {
    background: #EFEEF9;
    color: #545A78;
}
.badge-hold .badge-dot { background: #545A78; }

.badge-in-qa {
    background: #FFFFFF;
    color: #6D28D9;
    border: 1.5px solid #7C3AED;
}
.badge-in-qa .badge-dot { background: #6D28D9; }

.badge-approved {
    background: #7C3AED;
    color: #FFFFFF;
}
.badge-approved .badge-dot { background: #FFFFFF; }

.badge-priority-urgent {
    background: #0B1230;
    color: #FFFFFF;
}

.badge-priority-standard {
    background: #EFEEF9;
    color: #545A78;
}

/* ============================================================
   FORM PRIMITIVES
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
}

.form-grid.single {
    grid-template-columns: 1fr;
}

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

.field.span-2 {
    grid-column: 1 / -1;
}

.field label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--slate);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.field label .req {
    color: var(--ink);
}

.field-input,
.field select,
.field textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg-card);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    font-family: 'Inter', sans-serif;
}

.field-input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3.5px rgba(124, 58, 237, 0.12);
}

.field-input.error,
.field select.error {
    border-color: var(--danger);
}

.field-input.error:focus,
.field select.error:focus {
    box-shadow: 0 0 0 3.5px rgba(11, 18, 48, 0.12);
}

.field-error {
    font-size: 11.5px;
    color: var(--ink);
    margin-top: 4px;
}

.field-msg {
    font-size: 11.5px;
    color: var(--ink);
    min-height: 14px;
}

.field-msg.error {
    color: var(--ink);
}

.field-msg.success {
    color: var(--violet);
}

textarea {
    resize: vertical;
    min-height: 70px;
}

/* ============================================================
   CHECKBOXES & RADIOS
   ============================================================ */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.checkbox-tile {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: var(--paper);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.checkbox-tile input {
    accent-color: var(--violet);
    width: 16px;
    height: 16px;
}

.checkbox-tile:hover {
    border-color: var(--violetlt);
    background: var(--bg-card);
}

.checkbox-tile:has(input:checked) {
    border-color: var(--violet);
    background: rgba(124, 58, 237, 0.06);
}

.radio-pill-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.radio-pill input {
    accent-color: var(--violet);
}

.radio-pill.is-active,
.radio-pill:has(input:checked) {
    border-color: var(--violet);
    background: rgba(124, 58, 237, 0.06);
}

.radio-pill:hover {
    border-color: var(--violetlt);
}

/* ============================================================
   MODAL — classic (.modal-overlay/.modal-card)
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 48, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 36px 20px;
    overflow-y: auto;
}

.modal-overlay.is-active {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 760px;
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-head {
    padding: 20px 26px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--slate);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), color var(--transition-fast);
    cursor: pointer;
}

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

.modal-body {
    padding: 22px 26px;
    max-height: 68vh;
    overflow-y: auto;
    flex: 1;
}

.modal-foot {
    padding: 16px 26px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* ============================================================
   MODAL — new (.modal/.modal-content)
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.is-active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 18, 48, 0.55);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(11, 18, 48, 0.2);
    animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 1;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--slate-lt);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-soft);
    position: sticky;
    bottom: 0;
    background: #ffffff;
    border-radius: 0 0 16px 16px;
}

.hidden {
    display: none !important;
}

/* ============================================================
   FILE VIEWER MODAL (legacy)
   ============================================================ */
.file-viewer-modal .modal-card {
    max-width: 75vw;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
}

.file-viewer-modal .modal-body {
    overflow: auto;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    padding: 0;
    min-height: 400px;
}

.file-viewer-modal .modal-body img,
.file-viewer-modal .modal-body iframe {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    transform-origin: center;
    user-select: none;
}

.file-viewer-modal .modal-body img {
    pointer-events: none;
}

.file-viewer-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.zoom-badge {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 12px;
    border-radius: 12px;
    font-family: var(--font-mono);
}

/* ============================================================
   INLINE FILE VIEWER (click filename to maximize inline)
   ============================================================ */
.file-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color .15s ease;
}

.file-block.is-open {
    border-color: var(--violetlt);
}

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    user-select: none;
}

.file-row:hover {
    background: var(--paperdim);
}

.file-row .file-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--paperdim);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.file-row .file-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-row .file-name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}

.file-row .file-meta {
    font-size: 11px;
    color: var(--slate);
    font-family: 'IBM Plex Mono', monospace;
    flex-shrink: 0;
}

.file-row .file-toggle {
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--slate);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.file-block.is-open .file-row .file-toggle {
    color: var(--violet);
    border-color: var(--violetlt);
}

.file-block.is-open .file-row .file-toggle .toggle-label::before {
    content: 'Minimize';
}

.file-block.is-open .file-row .file-toggle .toggle-label-text {
    display: none;
}

.file-stage {
    display: none;
    border-top: 1px solid var(--border-soft);
    background: #f0f0f0;
    position: relative;
    padding: 0;
}

.file-block.is-open .file-stage {
    display: block;
}

.file-stage-inner {
    position: relative;
    overflow: auto;
    max-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.file-stage img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    transition: transform .2s ease;
    transform-origin: center center;
    user-select: none;
    display: block;
}

.file-stage iframe {
    width: 100%;
    height: 78vh;
    border: none;
    background: #fff;
}

.file-stage .zoom-bar {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border-soft);
    z-index: 5;
}

.file-stage .zoom-bar button {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--slate);
    cursor: pointer;
}

.file-stage .zoom-bar button:hover {
    border-color: var(--violetlt);
    color: var(--violet);
}

.file-stage .zoom-bar .zoom-label {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--slate);
}

.file-stage .no-preview {
    padding: 40px 20px;
    text-align: center;
    color: var(--slate);
    font-size: 13px;
}

.file-stage .no-preview a {
    color: var(--violet);
    font-weight: 700;
    text-decoration: underline;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: var(--z-toast);
    background: var(--ink);
    color: #fff;
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 9px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
    max-width: 400px;
}

.toast.is-active {
    transform: translateY(0);
    opacity: 1;
}

.toast.toast-success {
    background: var(--violet);
}

.toast.toast-error {
    background: var(--ink);
}

.toast.toast-warning {
    background: var(--violet-600);
    color: #fff;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 48, 0.5);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: var(--z-modal);
}

.loading-overlay.is-active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-message {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--paper) 0%, var(--paperdim) 50%, var(--paper) 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite;
}

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

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--slate);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state .empty-message {
    font-size: 14px;
    color: var(--slate-lt);
}

/* ============================================================
   BULK UPLOAD — drop zone, file pill, preview table
   ============================================================ */
.bulk-drop-zone {
    border: 2px dashed var(--border, rgba(19, 27, 69, 0.12));
    border-radius: var(--radius-md, 10px);
    padding: 34px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--paper, #F7F7FB);
}

.bulk-drop-zone:hover,
.bulk-drop-zone.is-dragover {
    border-color: var(--violet);
    background: rgba(124, 58, 237, 0.04);
}

.bulk-drop-zone svg {
    width: 38px;
    height: 38px;
    color: var(--slate-lt);
    margin-bottom: 10px;
}

.bulk-drop-zone p {
    margin: 0;
    font-size: 13.5px;
    color: var(--slate);
}

.bulk-drop-zone .bulk-hint {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--slate-lt);
}

.bulk-file-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    margin-top: 12px;
    font-size: 13px;
}

.bulk-file-pill .bulk-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.bulk-file-pill .bulk-size {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--slate);
}

.bulk-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 12px;
}

.bulk-preview-table th,
.bulk-preview-table td {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.bulk-preview-table th {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.bulk-preview-wrap {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    margin-top: 12px;
}

/* ============================================================
   UPLOAD AREA (API Verifications)
   ============================================================ */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--paper);
}

.upload-area:hover {
    border-color: var(--violet);
    background: rgba(124, 58, 237, 0.04);
}

.upload-area.dragover {
    border-color: var(--violet);
    background: rgba(124, 58, 237, 0.08);
}

.upload-area svg {
    width: 40px;
    height: 40px;
    color: var(--slate-lt);
    margin-bottom: 12px;
}

.upload-area p {
    margin: 0;
    font-size: 14px;
    color: var(--slate);
}

.upload-area .upload-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--slate-lt);
}

/* ============================================================
   MISC HELPERS
   ============================================================ */
.text-muted { color: var(--text-secondary, var(--slate)); }
.text-mono { font-family: 'IBM Plex Mono', monospace; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   EMERGENCY MODAL VISIBILITY FIX
   ============================================================ */
.modal.is-active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.modal:not(.is-active) {
    display: none !important;
}

#createCaseModal.modal.is-active,
#addClientModal.modal.is-active,
#addTeamModal.modal.is-active,
#resetPasswordModal.modal.is-active,
#fileViewerModal.modal.is-active,
#bulkUploadModal.modal.is-active {
    display: flex !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .checkbox-grid { grid-template-columns: 1fr 1fr; }
    .modal-content { max-width: 100%; margin: 0 10px; }
}
