/* ==========================================================================
   committee-expenses.css — Member Portal Committee Expense Sign-Off (Phase 5)
   Token-pure, no raw hex/colors, 44px min targets, 16px inputs, D21 focus.
   ========================================================================== */

#cm-expenses-root {
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-xl);
    width: 100%;
}

.cx-view {
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-xl);
    width: 100%;
}

/* ── Top Navigation / Back Bar ────────────────────────────────────────── */
.cx-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--oecta-space-md);
    flex-wrap: wrap;
}

.cx-back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--oecta-space-sm);
    min-height: 44px;
    padding: var(--oecta-space-sm) var(--oecta-space-md);
    background: var(--oecta-surface-lowest);
    border: 1px solid var(--oecta-border);
    border-radius: var(--oecta-radius-md);
    color: var(--oecta-primary);
    font-size: var(--oecta-text-sm);
    font-weight: var(--oecta-font-semibold);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--oecta-duration-fast) var(--oecta-ease-default),
                border-color var(--oecta-duration-fast) var(--oecta-ease-default);
}

.cx-back-btn:hover {
    background: var(--oecta-surface-container);
    border-color: var(--oecta-primary);
}

.cx-back-btn:focus-visible {
    outline: 2px solid var(--oecta-focus-ring);
    outline-offset: 2px;
}

.cx-queue-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--oecta-space-xs);
    min-height: 32px;
    padding: var(--oecta-space-xs) var(--oecta-space-md);
    background: var(--oecta-surface-container);
    border-radius: var(--oecta-radius-full);
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
    color: var(--oecta-on-surface);
}

/* ── Header Card ───────────────────────────────────────────────────────── */
.cx-header-card {
    background: var(--oecta-surface-lowest);
    border-radius: var(--oecta-radius-xl);
    padding: var(--oecta-space-xl);
    box-shadow: var(--portal-shadow);
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-sm);
    position: relative;
    overflow: hidden;
}

.cx-header-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--oecta-primary);
}

.cx-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--oecta-space-md);
    flex-wrap: wrap;
}

.cx-title {
    margin: 0;
    font-size: var(--oecta-text-2xl);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
    display: flex;
    align-items: center;
    gap: var(--oecta-space-sm);
}

.cx-subtitle {
    margin: 0;
    font-size: var(--oecta-text-sm);
    color: var(--oecta-on-surface-variant);
}

/* ── Filter / Tab Strip ────────────────────────────────────────────────── */
.cx-filter-strip {
    display: flex;
    align-items: center;
    gap: var(--oecta-space-sm);
    flex-wrap: wrap;
    padding-bottom: var(--oecta-space-xs);
}

.cx-filter-btn {
    min-height: 44px;
    padding: var(--oecta-space-sm) var(--oecta-space-lg);
    background: var(--oecta-surface-lowest);
    border: 1px solid var(--oecta-border);
    border-radius: var(--oecta-radius-full);
    font-size: var(--oecta-text-sm);
    font-weight: var(--oecta-font-semibold);
    color: var(--oecta-on-surface-variant);
    cursor: pointer;
    transition: all var(--oecta-duration-fast) var(--oecta-ease-default);
}

.cx-filter-btn:hover {
    background: var(--oecta-surface-container);
    color: var(--oecta-on-surface);
}

.cx-filter-btn.active {
    background: var(--oecta-primary);
    border-color: var(--oecta-primary);
    color: var(--oecta-on-primary);
}

.cx-filter-btn:focus-visible {
    outline: 2px solid var(--oecta-focus-ring);
    outline-offset: 2px;
}

/* ── Claims List & Cards ───────────────────────────────────────────────── */
.cx-list {
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-md);
}

.cx-card {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--oecta-surface-lowest);
    border: 1px solid var(--oecta-border);
    border-radius: var(--oecta-radius-lg);
    padding: var(--oecta-space-lg);
    cursor: pointer;
    box-shadow: var(--portal-shadow);
    transition: transform var(--oecta-duration-fast) var(--oecta-ease-default),
                box-shadow var(--oecta-duration-fast) var(--oecta-ease-default),
                border-color var(--oecta-duration-fast) var(--oecta-ease-default);
}

.cx-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--portal-shadow-md, var(--portal-shadow));
    border-color: var(--oecta-primary);
}

.cx-card:focus-visible {
    outline: 2px solid var(--oecta-focus-ring);
    outline-offset: 2px;
}

.cx-card-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--oecta-space-md);
}

.cx-card-name {
    font-size: var(--oecta-text-base);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
}

.cx-card-amt {
    font-size: var(--oecta-text-base);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-primary);
    white-space: nowrap;
}

.cx-card-meta {
    font-size: var(--oecta-text-xs);
    color: var(--oecta-on-surface-variant);
    margin: var(--oecta-space-xs) 0 var(--oecta-space-md);
}

.cx-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--oecta-space-sm);
    flex-wrap: wrap;
}

.cx-status {
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
    color: var(--oecta-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Badges ────────────────────────────────────────────────────────────── */
.cx-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--oecta-space-xs);
    padding: var(--oecta-space-xs) var(--oecta-space-sm);
    border-radius: var(--oecta-radius-full);
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
    line-height: 1;
}

.cx-badge--wait {
    background: var(--oecta-warning-bg);
    color: var(--oecta-warning-text);
}

.cx-badge--ok {
    background: var(--oecta-success-bg);
    color: var(--oecta-success-text);
}

.cx-badge--bad {
    background: var(--oecta-error-bg);
    color: var(--oecta-error-text);
}

/* ── Detail Card ───────────────────────────────────────────────────────── */
.cx-detail-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-md);
}

.cx-detail {
    background: var(--oecta-surface-lowest);
    border-radius: var(--oecta-radius-xl);
    padding: var(--oecta-space-xl);
    box-shadow: var(--portal-shadow);
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-lg);
}

.cx-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--oecta-space-md);
    flex-wrap: wrap;
}

.cx-detail-name {
    font-size: var(--oecta-text-xl);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
}

.cx-detail-meta {
    font-size: var(--oecta-text-sm);
    color: var(--oecta-on-surface-variant);
    margin-top: var(--oecta-space-xs);
}

.cx-detail-total {
    font-size: var(--oecta-text-2xl);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-primary);
    white-space: nowrap;
}

.cx-desc {
    font-size: var(--oecta-text-sm);
    line-height: var(--oecta-leading-relaxed);
    color: var(--oecta-on-surface);
    padding: var(--oecta-space-md);
    background: var(--oecta-surface-container);
    border-radius: var(--oecta-radius-md);
}

/* ── Line Items ────────────────────────────────────────────────────────── */
.cx-lines {
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-sm);
}

.cx-lines-title {
    font-size: var(--oecta-text-sm);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cx-line {
    padding: var(--oecta-space-md);
    background: var(--oecta-surface-container);
    border-radius: var(--oecta-radius-md);
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-xs);
}

.cx-line-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--oecta-space-md);
}

.cx-line-type {
    font-size: var(--oecta-text-sm);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
}

.cx-line-amt {
    font-size: var(--oecta-text-sm);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-primary);
}

.cx-line-sub {
    font-size: var(--oecta-text-xs);
    color: var(--oecta-on-surface-variant);
}

.cx-receipt {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--oecta-primary);
    font-weight: var(--oecta-font-semibold);
    text-decoration: underline;
    margin-right: var(--oecta-space-sm);
    min-height: 24px;
}

.cx-receipt:focus-visible {
    outline: 2px solid var(--oecta-focus-ring);
    outline-offset: 2px;
}

/* ── Decided Banner (Read-Only) ────────────────────────────────────────── */
.cx-decided {
    padding: var(--oecta-space-md) var(--oecta-space-lg);
    border-radius: var(--oecta-radius-md);
    font-size: var(--oecta-text-sm);
    line-height: var(--oecta-leading-relaxed);
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-xs);
}

.cx-decided--ok {
    background: var(--oecta-success-bg);
    color: var(--oecta-success-text);
}

.cx-decided--bad {
    background: var(--oecta-error-bg);
    color: var(--oecta-error-text);
}

.cx-decided-reason {
    margin-top: var(--oecta-space-xs);
    font-style: italic;
}

.cx-sig-thumb {
    display: block;
    margin-top: var(--oecta-space-sm);
    max-width: 240px;
    height: auto;
    background: var(--oecta-surface-lowest);
    border: 1px solid var(--oecta-border);
    border-radius: var(--oecta-radius-sm);
    padding: var(--oecta-space-xs);
}

/* ── Self-Approval Callout ─────────────────────────────────────────────── */
.cx-ownnote {
    padding: var(--oecta-space-md);
    background: var(--oecta-warning-bg);
    color: var(--oecta-warning-text);
    border-radius: var(--oecta-radius-md);
    font-size: var(--oecta-text-sm);
    font-weight: var(--oecta-font-semibold);
    line-height: var(--oecta-leading-relaxed);
    display: flex;
    align-items: flex-start;
    gap: var(--oecta-space-sm);
}

/* ── Actions ───────────────────────────────────────────────────────────── */
.cx-actions {
    display: flex;
    gap: var(--oecta-space-md);
    margin-top: var(--oecta-space-sm);
    flex-wrap: wrap;
}

.cx-btn {
    flex: 1;
    min-width: 140px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--oecta-space-sm);
    padding: var(--oecta-space-sm) var(--oecta-space-xl);
    border-radius: var(--oecta-radius-md);
    font-size: var(--oecta-text-sm);
    font-weight: var(--oecta-font-semibold);
    cursor: pointer;
    transition: all var(--oecta-duration-fast) var(--oecta-ease-default);
}

.cx-btn:focus-visible {
    outline: 2px solid var(--oecta-focus-ring);
    outline-offset: 2px;
}

.cx-btn-approve,
.cx-btn-confirm {
    background: var(--oecta-primary);
    border: 1px solid var(--oecta-primary);
    color: var(--oecta-on-primary);
}

.cx-btn-approve:hover,
.cx-btn-confirm:hover {
    filter: brightness(1.1);
}

.cx-btn-deny {
    background: var(--oecta-surface-lowest);
    border: 1px solid var(--oecta-error-text);
    color: var(--oecta-error-text);
}

.cx-btn-deny:hover {
    background: var(--oecta-error-bg);
}

.cx-btn--ghost {
    background: transparent;
    border: 1px solid var(--oecta-border);
    color: var(--oecta-on-surface);
}

.cx-btn--ghost:hover {
    background: var(--oecta-surface-container);
}

/* ── Modal Dialog ──────────────────────────────────────────────────────── */
.cx-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--oecta-space-md);
    z-index: 1000;
}

.cx-modal[hidden] {
    display: none;
}

.cx-modal-card {
    width: 100%;
    max-width: 500px;
    background: var(--oecta-surface-lowest);
    border-radius: var(--oecta-radius-xl);
    padding: var(--oecta-space-xl);
    box-shadow: var(--portal-shadow);
    display: flex;
    flex-direction: column;
    gap: var(--oecta-space-md);
}

.cx-modal-title {
    margin: 0;
    font-size: var(--oecta-text-xl);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
}

.cx-label {
    display: block;
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--oecta-space-xs);
}

.cx-reason {
    width: 100%;
    border: 1px solid var(--oecta-border);
    border-radius: var(--oecta-radius-md);
    padding: var(--oecta-space-sm) var(--oecta-space-md);
    font-size: 16px;
    line-height: var(--oecta-leading-normal);
    color: var(--oecta-on-surface);
    background: var(--oecta-surface-lowest);
    resize: vertical;
    box-sizing: border-box;
}

.cx-reason:focus-visible {
    outline: 2px solid var(--oecta-focus-ring);
    outline-offset: 2px;
}

.cx-sigpad {
    border: 2px dashed var(--oecta-border);
    border-radius: var(--oecta-radius-md);
    background: var(--oecta-surface-container);
    padding: var(--oecta-space-xs);
}

.cx-sigpad canvas {
    display: block;
    width: 100%;
    height: 160px;
    background: var(--oecta-surface-lowest);
    border-radius: var(--oecta-radius-sm);
    cursor: crosshair;
    touch-action: none;
}

.cx-sig-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--oecta-space-xs);
}

.cx-hint {
    font-size: var(--oecta-text-xs);
    color: var(--oecta-on-surface-variant);
}

.cx-link {
    background: none;
    border: none;
    color: var(--oecta-primary);
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
    cursor: pointer;
    padding: var(--oecta-space-xs) var(--oecta-space-sm);
    min-height: 32px;
}

.cx-link:focus-visible {
    outline: 2px solid var(--oecta-focus-ring);
    outline-offset: 2px;
}

.cx-sig-error {
    color: var(--oecta-error-text);
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-font-semibold);
}

.cx-modal-actions {
    display: flex;
    gap: var(--oecta-space-md);
    margin-top: var(--oecta-space-md);
}

/* ── Empty & Loading States ────────────────────────────────────────────── */
.cx-empty {
    text-align: center;
    padding: var(--oecta-space-2xl) var(--oecta-space-xl);
    background: var(--oecta-surface-lowest);
    border-radius: var(--oecta-radius-xl);
    box-shadow: var(--portal-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--oecta-space-sm);
}

.cx-empty-icon {
    font-size: 48px;
    color: var(--oecta-on-surface-variant);
}

.cx-empty h3 {
    margin: 0;
    font-size: var(--oecta-text-lg);
    font-weight: var(--oecta-font-bold);
    color: var(--oecta-on-surface);
}

.cx-empty p {
    margin: 0;
    font-size: var(--oecta-text-sm);
    color: var(--oecta-on-surface-variant);
    max-width: 480px;
}

.cx-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--oecta-space-2xl);
    min-height: 200px;
}

.cx-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--oecta-border);
    border-top-color: var(--oecta-primary);
    border-radius: 50%;
    animation: cx-spin 0.8s linear infinite;
}

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

/* ── Responsive Reflow ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cx-detail-head {
        flex-direction: column;
    }
    .cx-actions {
        flex-direction: column;
    }
    .cx-actions .cx-btn {
        width: 100%;
    }
}
