/* PR Workflow & Approval System - Styles */
:root {
  --prws-primary: #0073aa;
  --prws-primary-dark: #005177;
  --prws-success: #28a745;
  --prws-danger: #dc3545;
  --prws-warning: #f0a500;
  --prws-info: #17a2b8;
  --prws-secondary: #6c757d;
  --prws-light: #f8f9fa;
  --prws-dark: #343a40;
  --prws-border: #dee2e6;
  --prws-radius: 6px;
  --prws-shadow: 0 2px 8px rgba(0,0,0,0.1);
  --prws-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===================== LAYOUT ===================== */
.prws-wrap { font-family: var(--prws-font); }
.prws-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.prws-page-title { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.prws-page-title .dashicons { color: var(--prws-primary); font-size: 28px; width: 28px; height: 28px; }
.prws-mt-4 { margin-top: 24px; }

/* ===================== CARDS ===================== */
.prws-card { background: #fff; border: 1px solid var(--prws-border); border-radius: var(--prws-radius); box-shadow: var(--prws-shadow); overflow: hidden; margin-bottom: 20px; }
.prws-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--prws-light); border-bottom: 1px solid var(--prws-border); }
.prws-card-header h2, .prws-card-header h3 { margin: 0; font-size: 16px; color: var(--prws-dark); }
.prws-card-body { padding: 20px; }
.prws-p-0 .prws-card-body, .prws-p-0 { padding: 0; }

/* ===================== DASHBOARD ===================== */
.prws-dashboard { font-family: var(--prws-font); }
.prws-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.prws-stat-card { background: #fff; border-radius: var(--prws-radius); padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--prws-shadow); border-left: 4px solid var(--prws-primary); }
.prws-stat-total { border-left-color: var(--prws-primary); }
.prws-stat-pending { border-left-color: var(--prws-warning); }
.prws-stat-approved { border-left-color: var(--prws-success); }
.prws-stat-rejected { border-left-color: var(--prws-danger); }
.prws-stat-icon .dashicons { font-size: 32px; width: 32px; height: 32px; color: #999; }
.prws-stat-number { font-size: 28px; font-weight: 700; line-height: 1; color: var(--prws-dark); }
.prws-stat-label { font-size: 13px; color: #666; margin-top: 4px; }
.prws-status-breakdown { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; background: #fff; padding: 16px; border-radius: var(--prws-radius); box-shadow: var(--prws-shadow); }
.prws-status-item { display: flex; align-items: center; gap: 6px; }
.prws-status-item .dashicons { font-size: 16px; width: 16px; height: 16px; color: #888; }
.prws-status-count { font-weight: 700; font-size: 14px; }
.prws-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 768px) { .prws-charts-grid { grid-template-columns: 1fr; } .prws-stats-grid { grid-template-columns: 1fr 1fr; } }
.prws-quick-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.prws-quick-link { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: var(--prws-radius); text-decoration: none; font-weight: 600; font-size: 14px; transition: opacity 0.2s; }
.prws-quick-link:hover { opacity: 0.85; text-decoration: none; }
.prws-quick-link .dashicons { font-size: 18px; width: 18px; height: 18px; }
.prws-ql-blue { background: var(--prws-primary); color: #fff; }
.prws-ql-orange { background: var(--prws-warning); color: #fff; }
.prws-ql-green { background: var(--prws-success); color: #fff; }
.prws-ql-gray { background: var(--prws-secondary); color: #fff; }

/* ===================== TABLE ===================== */
.prws-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prws-table th { background: var(--prws-light); padding: 10px 12px; text-align: left; font-weight: 600; color: #555; border-bottom: 2px solid var(--prws-border); white-space: nowrap; }
.prws-table td { padding: 10px 12px; border-bottom: 1px solid var(--prws-border); vertical-align: middle; }
.prws-table-hover tbody tr:hover { background: #f5f9ff; }
.prws-table tbody tr:last-child td { border-bottom: none; }
.prws-amount { font-weight: 600; font-family: monospace; }
.prws-link-strong { font-weight: 600; color: var(--prws-primary); }
.prws-category-tag { background: #e9ecef; padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.prws-text-muted { color: #888; }

/* ===================== BADGES ===================== */
.prws-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.prws-badge-secondary { background: #e9ecef; color: #555; }
.prws-badge-info { background: #d1ecf1; color: #0c5460; }
.prws-badge-warning { background: #fff3cd; color: #856404; }
.prws-badge-success { background: #d4edda; color: #155724; }
.prws-badge-danger { background: #f8d7da; color: #721c24; }
.prws-badge-primary { background: #cce5ff; color: #004085; }

/* ===================== BUTTONS ===================== */
.prws-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--prws-radius); border: none; cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none; transition: background 0.15s, opacity 0.15s; line-height: 1.4; }
.prws-btn:hover { opacity: 0.9; text-decoration: none; }
.prws-btn-primary { background: var(--prws-primary); color: #fff; }
.prws-btn-success { background: var(--prws-success); color: #fff; }
.prws-btn-danger { background: var(--prws-danger); color: #fff; }
.prws-btn-warning { background: var(--prws-warning); color: #fff; }
.prws-btn-secondary { background: var(--prws-secondary); color: #fff; }
.prws-btn-link { background: transparent; color: var(--prws-primary); padding-left: 0; }
.prws-btn-sm { padding: 5px 10px; font-size: 12px; }
.prws-btn-xs { padding: 3px 8px; font-size: 11px; }
.prws-btn-block { width: 100%; justify-content: center; margin-bottom: 8px; }
.prws-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ===================== FORMS ===================== */
.prws-form { width: 100%; }
.prws-form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.prws-form-group { margin-bottom: 16px; flex: 1; min-width: 200px; }
.prws-col-4 { flex: 0 0 calc(33.333% - 12px); min-width: 150px; }
.prws-col-6 { flex: 0 0 calc(50% - 8px); min-width: 200px; }
.prws-form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--prws-dark); }
.prws-form-group label .required { color: var(--prws-danger); }
.prws-input, .prws-select, .prws-textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--prws-border); border-radius: var(--prws-radius); font-size: 13px; font-family: var(--prws-font); background: #fff; box-sizing: border-box; transition: border-color 0.15s; }
.prws-input:focus, .prws-select:focus, .prws-textarea:focus { border-color: var(--prws-primary); outline: none; box-shadow: 0 0 0 3px rgba(0,115,170,0.12); }
.prws-textarea { min-height: 80px; resize: vertical; }
.prws-total-field { background: #f0f8ff; font-weight: 700; color: var(--prws-primary); }
.prws-file-input { width: 100%; }
.prws-help-text { font-size: 12px; color: #888; margin-top: 4px; }
.prws-form-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--prws-border); }
.prws-input-sm { padding: 5px 10px; font-size: 12px; }
.prws-select-sm { padding: 5px 10px; font-size: 12px; height: auto; }

/* ===================== MODALS ===================== */
.prws-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.prws-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); }
.prws-modal-dialog { position: relative; background: #fff; border-radius: var(--prws-radius); box-shadow: 0 8px 40px rgba(0,0,0,0.2); width: 90%; max-width: 520px; max-height: 90vh; overflow-y: auto; z-index: 1; }
.prws-modal-lg { max-width: 780px; }
.prws-modal-xl { max-width: 960px; }
.prws-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--prws-border); background: var(--prws-light); }
.prws-modal-header h3 { margin: 0; font-size: 16px; }
.prws-modal-x { background: none; border: none; font-size: 22px; cursor: pointer; color: #666; line-height: 1; padding: 0; }
.prws-modal-body { padding: 20px; }
.prws-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--prws-border); background: var(--prws-light); }

/* ===================== ALERTS ===================== */
.prws-alert { padding: 12px 16px; border-radius: var(--prws-radius); margin-bottom: 16px; font-size: 13px; }
.prws-alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.prws-alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.prws-alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.prws-alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.prws-notice { padding: 12px 16px; border-radius: var(--prws-radius); margin-bottom: 16px; }
.prws-notice-warning { background: #fff3cd; border-left: 4px solid var(--prws-warning); }
.prws-notice-danger { background: #f8d7da; border-left: 4px solid var(--prws-danger); }

/* ===================== FILTER BAR ===================== */
.prws-filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.prws-filter-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; }
.prws-total-count { color: #666; font-size: 13px; margin-left: auto; }

/* ===================== PAGINATION ===================== */
.prws-pagination { display: flex; gap: 4px; padding: 16px 20px; border-top: 1px solid var(--prws-border); }
.prws-page-btn { display: inline-block; padding: 4px 10px; border: 1px solid var(--prws-border); border-radius: var(--prws-radius); font-size: 13px; color: var(--prws-primary); text-decoration: none; }
.prws-page-btn:hover { background: var(--prws-primary); color: #fff; }
.prws-page-current { background: var(--prws-primary); color: #fff; border-color: var(--prws-primary); }

/* ===================== DETAIL VIEW ===================== */
.prws-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 600px) { .prws-detail-grid { grid-template-columns: 1fr; } }
.prws-detail-row { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.prws-detail-label { font-weight: 600; color: #555; font-size: 12px; min-width: 120px; }
.prws-detail-value { color: var(--prws-dark); font-size: 13px; word-break: break-word; }
.prws-section-title { font-size: 14px; font-weight: 700; margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--prws-primary); color: var(--prws-primary); }
.prws-timeline { list-style: none; margin: 0; padding: 0; }
.prws-timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 12px; }
.prws-timeline li:last-child { border-bottom: none; }
.prws-timeline-time { color: #888; min-width: 130px; }
.prws-timeline-user { font-weight: 600; min-width: 100px; }
.prws-approval-step { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--prws-border); border-radius: var(--prws-radius); margin-bottom: 6px; }
.prws-approval-step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--prws-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.prws-approval-name { font-weight: 600; flex: 1; font-size: 13px; }
.prws-approval-time { font-size: 11px; color: #888; }
.prws-reject-reason { background: #fff3f3; border: 1px solid #f5c6cb; border-radius: var(--prws-radius); padding: 8px 12px; font-size: 12px; color: #721c24; margin-top: 4px; }

/* ===================== LOADING / EMPTY ===================== */
.prws-loading { padding: 40px; text-align: center; color: #888; }
.prws-empty-state { padding: 40px; text-align: center; color: #aaa; }
.prws-empty-state .dashicons { font-size: 48px; width: 48px; height: 48px; display: block; margin: 0 auto 8px; }
.prws-purchasing-actions { display: flex; flex-direction: column; gap: 8px; }

/* ===================== TOAST ===================== */
.prws-toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999999; display: flex; flex-direction: column; gap: 10px; }
.prws-toast { background: #333; color: #fff; padding: 12px 18px; border-radius: var(--prws-radius); font-size: 13px; box-shadow: var(--prws-shadow); min-width: 250px; animation: prwsSlideIn 0.3s ease; }
.prws-toast-success { background: var(--prws-success); }
.prws-toast-error { background: var(--prws-danger); }
@keyframes prwsSlideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
