/* =========================================================
   Rewards module - Admin styles
   ========================================================= */

.smt-rewards-section {
    margin-bottom: 20px;
}

.smt-rewards-section h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #1d2327;
}

/* ---------------------------------------------------------
   Field rows
   --------------------------------------------------------- */

.smt-rewards-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.smt-rewards-field-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #3c434a;
}

.smt-rewards-select {
    min-width: 200px;
    max-width: 300px;
}

/* ---------------------------------------------------------
   Roles grid
   --------------------------------------------------------- */

.smt-rewards-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px 16px;
    margin-top: 8px;
}

.smt-rewards-roles-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* ---------------------------------------------------------
   Hook instructions box
   --------------------------------------------------------- */

.smt-rewards-hook-box {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 14px 16px;
    margin-top: 10px;
}

.smt-rewards-hook-label {
    font-size: 12px;
    color: #646970;
    margin: 0 0 4px;
}

.smt-rewards-hook-name {
    display: inline-block;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 13px;
    font-family: Consolas, monospace;
    color: #135e96;
    margin-bottom: 10px;
}

.smt-rewards-code {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    padding: 12px 16px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre;
    margin: 6px 0 0;
}

/* ---------------------------------------------------------
   Save message inline
   --------------------------------------------------------- */

.smt-rw-msg {
    font-size: 13px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 3px;
    margin-left: 8px;
}

.smt-rw-msg-success {
    color: #008a20;
    background: #edfaef;
    border: 1px solid #b8e6c2;
}

.smt-rw-msg-error {
    color: #cc1818;
    background: #fdf2f2;
    border: 1px solid #f5b7b7;
}

/* ---------------------------------------------------------
   Balance tab - controls
   --------------------------------------------------------- */

.smt-rewards-balance-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------
   Users table
   --------------------------------------------------------- */

.smt-rewards-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.smt-rewards-users-table th,
.smt-rewards-users-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.smt-rewards-users-table td .button {
    margin: 0 2px;
    font-size: 11px;
    padding: 2px 8px;
    height: auto;
    line-height: 1.6;
}

.smt-rw-balance-cell {
    font-size: 15px;
    color: #1e6a1e;
}

.smt-rw-loading {
    text-align: center;
    color: #646970;
    padding: 24px !important;
}

/* ---------------------------------------------------------
   Pagination
   --------------------------------------------------------- */

.smt-rewards-pagination {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.smt-rewards-pagination .button {
    min-width: 32px;
    text-align: center;
    padding: 2px 8px;
    height: auto;
    line-height: 1.8;
}

/* ---------------------------------------------------------
   Auto-actions blocks
   --------------------------------------------------------- */

.smt-rewards-action-block {
    padding: 16px 0;
}

.smt-rewards-action-block h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 4px;
}

.smt-rewards-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-top: 10px;
    align-items: center;
}

.smt-rewards-action-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #3c434a;
}

/* ---------------------------------------------------------
   Point type badges (history)
   --------------------------------------------------------- */

.smt-rewards-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #dcdcde;
    color: #3c434a;
}

.smt-rewards-type-earn       { background: #d6f5e3; color: #0a6928; }
.smt-rewards-type-redeem     { background: #fde8cc; color: #924e00; }
.smt-rewards-type-expire     { background: #fce8e8; color: #900f0f; }
.smt-rewards-type-admin      { background: #e0eaf8; color: #0044aa; }
.smt-rewards-type-refund     { background: #f3f0e0; color: #7a6000; }
.smt-rewards-type-registration { background: #e6d9f5; color: #4a1476; }
.smt-rewards-type-review     { background: #d9f0f5; color: #005f74; }
.smt-rewards-type-birthday   { background: #fce8f5; color: #83006a; }
.smt-rewards-type-level_up   { background: #e0fce8; color: #006b2a; }

.smt-rewards-plus { color: #008a20; font-weight: 600; }
.smt-rewards-minus { color: #cc1818; font-weight: 600; }

/* ---------------------------------------------------------
   Modals
   --------------------------------------------------------- */

.smt-rewards-modal {
    z-index: 100050;
}

.smt-rewards-modal[hidden] {
    display: none;
}

.smt-rewards-modal-box {
    max-width: 480px;
    width: 100%;
    position: relative;
    max-height: 90vh;
}

.smt-rewards-modal-wide {
    max-width: 780px;
}

.smt-rewards-modal-box h3 {
    margin: 0 0 18px;
    font-size: 15px;
    color: #1d2327;
    padding-right: 28px;
}

.smt-rewards-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #646970;
    padding: 4px;
    line-height: 1;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}

.smt-rewards-modal-close:hover {
    color: #1d2327;
    background: #f0f0f1;
}

/* History table inside modal */
#smt-rw-history-content .widefat {
    font-size: 12px;
}

#smt-rw-history-content .widefat th,
#smt-rw-history-content .widefat td {
    padding: 6px 8px;
}
