/* ============================================================
   Price Approvals — pa-* classes
   ============================================================ */

/* ── Empty state ─────────────────────────────────────────────────────────── */

.pa-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: #888;
    font-size: 14px;
}

.pa-empty i { font-size: 36px; color: #28a745; }

/* ── Project group ───────────────────────────────────────────────────────── */

.pa-group {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}

/* Group header */
.pa-group-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #f0f4f8;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.pa-group-hd:hover { background: #e4eaf0; }

.pa-group-hd-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.pa-chevron {
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.pa-group-name {
    font-weight: 700;
    font-size: 14px;
    color: #1a3a5c;
    white-space: nowrap;
}

.pa-group-name a {
    color: inherit;
    text-decoration: none;
}

.pa-group-name a:hover { text-decoration: underline; }

.pa-group-badge {
    background: #1a3a5c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    padding: 1px 8px;
    flex-shrink: 0;
}

.pa-group-by {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pa-group-hd-right {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.pa-bulk-btn {
    font-size: 12px;
    padding: 3px 10px;
    white-space: nowrap;
}

/* ── Proposal table ──────────────────────────────────────────────────────── */

.pa-table {
    border-top: 1px solid #e5e7eb;
}

.pa-table-hdr,
.pa-table-row {
    display: grid;
    grid-template-columns: 2fr 1.4fr 20px 1.4fr 1.2fr 80px;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
}

.pa-table-hdr {
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
}

.pa-table-row {
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: 13px;
    color: #111827;
}

.pa-table-row:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

.pa-table-row:hover { background: #f9fafb; }

/* Product column */
.pa-col-product {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
    overflow: hidden;
}

.pa-col-product span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pa-icon-product { color: #6b7280; font-size: 13px; flex-shrink: 0; }
.pa-icon-transport { color: #2d7dd2; font-size: 13px; flex-shrink: 0; }

/* Price columns */
.pa-col-price {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

.pa-price-sep { color: #9ca3af; }

.pa-price-old { color: #6b7280; }

.pa-price-new {
    color: #16a34a;
    font-weight: 600;
}

.pa-col-arrow {
    color: #9ca3af;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Who column */
.pa-col-who {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pa-who-name {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pa-who-date {
    font-size: 11px;
    color: #9ca3af;
}

/* Actions column */
.pa-col-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* XS button variant */
.btn-xs {
    padding: 3px 7px;
    font-size: 12px;
    line-height: 1.4;
}

/* ── Reject modals ───────────────────────────────────────────────────────── */

.pa-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pa-modal {
    background: var(--surface-color, #fff);
    border-radius: 10px;
    width: 420px;
    max-width: 95vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
}

.pa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    font-weight: 600;
    font-size: 14px;
}

.pa-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary, #6b7280);
}

.pa-modal-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pa-modal-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.pa-modal-textarea {
    width: 100%;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    background: var(--surface-color, #fff);
    color: var(--text-primary, #111827);
    font-family: inherit;
}

.pa-modal-textarea:focus {
    outline: none;
    border-color: #2d7dd2;
    box-shadow: 0 0 0 3px rgba(45,125,210,0.12);
}

.pa-modal-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    justify-content: flex-end;
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */

[data-theme="dark"] .pa-group { border-color: #2e2e4a; }

[data-theme="dark"] .pa-group-hd {
    background: #141428;
}

[data-theme="dark"] .pa-group-hd:hover { background: #1a1a38; }

[data-theme="dark"] .pa-group-name { color: #90caf9; }
[data-theme="dark"] .pa-group-badge { background: #2d5fa8; }
[data-theme="dark"] .pa-group-by { color: #8888aa; }
[data-theme="dark"] .pa-chevron { color: #8888aa; }

[data-theme="dark"] .pa-table { border-color: #2e2e4a; }

[data-theme="dark"] .pa-table-hdr {
    background: #12121f;
    border-color: #2e2e4a;
    color: #6666aa;
}

[data-theme="dark"] .pa-table-row { color: #d0d0e0; }
[data-theme="dark"] .pa-table-row:not(:last-child) { border-color: #1e1e35; }
[data-theme="dark"] .pa-table-row:hover { background: #141428; }

[data-theme="dark"] .pa-col-product { color: #d0d0e0; }
[data-theme="dark"] .pa-icon-product { color: #8888aa; }

[data-theme="dark"] .pa-who-name { color: #b0b0cc; }
[data-theme="dark"] .pa-who-date { color: #6666aa; }
[data-theme="dark"] .pa-price-sep { color: #6666aa; }
[data-theme="dark"] .pa-price-old { color: #8888aa; }
[data-theme="dark"] .pa-price-new { color: #4ade80; }
[data-theme="dark"] .pa-col-arrow { color: #6666aa; }

[data-theme="dark"] .pa-modal {
    background: #1a1a2e;
    border: 1px solid #2e2e4a;
}

[data-theme="dark"] .pa-modal-header {
    border-color: #2e2e4a;
    color: #d0d0e0;
}

[data-theme="dark"] .pa-modal-close { color: #8888aa; }
[data-theme="dark"] .pa-modal-label { color: #d0d0e0; }

[data-theme="dark"] .pa-modal-textarea {
    background: #12121f;
    border-color: #2e2e4a;
    color: #d0d0e0;
}

[data-theme="dark"] .pa-modal-footer { border-color: #2e2e4a; }

[data-theme="dark"] .pa-empty { color: #6666aa; }
