/* The loyalty palette is intentionally confined to this module and its dialogs. */
.loyalty-view,.ly-dialog{--ly-bg:#0d122b;--ly-surface:#161a3b;--ly-raised:#1b2045;--ly-line:#45436d;--ly-text:#f1efff;--ly-muted:#b0b6d8;--ly-accent:#c890ff;--ly-cyan:#31d9e3;--ly-gold:#ffe177;--ly-input:#141a38;color:var(--ly-text);background:var(--ly-bg);font-size:14px;color-scheme:dark}
.loyalty-view{padding:0!important;overflow:auto!important;background:radial-gradient(ellipse at 2% 0%,#4c228343,transparent 47%),radial-gradient(ellipse at 45% 110%,#3d29a345,transparent 60%),var(--ly-bg)}
.ly-shell{max-width:1580px;margin:auto;padding:28px 30px 20px;min-height:100%}.ly-heading{display:flex;justify-content:space-between;align-items:center;gap:22px;margin-bottom:26px}.ly-title{display:flex;align-items:center;gap:16px}.ly-title h1{margin:0;font-size:29px;font-weight:750;line-height:1.45;letter-spacing:0}.ly-title p{margin:3px 0 0;color:var(--ly-muted);font-size:15px}.ly-title-icon{width:60px;height:60px;display:grid;place-items:center;border:1px solid #c045f1;border-radius:15px;color:#efc8ff;background:linear-gradient(130deg,#8212aa,#412266);box-shadow:inset 0 1px 10px #dd72ff4d,0 3px 18px #921cec20}.ly-title-icon svg{width:31px;height:31px}
.loyalty-view svg,.ly-dialog svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;vertical-align:middle}.loyalty-view button,.ly-dialog button{font:inherit;cursor:pointer;color:var(--ly-text);background:linear-gradient(135deg,#28265088,#151a3d66);border:1px solid var(--ly-line);border-radius:9px;min-height:38px;padding:8px 14px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:background-color .15s,border-color .15s;box-shadow:inset 0 1px #ffffff04}.loyalty-view button:hover,.ly-dialog button:hover{border-color:#a278d4;background-color:#854acb20}.loyalty-view button:disabled,.ly-dialog button:disabled{opacity:.45;cursor:not-allowed}.loyalty-view :focus-visible,.ly-dialog :focus-visible{outline:2px solid var(--ly-accent);outline-offset:3px}.loyalty-view .ly-primary,.ly-dialog .ly-primary{background:linear-gradient(115deg,#7b2eec,#bd22ee);border:1px solid #c47df6;color:white;font-weight:700;min-height:46px;padding:10px 24px;box-shadow:inset 0 1px 6px #f6e0ff65,0 4px 14px #7024d52b}.ly-primary svg{width:25px;height:25px}.ly-state{white-space:nowrap;color:var(--ly-muted)!important}.ly-state i{width:10px;height:10px;background:#8f8bb1;border-radius:50%}.ly-state.on{background:#0b382980!important;color:#59edbe!important;border-color:#2b7769!important}.ly-state.on i{background:#4af49f;box-shadow:0 0 8px #3fdba852}
.ly-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin-bottom:18px}.ly-tabs>button{min-height:65px;gap:19px;font-size:17px;font-weight:650;border-radius:12px;background:linear-gradient(140deg,#1c1d4033,#15182dcc);color:var(--ly-text)}.ly-tabs>button[aria-selected=true]{border-color:#b979fd;background:linear-gradient(120deg,#532581a6,#4d26797a);box-shadow:inset 0 1px 6px #bb70ff38,0 0 15px #a73cef21}.ly-tab-icon{display:grid;place-items:center;width:47px;height:47px;border-radius:14px}.ly-tab-icon svg{width:29px;height:29px}.ly-tab-icon.customers{color:#df9aff;background:#722acc38}.ly-tab-icon.referrals{color:#16d9ed;background:#154bbb30}.ly-tab-icon.campaigns{color:#ffba64;background:#87402632}.ly-tab-icon.settings{color:#4f9eff;background:#1b4bc42b}
.ly-card{padding:22px 18px 14px;background:linear-gradient(145deg,#21204476,#12172edd);border:1px solid var(--ly-line);border-radius:15px;box-shadow:0 8px 22px #03041722,inset 0 1px #ffffff05;min-width:0}.ly-card-heading{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:20px}.ly-card h2{font-size:21px;margin:0 0 3px;display:flex;align-items:center;gap:10px}.ly-card h2 svg{color:var(--ly-accent);width:27px;height:27px}.ly-card-heading p{color:var(--ly-muted);margin:0}.ly-card h3,.ly-dialog h3{margin:22px 0 13px;font-size:17px}.ly-filters{display:flex;gap:12px;align-items:stretch;margin-bottom:16px}.ly-search,.ly-select{display:flex!important;align-items:center;gap:9px;position:relative;margin:0!important;min-height:48px;background:linear-gradient(120deg,#22264e,#171b38);border:1px solid var(--ly-line);border-radius:10px;padding:0 13px;color:var(--ly-muted)}.ly-search{flex:1.6;min-width:180px}.ly-select{flex:.9;min-width:130px}.ly-sort{flex:.6;min-width:115px}.ly-search input,.ly-select select{background:transparent!important;border:0!important;box-shadow:none!important;padding:7px 0!important;margin:0!important;width:100%;min-height:42px;color:var(--ly-text)!important}.ly-filters svg{color:#b3abe5}.ly-sort svg{width:18px}
.ly-table-wrap{overflow-x:auto;border:1px solid var(--ly-line);border-radius:12px}.ly-table{width:100%;border-collapse:separate;border-spacing:0;margin:0;white-space:nowrap;background:transparent;color:var(--ly-text);font-size:14px;text-align:center}.ly-table thead{background:#171d39}.ly-table th{font-size:13px;color:var(--ly-muted);font-weight:500;padding:15px 10px;border-bottom:1px solid var(--ly-line);text-align:center}.ly-table td{padding:14px 12px;border-bottom:1px solid #4d4c722e;vertical-align:middle;text-align:center}.ly-table tbody tr:last-child td{border-bottom:0}.ly-table tr.selected{background:linear-gradient(100deg,#713ace55,#622a934b)}.ly-table tr.selected td{border-block-color:#9255d084}.ly-table tbody tr:hover{background-color:#a28eda0a}.ly-table small{display:block;color:var(--ly-muted);font-size:12px;margin-top:5px}.ly-table input[type=checkbox],.loyalty-view input[type=checkbox],.ly-dialog input[type=checkbox]{appearance:auto;accent-color:#c989ff;width:19px;height:19px;min-height:0;padding:0;margin:0;cursor:pointer;flex-shrink:0}.ly-table th:first-child,.ly-table td:first-child{width:34px}.ly-person{display:flex;align-items:center;gap:12px;text-align:right;min-width:180px}.ly-person b{font-size:16px;font-weight:650}.ly-person small{text-align:right;font-size:12px}.ly-avatar{width:47px;height:47px;border-radius:50%;display:inline-grid;place-items:center;font-size:21px;font-weight:600;flex-shrink:0;box-shadow:inset 0 2px 5px #ffffff77;border:1px solid #ffffff35;color:#2c2e5c}.tone-0{background:linear-gradient(125deg,#f0e8ff,#b7bcff)}.tone-1{background:linear-gradient(125deg,#b6fdff,#6dd9f6)}.tone-2{background:linear-gradient(125deg,#e5ffad,#98e994)}.tone-3{background:linear-gradient(125deg,#fff3c6,#f0ce9b)}.tone-4{background:linear-gradient(125deg,#ffe0e7,#e59bbd)}.tone-5{background:linear-gradient(125deg,#e5eeff,#a6d4f4)}.ly-last{display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px}.ly-last svg{color:var(--ly-cyan);width:18px}.ly-points{display:inline-flex;justify-content:center;align-items:center;gap:7px;background:linear-gradient(120deg,#8d672542,#302a2333);color:var(--ly-gold);border:1px solid #bd9b4f;border-radius:24px;padding:5px 12px;font-weight:700;min-width:120px;box-shadow:inset 0 1px 5px #f3d0772c}.ly-points svg{width:18px;height:18px;stroke-width:2}.loyalty-view .ly-referrer{color:var(--ly-cyan);border:0;background:none;font-weight:600;min-height:28px;padding:3px}.ly-direct{display:inline-flex;gap:10px;align-items:center;color:var(--ly-muted)}.loyalty-view .ly-detail{border:0;background:none;padding:6px;min-height:32px}.ly-detail svg{transform:rotate(180deg)}.ly-pagination{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 5px 0}.ly-pagination>span{display:flex;align-items:center;gap:12px}.ly-pagination b{font-weight:600}.ly-pagination>span>b{padding:9px 15px;border:1px solid #af84e6;border-radius:9px;background:linear-gradient(130deg,#b967fa,#7920d5);color:#fff}.ly-pagination button{padding:4px;border:0;background:none;min-height:32px}.ly-pagination button:last-child svg{transform:rotate(180deg)}.ly-pagination>span>span{color:var(--ly-muted);font-size:12px}
.ly-footer{display:flex;align-items:center;gap:9px;padding:20px 0 0;color:var(--ly-muted);font-size:12px}.ly-footer button{margin-inline-start:auto;font-size:12px;min-height:28px;padding:3px 9px}.ly-note,.ly-notice{color:var(--ly-muted);font-size:13px;line-height:1.9;overflow-wrap:anywhere}.ly-notice{padding:10px 16px;border:1px solid var(--ly-line);background:#41326345;border-radius:10px;margin:0 0 14px}.ly-error{color:#ffb8c7!important;background:#87233b24;border-color:#bf536c!important;padding:12px;border-radius:8px}.ly-empty{text-align:center;padding:48px 20px;color:var(--ly-muted);white-space:normal}.ly-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.loyalty-view input:not([type=checkbox]),.loyalty-view select,.ly-dialog input:not([type=checkbox]),.ly-dialog select{font:inherit;color:var(--ly-text);background:var(--ly-input);border:1px solid var(--ly-line);border-radius:9px;padding:10px 12px;width:100%;min-height:42px;box-shadow:inset 0 1px 3px #00000012}.loyalty-view input::placeholder,.ly-dialog input::placeholder{color:var(--ly-muted);opacity:.8}.loyalty-view option,.ly-dialog option{color:var(--ly-text);background:var(--ly-bg)}.ly-card fieldset{margin:0;padding:0;border:0;min-width:0}.ly-settings-top{display:flex;justify-content:space-between;gap:16px;align-items:center;padding-bottom:18px;border-bottom:1px solid var(--ly-line)}.ly-settings-top small{color:var(--ly-muted)}.ly-check{display:flex!important;gap:10px;align-items:center;margin:15px 0!important;font-size:14px!important}.ly-settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px 24px;margin:20px 0}.ly-settings-grid label,.ly-dialog label,.ly-inline label,.ly-add-rule{display:grid;gap:9px;font-size:13px;color:var(--ly-muted)}.ly-inline{display:flex;align-items:end;gap:18px}.ly-inline label{max-width:300px;flex:1}.ly-rule-table input{max-width:160px;text-align:center}.ly-rule-table th:first-child,.ly-rule-table td:first-child{width:auto;text-align:right;min-width:200px}.ly-add-rule{max-width:550px;margin-top:16px}.ly-template-preview{white-space:pre-wrap;border:1px solid var(--ly-line);border-radius:12px;background:#19334355;padding:18px;margin-top:16px;color:var(--ly-text);line-height:1.9}.ly-review{border-top:1px solid var(--ly-line);margin-top:25px;padding-top:10px}.ly-review-scroll{max-height:470px;overflow:auto}.ly-message{white-space:pre-wrap!important;min-width:280px;text-align:start!important;line-height:1.8}.ly-campaign-history{margin-top:20px}.ly-campaign-row{display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid var(--ly-line);padding:18px 0}.ly-campaign-row:last-child{border-bottom:0}.ly-campaign-row small{display:block;margin-top:5px;color:var(--ly-muted)}.ly-campaign-row p{margin:9px 0;font-size:13px}.ly-campaign-row>div:last-child{display:flex;gap:7px}.loyalty-view .ly-link-field{max-width:270px;font-size:12px;margin-inline-end:8px}.ly-dialog{width:min(980px,calc(100vw - 32px));max-height:90dvh;border:1px solid var(--ly-line);border-radius:18px;padding:22px;box-shadow:0 20px 70px #0009}.ly-dialog::backdrop{background:#030716ba;backdrop-filter:blur(3px)}.ly-dialog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;gap:15px}.ly-dialog-heading h2{font-size:22px;margin:0}.ly-dialog-heading button{padding:6px;min-height:34px}.ly-dialog details{margin-top:18px;padding:14px;border:1px solid var(--ly-line);border-radius:10px}.ly-dialog summary{cursor:pointer;color:var(--ly-accent)}.ly-dialog form{display:grid;gap:12px;margin-top:14px}.ly-dialog-body{line-height:1.7}.ly-dialog .ly-table td:first-child{width:auto}.ly-loading{padding:40px;color:var(--ly-muted)}
html[data-theme=light] .loyalty-view,html[data-theme=light] .ly-dialog{--ly-bg:#f4f3fc;--ly-surface:#fff;--ly-raised:#efecfa;--ly-line:#d5cdea;--ly-text:#27233e;--ly-muted:#67627c;--ly-accent:#8137c7;--ly-cyan:#087c94;--ly-gold:#7a5406;--ly-input:#fff;color-scheme:light}
html[data-theme=light] .loyalty-view{background:radial-gradient(ellipse at 0 0,#decbff7a,transparent 45%),#f6f5fc}html[data-theme=light] .ly-card{background:linear-gradient(135deg,#fff,#f5f2ff);box-shadow:0 6px 22px #48326809}html[data-theme=light] .ly-tabs>button{background:#ffffffba}html[data-theme=light] .ly-tabs>button[aria-selected=true]{background:linear-gradient(120deg,#ead8ff,#f4e9ff);border-color:#a576d9;box-shadow:inset 0 1px #fff,0 4px 13px #732dc110}html[data-theme=light] .ly-search,html[data-theme=light] .ly-select,html[data-theme=light] .ly-table thead{background:#f1edfa}html[data-theme=light] .ly-table tr.selected{background:#e9dcfa}html[data-theme=light] .ly-table tr.selected td{border-color:#cbb5e5}html[data-theme=light] .ly-points{background:linear-gradient(130deg,#fff4ca,#fffaf0);border-color:#c8aa58}html[data-theme=light] .ly-error{color:#9c2446!important;background:#fff0f3}html[data-theme=light] .ly-notice{background:#eee8f9}html[data-theme=light] .ly-template-preview{background:#ebf6f0}html[data-theme=light] .ly-state.on{background:#e5f9ee!important;color:#137c5a!important;border-color:#9ad9bf!important}html[data-theme=light] .loyalty-view button:not(.ly-primary):not([role=tab]):not(.ly-referrer):not(.ly-detail):not(.ly-state),html[data-theme=light] .ly-dialog button:not(.ly-primary){background-color:#f3effa;background-image:none}
@media(min-width:1500px){.ly-shell{padding:30px 40px}.ly-table td{padding-block:17px}.ly-person b{font-size:17px}}
@media(max-width:1100px){.ly-shell{padding:22px 18px}.ly-tabs>button{font-size:14px;gap:10px}.ly-title h1{font-size:26px}.ly-filters{flex-wrap:wrap}.ly-search{flex-basis:100%}.ly-table{font-size:13px}.ly-person{min-width:160px}.ly-sort{min-width:150px}}
@media(max-width:720px){.ly-shell{padding:20px 12px}.ly-heading{align-items:flex-start;flex-wrap:wrap;gap:12px;margin-bottom:18px}.ly-title h1{font-size:23px}.ly-title p{font-size:12px}.ly-title-icon{width:47px;height:47px;border-radius:12px}.ly-title{gap:10px}.ly-state{min-height:32px!important;padding:5px 11px!important;font-size:12px!important}.ly-tabs{grid-template-columns:1fr 1fr;gap:9px}.ly-tabs>button{min-height:57px;padding:8px;font-size:13px}.ly-tab-icon{width:34px;height:34px;border-radius:10px}.ly-tab-icon svg{width:23px;height:23px}.ly-card{padding:16px 12px;border-radius:12px}.ly-card h2{font-size:19px}.ly-card-heading{align-items:flex-start;gap:10px}.ly-card-heading p{font-size:12px}.loyalty-view .ly-primary{padding:9px 13px;font-size:13px;min-height:43px;white-space:nowrap}.ly-filters{gap:9px}.ly-select{min-width:40%;padding-inline:9px}.ly-filters input,.ly-filters select{font-size:12px!important}.ly-pagination{flex-wrap:wrap;font-size:12px}.ly-footer{align-items:flex-start;flex-wrap:wrap;font-size:11px;line-height:1.7}.ly-footer button{margin-inline-start:0}.ly-settings-grid{grid-template-columns:1fr;gap:15px}.ly-settings-top{display:block}.ly-inline{flex-wrap:wrap}.ly-campaign-row{align-items:flex-start;flex-direction:column}.ly-dialog{padding:16px;width:calc(100vw - 20px)}.ly-dialog-heading h2{font-size:19px}.ly-table th,.ly-table td{padding:12px 9px}.ly-person b{font-size:14px}.ly-avatar{width:40px;height:40px;font-size:19px}.ly-points{font-size:13px;min-width:110px}.ly-settings-top small{font-size:12px}}
/* Override the legacy platform's global table/theme !important rules locally. */
#loyalty-view{color:var(--ly-text)!important}
#loyalty-view input[type=checkbox],.ly-dialog input[type=checkbox]{accent-color:#b969f5!important}
#loyalty-view .ly-table-wrap,.ly-dialog .ly-table-wrap{position:relative;max-width:100%}
#loyalty-view :is(h1,h2,h3),.ly-dialog :is(h2,h3){color:var(--ly-text)!important}
#loyalty-view .ly-table th,.ly-dialog .ly-table th{background:var(--ly-raised)!important;color:var(--ly-muted)!important;font-size:13px!important}
#loyalty-view .ly-table td,.ly-dialog .ly-table td{background:transparent!important;color:var(--ly-text)!important;font-size:14px!important;border-bottom-color:var(--ly-line)!important}
#loyalty-view .ly-table tbody tr,.ly-dialog .ly-table tbody tr{background:transparent!important}
#loyalty-view .ly-table tbody tr.selected{background:linear-gradient(100deg,#713ace55,#622a934b)!important}
#loyalty-view .ly-person b{color:var(--ly-text)!important}
#loyalty-view .ly-table small,.ly-dialog .ly-table small{color:var(--ly-muted)!important}
#loyalty-view .ly-pagination b{color:var(--ly-text)!important}
html[data-theme=light] #loyalty-view .ly-table tbody tr.selected{background:#e9dcfa!important}
html[data-theme=light] #loyalty-view .ly-tab-icon.customers{color:#8636bd;background:#e5d3f7}
html[data-theme=light] #loyalty-view .ly-tab-icon.referrals{color:#087f94;background:#d5eff4}
html[data-theme=light] #loyalty-view .ly-tab-icon.campaigns{color:#a66016;background:#fff0db}
html[data-theme=light] #loyalty-view .ly-tab-icon.settings{color:#266fc5;background:#dceafb}
.navigation .nav-item.loyalty-nav.active{background:linear-gradient(130deg,#9138d9,#54218b)!important;border-color:#a567df!important;color:#faf2ff!important;box-shadow:inset 0 1px 5px #eab8ff55,0 3px 12px #842dda20!important}
@media(prefers-reduced-motion:reduce){.loyalty-view *,.ly-dialog *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.ly-portal-status{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--ly-line);border-radius:20px;font-size:12px;white-space:nowrap}.ly-portal-status svg{width:15px;height:15px}.ly-portal-status.verified{color:var(--ly-cyan);background:#15c5b512;border-color:#28baa54a}.ly-portal-status.unverified{color:var(--ly-muted);background:#929ac40a}
