*{box-sizing:border-box}
body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:#f5f7fb;color:#172033}
:root{--navy:#172554;--purple:#7c3aed;--blue:#2563eb;--green:#16a34a;--orange:#f97316;--red:#dc2626;--pink:#db2777;--cyan:#0891b2;--border:#e2e8f0;--muted:#64748b}
.layout{display:flex;min-height:100vh}
.sidebar{width:255px;background:var(--navy);color:#fff;position:fixed;inset:0 auto 0 0;padding:20px 14px;overflow:auto}
.brand{font-size:18px;font-weight:900;padding:9px 10px 20px;border-bottom:1px solid #33447a}
.brand small{display:block;color:#67e8f9;font-size:10px;letter-spacing:1px;margin-top:5px}
.nav-title{font-size:10px;font-weight:800;color:#9fb0d7;margin:19px 10px 8px;letter-spacing:1px}
.nav a{display:flex;align-items:center;gap:10px;text-decoration:none;color:#dbe5ff;font-size:12px;font-weight:700;padding:10px 11px;border-radius:8px;margin:2px 0}
.nav a:hover,.nav a.active{background:var(--purple);color:#fff}
.icon{width:25px;height:25px;border-radius:6px;background:#33447a;display:grid;place-items:center;font-size:11px;font-style:normal}
.active .icon{background:#5b21b6}

body{background:linear-gradient(120deg,#edf7ff,#f8faff);color:#182658}.sidebar{display:block;z-index:30}.main{margin-left:255px;width:calc(100% - 255px)}.topbar{height:58px;display:flex;align-items:center;gap:25px;padding:10px 16px;border-bottom:1px solid #e3edf6;background:#ffffff99}.search{width:min(540px,65%);border:1px solid #dbe5f1;padding:10px 14px;border-radius:6px;font-size:12px}.user{display:flex;align-items:center;gap:10px;font-size:11px;margin-left:auto}.user small{display:block;color:#64748b}.avatar{padding:10px;background:#8024f6;color:white;border-radius:50%}.content{padding:12px;max-width:1800px;margin:auto}.head{display:flex;align-items:center;gap:15px;margin-bottom:16px}.head h1{font-size:29px;margin:0}.head p{font-size:12px;color:#64748b;margin:4px 0}.title-icon{background:linear-gradient(135deg,#b265ff,#6920ee);color:white;font-size:40px;border-radius:9px;width:53px;height:53px;text-align:center}.export{margin-left:auto;color:#7527ed;border-color:#ac7bfa}
button,input,select{font:inherit}button{background:white;border:1px solid #dce5f1;border-radius:5px;padding:8px 12px;color:#213364;font-size:11px;cursor:pointer}button:hover{filter:brightness(.97)}button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #ac7bfa}.summary{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:16px}.stat{border:1px solid #e3edf8;border-radius:10px;padding:14px 14px;display:flex;align-items:center;gap:12px;background:#eff8ff;min-height:106px;box-sizing:border-box}.stat-icon{height:46px;min-width:46px;width:46px;display:grid;place-items:center;border-radius:9px;background:#bfddff;color:#0878ff;font-size:26px;flex-shrink:0}.stat-content,.stat > div{display:flex;flex-direction:column;justify-content:center;min-width:0;flex:1}.stat label{display:block;font-size:11px;font-weight:800;color:#0868e9;line-height:1.3;margin:0 0 3px 0;white-space:normal;word-break:break-word}.stat-number{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;margin:2px 0 3px 0}.stat strong{display:inline-block;font-size:25px;font-weight:800;line-height:1.15;margin:0;color:#172554}.stat b{font-size:12px;font-weight:700;color:#10944c}.stat small{display:block;font-size:10px;color:#64748b;line-height:1.25;margin:0;white-space:normal}.stat:nth-child(2){background:#fff6eb}.stat:nth-child(2) label{color:#bc4010}.stat:nth-child(2) .stat-icon{background:#ffdbb9;color:#fb7707}.stat:nth-child(3){background:#edfff5}.stat:nth-child(3) label{color:#10944c}.stat:nth-child(3) .stat-icon{background:#b5f1d5;color:#00a65f}.stat:nth-child(4){background:#f7efff}.stat:nth-child(4) label{color:#7c20e9}.stat:nth-child(4) .stat-icon{background:#dfc3ff;color:#7820f3}.stat:nth-child(5){background:#fff1f5}.stat:nth-child(5) label,.stat:nth-child(5) strong{color:#e01543}.stat:nth-child(5) .stat-icon{background:#ffc0cf;color:#ec134a}
.refund-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:12px;align-items:start}.refund-list{min-width:0}.panel{background:white;border:1px solid #e3edf8;border-radius:8px;padding:14px;margin-bottom:12px}.tabs{display:flex;gap:7px;border-bottom:1px solid #edf1f7;overflow:auto}.tabs button{white-space:nowrap;border:0;border-radius:0;font-size:10px;padding:10px 5px}.tabs .active{color:#7328e9;border-bottom:2px solid #7328e9;font-weight:800}.filters{display:flex;gap:8px;align-items:end;margin-top:16px;flex-wrap:wrap}.filters label{font-size:10px;font-weight:750;display:flex;flex-direction:column;gap:5px;flex:1;min-width:90px}.filters label:first-child{flex:1.8}.filters input,.filters select{border:1px solid #dce6f2;border-radius:5px;padding:9px 7px;width:100%;font-size:10px;color:#334568;background:#fff}.dates{display:flex;gap:4px}.filters .apply{background:#802af4;color:white}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.panel-head h2{font-size:16px;margin:0}.panel-head span{font-size:10px;color:#64748b}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;min-width:730px}th{background:#eaf4ff;text-align:left;font-size:9px;padding:10px 7px;white-space:nowrap}td{padding:14px 7px;border-bottom:1px solid #eaf0f7;font-size:10px;line-height:1.5}td small{display:block}td input,th input{accent-color:#7825f2}.badge{display:inline-block;border-radius:5px;padding:4px 9px;font-size:9px;font-weight:700}.requested{background:#fff1cc;color:#be7d10}.approved,.automatic{background:#ddecff;color:#0877ee}.processing{background:#ede5ff;color:#7336c7}.completed{background:#d5fae5;color:#117b43}.rejected,.failed,.manual{background:#ffe0e8;color:#da2445}.view{background:#eee8ff;border:0;color:#6130de;padding:6px 12px;font-size:10px;font-weight:700}.pages{display:flex;justify-content:flex-end;gap:7px;margin-top:10px}.details{position:sticky;top:12px;min-height:570px}.details[hidden]{display:none}.refund-layout:has(.details[hidden]){grid-template-columns:1fr}.details h2{font-size:16px}.details .panel-head button{border:0;padding:0;font-size:22px}.detail-title{display:flex;justify-content:space-between;gap:8px;align-items:center;margin:18px 0 5px}.details small{font-size:10px;color:#64748b}.details h3{font-size:11px;border-bottom:1px solid #edf1f7;padding-bottom:8px;margin:20px 0 8px}dl{display:grid;grid-template-columns:100px 1fr;gap:7px;margin:0;font-size:11px}dt{color:#657594}dd{margin:0;overflow-wrap:anywhere}.documents{font-size:11px;color:#64748b}.documents a{display:flex;justify-content:space-between;padding:10px;border:1px solid #e4ebf5;border-radius:5px;text-decoration:none;color:#263567;margin-bottom:6px}.admin-actions{display:flex;gap:8px}.admin-actions button{flex:1;color:white;font-weight:750;font-size:10px;padding:11px 6px;border:0}.approve{background:#00aa59}.reject{background:#ef2050}.action-note{display:block;margin-top:10px}.empty{text-align:center;padding:30px;color:#64748b}#refundError{background:#fff0f2;color:#b91c1c;padding:12px;border-radius:7px}
@media(max-width:1150px){.summary{grid-template-columns:repeat(3,1fr)}.refund-layout{grid-template-columns:minmax(0,1fr) 285px}.stat{padding:12px}}@media(max-width:850px){.refund-layout{grid-template-columns:1fr}.details{position:static;min-height:0}.summary{grid-template-columns:repeat(2,1fr)}.head p{max-width:420px}.stat strong{font-size:23px}}@media(max-width:500px){.user{display:none}.search{width:85%}.stat-icon{display:none}.head{flex-wrap:wrap}.title-icon{display:none}.head h1{font-size:25px}.export{margin-left:0}.stat label{font-size:10px}}

@media(max-width:800px){.sidebar{width:70px}.brand{font-size:0}.brand small,.nav-title,.nav a span{display:none}.nav a{justify-content:center}.main{margin-left:70px;width:calc(100% - 70px)}}

/* Keep the date pair inside its own flex item on narrow screens. */
.filters label:has(.dates){flex:2 1 280px;min-width:280px}.dates{min-width:0;width:100%}.dates input{min-width:0;flex:1 1 0}.filters>button{flex:0 0 auto}@media(max-width:500px){.filters label:has(.dates){min-width:0;flex-basis:100%}}
