/* ===== AIMA UI Polish: System State + BankMatch actions — 2026-10-11 ===== */

/* SYSTEM STATE — compact status board */
.telemetry.system-state-card{
  width:min(1420px,calc(100% - 48px));
  margin:34px auto 0;
  display:grid;
  grid-template-columns:1.18fr repeat(4,1fr);
  border:1px solid rgba(15,20,32,.085)!important;
  border-radius:24px;
  overflow:hidden;
  background:rgba(255,255,255,.66)!important;
  box-shadow:0 18px 54px rgba(16,24,40,.055)!important;
}

.system-state-card .telemetry-title{
  min-height:98px;
  padding:20px 22px!important;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:11px;
  border:0!important;
  color:#1a2230!important;
  background:
    radial-gradient(circle at 12% 12%,rgba(86,114,255,.09),transparent 42%),
    rgba(248,249,251,.72);
}

.system-state-card .telemetry-title>span{
  font-size:8px;
  font-weight:950;
  letter-spacing:.18em;
}

.system-state-card .telemetry-title>small{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:#7b8694!important;
  font-size:5px;
  font-weight:850;
  letter-spacing:.075em;
}

.system-state-card .telemetry-title>small i{
  width:5px;
  height:5px;
  border-radius:50%;
  background:#45b887;
  box-shadow:0 0 0 4px rgba(69,184,135,.08),0 0 11px rgba(69,184,135,.24);
}

.system-state-card .metric{
  min-width:0;
  min-height:98px;
  padding:17px 17px!important;
  display:grid;
  grid-template-columns:31px minmax(0,1fr);
  align-items:center;
  gap:11px;
  border:0!important;
  border-left:1px solid rgba(15,20,32,.065)!important;
  background:rgba(255,255,255,.50);
  transition:background .22s ease,transform .22s ease;
}

.system-state-card .metric:hover{
  background:rgba(255,255,255,.86);
}

.system-state-card .metric-icon{
  width:31px;
  height:31px;
  display:grid;
  place-items:center;
  border-radius:10px;
  color:#6377df;
  background:linear-gradient(145deg,#eef1ff,#e7ebfb);
  border:1px solid rgba(88,109,217,.08);
  font-size:10px;
  line-height:1;
}

.system-state-card .metric-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.system-state-card .metric-copy>span{
  margin:0;
  color:#151c27!important;
  font-size:25px!important;
  line-height:1!important;
  font-weight:820!important;
  letter-spacing:-.045em!important;
}

.system-state-card .metric-copy>small{
  margin-top:7px!important;
  color:#7d8794!important;
  font-size:5.5px!important;
  line-height:1.1;
  font-weight:900!important;
  letter-spacing:.12em!important;
}

.system-state-card .metric-private .metric-icon{
  color:#257f90;
  background:linear-gradient(145deg,#e8f5f7,#deeff2);
}

.system-state-card .private-pill{
  width:max-content;
  min-height:25px;
  padding:0 10px;
  display:inline-flex!important;
  align-items:center;
  border-radius:999px;
  color:#233044!important;
  background:#eef1f5;
  border:1px solid rgba(15,20,32,.07);
  font-size:8px!important;
  letter-spacing:.08em!important;
  font-weight:900!important;
}

/* Midnight system state */
html[data-theme="dark"] .telemetry.system-state-card{
  border-color:rgba(255,255,255,.075)!important;
  background:rgba(12,19,32,.72)!important;
  box-shadow:0 22px 65px rgba(0,0,0,.18)!important;
}

html[data-theme="dark"] .system-state-card .telemetry-title{
  color:#eaf0f7!important;
  background:
    radial-gradient(circle at 12% 12%,rgba(106,126,255,.12),transparent 42%),
    rgba(14,22,37,.72);
}

html[data-theme="dark"] .system-state-card .telemetry-title>small{
  color:#75849a!important;
}

html[data-theme="dark"] .system-state-card .metric{
  border-left-color:rgba(255,255,255,.06)!important;
  background:rgba(255,255,255,.018);
}

html[data-theme="dark"] .system-state-card .metric:hover{
  background:rgba(255,255,255,.035);
}

html[data-theme="dark"] .system-state-card .metric-icon{
  color:#91a0ff;
  background:linear-gradient(145deg,#17213a,#111a2c);
  border-color:rgba(126,145,255,.10);
}

html[data-theme="dark"] .system-state-card .metric-copy>span{
  color:#edf2f8!important;
}

html[data-theme="dark"] .system-state-card .metric-copy>small{
  color:#758298!important;
}

html[data-theme="dark"] .system-state-card .metric-private .metric-icon{
  color:#79d2df;
  background:linear-gradient(145deg,#122830,#102129);
}

html[data-theme="dark"] .system-state-card .private-pill{
  color:#c7d3e3!important;
  background:#151f30;
  border-color:rgba(255,255,255,.07);
}

/* BANKMATCH REVIEW — proper dashboard actions, not giant boxes */
.report-actions{
  display:grid!important;
  grid-template-columns:1.08fr .92fr 1fr;
  gap:8px!important;
  margin-top:12px!important;
}

.report-actions .report-btn{
  appearance:none;
  min-width:0;
  min-height:49px;
  margin:0!important;
  padding:7px 9px!important;
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  align-items:center;
  gap:8px;
  text-align:left;
  border:1px solid rgba(15,20,32,.07)!important;
  border-radius:11px!important;
  background:#fff!important;
  color:#2e3948!important;
  box-shadow:0 5px 14px rgba(15,20,32,.025);
  cursor:default;
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,background .2s ease;
}

.report-actions .report-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(69,91,145,.14)!important;
  box-shadow:0 9px 22px rgba(15,20,32,.055);
}

.report-btn-icon{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#eef1f6;
  color:#637082;
  font-size:10px;
  line-height:1;
  font-weight:800;
}

.report-btn-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.report-btn-copy b{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#27313f;
  font-size:6.4px;
  line-height:1.1;
  font-weight:850;
}

.report-btn-copy small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#8a95a2;
  font-size:4.4px;
  line-height:1.15;
}

.report-actions .report-export .report-btn-icon{
  color:#3769b2;
  background:#eaf1fb;
}

.report-actions .report-close{
  border-color:transparent!important;
  background:linear-gradient(145deg,#6677df,#7686ea)!important;
  box-shadow:0 8px 18px rgba(102,119,223,.18);
}

.report-actions .report-close .report-btn-icon{
  color:#fff;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.11);
}

.report-actions .report-close .report-btn-copy b{
  color:#fff;
}

.report-actions .report-close .report-btn-copy small{
  color:rgba(255,255,255,.67);
}

/* Midnight BankMatch actions */
html[data-theme="dark"] .report-actions .report-btn{
  border-color:rgba(255,255,255,.065)!important;
  background:#111a2a!important;
  color:#dce4ef!important;
  box-shadow:none;
}

html[data-theme="dark"] .report-actions .report-btn:hover{
  border-color:rgba(122,143,202,.13)!important;
  background:#151f31!important;
}

html[data-theme="dark"] .report-btn-icon{
  background:#182235;
  color:#8795a9;
}

html[data-theme="dark"] .report-btn-copy b{
  color:#e8edf5;
}

html[data-theme="dark"] .report-btn-copy small{
  color:#6f7d91;
}

html[data-theme="dark"] .report-actions .report-export .report-btn-icon{
  color:#7ca5e6;
  background:#14213a;
}

html[data-theme="dark"] .report-actions .report-close{
  border-color:rgba(128,145,255,.12)!important;
  background:linear-gradient(145deg,#5f70d9,#7483ea)!important;
  box-shadow:0 8px 20px rgba(80,99,205,.20);
}

html[data-theme="dark"] .report-actions .report-close:hover{
  background:linear-gradient(145deg,#6879e3,#7b8bf3)!important;
}

/* Tablet */
@media(max-width:980px){
  .telemetry.system-state-card{
    width:min(760px,calc(100% - 30px));
    grid-template-columns:1fr 1fr;
    border-radius:22px;
  }

  .system-state-card .telemetry-title{
    grid-column:1/-1;
    min-height:66px;
    padding:14px 17px!important;
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
    border-bottom:1px solid rgba(15,20,32,.065)!important;
  }

  .system-state-card .metric{
    min-height:88px;
    border-top:0!important;
    border-left:0!important;
    border-bottom:1px solid rgba(15,20,32,.055)!important;
  }

  .system-state-card .metric:nth-child(even){
    border-right:1px solid rgba(15,20,32,.055)!important;
  }

  .system-state-card .metric:nth-last-child(-n+2){
    border-bottom:0!important;
  }

  html[data-theme="dark"] .system-state-card .telemetry-title{
    border-bottom-color:rgba(255,255,255,.055)!important;
  }

  html[data-theme="dark"] .system-state-card .metric{
    border-bottom-color:rgba(255,255,255,.05)!important;
  }

  html[data-theme="dark"] .system-state-card .metric:nth-child(even){
    border-right-color:rgba(255,255,255,.05)!important;
  }
}

/* Mobile */
@media(max-width:700px){
  .telemetry.system-state-card{
    width:calc(100% - 28px)!important;
    margin-top:28px!important;
    border-radius:20px;
  }

  .system-state-card .telemetry-title{
    min-height:58px;
    padding:12px 14px!important;
  }

  .system-state-card .telemetry-title>span{
    font-size:7px;
  }

  .system-state-card .telemetry-title>small{
    font-size:4.5px;
  }

  .system-state-card .metric{
    min-height:78px;
    padding:12px 12px!important;
    grid-template-columns:27px minmax(0,1fr);
    gap:9px;
  }

  .system-state-card .metric-icon{
    width:27px;
    height:27px;
    border-radius:9px;
    font-size:8px;
  }

  .system-state-card .metric-copy>span{
    font-size:20px!important;
  }

  .system-state-card .metric-copy>small{
    margin-top:5px!important;
    font-size:4.7px!important;
  }

  .system-state-card .private-pill{
    min-height:21px;
    padding:0 8px;
    font-size:6.5px!important;
  }

  /* BankMatch tour buttons: compact, clean 2+1 layout */
  .report-actions{
    grid-template-columns:1fr 1fr!important;
    gap:6px!important;
    margin-top:9px!important;
  }

  .report-actions .report-btn{
    min-height:42px;
    padding:6px 7px!important;
    grid-template-columns:23px minmax(0,1fr);
    gap:6px;
    border-radius:9px!important;
  }

  .report-btn-icon{
    width:23px;
    height:23px;
    border-radius:7px;
    font-size:8px;
  }

  .report-btn-copy b{
    font-size:5.5px;
  }

  .report-btn-copy small{
    display:none;
  }

  .report-actions .report-close{
    grid-column:1/-1;
    min-height:40px;
  }
}

@media(max-width:430px){
  .system-state-card .telemetry-title>small{
    max-width:112px;
    text-align:right;
    line-height:1.35;
  }

  .system-state-card .metric{
    min-height:72px;
    padding:10px!important;
  }

  .system-state-card .metric-copy>span{
    font-size:18px!important;
  }

  .report-actions .report-btn{
    min-height:39px;
  }
}
