/*
 * Audit-register attachments upload — GLOBAL (non-scoped) styles.
 *
 * Deliberately NOT component-scoped CSS: the always-visible dashed dropzone frame was
 * intermittently vanishing because Blazor CSS-isolation regenerates the component's scope
 * hash (b-xxxxx) on every .razor.css change, and the scoped bundle is served without
 * cache-busting — a stale bundle/scope-id mismatch made the scoped rules silently stop
 * matching until a hard refresh. Global rules key off the class only, so they always match.
 * Every selector is prefixed with .audit-upload so it stays confined to this component's markup.
 */

.audit-upload {
    margin-top: 0.2rem;
}

.audit-upload .audit-upload-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.audit-upload .audit-upload-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #1f2d3a);
}

.audit-upload .audit-upload-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #56656f);
    background: var(--surface-muted, #f1f4f7);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-variant-numeric: tabular-nums;
}

/* Literal border colour (not var(--border-strong)): one active theme sets that token to near-white,
   which is invisible on the light card. Fixed mid-grey stays visible in every theme. The inline
   style on the element is primary; this is a fallback. */
.audit-upload .audit-dropzone {
    position: relative;
    border: 2px dashed #94a3b0;
    border-radius: 10px;
    background: var(--surface-muted, #f8fafc);
}

.audit-upload .audit-dropzone.drag-over {
    border-color: #0a5aa6;
    background: var(--accent-soft, #e7f0f9);
}

.audit-upload .audit-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.4rem 1rem;
    pointer-events: none;
}

.audit-upload .audit-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--accent, #0a5aa6);
    color: var(--accent, #0a5aa6);
    margin-bottom: 0.6rem;
}

.audit-upload .audit-upload-text {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-primary, #1f2d3a);
}

.audit-upload .audit-browse-link {
    color: var(--accent, #0a5aa6);
    font-weight: 700;
    text-decoration: underline;
}

.audit-upload .audit-upload-subtext {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary, #8493a0);
}

/* Transparent native file input covering the whole zone → click + drag-drop both work, no JS. */
.audit-upload .audit-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.audit-upload .audit-upload-error {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--danger, #b3261e);
}

.audit-upload .audit-file-list {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.audit-upload .audit-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--surface-card, #fff);
    font-size: 0.86rem;
}

.audit-upload .audit-file-item.pending {
    background: var(--surface-muted, #f8fafc);
}

.audit-upload .af-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary, #1f2d3a);
}

.audit-upload a.af-name {
    color: var(--accent, #0a5aa6);
    text-decoration: none;
}

.audit-upload a.af-name:hover {
    text-decoration: underline;
}

.audit-upload .af-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #8493a0);
    background: var(--surface-muted, #eef2f6);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
}

.audit-upload .af-remove {
    border: 0;
    background: transparent;
    color: var(--text-secondary, #8493a0);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
}

.audit-upload .af-remove:hover:not(:disabled) {
    color: var(--danger, #b3261e);
}

.audit-upload .af-remove:disabled {
    opacity: 0.5;
    cursor: default;
}

.audit-upload .audit-upload-note {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    font-style: italic;
    color: var(--text-secondary, #8493a0);
}
