/* Payroll custom-blade styling (docs/52 precedent: custom blades must not
   rely on Tailwind utilities absent from Filament's compiled CSS — every
   class used by payroll blades is defined here and shipped as a
   FilamentAsset). Scoped pay-* namespace; light+dark; RTL-safe (logical
   properties; money cells isolate LTR digits). */

.pay-wrap { display: flex; flex-direction: column; gap: 1.25rem; }

.pay-header {
    border: 1px solid rgb(229 231 235); border-radius: 0.9rem;
    padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: 1.5rem;
    align-items: center; justify-content: space-between;
    background: rgb(255 255 255);
}
.dark .pay-header { background: rgb(24 24 27); border-color: rgb(255 255 255 / 0.08); }
.pay-header .pay-kicker { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgb(107 114 128); }
.pay-header .pay-big { font-size: 1.35rem; font-weight: 700; }
.pay-header .pay-sub { font-size: 0.85rem; color: rgb(107 114 128); margin-top: 0.15rem; }

.pay-grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 0.9rem; }
@media (min-width: 640px) { .pay-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pay-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.pay-card {
    display: block; border: 1px solid rgb(229 231 235); border-radius: 0.9rem;
    padding: 1rem 1.1rem; background: rgb(255 255 255);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.dark .pay-card { background: rgb(24 24 27); border-color: rgb(255 255 255 / 0.08); }
a.pay-card:hover { border-color: rgb(59 130 246); transform: translateY(-1px); }
.pay-card .pay-count { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.pay-card .pay-label { font-size: 0.85rem; color: rgb(75 85 99); margin-top: 0.25rem; }
.dark .pay-card .pay-label { color: rgb(156 163 175); }
.pay-card.pay-danger { border-inline-start: 4px solid rgb(220 38 38); }
.pay-card.pay-warning { border-inline-start: 4px solid rgb(217 119 6); }
.pay-card.pay-success { border-inline-start: 4px solid rgb(22 101 52); }
.pay-card.pay-info { border-inline-start: 4px solid rgb(37 99 235); }

.pay-section { border: 1px solid rgb(229 231 235); border-radius: 0.9rem; background: rgb(255 255 255); }
.dark .pay-section { background: rgb(24 24 27); border-color: rgb(255 255 255 / 0.08); }
.pay-section > .pay-section-head { padding: 0.8rem 1.1rem; font-weight: 600; border-bottom: 1px solid rgb(243 244 246); display:flex; justify-content: space-between; gap: 1rem; align-items:center; }
.dark .pay-section > .pay-section-head { border-color: rgb(255 255 255 / 0.06); }
.pay-section > .pay-section-body { padding: 1rem 1.1rem; }
.pay-section .pay-hint { font-size: 0.8rem; color: rgb(107 114 128); font-weight: 400; }

.pay-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.pay-actions a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.8rem; border-radius: 0.6rem; border: 1px solid rgb(243 244 246); font-size: 0.9rem; }
.dark .pay-actions a { border-color: rgb(255 255 255 / 0.06); }
.pay-actions a:hover { border-color: rgb(59 130 246); }

.pay-notice { border-radius: 0.9rem; padding: 0.9rem 1.1rem; font-size: 0.875rem; border: 1px solid; display: flex; gap: 0.75rem; align-items: flex-start; }
.pay-notice-warning { border-color: rgb(217 119 6 / 0.5); background: rgb(255 251 235); color: rgb(146 64 14); }
.dark .pay-notice-warning { background: rgb(217 119 6 / 0.08); color: rgb(252 211 77); }
.pay-notice-info { border-color: rgb(37 99 235 / 0.4); background: rgb(239 246 255); color: rgb(30 64 175); }
.dark .pay-notice-info { background: rgb(37 99 235 / 0.08); color: rgb(147 197 253); }
.pay-notice-danger { border-color: rgb(220 38 38 / 0.45); background: rgb(254 242 242); color: rgb(153 27 27); }
.dark .pay-notice-danger { background: rgb(220 38 38 / 0.08); color: rgb(252 165 165); }
.pay-notice .pay-notice-title { font-weight: 700; margin-bottom: 0.15rem; }

.pay-table-wrap { overflow-x: auto; border: 1px solid rgb(229 231 235); border-radius: 0.9rem; background: rgb(255 255 255); }
.dark .pay-table-wrap { background: rgb(24 24 27); border-color: rgb(255 255 255 / 0.08); }
.pay-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.pay-table thead th {
    text-align: start; padding: 0.65rem 0.9rem; font-weight: 600;
    color: rgb(107 114 128); font-size: 0.78rem; text-transform: uppercase;
    letter-spacing: 0.04em; border-bottom: 1px solid rgb(229 231 235);
    white-space: nowrap;
}
.dark .pay-table thead th { border-color: rgb(255 255 255 / 0.08); }
.pay-table tbody td { padding: 0.65rem 0.9rem; border-top: 1px solid rgb(243 244 246); vertical-align: top; }
.dark .pay-table tbody td { border-color: rgb(255 255 255 / 0.05); }
.pay-table tbody tr:hover { background: rgb(249 250 251); }
.dark .pay-table tbody tr:hover { background: rgb(255 255 255 / 0.03); }
.pay-table .pay-total-row td { font-weight: 700; border-top: 2px solid rgb(209 213 219); }

.pay-money { direction: ltr; unicode-bidi: isolate; text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-muted { color: rgb(107 114 128); font-size: 0.8rem; }
.pay-name { font-weight: 600; }

.pay-badge { display: inline-block; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.pay-badge-gray { background: rgb(243 244 246); color: rgb(55 65 81); }
.pay-badge-info { background: rgb(219 234 254); color: rgb(30 64 175); }
.pay-badge-warning { background: rgb(254 243 199); color: rgb(146 64 14); }
.pay-badge-danger { background: rgb(254 226 226); color: rgb(153 27 27); }
.pay-badge-success { background: rgb(220 252 231); color: rgb(22 101 52); }
.dark .pay-badge-gray { background: rgb(255 255 255 / 0.08); color: rgb(209 213 219); }
.dark .pay-badge-info { background: rgb(37 99 235 / 0.2); color: rgb(147 197 253); }
.dark .pay-badge-warning { background: rgb(217 119 6 / 0.2); color: rgb(252 211 77); }
.dark .pay-badge-danger { background: rgb(220 38 38 / 0.2); color: rgb(252 165 165); }
.dark .pay-badge-success { background: rgb(22 101 52 / 0.25); color: rgb(134 239 172); }

.pay-empty { padding: 2.2rem 1rem; text-align: center; color: rgb(107 114 128); }
.pay-empty .pay-empty-title { font-weight: 600; color: rgb(55 65 81); margin-bottom: 0.2rem; }
.dark .pay-empty .pay-empty-title { color: rgb(209 213 219); }

.pay-toolbar { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-end; }
.pay-toolbar label { font-size: 0.8rem; color: rgb(75 85 99); display: block; }
.dark .pay-toolbar label { color: rgb(156 163 175); }
.pay-toolbar select, .pay-toolbar input {
    display: block; margin-top: 0.3rem; border: 1px solid rgb(209 213 219);
    border-radius: 0.55rem; padding: 0.45rem 0.7rem; font-size: 0.875rem;
    background: rgb(255 255 255); min-width: 14rem;
}
.dark .pay-toolbar select, .dark .pay-toolbar input { background: rgb(39 39 42); border-color: rgb(255 255 255 / 0.12); color: rgb(229 231 235); }

.pay-summary { display: grid; gap: 0.7rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 900px) { .pay-summary { grid-template-columns: repeat(6, minmax(0,1fr)); } }
.pay-summary .pay-sum-item { border: 1px solid rgb(243 244 246); border-radius: 0.7rem; padding: 0.6rem 0.8rem; }
.dark .pay-summary .pay-sum-item { border-color: rgb(255 255 255 / 0.06); }
.pay-summary .pay-sum-label { font-size: 0.72rem; color: rgb(107 114 128); text-transform: uppercase; letter-spacing: 0.04em; }
.pay-summary .pay-sum-value { font-weight: 700; margin-top: 0.15rem; }

/* ── Command Center (docs/75) ─────────────────────────────────────────── */

.pay-cc-title { font-size: 1.45rem; font-weight: 800; }
.pay-cc-sub { color: rgb(107 114 128); font-size: 0.85rem; margin-top: 0.1rem; }

.pay-context-bar {
    display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: center;
    border: 1px solid rgb(229 231 235); border-radius: 0.9rem;
    background: rgb(255 255 255); padding: 0.8rem 1.1rem;
}
.dark .pay-context-bar { background: rgb(24 24 27); border-color: rgb(255 255 255 / 0.08); }
.pay-ctx-item { min-width: 8rem; }
.pay-ctx-item .pay-ctx-label { font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: rgb(107 114 128); }
.pay-ctx-item .pay-ctx-value { font-weight: 700; margin-top: 0.1rem; font-size: 0.95rem; }
.pay-ctx-spacer { flex: 1 1 auto; }
.pay-ctx-refresh { border: 1px solid rgb(209 213 219); border-radius: 0.55rem; padding: 0.35rem 0.7rem; font-size: 0.8rem; background: rgb(255 255 255); cursor: pointer; }
.dark .pay-ctx-refresh { background: rgb(39 39 42); border-color: rgb(255 255 255 / 0.12); color: rgb(229 231 235); }
.pay-ctx-refresh:hover { border-color: rgb(59 130 246); }

.pay-kpi-grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); }
.pay-kpi {
    display: block; border: 1px solid rgb(229 231 235); border-radius: 0.9rem;
    background: rgb(255 255 255); padding: 0.85rem 0.95rem;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.dark .pay-kpi { background: rgb(24 24 27); border-color: rgb(255 255 255 / 0.08); }
a.pay-kpi:hover { border-color: rgb(59 130 246); transform: translateY(-1px); }
.pay-kpi-top { display: flex; align-items: center; gap: 0.6rem; }
.pay-kpi-chip { width: 2.1rem; height: 2.1rem; border-radius: 0.6rem; display: flex; align-items: center; justify-content: center; flex: none; }
.pay-kpi-chip svg { width: 1.15rem; height: 1.15rem; }
.pay-chip-danger { background: rgb(254 226 226); color: rgb(185 28 28); }
.pay-chip-warning { background: rgb(254 243 199); color: rgb(180 83 9); }
.pay-chip-success { background: rgb(220 252 231); color: rgb(21 128 61); }
.pay-chip-info { background: rgb(219 234 254); color: rgb(29 78 216); }
.pay-chip-purple { background: rgb(237 233 254); color: rgb(109 40 217); }
.pay-chip-teal { background: rgb(204 251 241); color: rgb(15 118 110); }
.dark .pay-chip-danger { background: rgb(220 38 38 / 0.2); color: rgb(252 165 165); }
.dark .pay-chip-warning { background: rgb(217 119 6 / 0.2); color: rgb(252 211 77); }
.dark .pay-chip-success { background: rgb(22 101 52 / 0.25); color: rgb(134 239 172); }
.dark .pay-chip-info { background: rgb(37 99 235 / 0.2); color: rgb(147 197 253); }
.dark .pay-chip-purple { background: rgb(109 40 217 / 0.25); color: rgb(196 181 253); }
.dark .pay-chip-teal { background: rgb(15 118 110 / 0.25); color: rgb(94 234 212); }
.pay-kpi-count { font-size: 1.55rem; font-weight: 800; line-height: 1.1; direction: ltr; }
.pay-kpi-label { font-size: 0.8rem; color: rgb(55 65 81); margin-top: 0.45rem; font-weight: 600; }
.dark .pay-kpi-label { color: rgb(209 213 219); }
.pay-kpi-link { font-size: 0.75rem; color: rgb(37 99 235); margin-top: 0.35rem; display: inline-flex; gap: 0.25rem; align-items: center; }
.dark .pay-kpi-link { color: rgb(147 197 253); }

.pay-cc-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1150px) { .pay-cc-grid { grid-template-columns: 1.05fr 1.55fr 1fr; } }

.pay-attn-list { display: flex; flex-direction: column; }
.pay-attn-item { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.7rem 0; border-top: 1px solid rgb(243 244 246); }
.pay-attn-item:first-child { border-top: 0; }
.dark .pay-attn-item { border-color: rgb(255 255 255 / 0.06); }
.pay-dot { width: 0.55rem; height: 0.55rem; border-radius: 999px; margin-top: 0.4rem; flex: none; }
.pay-dot-danger { background: rgb(220 38 38); }
.pay-dot-warning { background: rgb(217 119 6); }
.pay-dot-info { background: rgb(37 99 235); }
.pay-dot-muted { background: rgb(156 163 175); }
.pay-attn-body { flex: 1 1 auto; min-width: 0; }
.pay-attn-title { font-weight: 600; font-size: 0.86rem; }
.pay-attn-hint { color: rgb(107 114 128); font-size: 0.78rem; margin-top: 0.1rem; }
.pay-attn-btn {
    flex: none; align-self: center; border: 1px solid rgb(191 219 254); background: rgb(239 246 255);
    color: rgb(29 78 216); border-radius: 0.55rem; padding: 0.3rem 0.65rem; font-size: 0.75rem;
    font-weight: 600; white-space: nowrap;
}
.pay-attn-btn:hover { border-color: rgb(59 130 246); }
.dark .pay-attn-btn { background: rgb(37 99 235 / 0.12); border-color: rgb(37 99 235 / 0.4); color: rgb(147 197 253); }

.pay-snap-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.pay-snap-meta { display: grid; gap: 0.6rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 700px) { .pay-snap-meta { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.pay-snap-meta .pay-sum-item { min-width: 0; }
.pay-tiles { display: grid; gap: 0.6rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 700px) { .pay-tiles { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.pay-tile { border: 1px solid rgb(243 244 246); border-radius: 0.7rem; padding: 0.6rem 0.75rem; background: rgb(249 250 251); }
.dark .pay-tile { background: rgb(255 255 255 / 0.03); border-color: rgb(255 255 255 / 0.06); }
.pay-tile-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: rgb(107 114 128); }
.pay-tile-value { font-weight: 800; font-size: 1.02rem; margin-top: 0.15rem; }
.pay-tile-delta { font-size: 0.72rem; margin-top: 0.15rem; }
.pay-delta-up { color: rgb(21 128 61); }
.pay-delta-down { color: rgb(185 28 28); }

.pay-action-rail { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pay-action-rail .pay-rail-btn {
    display: inline-flex; flex-direction: column; align-items: center; gap: 0.3rem;
    border: 1px solid rgb(229 231 235); border-radius: 0.7rem; background: rgb(255 255 255);
    padding: 0.55rem 0.8rem; font-size: 0.72rem; font-weight: 600; color: rgb(55 65 81);
    min-width: 5.2rem; cursor: pointer; text-align: center;
}
.pay-action-rail .pay-rail-btn:hover { border-color: rgb(59 130 246); color: rgb(29 78 216); }
.dark .pay-action-rail .pay-rail-btn { background: rgb(39 39 42); border-color: rgb(255 255 255 / 0.1); color: rgb(209 213 219); }
.pay-action-rail .pay-rail-btn svg { width: 1.1rem; height: 1.1rem; }

.pay-side-rows { display: flex; flex-direction: column; }
.pay-side-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0; border-top: 1px solid rgb(243 244 246); font-size: 0.85rem; }
.pay-side-row:first-child { border-top: 0; }
.dark .pay-side-row { border-color: rgb(255 255 255 / 0.06); }
.pay-side-row .pay-side-count { margin-inline-start: auto; font-weight: 800; direction: ltr; }

.pay-trend-wrap svg { width: 100%; height: auto; display: block; }
.pay-trend-legend { display: flex; gap: 1rem; font-size: 0.75rem; color: rgb(107 114 128); margin-top: 0.4rem; }
.pay-trend-legend .pay-leg { display: inline-flex; align-items: center; gap: 0.35rem; }
.pay-leg-swatch { width: 0.7rem; height: 0.22rem; border-radius: 2px; display: inline-block; }

.pay-mini-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .pay-mini-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1400px) { .pay-mini-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.pay-table-sm thead th { padding: 0.45rem 0.7rem; font-size: 0.7rem; }
.pay-table-sm tbody td { padding: 0.45rem 0.7rem; font-size: 0.8rem; }
.pay-row-link { cursor: pointer; }

.pay-inline-btn {
    border: 1px solid rgb(209 213 219); border-radius: 0.5rem; background: rgb(255 255 255);
    padding: 0.2rem 0.55rem; font-size: 0.72rem; font-weight: 600; color: rgb(55 65 81); cursor: pointer;
}
.pay-inline-btn:hover { border-color: rgb(59 130 246); color: rgb(29 78 216); }
.dark .pay-inline-btn { background: rgb(39 39 42); border-color: rgb(255 255 255 / 0.12); color: rgb(209 213 219); }
.pay-inline-btn.pay-inline-danger { color: rgb(185 28 28); }
.pay-inline-btn.pay-inline-danger:hover { border-color: rgb(220 38 38); }

.pay-hub-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1150px) { .pay-hub-grid { grid-template-columns: 1.6fr 1fr; } }

.pay-notice-rows { display: flex; flex-direction: column; }
.pay-notice-row { display: flex; gap: 0.6rem; padding: 0.6rem 0; border-top: 1px solid rgb(243 244 246); align-items: flex-start; }
.pay-notice-row:first-child { border-top: 0; }
.dark .pay-notice-row { border-color: rgb(255 255 255 / 0.06); }
.pay-notice-row .pay-notice-date { margin-inline-start: auto; color: rgb(156 163 175); font-size: 0.72rem; white-space: nowrap; }

.pay-cc-footer { display: flex; justify-content: space-between; gap: 1rem; color: rgb(156 163 175); font-size: 0.75rem; padding: 0.4rem 0.2rem; flex-wrap: wrap; }
