/* ============================================================
   Production Analysis (PA) — Производственный анализ
   LeanSpace
   ============================================================ */

/* ===== Container & Layout ===== */

.pa-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.pa-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.pa-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.2;
}

.pa-subtitle {
    font-size: 13px;
    color: #6e6e73;
    margin: 4px 0 0;
}

.pa-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ===== View Tabs ===== */

.pa-view-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 20px;
}

.pa-view-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #6e6e73;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.pa-view-tab:hover {
    color: #1d1d1f;
}

.pa-view-tab.active {
    color: #6d28d9;
    border-bottom-color: #6d28d9;
}

/* ===== Buttons ===== */

.pa-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.pa-btn-primary {
    background: #6d28d9;
    color: white;
}
.pa-btn-primary:hover { background: #5b21b6; }

.pa-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}
.pa-btn-secondary:hover { background: #e5e7eb; }

.pa-btn-danger {
    background: #fee2e2;
    color: #dc2626;
}
.pa-btn-danger:hover { background: #fca5a5; }

.pa-btn-ghost {
    background: transparent;
    color: #6d28d9;
    padding: 8px 4px;
}
.pa-btn-ghost:hover { text-decoration: underline; }

.pa-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.pa-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Dashboard Grid ===== */

.pa-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ===== Process Card ===== */

.pa-process-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-left: 4px solid #94a3b8;
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pa-process-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    transform: translateY(-1px);
}

.pa-process-card.green  { border-left-color: #16a34a; }
.pa-process-card.yellow { border-left-color: #ca8a04; }
.pa-process-card.red    { border-left-color: #dc2626; }
.pa-process-card.gray   { border-left-color: #94a3b8; }

.pa-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.pa-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.pa-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pa-card-unit {
    font-size: 12px;
    color: #6e6e73;
    flex-shrink: 0;
}

/* ===== Status Dot ===== */

.pa-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #94a3b8;
}

.pa-status-dot.green  { background: #22c55e; }
.pa-status-dot.yellow { background: #eab308; }
.pa-status-dot.red    { background: #ef4444; }
.pa-status-dot.gray   { background: #94a3b8; }

/* ===== Card Metrics ===== */

.pa-card-metrics {
    display: flex;
    gap: 4px;
}

.pa-metric {
    flex: 1;
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
}

.pa-metric-label {
    display: block;
    font-size: 11px;
    color: #6e6e73;
    font-weight: 500;
    margin-bottom: 4px;
}

.pa-metric-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.1;
}

/* ===== Percentage colors ===== */

.pa-pct-green  { color: #16a34a !important; }
.pa-pct-yellow { color: #ca8a04 !important; }
.pa-pct-red    { color: #dc2626 !important; }
.pa-pct-gray   { color: #94a3b8 !important; }

/* ===== Status label ===== */

.pa-status-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.pa-status-label.green  { background: #dcfce7; color: #16a34a; }
.pa-status-label.yellow { background: #fef9c3; color: #ca8a04; }
.pa-status-label.red    { background: #fee2e2; color: #dc2626; }
.pa-status-label.gray   { background: #f1f5f9; color: #64748b; }

/* ===== Card Meta ===== */

.pa-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pa-last-filled {
    font-size: 11px;
    color: #9ca3af;
}

.pa-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== Process List ===== */

.pa-process-list {
    display: grid;
    gap: 10px;
}

.pa-list-item {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    transition: box-shadow 0.2s;
}

.pa-list-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.pa-list-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.pa-list-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
}

.pa-list-item-meta {
    font-size: 12px;
    color: #6e6e73;
}

.pa-list-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ===== Templates ===== */

.pa-templates {
    background: #f5f3ff;
    border: 1px solid #e0d9f7;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.pa-templates-label {
    font-size: 12px;
    color: #7c3aed;
    font-weight: 600;
    margin: 0 0 8px;
}

.pa-templates-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pa-template-chip {
    background: white;
    border: 1px solid #c4b5fd;
    color: #6d28d9;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pa-template-chip:hover {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

/* ===== Form Card ===== */

.pa-form-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
}

.pa-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.pa-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.pa-form-group:only-child {
    margin-bottom: 16px;
}

.pa-form-group + .pa-form-group {
    /* handled via form-row */
}

.pa-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.pa-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1d1d1f;
    background: white;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.pa-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.pa-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.pa-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 12px;
}

/* ===== Downtime Reasons ===== */

.pa-reasons-list {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

.pa-reason-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    gap: 8px;
}

/* ===== Session View ===== */

.pa-session-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pa-summary-item {
    flex: 1;
    min-width: 120px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.pa-summary-label {
    display: block;
    font-size: 11px;
    color: #6e6e73;
    font-weight: 500;
    margin-bottom: 4px;
}

.pa-summary-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
}

/* ===== Session Table ===== */

.pa-session-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    background: white;
}

.pa-session-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pa-session-table thead tr {
    background: #f9fafb;
    border-bottom: 2px solid #e5e5e5;
}

.pa-session-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6e6e73;
    white-space: nowrap;
}

.pa-session-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #1d1d1f;
    vertical-align: middle;
}

.pa-slot-row {
    cursor: pointer;
    transition: background 0.15s;
}

.pa-slot-row:hover td {
    background: #f5f3ff;
}

.pa-slot-row.pa-slot-expanded td {
    background: #faf5ff;
}

/* ===== Current Time Slot ===== */

.pa-time-slot td {
    background: #f0fdf4 !important;
    font-weight: 600;
}

.pa-time-slot:hover td {
    background: #dcfce7 !important;
}

.pa-current-badge {
    color: #16a34a;
    font-size: 10px;
    margin-right: 4px;
}

.pa-slot-period {
    white-space: nowrap;
    font-weight: 500;
}

.pa-reason-cell {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pa-empty-cell {
    color: #9ca3af;
}

/* ===== Deviation colors ===== */

.pa-dev-pos { color: #16a34a; font-weight: 600; }
.pa-dev-neg { color: #dc2626; font-weight: 600; }

/* ===== Total Row ===== */

.pa-total-row td {
    background: #f9fafb;
    border-top: 2px solid #e5e5e5;
    font-size: 14px;
}

/* ===== Entry Form (inline) ===== */

.pa-entry-form-row td {
    padding: 0 !important;
    background: #faf5ff;
}

.pa-entry-form {
    padding: 16px;
    border-top: 2px solid #e0d9f7;
}

.pa-entry-form-title {
    font-size: 13px;
    font-weight: 600;
    color: #7c3aed;
    margin-bottom: 12px;
}

.pa-entry-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.pa-entry-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===== Worker Form (mobile) ===== */

.pa-worker-form {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 100vh;
    background: #f9fafb;
    box-sizing: border-box;
}

.pa-worker-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 16px;
    color: #6e6e73;
}

.pa-worker-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e5e5;
}

.pa-worker-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 4px;
}

.pa-worker-period {
    font-size: 18px;
    font-weight: 600;
    color: #6d28d9;
    margin: 0;
}

.pa-worker-metrics {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.pa-worker-metric {
    flex: 1;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.pa-worker-metric-label {
    display: block;
    font-size: 11px;
    color: #6e6e73;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.pa-worker-metric-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
}

.pa-worker-metric-value small {
    font-size: 14px;
    color: #6e6e73;
}

.pa-worker-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.pa-worker-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pa-worker-label {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Worker input (large touch targets) ===== */

.pa-worker-input {
    min-height: 56px;
    font-size: 24px;
    font-weight: 700;
    padding: 8px 16px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background: white;
    color: #1d1d1f;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pa-worker-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

.pa-worker-input-sm {
    font-size: 18px;
    min-height: 48px;
}

.pa-worker-file-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed #c4b5fd;
    border-radius: 12px;
    background: #faf5ff;
    font-size: 14px;
    color: #6d28d9;
    cursor: pointer;
    box-sizing: border-box;
}

/* ===== Submit Button (big green) ===== */

.pa-submit-btn {
    width: 100%;
    min-height: 60px;
    font-size: 20px;
    font-weight: 700;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pa-submit-btn:hover  { background: #15803d; }
.pa-submit-btn:active { transform: scale(0.98); }
.pa-submit-btn:disabled { background: #86efac; cursor: not-allowed; }

/* ===== Worker Success ===== */

.pa-worker-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    min-height: 60vh;
    gap: 12px;
}

.pa-success-icon {
    font-size: 64px;
    line-height: 1;
}

.pa-worker-success h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.pa-worker-success p {
    font-size: 16px;
    color: #374151;
    margin: 0;
}

.pa-next-slot {
    font-size: 14px !important;
    color: #6e6e73 !important;
}

/* ===== QR Modal ===== */

.pa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.pa-qr-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.pa-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.pa-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6e6e73;
    line-height: 1;
    padding: 4px;
}

.pa-qr-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px 16px;
    gap: 12px;
}

.pa-qr-image {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.pa-qr-url {
    font-size: 11px;
    color: #6e6e73;
    word-break: break-all;
    text-align: center;
    margin: 0;
}

.pa-qr-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #f3f4f6;
}

.pa-qr-actions .pa-btn {
    flex: 1;
    justify-content: center;
}

/* ===== Analytics ===== */

.pa-period-selector {
    display: flex;
    gap: 6px;
}

.pa-period-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e5e5e5;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.pa-period-btn:hover { border-color: #7c3aed; color: #7c3aed; }
.pa-period-btn.active { background: #7c3aed; color: white; border-color: #7c3aed; }

.pa-analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 720px) {
    .pa-analytics-grid {
        grid-template-columns: 1fr;
    }
}

.pa-analytics-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
}

.pa-analytics-title {
    font-size: 15px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 16px;
}

/* ===== Pareto Chart ===== */

.pa-pareto-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pa-pareto-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pa-pareto-label {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

.pa-pareto-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pa-analytics-bar {
    height: 22px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.4s ease;
}

.pa-pareto-value {
    font-size: 11px;
    color: #6e6e73;
    white-space: nowrap;
}

/* ===== Trend Chart ===== */

.pa-trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 140px;
    padding-bottom: 24px;
    position: relative;
    overflow-x: auto;
}

.pa-trend-col {
    flex: 1;
    min-width: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
}

.pa-trend-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
}

.pa-trend-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

.pa-trend-bar.pa-trend-plan {
    background: #e0e7ff;
}

.pa-trend-bar.pa-trend-actual.green  { background: #22c55e; }
.pa-trend-bar.pa-trend-actual.yellow { background: #eab308; }
.pa-trend-bar.pa-trend-actual.red    { background: #ef4444; }
.pa-trend-bar.pa-trend-actual.gray   { background: #d1d5db; }

.pa-trend-label {
    position: absolute;
    bottom: 0;
    font-size: 9px;
    color: #9ca3af;
    white-space: nowrap;
    text-align: center;
}

.pa-trend-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    justify-content: center;
}

.pa-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6e6e73;
}

.pa-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.pa-legend-dot.plan   { background: #e0e7ff; border: 1px solid #a5b4fc; }
.pa-legend-dot.actual { background: #22c55e; }

/* ===== Empty / Error / Loading States ===== */

.pa-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    gap: 12px;
}

.pa-empty-icon {
    font-size: 48px;
    line-height: 1;
}

.pa-empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.pa-empty-state p {
    font-size: 14px;
    color: #6e6e73;
    margin: 0;
    max-width: 320px;
}

.pa-empty-text {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    padding: 16px 0;
    margin: 0;
}

.pa-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    gap: 12px;
}

.pa-error-icon {
    font-size: 36px;
}

.pa-error-state p {
    font-size: 14px;
    color: #dc2626;
    margin: 0;
}

.pa-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
    color: #6e6e73;
}

.pa-loading p {
    font-size: 14px;
    margin: 0;
}

.pa-loading-inline {
    font-size: 13px;
    color: #9ca3af;
    padding: 8px 0;
}

/* ===== Spinner ===== */

.pa-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e5e5;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: pa-spin 0.8s linear infinite;
}

@keyframes pa-spin {
    to { transform: rotate(360deg); }
}

/* ===== Toast ===== */

.pa-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background: #1d1d1f;
    color: white;
    z-index: 9999;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
    max-width: 320px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.pa-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.pa-toast-error   { background: #dc2626; }
.pa-toast-warning { background: #ca8a04; }
.pa-toast-success { background: #16a34a; }

/* ===== Responsive ===== */

@media (max-width: 640px) {
    .pa-container {
        padding: 12px;
    }

    .pa-dashboard {
        grid-template-columns: 1fr;
    }

    .pa-session-table th,
    .pa-session-table td {
        padding: 8px 8px;
        font-size: 12px;
    }

    .pa-reason-cell {
        max-width: 80px;
    }

    .pa-header {
        flex-direction: column;
        align-items: stretch;
    }

    .pa-header-actions {
        justify-content: flex-start;
    }

    .pa-form-row {
        flex-direction: column;
    }

    .pa-session-summary {
        gap: 8px;
    }

    .pa-summary-item {
        min-width: 90px;
    }

    .pa-summary-value {
        font-size: 18px;
    }

    .pa-qr-actions {
        flex-direction: column;
    }

    .pa-toast {
        right: 12px;
        left: 12px;
        bottom: 16px;
        max-width: none;
    }
}

@media (max-width: 420px) {
    .pa-card-metrics {
        flex-wrap: wrap;
    }

    .pa-metric {
        min-width: 80px;
    }

    .pa-period-selector {
        flex-wrap: wrap;
    }
}
