/* ============================================================
   ACE Tech — iOS Glass × Terminal Hacker UI
   Pure visual layer. No functional changes.
   ============================================================ */
html[data-theme="dark"]{
  --ace-bg:#05070c;
  --ace-bg-2:#080d15;
  --ace-glass:rgba(13,20,31,.64);
  --ace-glass-strong:rgba(10,16,26,.88);
  --ace-line:rgba(120,220,255,.13);
  --ace-line-2:rgba(120,220,255,.30);
  --ace-text:#e9f3ff;
  --ace-dim:#8ea3bb;
  --ace-mute:#5d7188;
  --ace-cyan:#64d2ff;
  --ace-teal:#5eead4;
  --ace-blue:#0a84ff;
  --ace-green:#30d158;
  --ace-red:#ff453a;
  --ace-amber:#ffd60a;
  --ace-mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
  --ace-ease:cubic-bezier(.22,1,.36,1);
  color-scheme:dark;
  background:var(--ace-bg)!important;
}

html[data-theme="dark"] body{
  background:
    radial-gradient(1100px 720px at 6% -14%, rgba(10,132,255,.20), transparent 62%),
    radial-gradient(900px 620px at 102% -4%, rgba(94,234,212,.10), transparent 58%),
    radial-gradient(900px 700px at 50% 120%, rgba(10,132,255,.09), transparent 62%),
    #05070c!important;
  color:var(--ace-text)!important;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","PingFang SC","Helvetica Neue",Arial,sans-serif!important;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/* two texture layers: faint blueprint grid + CRT scanlines */
html[data-theme="dark"] body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background-image:
    linear-gradient(rgba(100,210,255,.05) 1px,transparent 1px),
    linear-gradient(90deg,rgba(100,210,255,.05) 1px,transparent 1px);
  background-size:46px 46px,46px 46px;
  -webkit-mask-image:radial-gradient(circle at 50% 28%,#000 0%,rgba(0,0,0,.55) 55%,transparent 88%);
  mask-image:radial-gradient(circle at 50% 28%,#000 0%,rgba(0,0,0,.55) 55%,transparent 88%);
  opacity:.55;
}
html[data-theme="dark"] body::after{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:9999;
  background:repeating-linear-gradient(0deg,rgba(255,255,255,.022) 0 1px,transparent 1px 3px);
  mix-blend-mode:overlay;opacity:.45;
}
html[data-theme="dark"] #root{position:relative;z-index:1;background:transparent!important;}

/* ---------- shell ---------- */
html[data-theme="dark"] .ant-layout{background:transparent!important;}
html[data-theme="dark"] .ant-layout-sider{
  background:linear-gradient(180deg,rgba(7,11,19,.92),rgba(5,8,14,.97))!important;
  border-right:1px solid var(--ace-line)!important;
  box-shadow:22px 0 70px rgba(0,0,0,.48)!important;
  -webkit-backdrop-filter:blur(24px) saturate(150%);
  backdrop-filter:blur(24px) saturate(150%);
}
html[data-theme="dark"] .ant-layout-header{
  background:rgba(6,10,18,.60)!important;
  border-bottom:1px solid var(--ace-line)!important;
  box-shadow:0 12px 36px rgba(0,0,0,.28)!important;
  -webkit-backdrop-filter:blur(24px) saturate(160%);
  backdrop-filter:blur(24px) saturate(160%);
}
html[data-theme="dark"] .ant-layout-content{background:transparent!important;}
html[data-theme="dark"] .ant-layout-content > div{background:transparent!important;}

/* logo */
html[data-theme="dark"] .ant-layout-sider-children > div[style*="padding: 20px 16px"]{
  position:relative;padding-bottom:30px!important;
}
html[data-theme="dark"] .ant-layout-sider-children > div[style*="padding: 20px 16px"] > div{
  color:#eafcff!important;
  font-family:var(--ace-mono)!important;
  font-size:15px!important;font-weight:600!important;
  letter-spacing:.14em;
  text-shadow:0 0 20px rgba(100,210,255,.40);
}
html[data-theme="dark"] .ant-layout-sider-children > div[style*="padding: 20px 16px"]::after{
  content:"// SECURE_OPS";position:absolute;left:0;right:0;bottom:9px;
  text-align:center;font:9px/1 var(--ace-mono);letter-spacing:.24em;
  color:rgba(100,210,255,.48);
}

/* menu */
html[data-theme="dark"] .ant-menu-dark.ant-menu-inline{
  background:transparent!important;border-inline-end:0!important;
}
html[data-theme="dark"] .ant-menu-dark.ant-menu-inline .ant-menu-item{
  height:42px!important;line-height:42px!important;
  margin:4px 9px!important;padding:0 12px!important;
  border-radius:12px!important;color:#8fa3bb!important;
  transition:background .22s var(--ace-ease),color .22s,box-shadow .22s!important;
}
html[data-theme="dark"] .ant-menu-dark.ant-menu-inline .ant-menu-item:hover{
  background:rgba(100,210,255,.065)!important;color:#eafcff!important;
}
html[data-theme="dark"] .ant-menu-dark.ant-menu-inline .ant-menu-item-selected{
  background:linear-gradient(92deg,rgba(10,132,255,.24),rgba(94,234,212,.09))!important;
  color:#f2feff!important;
  box-shadow:inset 0 0 0 1px rgba(100,210,255,.22),0 0 26px rgba(10,132,255,.16)!important;
}
html[data-theme="dark"] .ant-menu-dark.ant-menu-inline .ant-menu-item-selected::after{display:none!important;}
html[data-theme="dark"] .ant-menu-dark.ant-menu-inline .ant-menu-item-selected::before{
  content:"";position:absolute;left:3px;top:11px;bottom:11px;width:3px;border-radius:2px;
  background:linear-gradient(180deg,var(--ace-cyan),var(--ace-teal));
  box-shadow:0 0 12px rgba(100,210,255,.9);
}
html[data-theme="dark"] .ant-menu-dark .ant-menu-item .anticon{color:#7f96ae!important;transition:color .2s;}
html[data-theme="dark"] .ant-menu-dark .ant-menu-item-selected .anticon{color:var(--ace-cyan)!important;filter:drop-shadow(0 0 8px rgba(100,210,255,.55));}

/* header */
html[data-theme="dark"] .ant-layout-header .ant-btn-text{color:#8fa3bb!important;border-radius:10px!important;}
html[data-theme="dark"] .ant-layout-header .ant-btn-text:hover{color:#eafcff!important;background:rgba(100,210,255,.08)!important;}
html[data-theme="dark"] .ant-layout-header > div:first-child > div:last-child{
  color:#eafcff!important;font-family:var(--ace-mono)!important;
  letter-spacing:.10em;border-left-color:var(--ace-line-2)!important;
}
html[data-theme="dark"] .ant-layout-header span{color:#8ea3bb!important;}
html[data-theme="dark"] .ant-layout-header > div:first-child > div:last-child,
html[data-theme="dark"] .ant-layout-header > div:first-child > div:last-child *{color:#eafcff!important;}
html[data-theme="dark"] .ant-layout-header .ant-avatar{
  background:linear-gradient(135deg,#0a84ff,#5eead4)!important;
  box-shadow:0 0 0 2px rgba(5,7,12,.9),0 0 0 3px rgba(100,210,255,.35),0 0 22px rgba(10,132,255,.35);
}
html[data-theme="dark"] .ant-badge-count{
  background:linear-gradient(135deg,#ff453a,#ff2d55)!important;
  box-shadow:0 0 16px rgba(255,69,58,.55)!important;
  font-family:var(--ace-mono);
}

/* ---------- glass cards ---------- */
html[data-theme="dark"] .ant-card{
  position:relative;
  background:linear-gradient(180deg,rgba(16,24,38,.72),rgba(9,14,23,.80))!important;
  border:1px solid var(--ace-line)!important;
  border-radius:18px!important;
  box-shadow:0 20px 55px rgba(0,0,0,.42),inset 0 1px 0 rgba(255,255,255,.055)!important;
  -webkit-backdrop-filter:blur(18px) saturate(140%);
  backdrop-filter:blur(18px) saturate(140%);
}
html[data-theme="dark"] .ant-card::before{
  content:"";position:absolute;left:20px;right:20px;top:0;height:1px;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(100,210,255,.65),rgba(94,234,212,.35),transparent);
  opacity:.65;
}
html[data-theme="dark"] .ant-card::after{
  content:"";position:absolute;inset:9px;pointer-events:none;border-radius:12px;opacity:.16;
  background:
    linear-gradient(var(--ace-cyan),var(--ace-cyan)) left top/14px 1px no-repeat,
    linear-gradient(var(--ace-cyan),var(--ace-cyan)) left top/1px 14px no-repeat,
    linear-gradient(var(--ace-cyan),var(--ace-cyan)) right top/14px 1px no-repeat,
    linear-gradient(var(--ace-cyan),var(--ace-cyan)) right top/1px 14px no-repeat,
    linear-gradient(var(--ace-cyan),var(--ace-cyan)) left bottom/14px 1px no-repeat,
    linear-gradient(var(--ace-cyan),var(--ace-cyan)) left bottom/1px 14px no-repeat,
    linear-gradient(var(--ace-cyan),var(--ace-cyan)) right bottom/14px 1px no-repeat,
    linear-gradient(var(--ace-cyan),var(--ace-cyan)) right bottom/1px 14px no-repeat;
}
html[data-theme="dark"] .ant-card-head{
  background:transparent!important;border-bottom:1px solid var(--ace-line)!important;color:#eafcff!important;
}
html[data-theme="dark"] .ant-card-head-title{
  font-weight:600!important;letter-spacing:.03em;color:#eafcff!important;
}
html[data-theme="dark"] .ant-card-body{color:var(--ace-text);}

/* filter panel + pagination panel are plain divs, use :has */
html[data-theme="dark"] div:has(> form.ant-form-inline){
  background:linear-gradient(180deg,rgba(15,23,36,.74),rgba(8,13,22,.80))!important;
  border:1px solid var(--ace-line)!important;border-radius:18px!important;
  box-shadow:0 18px 50px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.05)!important;
  -webkit-backdrop-filter:blur(18px) saturate(140%);
  backdrop-filter:blur(18px) saturate(140%);
  position:relative;
}
html[data-theme="dark"] div:has(> .ant-pagination){
  background:rgba(11,17,27,.55)!important;
  border:1px solid var(--ace-line)!important;border-radius:14px!important;
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
}

/* device status strip + info grid */
html[data-theme="dark"] .ant-card div[style*="border-bottom: 3px solid"]{
  border-bottom:1px solid rgba(255,69,58,.38)!important;
  background:linear-gradient(90deg,rgba(255,69,58,.10),rgba(255,69,58,.02))!important;
  border-radius:14px 14px 0 0!important;
  font-family:var(--ace-mono);
  letter-spacing:.04em;
}
html[data-theme="dark"] .ant-card div[style*="grid-template-columns: repeat(6, 1fr)"]{
  background:rgba(255,255,255,.025)!important;
  border:1px solid rgba(120,220,255,.10)!important;
  border-radius:12px!important;
  font-variant-numeric:tabular-nums;
}

/* ---------- buttons ---------- */
html[data-theme="dark"] .ant-btn{
  border-radius:10px!important;
  border-color:rgba(255,255,255,.11)!important;
  background:rgba(255,255,255,.035)!important;
  color:#dbe9f7!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
  transition:transform .16s var(--ace-ease),box-shadow .22s,border-color .22s,background .22s!important;
  font-weight:500;
}
html[data-theme="dark"] .ant-btn:not(:disabled):hover{
  transform:translateY(-1px);
  border-color:rgba(100,210,255,.45)!important;
  box-shadow:0 0 20px rgba(100,210,255,.16),inset 0 1px 0 rgba(255,255,255,.08)!important;
}
html[data-theme="dark"] .ant-btn:not(:disabled):active{transform:scale(.97);}
html[data-theme="dark"] .ant-btn-primary{
  background:linear-gradient(135deg,#0a84ff 0%,#64d2ff 100%)!important;
  border:none!important;color:#001018!important;
  box-shadow:0 8px 24px rgba(10,132,255,.32),inset 0 1px 0 rgba(255,255,255,.38)!important;
  text-shadow:0 1px 0 rgba(255,255,255,.18);
}
html[data-theme="dark"] .ant-btn-primary:not(:disabled):hover{
  box-shadow:0 10px 32px rgba(100,210,255,.42),inset 0 1px 0 rgba(255,255,255,.45)!important;
}
html[data-theme="dark"] .ant-btn-dangerous{
  background:linear-gradient(135deg,#ff453a,#ff2d55)!important;
  border:none!important;color:#1a0505!important;
  box-shadow:0 8px 24px rgba(255,69,58,.28),inset 0 1px 0 rgba(255,255,255,.35)!important;
}
html[data-theme="dark"] .ant-btn-text{background:transparent!important;border-color:transparent!important;}
html[data-theme="dark"] .ant-btn-default{
  background:rgba(255,255,255,.045)!important;
  color:#dbe9f7!important;
  border-color:rgba(255,255,255,.12)!important;
}
html[data-theme="dark"] .ant-btn:disabled,
html[data-theme="dark"] .ant-btn.ant-btn-disabled{
  background:rgba(255,255,255,.025)!important;
  color:rgba(180,200,220,.32)!important;
  border-color:rgba(255,255,255,.06)!important;
  box-shadow:none!important;transform:none!important;
}

html[data-theme="dark"] .ant-btn-group .ant-btn:first-child{border-radius:10px 0 0 10px!important;}
html[data-theme="dark"] .ant-btn-group .ant-btn:last-child{border-radius:0 10px 10px 0!important;}

/* ---------- inputs ---------- */
html[data-theme="dark"] .ant-input,
html[data-theme="dark"] .ant-input-affix-wrapper,
html[data-theme="dark"] .ant-select-selector,
html[data-theme="dark"] .ant-picker,
html[data-theme="dark"] .ant-input-number{
  background:rgba(255,255,255,.035)!important;
  border-color:rgba(255,255,255,.10)!important;
  border-radius:10px!important;
  color:var(--ace-text)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
  transition:border-color .2s,box-shadow .2s,background .2s;
}
html[data-theme="dark"] .ant-input::placeholder,
html[data-theme="dark"] .ant-select-selection-placeholder,
html[data-theme="dark"] .ant-picker-input>input::placeholder{color:var(--ace-mute)!important;}
html[data-theme="dark"] .ant-input:hover,
html[data-theme="dark"] .ant-input-affix-wrapper:hover,
html[data-theme="dark"] .ant-select:hover .ant-select-selector,
html[data-theme="dark"] .ant-picker:hover{border-color:rgba(100,210,255,.34)!important;}
html[data-theme="dark"] .ant-input:focus,
html[data-theme="dark"] .ant-input-affix-wrapper-focused,
html[data-theme="dark"] .ant-select-focused .ant-select-selector,
html[data-theme="dark"] .ant-picker-focused{
  border-color:var(--ace-cyan)!important;
  box-shadow:0 0 0 3px rgba(10,132,255,.16),0 0 18px rgba(100,210,255,.12)!important;
}
html[data-theme="dark"] .ant-select-arrow,
html[data-theme="dark"] .ant-picker-suffix{color:#6f849c!important;}

/* dropdowns, popovers */
html[data-theme="dark"] .ant-select-dropdown,
html[data-theme="dark"] .ant-picker-dropdown .ant-picker-panel-container,
html[data-theme="dark"] .ant-dropdown-menu,
html[data-theme="dark"] .ant-menu-submenu-popup,
html[data-theme="dark"] .ant-popover-inner{
  background:rgba(9,15,24,.92)!important;
  border:1px solid var(--ace-line)!important;
  border-radius:14px!important;
  box-shadow:0 26px 70px rgba(0,0,0,.60)!important;
  -webkit-backdrop-filter:blur(26px) saturate(150%);
  backdrop-filter:blur(26px) saturate(150%);
}
html[data-theme="dark"] .ant-select-item{color:#cfe0f2!important;border-radius:8px!important;}
html[data-theme="dark"] .ant-select-item-option-active{background:rgba(100,210,255,.08)!important;}
html[data-theme="dark"] .ant-select-item-option-selected{background:rgba(10,132,255,.22)!important;color:#fff!important;}

/* tables */
html[data-theme="dark"] .ant-table{background:transparent!important;color:var(--ace-text)!important;}
html[data-theme="dark"] .ant-table-thead>tr>th{
  background:rgba(255,255,255,.03)!important;color:#8fa6bd!important;
  border-bottom:1px solid var(--ace-line)!important;
  font-family:var(--ace-mono);font-size:12px;letter-spacing:.05em;
}
html[data-theme="dark"] .ant-table-tbody>tr>td{border-bottom:1px solid rgba(120,220,255,.07)!important;}
html[data-theme="dark"] .ant-table-tbody>tr:hover>td{background:rgba(100,210,255,.045)!important;}

/* pagination */
html[data-theme="dark"] .ant-pagination-item,
html[data-theme="dark"] .ant-pagination-prev .ant-pagination-item-link,
html[data-theme="dark"] .ant-pagination-next .ant-pagination-item-link{
  background:rgba(255,255,255,.03)!important;border-color:rgba(255,255,255,.08)!important;border-radius:10px!important;
}
html[data-theme="dark"] .ant-pagination-item a{color:#b9cbdf!important;}
html[data-theme="dark"] .ant-pagination-item-active{
  background:rgba(10,132,255,.20)!important;border-color:rgba(100,210,255,.55)!important;
  box-shadow:0 0 16px rgba(10,132,255,.25);
}
html[data-theme="dark"] .ant-pagination-item-active a{color:#eafcff!important;}

/* tags / badges */
html[data-theme="dark"] .ant-tag{
  background:rgba(100,210,255,.075)!important;border:1px solid rgba(100,210,255,.22)!important;
  color:#9fe8ff!important;border-radius:999px!important;font-family:var(--ace-mono);font-size:11px;
}

/* modal / drawer / message */
html[data-theme="dark"] .ant-modal-content,
html[data-theme="dark"] .ant-drawer-content{
  background:rgba(9,15,24,.94)!important;border:1px solid var(--ace-line)!important;
  border-radius:22px!important;box-shadow:0 44px 130px rgba(0,0,0,.70)!important;
  -webkit-backdrop-filter:blur(30px) saturate(150%);backdrop-filter:blur(30px) saturate(150%);
}
html[data-theme="dark"] .ant-modal-header{background:transparent!important;}
html[data-theme="dark"] .ant-modal-title{color:#eafcff!important;letter-spacing:.02em;}
html[data-theme="dark"] .ant-message-notice-content,
html[data-theme="dark"] .ant-notification-notice{
  background:rgba(9,15,24,.92)!important;border:1px solid var(--ace-line)!important;
  color:var(--ace-text)!important;border-radius:14px!important;
  box-shadow:0 20px 60px rgba(0,0,0,.55)!important;
  -webkit-backdrop-filter:blur(22px);backdrop-filter:blur(22px);
}
html[data-theme="dark"] .ant-notification-notice-message{color:#eafcff!important;}

/* tabs */
html[data-theme="dark"] .ant-tabs-tab{color:#8fa3bb!important;}
html[data-theme="dark"] .ant-tabs-tab-active .ant-tabs-tab-btn{color:var(--ace-cyan)!important;text-shadow:0 0 12px rgba(100,210,255,.40);}
html[data-theme="dark"] .ant-tabs-ink-bar{background:linear-gradient(90deg,var(--ace-blue),var(--ace-cyan))!important;box-shadow:0 0 10px var(--ace-cyan);}

/* checkbox / radio / switch */
html[data-theme="dark"] .ant-checkbox-inner,
html[data-theme="dark"] .ant-radio-inner{
  background:rgba(255,255,255,.045)!important;border-color:rgba(255,255,255,.18)!important;border-radius:6px!important;
}
html[data-theme="dark"] .ant-checkbox-checked .ant-checkbox-inner{
  background:var(--ace-blue)!important;border-color:var(--ace-blue)!important;
  box-shadow:0 0 12px rgba(10,132,255,.45);
}
html[data-theme="dark"] .ant-switch{background:rgba(255,255,255,.14)!important;}
html[data-theme="dark"] .ant-switch-checked{background:linear-gradient(90deg,var(--ace-blue),var(--ace-cyan))!important;}

/* scrollbars */
html[data-theme="dark"] ::-webkit-scrollbar{width:8px;height:8px;}
html[data-theme="dark"] ::-webkit-scrollbar-thumb{
  background:rgba(100,210,255,.24);border-radius:999px;border:2px solid transparent;background-clip:padding-box;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover{background:rgba(100,210,255,.42);background-clip:padding-box;}
html[data-theme="dark"] ::-webkit-scrollbar-track{background:transparent;}

/* small terminal accents */
html[data-theme="dark"] .ant-card-head-title::before{
  content:"// ";color:rgba(100,210,255,.55);font-family:var(--ace-mono);font-weight:400;
}
html[data-theme="dark"] .ant-form-item-label>label{
  color:#8fa6bd!important;font-family:var(--ace-mono);font-size:12px;letter-spacing:.03em;
}
html[data-theme="dark"] .ant-empty-description{color:var(--ace-mute)!important;}

@media (max-width:768px){
  html[data-theme="dark"] .ant-layout-sider{box-shadow:none!important;}
  html[data-theme="dark"] .ant-card{border-radius:16px!important;}
}

/* ---------- filter toolbar button polish ---------- */
html[data-theme="dark"] form.ant-form-inline .ant-btn{
  background:rgba(255,255,255,.05)!important;
  color:#dbe9f7!important;
  border:1px solid rgba(255,255,255,.12)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06)!important;
}
html[data-theme="dark"] form.ant-form-inline .ant-btn-primary{
  background:linear-gradient(135deg,#0a84ff,#64d2ff)!important;
  color:#001018!important;border:none!important;
  box-shadow:0 8px 24px rgba(10,132,255,.32)!important;
}
html[data-theme="dark"] form.ant-form-inline .ant-btn-dangerous{
  background:linear-gradient(135deg,#ff453a,#ff2d55)!important;
  color:#1a0505!important;border:none!important;
  box-shadow:0 8px 24px rgba(255,69,58,.26)!important;
}
html[data-theme="dark"] form.ant-form-inline .ant-btn-text{
  background:transparent!important;border-color:transparent!important;box-shadow:none!important;
}
html[data-theme="dark"] form.ant-form-inline div[style*="position: relative"][style*="display: inline-block"] > .ant-btn{
  background:rgba(255,255,255,.05)!important;color:#dbe9f7!important;
  border:1px solid rgba(255,255,255,.12)!important;box-shadow:none!important;
}
html[data-theme="dark"] form.ant-form-inline > div[style*="margin-left: auto"] > .ant-btn:last-child{
  background:rgba(255,255,255,.05)!important;color:#dbe9f7!important;
  border:1px solid rgba(255,255,255,.12)!important;box-shadow:none!important;
}

/* input addons (AntD labels) */
html[data-theme="dark"] .ant-input-group-addon{
  background:rgba(255,255,255,.055)!important;
  border-color:rgba(255,255,255,.10)!important;
  color:#9fb3c8!important;
  font-family:var(--ace-mono);font-size:12px;
}
html[data-theme="dark"] .ant-input-group .ant-input:first-child,
html[data-theme="dark"] .ant-input-group-addon:first-child{border-radius:10px 0 0 10px!important;}
html[data-theme="dark"] .ant-input-group .ant-input:last-child,
html[data-theme="dark"] .ant-input-group-addon:last-child{border-radius:0 10px 10px 0!important;}
html[data-theme="dark"] .ant-divider{border-color:var(--ace-line)!important;}

/* settings page: give tables room (3 equal columns -> 2 + full-width logs) */
html[data-theme="dark"] div[style*="grid-template-columns: 1fr 1fr 1fr"]{
  grid-template-columns:minmax(420px,.88fr) minmax(620px,1.42fr)!important;
}
html[data-theme="dark"] div[style*="grid-template-columns: 1fr 1fr 1fr"] > div:nth-child(3){
  grid-column:1 / -1!important;
}
@media (max-width:1200px){
  html[data-theme="dark"] div[style*="grid-template-columns: 1fr 1fr 1fr"]{grid-template-columns:1fr!important;}
  html[data-theme="dark"] div[style*="grid-template-columns: 1fr 1fr 1fr"] > div:nth-child(3){grid-column:auto!important;}
}
html[data-theme="dark"] .ant-table-wrapper{overflow-x:auto;}
html[data-theme="dark"] .ant-table{font-size:12px!important;}

/* neutralize light inline chips from legacy components */
html[data-theme="dark"] [style*="background: rgb(246, 255, 237)"],
html[data-theme="dark"] [style*="background: #f6ffed"],
html[data-theme="dark"] [style*="background: rgb(230, 244, 255)"],
html[data-theme="dark"] [style*="background: #e6f4ff"],
html[data-theme="dark"] [style*="background: rgb(255, 241, 240)"],
html[data-theme="dark"] [style*="background: #fff1f0"]{
  background:rgba(100,210,255,.07)!important;
  border-color:rgba(100,210,255,.22)!important;
}

/* tighter table + small buttons so action columns fit */
html[data-theme="dark"] .ant-table-thead>tr>th,
html[data-theme="dark"] .ant-table-tbody>tr>td{
  padding:8px 6px!important;
}
html[data-theme="dark"] .ant-btn-sm{padding:0 8px!important;}
html[data-theme="dark"] .ant-table .ant-btn-sm{padding:0 6px!important;font-size:12px!important;}
html[data-theme="dark"] form.ant-form-inline .ant-btn:disabled,
html[data-theme="dark"] form.ant-form-inline .ant-btn.ant-btn-disabled{
  background:rgba(255,255,255,.025)!important;
  color:rgba(180,200,220,.32)!important;
  border-color:rgba(255,255,255,.06)!important;
  box-shadow:none!important;
}

html[data-theme="dark"] .ant-table-tbody .ant-space{flex-wrap:wrap!important;row-gap:4px!important;}

html[data-theme="dark"] div[style*="grid-template-columns: 1fr 1fr 1fr"] > div{min-width:0!important;}


html[data-theme="dark"] .ant-table table{table-layout:fixed!important;width:100%!important;}

html[data-theme="dark"] div[style*="grid-template-columns: 1fr 1fr 1fr"] > div:first-child .ant-card-body > div:last-child{flex-wrap:wrap;row-gap:8px;}

/* ---------- login ---------- */
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"]{
  background-image:
    radial-gradient(1000px 700px at 50% -10%, rgba(10,132,255,.24), transparent 62%),
    radial-gradient(800px 600px at 105% 105%, rgba(94,234,212,.10), transparent 58%),
    linear-gradient(180deg,#05070c 0%,#070c15 100%)!important;
  background-color:#05070c!important;
  position:relative;
}
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"]::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background-image:
    linear-gradient(rgba(100,210,255,.05) 1px,transparent 1px),
    linear-gradient(90deg,rgba(100,210,255,.05) 1px,transparent 1px);
  background-size:46px 46px;
  -webkit-mask-image:radial-gradient(circle at 50% 42%,#000 0%,rgba(0,0,0,.5) 55%,transparent 85%);
  mask-image:radial-gradient(circle at 50% 42%,#000 0%,rgba(0,0,0,.5) 55%,transparent 85%);
}
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"] .ant-card{
  width:420px!important;
  background:linear-gradient(180deg,rgba(14,22,35,.84),rgba(8,13,22,.93))!important;
  border:1px solid rgba(120,220,255,.18)!important;
  border-radius:24px!important;
  box-shadow:0 40px 120px rgba(0,0,0,.65),0 0 60px rgba(10,132,255,.12),inset 0 1px 0 rgba(255,255,255,.07)!important;
  -webkit-backdrop-filter:blur(26px) saturate(150%);
  backdrop-filter:blur(26px) saturate(150%);
  position:relative;z-index:1;
}
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"] .ant-card-body{padding:34px 32px!important;}
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"] h3{
  font-family:var(--ace-mono)!important;font-size:22px!important;font-weight:600!important;
  letter-spacing:.20em;color:#eafcff!important;text-shadow:0 0 26px rgba(100,210,255,.45);
}
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"] h3::after{
  content:"// SECURE ACCESS";display:block;margin-top:10px;
  font:9px/1 var(--ace-mono);letter-spacing:.30em;color:rgba(100,210,255,.48);
}
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"] .ant-input,
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"] .ant-input-affix-wrapper{
  height:44px!important;border-radius:12px!important;
}
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"] .ant-btn-primary{
  height:46px!important;border-radius:12px!important;
  font-family:var(--ace-mono);letter-spacing:.22em;
}
html[data-theme="dark"] div[style*="login-background-CIXeAMgm.png"] .ant-checkbox-wrapper{color:#8ea3bb!important;}
html[data-theme="dark"] div[style*="bottom: 0"][style*="letter-spacing: 1px"]{
  font-family:var(--ace-mono)!important;color:rgba(140,170,200,.55)!important;letter-spacing:.18em!important;
}

/* APK 管理 segmented tabs */
html[data-theme="dark"] .ace-apk-tabs{
  background:linear-gradient(180deg,rgba(15,23,36,.72),rgba(9,14,23,.78))!important;
  border:1px solid var(--ace-line)!important;
  border-radius:16px!important;
  box-shadow:0 16px 45px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.05)!important;
  -webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);
}
html[data-theme="dark"] .ace-apk-tabs__title{
  color:#eafcff!important;font-family:var(--ace-mono)!important;letter-spacing:.08em;
}
html[data-theme="dark"] .ace-apk-tabs__button{
  border-radius:10px!important;
  border-color:rgba(255,255,255,.10)!important;
  background:rgba(255,255,255,.035)!important;
  color:#8ea3bb!important;
}
html[data-theme="dark"] .ace-apk-tabs__button:hover{
  color:#eafcff!important;border-color:rgba(100,210,255,.35)!important;background:rgba(100,210,255,.06)!important;
}
html[data-theme="dark"] .ace-apk-tabs__button.is-active{
  background:linear-gradient(135deg,#0a84ff,#64d2ff)!important;
  color:#001018!important;border:none!important;
  box-shadow:0 8px 24px rgba(10,132,255,.32)!important;
}

/* settings fine-tuning */
html[data-theme="dark"] div[style*="grid-template-columns: 1fr 1fr 1fr"] > div:first-child .ant-card-body > div:has(.ant-switch){
  flex-wrap:wrap!important;row-gap:8px!important;
}
html[data-theme="dark"] .ant-table .ant-btn-sm{font-size:11px!important;padding:0 5px!important;}

/* sidebar logo: icon + ACE科技 */
html[data-theme="dark"] .ant-layout-sider-children > div[style*="padding: 20px 16px"]{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  padding:18px 10px 30px!important;
}
html[data-theme="dark"] .ant-layout-sider-children > div[style*="padding: 20px 16px"]::before{
  content:"";flex:0 0 30px;width:30px;height:30px;
  background:url("/assets/favicon-192.png?v=20261027") center/contain no-repeat;
  border-radius:9px;
  box-shadow:0 0 0 1px rgba(212,175,55,.32),0 0 18px rgba(212,175,55,.22);
  filter:drop-shadow(0 0 6px rgba(212,175,55,.28));
}
html[data-theme="dark"] .ant-layout-sider-children > div[style*="padding: 20px 16px"] > div{
  font-size:15px!important;
}
html[data-theme="dark"] .ant-layout-sider-children > div[style*="padding: 20px 16px"]::after{
  padding-left:40px;
}
html[data-theme="dark"] .ant-layout-sider-collapsed .ant-layout-sider-children > div[style*="padding: 20px 16px"]{
  justify-content:center!important;gap:0!important;padding:16px 0 18px!important;
}
html[data-theme="dark"] .ant-layout-sider-collapsed .ant-layout-sider-children > div[style*="padding: 20px 16px"]::after{
  display:none!important;
}
html[data-theme="dark"] .ant-layout-sider-collapsed .ant-layout-sider-children > div[style*="padding: 20px 16px"] > div{
  display:none!important;
}

/* fix AB launch settings: stack the two panels + stabilize switches */
html[data-theme="dark"] .ant-row:has(.ant-input[placeholder="名称"]) > .ant-col:has(.ant-input[placeholder="名称"]),
html[data-theme="dark"] .ant-row:has(.ant-input[placeholder="名称"]) > .ant-col:has(.ant-input[placeholder="名称"]) + .ant-col{
  flex:0 0 100%!important;
  max-width:100%!important;
}
html[data-theme="dark"] .ant-switch{
  flex:0 0 auto!important;
  width:28px!important;
  min-width:28px!important;
  height:16px!important;
  line-height:16px!important;
  padding:0!important;
  border-radius:999px!important;
}
html[data-theme="dark"] .ant-switch .ant-switch-handle{
  width:12px!important;height:12px!important;top:2px!important;left:2px!important;
}
html[data-theme="dark"] .ant-switch-checked .ant-switch-handle{
  left:calc(100% - 14px)!important;
}

/* sticky left sidebar on desktop */
@media (min-width:992px){
  html[data-theme="dark"] .ant-layout-sider{
    position:sticky!important;
    top:0!important;
    height:100vh!important;
    align-self:flex-start!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    z-index:60!important;
  }
}
