/* Rewards v3: what Rewards needs on top of the IGTags stylesheets (igtags.css and pages.css, copied unchanged).
   Same tokens, same rules: pills, 20px surfaces, ink 7% hover, accent only for the main action and selection.
   Page-only styles go in their own file under assets/v3/ and are pushed from the view (@push('styles')). */

/* ------------------------------------------------------------------ small additions */
/* the hidden attribute wins over component display rules (.ig-card is display: flex) */
.ig [hidden] { display: none !important; }
.ig .ig-btn.pg-danger { background: var(--coral); color: var(--on-coral); }
.ig-nav .rw-nav-count { margin-left: 6px; }
.ig-avatar-icon { display: flex; align-items: center; justify-content: center; }
.rw-hero-end { flex: none; display: flex; align-items: flex-end; gap: 28px; }
@media (max-width: 760px) { .rw-hero-end { flex-direction: column; align-items: flex-start; gap: 14px; } .rw-hero-end:has(> .ig-hero-login) { width: 100%; align-items: stretch; } }

/* a page's content blocks, 14px apart (Card rule) */
.rw-stack { display: flex; flex-direction: column; gap: 14px; }
.rw-stack.is-wide { gap: 24px; }
/* a card's head: title + note on the left, small actions on the right */
.rw-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rw-card-head > div:first-child { min-width: 0; }
.rw-card-head .ig-note { margin-top: 2px; }
.rw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rw-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rw-num { font-variant-numeric: tabular-nums; }

/* spinner (#loading-div, busy areas) */
.rw-loading { padding: 32px; display: flex; justify-content: center; color: var(--muted); }
.rw-loading svg, .rw-spin { animation: ig-spin 1s linear infinite; }

/* selects in the field style (46px, 12px corners); the chevron follows the theme */
.ig select.ig-input, .ig .rw-select { height: 46px; padding: 0 40px 0 14px; border: 1px solid var(--field); border-radius: 12px; background: var(--card); color: var(--ink); font-size: 15px; -webkit-appearance: none; appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.ig .rw-select:focus, .ig select.ig-input:focus { outline: none; border-color: var(--field-open); box-shadow: 0 0 0 3px rgba(22, 24, 26, .06); }
.ig .rw-select.is-small { height: 40px; font-size: 14px; }

/* ------------------------------------------------------------------ tables (admin lists) */
/* a card that holds a table edge to edge; it scrolls sideways on its own on phones, the page never does */
.rw-table-card { padding: 0; overflow: hidden; }
.rw-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rw-table { width: 100%; border-collapse: collapse; font-size: 14px; }
/* the DataTable guideline: sentence-case 13px 600 headers in soft-ink with a field line under them; 14px cells,
   9px 12px, a line between rows; no stripes, no vertical lines, no row hover unless the row opens something */
.rw-table th { padding: 13px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--field); background: var(--card); font-size: 13px; font-weight: 600; color: var(--soft-ink); }
.rw-table td { padding: 9px 12px; vertical-align: middle; border-bottom: 1px solid var(--line); }
/* gray subtext: the second line under a cell's main text */
.rw-table small, .rw-table .rw-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.rw-table tr:last-child td { border-bottom: none; }
.rw-table th:first-child, .rw-table td:first-child { padding-left: 22px; }
.rw-table th:last-child, .rw-table td:last-child { padding-right: 22px; }
.rw-table td.is-num, .rw-table th.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.rw-table td.is-muted { color: var(--muted); }
/* rows that open something get .is-click: pointer and the hover */
.rw-table tbody tr.is-click { transition: background .15s; }
@media (hover: hover) { .rw-table tbody tr.is-click:hover { background: var(--row-hover); } }
.rw-table tbody tr.is-click { cursor: pointer; }
@media (max-width: 760px) {
    .rw-table th:first-child, .rw-table td:first-child { padding-left: 16px; }
    .rw-table th:last-child, .rw-table td:last-child { padding-right: 16px; }
}

/* ------------------------------------------------------------------ jQuery UI dialogs (older admin windows) */
/* drawn as the design's Modal, built like the IGTags windows (ig-settings): a header with a line under it (title + round
   close button on one line), the body, and a footer with a line above it holding the buttons. Centered, 20px corners,
   card, pop shadow, on the scrim. rewards.js gives every dialog a 440px default width and closes it on a click outside. */
.ig .ui-widget-overlay { position: fixed; inset: 0; background: var(--scrim); opacity: 1; }
/* toasts show above the windows and their dimmed background */
.ig .ig-toasts { z-index: 3000; }
.ig .ui-dialog { max-width: calc(100% - 24px); max-height: calc(100vh - 32px); padding: 0; display: flex; flex-direction: column; overflow: hidden; border: none; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: var(--pop-shadow); font-family: inherit; font-size: 15px; line-height: 1.5; }
@supports (height: 100dvh) { .ig .ui-dialog { max-height: calc(100dvh - 32px); } }
/* jQuery UI's clearfix adds empty ::before/::after boxes; in a flex row they pushed the title toward the middle */
.ig .ui-dialog .ui-helper-clearfix::before, .ig .ui-dialog .ui-helper-clearfix::after { display: none; }
.ig .ui-dialog .ui-dialog-titlebar { flex: none; padding: 18px 20px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: none; color: var(--ink); }
.ig .ui-dialog .ui-dialog-title { flex: 1; min-width: 0; float: none; width: auto; margin: 0; padding: 0; font-size: 17px; font-weight: 700; line-height: 1.3; text-align: left; white-space: normal; }
/* jQuery UI's theme sets Arial on fields and buttons inside its widgets */
.ig .ui-widget input, .ig .ui-widget select, .ig .ui-widget textarea, .ig .ui-widget button { font-family: inherit; }
.ig .ui-widget-content a:not([class]) { color: inherit; }
/* the close button: the design's 40px round icon button on soft. It holds the word "Close" for screen readers; font-size 0 hides it */
.ig .ui-dialog .ui-dialog-titlebar-close { position: static; width: 40px; height: 40px; margin: 0; padding: 0; flex: none; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 50%; background: var(--soft); color: var(--soft-ink); text-indent: 0; font-size: 0; transition: box-shadow .15s; }
@media (hover: hover) { .ig .ui-dialog .ui-dialog-titlebar-close:hover { box-shadow: inset 0 0 0 999px color-mix(in srgb, currentColor 10%, transparent); } }
.ig .ui-dialog .ui-dialog-titlebar-close .ui-button-icon,
.ig .ui-dialog .ui-dialog-titlebar-close .ui-icon { position: static; width: 20px; height: 20px; margin: 0; background: currentColor; text-indent: -9999px;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E") center / 20px no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E") center / 20px no-repeat; }
.ig .ui-dialog .ui-dialog-titlebar-close .ui-button-icon-space { display: none; }
.ig .ui-dialog .ui-dialog-content { min-height: 0 !important; height: auto !important; padding: 20px; flex: 1 1 auto; overflow: auto; border: none; background: none; color: var(--ink); font-size: 15px; }
.ig .ui-dialog .ui-dialog-buttonpane { flex: none; margin: 0; padding: 16px 20px 18px; border: none; border-top: 1px solid var(--line); background: none; }
.ig .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: none; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.ig .ui-dialog .ui-dialog-buttonpane button { margin: 0; }
.ig .ui-dialog .ui-resizable-handle { display: none !important; }
.ig .ui-dialog .ui-dialog-content a:not([class]) { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
    .ig .ui-dialog .ui-dialog-titlebar { padding: 16px 16px 12px; }
    .ig .ui-dialog .ui-dialog-content { padding: 16px; }
    .ig .ui-dialog .ui-dialog-buttonpane { padding: 14px 16px 16px; }
    .ig .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset .ig-btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------------------ switches on a checkbox */
/* the Switch look (igtags.css .ig-switch) on a real checkbox, so forms and scripts keep reading .checked.
   Admin on/off settings use it instead of a checkbox. .is-row: the text on the left, the switch at the end of the row. */
.ig .rw-switch { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; line-height: 1.35; cursor: pointer; }
.ig .rw-switch.is-row { width: 100%; min-height: 44px; display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; }
.ig .rw-switch > span small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
.ig .rw-switch input[type="checkbox"] { position: relative; width: 46px; height: 28px; margin: 0; flex: none; -webkit-appearance: none; appearance: none; border: none; border-radius: 999px; background: var(--switch-off); cursor: pointer; transition: background .15s; }
.ig .rw-switch input[type="checkbox"]::before { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s, background .15s; }
.ig .rw-switch input[type="checkbox"]:checked { background: var(--accent); }
.ig .rw-switch input[type="checkbox"]:checked::before { transform: translateX(18px); background: var(--on-accent); }
.ig .rw-switch input[type="checkbox"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ig .rw-switch input[type="checkbox"]:disabled { opacity: .38; cursor: default; }

/* admin menu: the page you're on (ink 10%, like a picked list tile) */
.rw-admin-menu { width: 240px; }
.ig .rw-admin-menu .ig-menu-item.is-on { background: color-mix(in srgb, var(--ink) 10%, transparent); font-weight: 600; }

/* delete icon buttons turn coral on hover everywhere, also inside list tiles (pages.css .pg-row .ig-icon-btn:hover is stronger than .pg-del:hover) */
@media (hover: hover) {
    .ig .pg-del:not(.is-off):hover, .ig .pg-row .pg-del:not(.is-off):hover { background: var(--coral-bg); color: var(--coral); box-shadow: none; }
}

/* the Requests pill in the header (only while there are new requests) */
.ig-pill-btn.rw-req-pill { padding-right: 8px; }
.ig-pill-btn.rw-req-pill.is-on { font-weight: 600; background: color-mix(in srgb, var(--ink) 7%, var(--card)); }

/* jQuery UI windows sorted by rewards.js into the design's two kinds (Modal guideline) */
/* confirmation: title, text and two buttons - no lines, no x, 20px padding, 10px between parts */
.ig .ui-dialog.rw-confirm .ui-dialog-titlebar { padding: 20px 20px 0; border-bottom: none; }
.ig .ui-dialog.rw-confirm .ui-dialog-titlebar-close, .ig .ui-dialog.rw-confirm .rw-head-del { display: none !important; }
.ig .ui-dialog.rw-confirm .ui-dialog-content { padding: 10px 20px 0; color: var(--muted); font-size: 13px; }
.ig .ui-dialog.rw-confirm .ui-dialog-content strong, .ig .ui-dialog.rw-confirm .ui-dialog-content b { color: var(--ink); }
.ig .ui-dialog.rw-confirm .ui-dialog-buttonpane { padding: 18px 20px 20px; border-top: none; }
/* edit window header: the Delete icon (moved up from the form) and the x, 4px apart; the original button stays hidden */
.ig .ui-dialog .rw-head-del { margin-left: auto; }
.ig .ui-dialog .rw-head-del + .ui-dialog-titlebar-close { margin-left: -8px; }
.ig .rw-moved { display: none !important; }

/* a form's own button row (edit-pack, edit-volume, edit-preset, new-user): in a window it is the footer, edge to edge
   with a line above, buttons on the right (rewards.js puts Cancel first and moves Delete to the header) */
.ig .pr-form-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.ig .ui-dialog-content .pr-form-acts { margin: 6px -20px -20px; padding: 16px 20px 18px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
    .ig .ui-dialog-content .pr-form-acts { margin: 4px -16px -16px; padding: 14px 16px 16px; }
    .ig .ui-dialog-content .pr-form-acts .ig-btn { flex: 1 1 auto; }
}

/* the header row can't wrap: a long name in the user pill ends in "..." instead of pushing the row past the page edge */
.ig-user { min-width: 0; }
.rw-user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* an (i) after a label: its note on hover or a tap (copied from IGTags igtags.css) */
.ig-info { position: relative; display: inline-flex; vertical-align: middle; margin: -5px 0 -3px 1px; }
.ig .ig-info-btn { width: 26px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 50%; background: none; color: color-mix(in srgb, var(--muted) 55%, transparent); cursor: help; transition: color .15s; }
.ig .ig-info-btn:hover, .ig-info-btn[aria-expanded="true"] { color: var(--ink); }
.ig-info-tip { display: none; position: absolute; z-index: 20; left: 50%; top: calc(100% + 6px); transform: translateX(calc(-50% + var(--tip-x, 0px))); width: max-content; max-width: min(260px, 80vw); padding: 8px 12px; white-space: normal; text-align: left; border-radius: 10px; background: var(--ink); color: var(--on-ink); font-size: 13px; font-weight: 500; line-height: 1.4; box-shadow: var(--pop-shadow); }
.ig-info-tip.is-on { display: block; }
@media (hover: hover) { .ig-info:hover .ig-info-tip { display: block; } } /* a phone keeps :hover on the last tapped one */
.ig-info.is-up .ig-info-tip { top: auto; bottom: calc(100% + 6px); } /* no room below: above the (i) */

.ig input[type="search"]::-webkit-search-cancel-button { cursor: pointer; } /* the browser's clear (x) is clickable too */
