/* AIOS V26 — compact topbar dropdown and mobile light-mode table correction.
   Scoped to the main layout; no change to dark-mode table coloring. */
body.ai-platform .topbar-tools {
  position:relative;display:flex;align-items:center;flex:0 0 auto;z-index:3;
}
body.ai-platform .topbar-tools__trigger {
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  height:42px;min-width:42px;padding:0 13px;
  border:1px solid #426477;border-radius:13px;
  background:linear-gradient(145deg,#19384a,#152b3b);
  color:#e6f8f8;box-shadow:0 4px 14px rgba(0,0,0,.12);
  font:800 12px/1.5 'YBakh',Tahoma,sans-serif;
  white-space:nowrap;cursor:pointer;
  transition:background .17s,border-color .17s,box-shadow .17s;
}
body.ai-platform .topbar-tools__trigger:hover,
body.ai-platform .topbar-tools__trigger[aria-expanded="true"] {
  background:linear-gradient(145deg,#245364,#1b3948);
  border-color:#48aaa1;box-shadow:0 6px 20px rgba(0,116,112,.13);
}
body.ai-platform .topbar-tools__trigger .ui-icon{width:21px;height:21px;flex-shrink:0}
body.ai-platform .topbar-tools__chevron{width:15px;height:15px;flex-shrink:0;transition:transform .18s ease}
body.ai-platform .topbar-tools__trigger[aria-expanded="true"] .topbar-tools__chevron{transform:rotate(180deg)}
body.ai-platform .topbar-tools__trigger:focus-visible,
body.ai-platform .topbar-tools__panel :is(a,button):focus-visible{outline:3px solid #ffb547;outline-offset:3px}
body.ai-platform .topbar-tools__panel {
  position:absolute;top:calc(100% + 12px);left:0;z-index:110;
  width:min(310px,calc(100vw - 24px));box-sizing:border-box;
  padding:9px;border:1px solid #365b68;border-radius:18px;
  background:linear-gradient(155deg,#203b4b,#102637);
  color:#f0fbfb;box-shadow:0 20px 48px rgba(1,13,22,.30);
  direction:rtl;isolation:isolate;
  animation:aiosToolsReveal .17s ease-out both;
}
body.ai-platform .topbar-tools__panel[hidden]{display:none!important}
body.ai-platform .topbar-tools__heading{padding:7px 12px 11px;color:#a8c5d0;font-size:11px;font-weight:800}
body.ai-platform .topbar-tools__item {
  display:flex;align-items:center;justify-content:flex-start;gap:12px;
  width:100%;height:auto;min-height:60px;box-sizing:border-box;
  padding:10px 11px;margin:0;border-radius:12px;
  border:1px solid transparent;background:transparent;
  box-shadow:none;text-align:right;text-decoration:none;
  color:#eff9fb;font:inherit;cursor:pointer;
  transition:background .16s ease,border-color .16s ease;
}
body.ai-platform .topbar-tools__item:is(a,button):hover{
  background:rgba(77,176,166,.12);border-color:rgba(115,208,201,.22);
}
body.ai-platform .topbar-tools__item-icon {
  display:grid;place-items:center;width:40px;height:40px;min-width:40px;
  border:1px solid #426a77;border-radius:12px;
  background:#294456;color:#a9ebdf;
}
body.ai-platform .topbar-tools__item-icon .ui-icon,
body.ai-platform .topbar-tools__item-icon .aios-theme-icon{display:block;width:21px;height:21px}
body.ai-platform .topbar-tools__item-icon .aios-theme-icon--moon{display:none}
html[data-theme="light"] body.ai-platform .topbar-tools__item-icon .aios-theme-icon--sun{display:none}
html[data-theme="light"] body.ai-platform .topbar-tools__item-icon .aios-theme-icon--moon{display:block}
body.ai-platform .topbar-tools__item-icon.role-admin{color:#ffda97;background:#473c32;border-color:#846b47}
body.ai-platform .topbar-tools__item-icon.role-representative{color:#a5e5ff;background:#244658;border-color:#467b91}
body.ai-platform .topbar-tools__item-icon.role-customer{color:#a9f4d5;background:#1d4b42;border-color:#457e6c}
body.ai-platform .topbar-tools__item-copy{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;gap:3px}
body.ai-platform .topbar-tools__item-copy strong{font-size:12px;font-weight:850;line-height:1.55;color:inherit}
body.ai-platform .topbar-tools__item-copy small{font-size:10px;line-height:1.5;font-weight:500;color:#a3c0cc}
body.ai-platform .topbar-tools__item-arrow,
body.ai-platform .topbar-tools__theme-hint{color:#86aea9;font-size:20px;line-height:1;flex-shrink:0}
body.ai-platform .topbar-tools__status{cursor:default;border-top:1px solid #344b59;border-radius:0 0 12px 12px;margin-top:3px}
body.ai-platform .topbar-tools__status-icon{color:#9ce8c3;background:#1b493f;border-color:#317d63}
body.ai-platform .topbar-tools__online-dot{width:8px;height:8px;border-radius:50%;background:#54dc9b;box-shadow:0 0 0 4px rgba(84,220,155,.11)}
@keyframes aiosToolsReveal{from{opacity:0;transform:translateY(-5px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(prefers-reduced-motion:reduce){body.ai-platform .topbar-tools__panel{animation:none}body.ai-platform .topbar-tools__chevron{transition:none}}

/* Mobile rules from older styles must not collapse the new popup's buttons.
   Keep the popup available even with 'Desktop site' on a phone. */
@media(max-width:700px){
  body.ai-platform .topbar-tools__trigger{width:42px;min-width:42px;padding:0}
  body.ai-platform .topbar-tools__trigger>span{display:none}
  body.ai-platform .topbar-tools__chevron{display:none}
  body.ai-platform .topbar-tools__panel{top:calc(100% + 9px)}
}
html.aios-touch-compact body.ai-platform .topbar-tools__trigger{width:42px;min-width:42px;padding:0}
html.aios-touch-compact body.ai-platform .topbar-tools__trigger>span,
html.aios-touch-compact body.ai-platform .topbar-tools__chevron{display:none}
body.ai-platform .topbar-tools .aios-theme-switch.topbar-tools__theme{
  display:flex!important;width:100%!important;min-width:0;min-height:60px;
  padding:10px 11px!important;flex:0 1 auto;
  white-space:normal;
}
body.ai-platform .topbar-tools .aios-theme-switch [data-aios-theme-label]{display:block!important}
html.aios-touch-compact body.ai-platform .topbar-tools .aios-theme-switch [data-aios-theme-label]{display:block!important}

/* Light palette for panel and trigger (dark palette above is untouched). */
html[data-theme="light"] body.ai-platform .topbar-tools__trigger{
  background:#fff;color:#176a65;border-color:#b7d7db;
  box-shadow:0 4px 12px rgba(27,79,87,.06);
}
html[data-theme="light"] body.ai-platform .topbar-tools__trigger:hover,
html[data-theme="light"] body.ai-platform .topbar-tools__trigger[aria-expanded="true"]{
  background:#e9f6f3;border-color:#5cbaac;
}
html[data-theme="light"] body.ai-platform .topbar-tools__panel{
  background:linear-gradient(160deg,#fff,#f4f9fa);
  border-color:#c9dfe4;color:#173e4b;
  box-shadow:0 17px 42px rgba(16,65,79,.16);
}
html[data-theme="light"] body.ai-platform .topbar-tools__heading{color:#637f88}
html[data-theme="light"] body.ai-platform .topbar-tools__item{color:#234857}
html[data-theme="light"] body.ai-platform .topbar-tools__item:is(a,button):hover{
  background:#e9f5f3;border-color:#bbdfd6;
}
html[data-theme="light"] body.ai-platform .topbar-tools__item-icon{background:#e9f3f6;color:#007470;border-color:#c5dce3}
html[data-theme="light"] body.ai-platform .topbar-tools__item-icon.role-admin{color:#8a590b;background:#fff1d6;border-color:#e3c99a}
html[data-theme="light"] body.ai-platform .topbar-tools__item-icon.role-representative{color:#176782;background:#e4f4fe;border-color:#b6d9e8}
html[data-theme="light"] body.ai-platform .topbar-tools__item-icon.role-customer{color:#006d60;background:#dff4eb;border-color:#abdccc}
html[data-theme="light"] body.ai-platform .topbar-tools__item-copy strong{color:#183d4b!important}
html[data-theme="light"] body.ai-platform .topbar-tools__item-copy small{color:#5b7b88}
html[data-theme="light"] body.ai-platform .topbar-tools__item-arrow,
html[data-theme="light"] body.ai-platform .topbar-tools__theme-hint{color:#6b968d}
html[data-theme="light"] body.ai-platform .topbar-tools__status{border-top-color:#dae9ec}
html[data-theme="light"] body.ai-platform .topbar-tools__status-icon{color:#08765a;background:#e1f4ea;border-color:#a6d6bd}

/* FIX: old mobile .adaptive-table tr has a forced dark background on *every* row,
   while the light theme styles only even rows. Explicitly style both here. */
@media(max-width:700px){
  html[data-theme="light"] body.ai-platform .table-wrap table.adaptive-table tbody tr,
  html[data-theme="light"] body.ai-platform .table-wrap table.adaptive-table tbody tr:nth-child(odd){
    background:#fff!important;border-color:#d1e2e7!important;color:#1d4151!important;
    box-shadow:0 3px 10px rgba(20,70,86,.045);
  }
  html[data-theme="light"] body.ai-platform .table-wrap table.adaptive-table tbody tr:nth-child(even){
    background:#f2f7f9!important;
  }
  html[data-theme="light"] body.ai-platform .table-wrap table.adaptive-table tbody tr:hover{
    background:#e5f3f0!important;border-color:#a9d2c9!important;
  }
  html[data-theme="light"] body.ai-platform .table-wrap table.adaptive-table tbody td{
    background:transparent!important;border-bottom-color:#dce8ec!important;color:#203f50!important;
  }
  html[data-theme="light"] body.ai-platform .table-wrap table.adaptive-table tbody td::before{
    color:#4c6a78!important;
  }
  html[data-theme="light"] body.ai-platform .table-wrap table.adaptive-table tbody td small{
    color:#5b7785!important;
  }
}
