
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;padding:0;overflow:hidden}
body{font-family:"Segoe UI",Tahoma,Arial,sans-serif;font-size:13px;background:#aaa;color:#000}
button,input,select,textarea{font:inherit;color:#000}
.hidden{display:none!important}

/* Login */
.login-screen{position:fixed;inset:0;background:#b0b0b0;display:flex;align-items:center;justify-content:center;z-index:999999}
.login-dialog{width:390px;background:#eee;border:1px solid #777;box-shadow:4px 5px 12px rgba(0,0,0,.32)}
.legacy-titlebar{height:29px;background:#fff;border-bottom:1px solid #aaa;display:flex;align-items:center;padding:0 9px;font-size:12px}
.login-content{padding:22px 24px 20px}
.login-heading{text-align:center;font-size:17px;font-weight:600;margin-bottom:20px}
.legacy-form-row{display:grid;grid-template-columns:100px 1fr;align-items:center;margin:9px 0;gap:8px}
.legacy-form-row input{height:29px;border:1px solid #888;background:#fff;padding:3px 6px}
.login-error{min-height:20px;color:#a00000;padding-left:108px}
.legacy-button-row{text-align:right;margin-top:10px}
.legacy-button-row button,.legacy-button{min-width:64px;height:31px;background:#eee;border:1px solid #aaa;box-shadow:inset 0 0 0 1px #fafafa;padding:2px 13px}
.legacy-button-row button:active,.legacy-button:active{background:#ddd}

/* Main exact-style shell */
.legacy-app{position:fixed;inset:0;display:grid;grid-template-rows:20px 20px 64px 70px 70px 1fr 27px;background:#aaa}
.app-titlebar{height:20px;background:#fafafa;display:flex;align-items:center;padding:0 4px;font-size:11px;white-space:nowrap}
.app-titlebar .spade{font-size:15px;margin-right:4px;color:#8b6f38}
.fake-win-buttons{margin-left:auto;font-size:12px;letter-spacing:4px;color:#333}
.app-menubar{height:20px;background:#a9c6e5;display:flex;align-items:stretch;padding-left:3px;border-bottom:1px solid #8da7c2}
.app-menubar button{height:20px;border:0;background:transparent;padding:0 9px;font-size:11px;text-align:left}
.app-menubar button:hover,.app-menubar button.menu-open{background:#f4f4f4;border-left:1px solid #aaa;border-right:1px solid #aaa}

.group-row{background:#ccc;display:flex;align-items:center;padding:0 14px;gap:16px;position:relative}
.group-row>label{font-size:17px}
.group-row select{width:186px;height:31px;border:1px solid #aaa;background:#eee;padding:2px 7px;font-size:16px}
.group-row .legacy-button{height:31px;min-width:64px;font-size:16px}
.legacy-clock{font-size:20px;color:#0078d7;margin-left:-4px}
.active-group{margin-left:auto;font-size:20px;color:#0078d7;padding-right:6px}

.member-row{background:#efefef;display:grid;grid-template-columns:90px 186px 64px 1fr 78px;align-items:center;gap:16px;padding-left:14px}
.member-row>label{font-size:17px}
.member-row input{height:27px;border:1px solid #999;background:white;padding:2px 5px;font-size:16px}
.member-row .legacy-button{height:31px;font-size:16px}
.member-quick-info{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.member-detail-button{align-self:stretch;margin:0;border:1px solid #aaa;background:#eee;font-size:16px;line-height:18px}

.summary-row{background:#ffb2bd;border-bottom:1px solid #555;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:center;text-align:center;font-size:20px}
.summary-row span{font-weight:400}

.transaction-area{min-height:0;display:grid;grid-template-rows:auto 1fr;background:#aaa}
.main-grid-wrap{overflow-x:auto;overflow-y:hidden;background:#aaa}
.main-grid{border-collapse:collapse;width:calc(100% - 180px);min-width:1180px;background:#fff;table-layout:fixed;font-size:13px}
.main-grid th,.main-grid td{border:1px solid #9c9c9c;height:20px;padding:1px 6px;white-space:nowrap;overflow:hidden;text-overflow:clip}
.main-grid thead th{height:24px;background:#fafafa;font-weight:400;text-align:left;font-size:14px}
.main-grid .row-head{width:43px;padding:0}
.main-grid th:nth-child(2){width:174px}
.main-grid th:nth-child(3){width:90px}
.main-grid th:nth-child(4){width:105px}
.main-grid th:nth-child(5){width:105px}
.main-grid th:nth-child(6){width:105px}
.main-grid th:nth-child(7){width:175px}
.main-grid th:nth-child(8){width:110px}
.main-grid th:nth-child(9){width:285px}
.main-grid th:nth-child(10){width:300px}
.main-grid td.num{text-align:right}
.main-grid tbody tr:nth-child(odd){background:#e8ffff}
.main-grid tbody tr:nth-child(even){background:#fff}
.main-grid tbody tr.selected td{background:#0078d7!important;color:#fff}
.main-grid tbody tr.selected td.row-marker{background:#e7e7e7!important;color:#333}
.row-marker{text-align:left;width:43px;padding-left:4px!important}
.gray-workspace{background:#aaa;min-height:0}

.shortcut-bar{background:#f6f6f6;border-top:1px solid #999;display:flex;align-items:center;padding:0 4px;font-size:12px}

/* Old Windows drop-down menu */
.legacy-dropdown,.legacy-context{position:fixed;background:#f4f4f4;border:1px solid #888;box-shadow:2px 3px 5px rgba(0,0,0,.35);z-index:500000;padding:3px 0;min-width:180px}
.legacy-context{min-width:145px}
.legacy-dropdown button,.legacy-context button{display:block;border:0;background:transparent;width:100%;height:24px;text-align:left;padding:0 12px 0 28px;font-size:12px;white-space:nowrap}
.legacy-dropdown button:hover,.legacy-context button:hover{background:#91c9f7;color:#000}
.legacy-dropdown button:disabled,.legacy-context button:disabled{color:#999;background:transparent}
.menu-separator{height:1px;background:#aaa;margin:3px 4px}

/* Dialogs: no overlay, just desktop style window */
.legacy-window{position:fixed;background:#eee;border:1px solid #777;box-shadow:3px 5px 12px rgba(0,0,0,.35);z-index:200000;overflow:hidden}
.legacy-window.active{z-index:210000}
.window-titlebar{height:28px;background:#fafafa;display:flex;align-items:center;border-bottom:1px solid #ddd;padding-left:8px;font-size:11px;user-select:none}
.window-caption{flex:1}
.window-close{width:31px;height:22px;margin-right:2px;border:0;background:#d75a4e;color:white;font-size:13px}
.window-body{position:absolute;left:0;right:0;top:28px;bottom:0;overflow:auto;background:#eee}
.window-footer{position:absolute;left:0;right:0;bottom:0;height:36px;background:#f4f4f4;border-top:1px solid #aaa;padding:8px 12px;font-size:12px}

/* Member Search */
.search-window{width:min(1245px,calc(100vw - 40px));height:min(575px,calc(100vh - 70px));left:50%;top:50%;transform:translate(-50%,-50%)}
.search-window .window-body{bottom:36px}
.member-search-top{height:158px;padding:12px 16px 8px;background:#eee;border-bottom:1px solid #444}
.search-title{font-size:16px;margin-bottom:7px}
.search-filter-grid{display:grid;grid-template-columns:1.35fr 1.05fr 1.05fr 190px;gap:9px 28px;align-items:center}
.filter-line{display:grid;grid-template-columns:18px 105px 1fr;gap:5px;align-items:center}
.filter-line.wide{grid-template-columns:18px 105px 1fr}
.filter-line input[type=checkbox]{width:14px;height:14px}
.filter-line input[type=text],.filter-line input[type=email],.filter-line select,.filter-line input[type=date]{height:26px;border:1px solid #aaa;background:white;padding:2px 5px;min-width:0;width:100%}
.date-range{display:grid;grid-template-columns:1fr 14px 1fr;gap:4px;align-items:center}
.search-buttons{grid-column:4;grid-row:1/4;display:grid;grid-template-columns:1fr 1fr;gap:14px 15px;align-content:start;padding-top:0}
.search-buttons button{height:43px;border:1px solid #aaa;background:#eee}
.username-search-line{margin-top:8px;display:flex;align-items:center;gap:8px}
.username-search-line input{width:215px;height:25px;border:1px solid #aaa;background:#fff}
.member-count{margin-left:auto;margin-right:185px;font-size:17px;font-weight:600}
.search-results{height:calc(100% - 158px);background:#aaa;overflow:auto}
.legacy-data{border-collapse:collapse;width:100%;min-width:1120px;background:#fff;font-size:12px}
.legacy-data th,.legacy-data td{border:1px solid #aaa;padding:2px 5px;height:20px;white-space:nowrap}
.legacy-data th{background:#f5f5f5;font-size:14px;font-weight:400;text-align:left}
.legacy-data tr.selected td{background:#0078d7;color:#fff}
.legacy-data .marker{width:43px;background:#eee;color:#333!important}

/* Transaction dialog */
.transaction-window{width:500px;height:707px;left:50%;top:50%;transform:translate(-50%,-50%);background:#c6d8e7}
.transaction-window .window-body{background:#c6d8e7;padding:20px 28px}
.member-blue-grid{display:grid;grid-template-columns:130px 18px 1fr;gap:9px 0;align-items:center;font-size:15px;margin-bottom:12px}
.blue-value{font-weight:700;color:#0000d8;font-size:16px}
.radio-row{display:flex;gap:30px;margin:4px 0 16px 0;align-items:center}
.radio-row label{display:flex;align-items:center;gap:5px;font-size:15px}
.legacy-groupbox{border:1px solid #f0f0f0;box-shadow:inset 0 0 0 1px #b2c2d2;padding:26px 14px 14px;position:relative;margin:18px 0 14px}
.legacy-groupbox>legend{position:absolute;top:-13px;left:8px;background:#c6d8e7;padding:0 4px;font-size:20px}
.transaction-fields{display:grid;grid-template-columns:145px 1fr;gap:9px 8px;align-items:center}
.transaction-fields input,.transaction-fields select,.transaction-fields textarea{border:1px solid #aaa;background:#fff;height:25px;padding:2px 4px}
.transaction-fields textarea{height:62px;resize:none}
.bonus-check{display:flex;align-items:center;gap:6px;margin:18px 0 2px 2px}
.balance-box{border:1px solid #eef5fa;box-shadow:inset 0 0 0 1px #b3c3d1;padding:11px 8px;margin-top:14px}
.balance-line{display:grid;grid-template-columns:190px 1fr;gap:8px;margin-bottom:8px;align-items:center}
.balance-line:last-child{margin-bottom:0}
.balance-line output{height:22px;background:#f5f5f5;border:1px solid #aaa;text-align:right;padding:2px 4px;color:#777}
.transaction-time{display:grid;grid-template-columns:130px 20px 1fr;align-items:center;margin:10px 0;color:#000}
.transaction-time b{color:#0000d8}
.transaction-buttons{display:flex;justify-content:center;gap:26px;margin-top:12px}
.transaction-buttons button{width:98px;height:38px;border:1px solid #aaa;background:#eee;font-size:14px}

/* Simple modal forms */
.simple-window{width:650px;height:440px;left:50%;top:50%;transform:translate(-50%,-50%)}
.simple-window .window-body{padding:14px 18px}
.simple-grid{display:grid;grid-template-columns:155px 1fr;gap:8px;align-items:center}
.simple-grid input,.simple-grid select,.simple-grid textarea{width:100%;min-height:27px;border:1px solid #aaa;background:white;padding:3px 5px}
.simple-grid textarea{height:80px;resize:vertical}
.simple-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:15px}
.simple-actions button{min-width:82px;height:32px;background:#eee;border:1px solid #aaa}
.list-window{width:min(1050px,calc(100vw - 40px));height:min(600px,calc(100vh - 70px));left:50%;top:50%;transform:translate(-50%,-50%)}
.list-window .window-body{padding:10px}
.tool-row{display:flex;gap:8px;align-items:center;margin-bottom:8px}
.tool-row input,.tool-row select{height:27px;border:1px solid #aaa;background:#fff;padding:2px 5px}
.tool-row button{height:31px;border:1px solid #aaa;background:#eee;padding:0 14px}
.tool-row .grow{flex:1}

/* Input Bonus */
.input-bonus-window{width:410px;height:420px;left:50%;top:50%;transform:translate(-50%,-50%)}
.input-bonus-window .window-body{padding:12px 10px}
.bonus-top{display:grid;grid-template-columns:auto 110px 72px 18px 72px;gap:6px;align-items:center;font-size:15px}
.bonus-top select,.bonus-top input{height:25px;border:1px solid #aaa;background:white}
.bonus-bigbox{height:290px;border:1px solid #1683e8;background:white;margin:9px 0;overflow:auto;padding:5px;white-space:pre-wrap}
.bonus-bottom{display:flex;justify-content:space-between}
.bonus-bottom button{width:74px;height:28px;border:1px solid #aaa;background:#eee}

/* Pending/settings list */
.menu-list-table{width:100%;border-collapse:collapse;background:#fff}
.menu-list-table th,.menu-list-table td{border:1px solid #aaa;padding:3px 5px;white-space:nowrap}
.menu-list-table th{background:#f5f5f5;text-align:left;font-weight:400}
.menu-list-table tr.selected td{background:#0078d7;color:#fff}

/* Toast */
.legacy-toast{position:fixed;right:12px;bottom:35px;z-index:800000;background:#ffffe1;border:1px solid #666;box-shadow:2px 2px 4px rgba(0,0,0,.35);padding:9px 12px;max-width:430px}
.legacy-toast.error{background:#ffd8d8;border-color:#a00000}
.legacy-toast.ok{background:#e5ffe5;border-color:#278027}

/* Mobile fallback */
@media(max-width:900px){
  .legacy-app{min-width:900px;overflow:auto}
  html,body{overflow:auto}
  .active-group{display:none}
}


/* v2.1.2 layout tidy */
.transaction-window [data-bonusbox]{margin-top:18px}
.password-window{width:440px;height:245px;left:50%;top:50%;transform:translate(-50%,-50%)}
.password-window .window-body{padding:16px 18px;background:#eee}
.delete-warning{background:#fff4cf;border:1px solid #c8aa55;padding:9px 10px;margin-bottom:14px;line-height:1.35}

.coin-balance-window{width:min(1050px,calc(100vw - 30px));height:190px;left:50%;top:50%;transform:translate(-50%,-50%)}
.coin-balance-window .window-body{display:grid;grid-template-rows:1fr 42px;background:#eee;padding:10px}
.coin-table-area{overflow:auto}
.coin-buttonbar{display:flex;justify-content:flex-end;align-items:center;gap:10px;padding-top:8px}
.coin-buttonbar button{min-width:120px;height:30px;border:1px solid #aaa;background:#eee}
.coin-adjust-window{width:500px;height:330px;left:50%;top:50%;transform:translate(-50%,-50%)}
.coin-adjust-window .window-body{padding:16px 18px}

.history-coin-window{width:min(950px,calc(100vw - 30px));height:min(620px,calc(100vh - 50px));left:50%;top:50%;transform:translate(-50%,-50%)}
.history-coin-window .window-body{display:grid;grid-template-rows:42px 34px 1fr 42px;background:#eee;padding:10px 12px}
.history-coin-top{display:flex;align-items:center;gap:10px}
.history-coin-top input{height:25px;border:1px solid #aaa;background:#fff;padding:2px 5px}
.history-coin-top button{height:26px;min-width:74px;border:1px solid #aaa;background:#eee}
.history-coin-site{font-size:16px;display:flex;align-items:center}
.history-coin-grid{background:#bbb;overflow:auto;border:1px solid #999}
.history-coin-grid .menu-list-table{min-width:900px}
.history-coin-grid .menu-list-table tbody tr td{background:#c7c7c7}
.history-coin-grid .menu-list-table tbody tr.selected td{background:#0078d7;color:#fff}
.history-coin-bottom{display:flex;justify-content:flex-end;align-items:end}
.history-coin-bottom button{width:74px;height:28px;border:1px solid #aaa;background:#eee}

/* keep date controls compact and aligned */
.tool-row input[type=date]{width:125px}
