/* ========================================
   Period-End Processing Wizard Styles
   ========================================
   Styling for the Period-End Dashboard and
   all wizard step components.

   References: Period_End_Processing_UI_Mock.html
   Version: 1.0
   Last Updated: 2026-07-29
   ======================================== */

/* ========================================
   PERIOD-END DESIGN TOKENS
   Extends rava-design-system.css tokens
   ======================================== */

:root {
    /* Period-End Specific Colors */
    --pe-teal: #15B6A0;
    --pe-teal-light: #E8F8F5;
    --pe-teal-dark: #0E9A87;
    --pe-blue-dark: #333F4D;
    --pe-blue-darker: #1B1D22;
    --pe-success: #26C281;
    --pe-success-light: #E8F9F1;
    --pe-warning: #FFB347;
    --pe-warning-light: #FFF5E6;
    --pe-error: #F95F62;
    --pe-error-light: #FEF0F0;
    --pe-info: #29ABE2;
    --pe-info-light: #E8F6FC;
    --pe-purple: #5E35B1;
    --pe-purple-light: #EDE7F6;
    --pe-border: #E4E7EC;
    --pe-border-light: #F0F1F3;
    --pe-bg: #F5F6F8;
    --pe-text-muted: #8A8D93;
}

/* ========================================
   SUMMARY TILES
   ======================================== */

.period-end-tiles {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.period-end-tiles.monthly-tiles {
    grid-template-columns: repeat(4, 1fr);
}

.pe-tile {
    background: #FFFFFF;
    border: 1px solid var(--pe-border);
    border-radius: var(--radius, 12px);
    padding: 16px 20px;
    box-shadow: var(--shadow-1, 0 2px 4px rgba(16, 24, 40, 0.08));
    position: relative;
    overflow: hidden;
}

.pe-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.pe-tile.tile-employees::before { background: var(--pe-info); }
.pe-tile.tile-earnings::before { background: var(--pe-teal); }
.pe-tile.tile-benefits::before { background: var(--pe-purple); }
.pe-tile.tile-tax::before { background: var(--pe-warning); }
.pe-tile.tile-status::before { background: var(--pe-success); }

.pe-tile-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pe-text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.pe-tile-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #1B1D22);
}

.pe-tile-detail {
    font-size: 12px;
    color: var(--pe-text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pe-tile-detail .material-icons { font-size: 14px; }
.pe-tile-detail.positive { color: var(--pe-success); }
.pe-tile-detail.negative { color: var(--pe-error); }

/* Status tile progress bar */
.pe-progress-bar {
    height: 6px;
    background: var(--pe-border-light);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.pe-progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.pe-progress-bar-fill.teal { background: var(--pe-teal); }
.pe-progress-bar-fill.success { background: var(--pe-success); }

/* ========================================
   CUSTOM STEPPER
   ======================================== */

.pe-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    background: #FFFFFF;
    border: 1px solid var(--pe-border);
    border-radius: var(--radius, 12px);
    padding: 0;
    margin-bottom: 24px;
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.pe-stepper-step {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-right: 1px solid var(--pe-border);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    background: #FFFFFF;
}

.pe-stepper-step:last-child { border-right: none; }

/* Clickable steps get hover effect */
.pe-stepper-step:hover:not(.disabled) {
    background: var(--pe-bg);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.05);
}

/* Completed steps show stronger hover */
.pe-stepper-step.completed:hover {
    background: var(--pe-success-light);
    filter: brightness(0.97);
}

/* Non-clickable future steps are dimmed */
.pe-stepper-step.disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.pe-stepper-step.active { background: var(--pe-teal-light); }
.pe-stepper-step.completed { background: var(--pe-success-light); }

.pe-stepper-step.active::after,
.pe-stepper-step.completed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.pe-stepper-step.active::after { background: var(--pe-teal); }
.pe-stepper-step.completed::after { background: var(--pe-success); }

.pe-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--pe-bg);
    color: var(--pe-text-muted);
    border: 2px solid var(--pe-border);
}

.pe-stepper-step.active .pe-step-circle {
    background: var(--pe-teal);
    color: white;
    border-color: var(--pe-teal);
}

.pe-stepper-step.completed .pe-step-circle {
    background: var(--pe-success);
    color: white;
    border-color: var(--pe-success);
}

.pe-step-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #5C5F66);
}

.pe-step-sublabel {
    font-size: 11px;
    color: var(--pe-text-muted);
}

.pe-stepper-step.active .pe-step-label { color: var(--pe-teal-dark); }
.pe-stepper-step.completed .pe-step-label { color: var(--pe-success); }

/* ========================================
   PATTY'S INSIGHTS (Dark Theme Card)
   ======================================== */

.iris-card {
    background: linear-gradient(135deg, #1B1D22, #2C3A47);
    border: 1px solid #3D4F5F;
    border-radius: var(--radius, 12px);
    color: white;
    margin-bottom: 20px;
    overflow: hidden;
}

.iris-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #3D4F5F;
}

.iris-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.iris-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pe-teal), #0E9A87);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.iris-title {
    font-size: 14px;
    font-weight: 700;
}

.iris-subtitle {
    font-size: 11px;
    opacity: 0.5;
}

.iris-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    height: 28px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    transition: background 0.15s;
}

.iris-toggle-btn:hover { background: rgba(255,255,255,0.2); }

.iris-body {
    padding: 16px 20px;
}

.iris-insight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
}

.iris-insight:last-child { border-bottom: none; }

.iris-tag {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-top: 2px;
}

.iris-tag-info { background: rgba(41,171,226,0.2); color: #6DD5FA; }
.iris-tag-watch { background: rgba(255,179,71,0.2); color: #FFD093; }
.iris-tag-action { background: rgba(249,95,98,0.2); color: #FF9B9D; }

/* ========================================
   PREFLIGHT CHECKS GRID
   ======================================== */

.preflight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.preflight-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #FFFFFF;
    border: 1px solid var(--pe-border);
    border-radius: var(--radius-sm, 8px);
    font-size: 12px;
    color: var(--text-secondary, #5C5F66);
}

.preflight-item .material-icons {
    font-size: 18px;
    flex-shrink: 0;
}

.preflight-item.preflight-pass .material-icons { color: var(--pe-success); }
.preflight-item.preflight-warn .material-icons { color: var(--pe-warning); }
.preflight-item.preflight-fail .material-icons { color: var(--pe-error); }

.preflight-item.preflight-pass { border-left: 3px solid var(--pe-success); }
.preflight-item.preflight-warn {
    border-left: 3px solid var(--pe-warning);
    background: var(--pe-warning-light);
}
.preflight-item.preflight-fail {
    border-left: 3px solid var(--pe-error);
    background: var(--pe-error-light);
}

.preflight-item strong {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #1B1D22);
}

.preflight-item .detail {
    font-size: 11px;
    color: var(--pe-text-muted);
}

/* ========================================
   VALIDATION TABLES
   ======================================== */

.pe-table {
    width: 100%;
    border-collapse: collapse;
}

.pe-table thead th {
    background: var(--pe-blue-dark);
    color: white;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-align: left;
}

.pe-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.pe-table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.pe-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--pe-border-light);
    font-size: 13px;
}

.pe-table tbody tr:hover { background: #FAFBFC; }

.pe-table .amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
}

.pe-table .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.pe-table .dot-pass { background: var(--pe-success); }
.pe-table .dot-warn { background: var(--pe-warning); }
.pe-table .dot-fail { background: var(--pe-error); }

/* Prior rows (dimmed) */
.pe-table tbody tr.prior-row {
    color: var(--pe-text-muted);
    background: #FAFBFC;
}

/* Warning row highlight */
.pe-table tbody tr.warning-row {
    background: var(--pe-warning-light);
}

/* Current quarter border */
.pe-table tbody tr.current-quarter-start {
    border-top: 2px solid var(--pe-teal);
}

/* Total row */
.pe-table tbody tr.total-row {
    font-weight: 700;
    background: var(--pe-bg);
    border-top: 2px solid var(--pe-border);
}

/* Inline metrics footer */
.pe-table-metrics {
    padding: 12px 14px;
    border-top: 2px solid var(--pe-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pe-inline-metric {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.pe-inline-metric .value {
    font-size: 15px;
    font-weight: 700;
}

.pe-inline-metric .label {
    font-size: 12px;
    color: var(--pe-text-muted);
}

/* Grouped Table Styles */
.pe-table-grouped .pe-table-group-header {
    background: linear-gradient(135deg, #F8F9FA, #EEF0F3);
    border-top: 2px solid var(--pe-border);
}

.pe-table-grouped .pe-table-group-header td {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--pe-blue-dark);
}

.pe-table-grouped .pe-table-group-row td {
    background: #FFFFFF;
}

.pe-table-grouped .pe-table-group-row:hover td {
    background: #FAFBFC;
}

.pe-table-grouped .pe-table-total-row {
    background: linear-gradient(135deg, var(--pe-teal-light), #E8F8F5);
    border-top: 2px solid var(--pe-teal);
}

.pe-table-grouped .pe-table-total-row td {
    padding: 14px;
    font-size: 13px;
}

/* Variance Indicators */
.pe-variance-positive {
    color: var(--pe-success);
    font-weight: 600;
}

.pe-variance-negative {
    color: var(--pe-error);
    font-weight: 600;
}

.pe-variance-neutral {
    color: var(--pe-text-muted);
}

/* ========================================
   STATUS PILLS
   ======================================== */

.pe-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pe-pill-pass { background: var(--pe-success-light); color: var(--pe-success); }
.pe-pill-warn { background: var(--pe-warning-light); color: #D4820A; }
.pe-pill-fail { background: var(--pe-error-light); color: var(--pe-error); }
.pe-pill-pending { background: var(--pe-bg); color: var(--pe-text-muted); }
.pe-pill-info { background: var(--pe-info-light); color: var(--pe-info); }
.pe-pill-purple { background: var(--pe-purple-light); color: var(--pe-purple); }

/* ========================================
   CURRENCY BADGES (DEFECT-18723: BUG-171)
   Multi-currency consolidated group display
   ======================================== */

.pe-currency-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--pe-info-light, #E8F4FD);
    color: var(--pe-info, #0078D4);
}

.pe-currency-warning-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--pe-warning-light, #FFF4CE);
    border: 1px solid var(--pe-warning, #FFB900);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    color: #B87A00;
    vertical-align: middle;
}

.pe-currency-warning-badge .material-icons {
    font-size: 12px;
}

/* ========================================
   SPARKLINES (CSS Mini-Bar Charts)
   ======================================== */

.pe-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
}

.pe-sparkline-bar {
    width: 6px;
    border-radius: 2px 2px 0 0;
    background: var(--pe-teal);
    opacity: 0.4;
}

.pe-sparkline-bar.current {
    opacity: 1;
}

/* ========================================
   VARIANCE DISPLAY
   ======================================== */

.pe-var-up {
    color: var(--pe-success);
    font-size: 11px;
    font-weight: 600;
}

.pe-var-down {
    color: var(--pe-error);
    font-size: 11px;
    font-weight: 600;
}

.pe-var-flat {
    color: var(--pe-text-muted);
    font-size: 11px;
}

/* ========================================
   ALERTS / BANNERS
   ======================================== */

.pe-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.pe-alert .material-icons {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.pe-alert-success { background: var(--pe-success-light); color: #1B8A5A; }
.pe-alert-warning { background: var(--pe-warning-light); color: #96600A; }
.pe-alert-error { background: var(--pe-error-light); color: #C82333; }
.pe-alert-info { background: var(--pe-info-light); color: #1A7AB5; }

/* ========================================
   CARDS
   ======================================== */

.pe-card {
    background: #FFFFFF;
    border: 1px solid var(--pe-border);
    border-radius: var(--radius, 12px);
    box-shadow: var(--shadow-1);
    margin-bottom: 20px;
    overflow: hidden;
}

.pe-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--pe-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pe-card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #1B1D22);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.pe-card-header h3 .material-icons {
    font-size: 20px;
    color: var(--pe-teal);
}

.pe-card-body {
    padding: 20px;
}

/* ========================================
   REPORT LIST TABLE
   ======================================== */

.pe-report-table {
    width: 100%;
    border-collapse: collapse;
}

.pe-report-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pe-text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--pe-border);
}

.pe-report-table tbody td {
    padding: 14px;
    border-bottom: 1px solid var(--pe-border-light);
    font-size: 13px;
    vertical-align: middle;
}

.pe-report-table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

.pe-report-table tbody tr:hover {
    background: var(--pe-teal-light);
}

.pe-report-actions {
    text-align: right;
}

.pe-report-actions .material-icons {
    font-size: 16px;
    color: var(--pe-text-muted);
    cursor: pointer;
    padding: 4px;
}

.pe-report-actions .material-icons:hover {
    color: var(--pe-teal);
}

.pe-report-actions .material-icons.primary {
    color: var(--pe-teal);
}

/* Format badges */
.pe-format-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.pe-format-insight { background: var(--pe-teal-light); color: var(--pe-teal-dark); }
.pe-format-excel { background: #E8F9F1; color: #1E8449; }
.pe-format-pdf { background: var(--pe-error-light); color: #C0392B; }

/* ZIP download bar */
.pe-zip-bar {
    padding: 12px 20px;
    border-top: 2px solid var(--pe-border);
    background: var(--pe-teal-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pe-zip-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--pe-teal-dark);
    font-weight: 600;
}

.pe-zip-info .material-icons { font-size: 18px; }

/* ========================================
   CHECKLIST
   ======================================== */

.pe-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pe-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--pe-border-light);
    font-size: 13px;
}

.pe-checklist li:last-child { border-bottom: none; }
.pe-checklist .material-icons { font-size: 20px; }

.pe-checklist li.check-pass .material-icons { color: var(--pe-success); }
.pe-checklist li.check-warn .material-icons { color: var(--pe-warning); }
.pe-checklist li.check-fail .material-icons { color: var(--pe-error); }
.pe-checklist li.check-pending .material-icons { color: var(--pe-border); }

/* ========================================
   APPROVAL BOX
   ======================================== */

.pe-approval-box {
    background: linear-gradient(135deg, #F8F9FA, #FFFFFF);
    border: 2px solid var(--pe-border);
    border-radius: var(--radius, 12px);
    padding: 32px;
    text-align: center;
}

.pe-approval-box.ready {
    border-color: var(--pe-success);
    background: linear-gradient(135deg, var(--pe-success-light), #FFFFFF);
}

.pe-approval-box .material-icons.large {
    font-size: 48px;
    color: var(--pe-success);
    margin-bottom: 12px;
}

.pe-approval-box h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.pe-approval-box p {
    font-size: 13px;
    color: var(--text-secondary, #5C5F66);
    margin-bottom: 20px;
}

/* ========================================
   TOOLBAR ADDITIONS
   ======================================== */

.pe-tolerance-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--pe-text-muted);
    padding: 8px 14px;
    background: var(--pe-bg);
    border-radius: 6px;
}

.pe-tolerance-display .material-icons { font-size: 16px; }

/* ========================================
   BUTTONS
   ======================================== */

.pe-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 38px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--pe-border);
    transition: all 0.15s;
}

.pe-btn .material-icons { font-size: 18px; }

.pe-btn-primary {
    background: var(--pe-teal);
    color: white;
    border-color: var(--pe-teal);
}

.pe-btn-primary:hover { background: var(--pe-teal-dark); }

.pe-btn-secondary {
    background: white;
    color: var(--text-primary, #1B1D22);
}

.pe-btn-secondary:hover { background: var(--pe-bg); }

.pe-btn-success {
    background: var(--pe-success);
    color: white;
    border-color: var(--pe-success);
}

.pe-btn-success:hover {
    background: #1B8A5A;
}

/* ========================================
   TWO/THREE COLUMN LAYOUTS
   ======================================== */

.pe-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.pe-three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

@media (max-width: 1200px) {
    .period-end-tiles { grid-template-columns: repeat(3, 1fr); }
    .pe-three-col { grid-template-columns: repeat(2, 1fr); }
    .preflight-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .period-end-tiles { grid-template-columns: 1fr 1fr; }
    .pe-two-col, .pe-three-col { grid-template-columns: 1fr; }
    .pe-stepper { flex-direction: column; }
    .pe-stepper-step { border-right: none; border-bottom: 1px solid var(--pe-border); }
    .pe-stepper-step:last-child { border-bottom: none; }
    .preflight-grid { grid-template-columns: 1fr; }
}
