/**
 * GP Signup Approval — v1.0.0
 * Inherits base layout from mdm-pages.css (gp-page, gp-card, etc.)
 * Only signup-approval-specific styles here.
 */

/* ═══════════════════════ PAGE LOADING ═══════════════════════ */

.sa-loading {
    padding: 60px 40px;
    text-align: center;
    color: #64748b;
    font-size: 15px;
}
.sa-loading .fa-spin {
    font-size: 22px;
    margin-bottom: 10px;
    display: block;
    color: #3b82f6;
}

/* ═══════════════════════ ACCESS DENIED ═══════════════════════ */

.sa-denied {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}
.sa-denied-inner {
    text-align: center;
    max-width: 380px;
}
.sa-denied-inner .fa-lock {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
    display: block;
}
.sa-denied-inner h2 {
    margin: 0 0 8px;
    color: #1e293b;
    font-size: 20px;
}
.sa-denied-inner p {
    color: #64748b;
    margin: 0 0 24px;
    font-size: 14px;
}

/* ═══════════════════════ STATS ROW ═══════════════════════ */

.sa-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.sa-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.sa-stat-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.sa-stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sa-stat-info .sa-stat-card-icon,
.sa-stat-card.sa-stat-info .sa-stat-card-icon   { background: #dbeafe; color: #2563eb; }
.sa-stat-card.sa-stat-warn .sa-stat-card-icon    { background: #fef3c7; color: #d97706; }
.sa-stat-card.sa-stat-success .sa-stat-card-icon { background: #dcfce7; color: #16a34a; }
.sa-stat-card.sa-stat-danger .sa-stat-card-icon  { background: #fee2e2; color: #dc2626; }

.sa-stat-card-body {
    display: flex;
    flex-direction: column;
}
.sa-stat-count {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}
.sa-stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* ═══════════════════════ TOOLBAR ═══════════════════════ */

.sa-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.sa-toolbar-left h2 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sa-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sa-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sa-filter-group label {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
}

.sa-select,
.sa-input {
    height: 34px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}
.sa-select:focus,
.sa-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.sa-input { width: 180px; }

.sa-btn-sm {
    height: 34px;
    width: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
}

/* ═══════════════════════ TABLE ═══════════════════════ */

.sa-table-wrap {
    overflow-x: auto;
    padding: 0 !important;
}

.sa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.sa-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}
.sa-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.sa-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}
.sa-table tbody tr:hover {
    background: #f8fafc;
}

.sa-th-id      { width: 50px; }
.sa-th-actions { width: 120px; text-align: center; }
.sa-td-id      { font-weight: 600; color: #94a3b8; }
.sa-td-intro   { max-width: 200px; color: #64748b; font-size: 12px; }
.sa-td-actions { text-align: center; white-space: nowrap; }

.sa-email {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #1e40af;
}

/* ═══════════════════════ BADGES ═══════════════════════ */

.sa-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.sa-badge-info    { background: #dbeafe; color: #1d4ed8; }
.sa-badge-warn    { background: #fef3c7; color: #b45309; }
.sa-badge-success { background: #dcfce7; color: #15803d; }
.sa-badge-danger  { background: #fee2e2; color: #b91c1c; }
.sa-badge-default { background: #f1f5f9; color: #475569; }

/* ═══════════════════════ ACTION BUTTONS ═══════════════════════ */

.sa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 10px;
    transition: background 0.15s, opacity 0.15s;
    color: #fff;
}
.sa-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.sa-btn-loading {
    position: relative;
}
.sa-btn-loading::after {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sa-spin 0.6s linear infinite;
}

.sa-btn-view    { background: #64748b; }
.sa-btn-view:hover    { background: #475569; }
.sa-btn-approve { background: #16a34a; }
.sa-btn-approve:hover { background: #15803d; }
.sa-btn-reject  { background: #dc2626; }
.sa-btn-reject:hover  { background: #b91c1c; }
.sa-btn-resend  { background: #2563eb; }
.sa-btn-resend:hover  { background: #1d4ed8; }
.sa-btn-block   { background: #dc2626; }
.sa-btn-block:hover   { background: #b91c1c; }
.sa-btn-reopen  { background: #d97706; }
.sa-btn-reopen:hover  { background: #b45309; }
.sa-btn-delete  { background: #9f1239; }
.sa-btn-delete:hover  { background: #881337; }

.sa-btn-lg {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
}

/* ═══════════════════════ EMPTY / LOADING STATES ═══════════════════════ */

.sa-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px;
    color: #94a3b8;
}
.sa-empty .fa-folder-open {
    font-size: 36px;
    margin-bottom: 12px;
}
.sa-empty p { margin: 0; font-size: 14px; }

.sa-table-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: #64748b;
    font-size: 14px;
    gap: 8px;
}

.sa-fatal {
    padding: 40px;
    text-align: center;
    color: #dc2626;
    font-size: 15px;
}

/* ═══════════════════════ PAGINATION ═══════════════════════ */

.sa-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 16px;
    border-top: 1px solid #f1f5f9;
}

.sa-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.sa-page-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.sa-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.sa-page-active {
    background: #3b82f6 !important;
    color: #fff !important;
    border-color: #3b82f6 !important;
}

/* ═══════════════════════ MODAL ═══════════════════════ */

.sa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sa-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: sa-modal-in 0.25s ease-out;
}

@keyframes sa-modal-in {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.sa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
}
.sa-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sa-modal-close {
    width: 32px; height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.sa-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.sa-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.sa-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
}

.sa-modal-spinner {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 14px;
}

/* ── Detail Grid inside modal ── */

.sa-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    padding: 14px 0 8px;
    border-top: 1px solid #f1f5f9;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sa-section-label:first-child {
    padding-top: 0;
    border-top: none;
    margin-top: 0;
}
.sa-section-label-security {
    color: #7c3aed;
}
.sa-section-label-security .fa-shield-halved {
    color: #7c3aed;
}

.sa-security-grid {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
    padding: 12px 14px;
}
.sa-security-grid .sa-detail-label {
    color: #7c3aed;
}
.sa-security-grid .sa-detail-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    word-break: break-all;
}

.sa-detail-na {
    color: #94a3b8;
    font-style: italic;
    font-size: 12px;
    font-family: inherit;
}

.sa-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.sa-detail-wide {
    grid-column: 1 / -1;
}
.sa-detail-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sa-detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}
.sa-detail-value {
    font-size: 13px;
    color: #1e293b;
    word-break: break-word;
}

.sa-notes-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}
.sa-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}
.sa-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}
.sa-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ═══════════════════════ TOAST ═══════════════════════ */

.sa-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.sa-toast-visible {
    transform: translateY(0);
    opacity: 1;
}
.sa-toast-success { background: #15803d; color: #fff; }
.sa-toast-error   { background: #b91c1c; color: #fff; }
.sa-toast-info    { background: #1d4ed8; color: #fff; }

.sa-text-danger { color: #dc2626; }

/* ═══════════════════════ SET-PASSWORD LINK (DEV MODE) ═══════════════════════ */

.sa-link-section {
    padding: 4px 0;
}

.sa-link-info {
    font-size: 13px;
    color: #475569;
    margin: 0 0 14px;
    line-height: 1.5;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 14px;
}
.sa-link-info .fa-info-circle {
    color: #16a34a;
}

.sa-link-box {
    margin-bottom: 12px;
}

.sa-link-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Courier New', Courier, monospace;
    color: #1e293b;
    background: #f8fafc;
    box-sizing: border-box;
    outline: none;
}
.sa-link-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sa-link-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sa-btn-copy {
    background: #334155;
    flex: 1;
    min-width: 130px;
}
.sa-btn-copy:hover {
    background: #1e293b;
}
.sa-btn-copied {
    background: #16a34a !important;
}

.sa-btn-whatsapp {
    background: #25D366;
    flex: 1;
    min-width: 180px;
    text-decoration: none;
    color: #fff;
}
.sa-btn-whatsapp:hover {
    background: #1fb855;
    color: #fff;
}

.sa-link-expiry {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}
.sa-link-expiry .fa-clock {
    margin-right: 4px;
}

/* ═══════════════════════ SPINNER KEYFRAME ═══════════════════════ */

@keyframes sa-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */

@media (max-width: 768px) {
    .sa-stats-row { grid-template-columns: 1fr 1fr; }
    .sa-toolbar { flex-direction: column; align-items: stretch; }
    .sa-toolbar-right { flex-direction: column; }
    .sa-input { width: 100%; }
    .sa-detail-grid { grid-template-columns: 1fr; }
    .sa-modal { max-width: 100%; margin: 10px; }
    .sa-table th:nth-child(4),
    .sa-table td:nth-child(4),
    .sa-table th:nth-child(5),
    .sa-table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 480px) {
    .sa-stats-row { grid-template-columns: 1fr; }
    .sa-table th:nth-child(7),
    .sa-table td:nth-child(7) { display: none; }
}