/* v17.31.0: Topbar readability + new module utilities */
.topbar,
body.tpipeline-theme .topbar,
body.tcostsheet-theme .topbar,
body.tquote-theme .topbar,
body.tproject-theme .topbar,
body.twork-theme .topbar,
body.tservice-theme .topbar,
body.tcashflow-theme .topbar,
body.temp-theme .topbar,
body.tasset-theme .topbar,
body.tstore-theme .topbar,
body.tpurchase-theme .topbar{
  color:#111827 !important;
}
.topbar .topbar-title,
body.tpipeline-theme .topbar .topbar-title,
body.tcostsheet-theme .topbar .topbar-title,
body.tquote-theme .topbar .topbar-title,
body.tproject-theme .topbar .topbar-title,
body.twork-theme .topbar .topbar-title,
body.tservice-theme .topbar .topbar-title,
body.tcashflow-theme .topbar .topbar-title,
body.temp-theme .topbar .topbar-title,
body.tasset-theme .topbar .topbar-title,
body.tstore-theme .topbar .topbar-title,
body.tpurchase-theme .topbar .topbar-title{
  color:#111827 !important;
  font-weight:800 !important;
}
.topbar .topbar-btn,
.topbar .user-pill,
.topbar .user-pill-name,
.topbar .user-pill-role,
.topbar .presence-btn,
.topbar svg{
  color:#111827 !important;
}
.topbar .topbar-btn:hover,
.topbar .presence-btn:hover{
  background:rgba(17,24,39,.08) !important;
}
.tgo31-shell{padding:16px;max-width:1400px;margin:0 auto}.tgo31-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}.tgo31-title{font-size:24px;font-weight:900;color:#111827}.tgo31-sub{font-size:13px;color:#64748b;margin-top:3px}.tgo31-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 1px 2px rgba(15,23,42,.04);padding:14px}.tgo31-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.tgo31-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}.tgo31-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.tgo31-stat span{display:block;font-size:12px;color:#64748b;font-weight:700}.tgo31-stat b{display:block;font-size:26px;margin-top:4px;color:#0f172a}.tgo31-table{width:100%;border-collapse:collapse;font-size:13px}.tgo31-table th,.tgo31-table td{padding:10px;border-bottom:1px solid #eef2f7;text-align:left;vertical-align:top}.tgo31-table th{font-size:12px;color:#64748b;background:#f8fafc;font-weight:800}.tgo31-input,.tgo31-select,.tgo31-textarea{font:14px inherit;border:1px solid #d1d5db;border-radius:8px;padding:8px 10px;background:#fff;box-sizing:border-box}.tgo31-textarea{min-height:88px;resize:vertical}.tgo31-btn{font:13px inherit;border:1px solid #d1d5db;background:#fff;border-radius:8px;padding:8px 12px;cursor:pointer;font-weight:700}.tgo31-btn.primary{border-color:#eab308;background:#eab308;color:#111827}.tgo31-btn.danger{border-color:#fecaca;color:#b91c1c;background:#fff5f5}.tgo31-btn:disabled{opacity:.55;cursor:not-allowed}.tgo31-badge{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800;background:#f1f5f9;color:#334155}.tgo31-badge.green{background:#dcfce7;color:#166534}.tgo31-badge.amber{background:#fef3c7;color:#92400e}.tgo31-badge.red{background:#fee2e2;color:#991b1b}.tgo31-badge.blue{background:#dbeafe;color:#1d4ed8}.tgo31-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.tgo31-field label{display:block;font-size:12px;color:#475569;font-weight:800;margin-bottom:4px}.tgo31-field.wide{grid-column:1/-1}.tgo31-field input,.tgo31-field select,.tgo31-field textarea{width:100%}.tgo31-empty{padding:24px;text-align:center;color:#94a3b8;background:#fff;border:1px dashed #cbd5e1;border-radius:12px}.tgo31-modal-bg{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:1200;display:none;align-items:center;justify-content:center;padding:18px}.tgo31-modal-bg.on{display:flex}.tgo31-modal{background:#fff;border-radius:16px;max-width:780px;width:min(100%,780px);max-height:90vh;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.25)}.tgo31-modal-h{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid #e5e7eb}.tgo31-modal-b{padding:16px}.tgo31-modal-f{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid #e5e7eb}.tgo31-x{border:0;background:transparent;font-size:22px;cursor:pointer;color:#64748b}.tgo31-perm-grid{display:grid;grid-template-columns:260px repeat(2,120px);gap:0;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden}.tgo31-perm-grid>div{padding:10px;border-bottom:1px solid #eef2f7}.tgo31-perm-grid>div:nth-child(3n+1){background:#fff}.tgo31-perm-grid>div:nth-child(3n+2),.tgo31-perm-grid>div:nth-child(3n+3){text-align:center}.tgo31-perm-head{background:#f8fafc!important;font-weight:900;color:#475569}.hm-request-panel{padding:16px;background:#fff7ed;border:1px solid #fed7aa;border-radius:12px;margin:16px 0}.hm-request-panel h3{margin:0 0 8px;color:#9a3412}.hm-request-list{display:grid;gap:8px;margin-top:12px}.hm-request-item{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:10px}.hm-request-item b{color:#111827}.hm-request-item small{display:block;color:#64748b;margin-top:3px}
@media(max-width:900px){.tgo31-grid,.tgo31-grid.two{grid-template-columns:1fr}.tgo31-form{grid-template-columns:1fr}.tgo31-perm-grid{grid-template-columns:1fr}.tgo31-perm-grid>div{text-align:left!important}}

/* v17.31.1: T-Store / T-Purchase logo update */
.tgo31-nav-logo{
  width:28px;
  height:28px;
  display:block;
  object-fit:contain;
  border-radius:4px;
}
.tgo31-module-card-logo{
  width:86px;
  height:86px;
  object-fit:contain;
  display:block;
  border-radius:12px;
}
.tgo31-title-logo{
  display:flex;
  align-items:center;
  gap:10px;
}
.tgo31-header-logo{
  width:52px;
  height:52px;
  object-fit:contain;
  display:block;
  border-radius:10px;
  background:#fff;
}
@media(max-width:520px){
  .tgo31-module-card-logo{width:56px;height:56px;}
  .tgo31-header-logo{width:38px;height:38px;}
}


/* v17.32.1: deterministic workspace order + latest cropped module icons */
.module-card[data-module="pipeline"]{order:1}
.module-card[data-module="costsheet"]{order:2}
.module-card[data-module="quote"]{order:3}
.module-card[data-module="purchase"]{order:4}
.module-card[data-module="project"]{order:5}
.module-card[data-module="work"]{order:6}
.module-card[data-module="service"]{order:7}
.module-card[data-module="store"]{order:8}
.module-card[data-module="asset"]{order:9}
.module-card[data-module="cashflow"]{order:10}
.module-card[data-module="temp"]{order:11}
.module-card[data-module="purchase"]::before{background:#EF4444}
.module-card[data-module="store"]::before{background:#0EA5A6}
.tgo31-nav-logo,.tgo31-module-card-logo,.tgo31-header-logo{object-fit:contain;background:#fff;}
.tgo31-module-card-logo{filter:none;}

/* v17.33.0 T-Purchase approval flow */
.tgo-purchase-v1733 .tp-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.tgo-purchase-v1733 .tp-tabs button{border:1px solid #e2e8f0;background:#fff;border-radius:999px;padding:8px 12px;cursor:pointer;font-weight:700;color:#334155}
.tgo-purchase-v1733 .tp-tabs button.active{background:#ef4444;color:#fff;border-color:#ef4444;box-shadow:0 8px 18px rgba(239,68,68,.18)}
.tgo-purchase-v1733 .tp-flow{display:flex;gap:4px;flex-wrap:wrap;margin-top:5px}
.tgo-purchase-v1733 .tp-flow span{font-size:10px;border-radius:999px;padding:2px 5px;background:#f1f5f9;color:#94a3b8;border:1px solid #e2e8f0}
.tgo-purchase-v1733 .tp-flow span.on{background:#fee2e2;color:#b91c1c;border-color:#fecaca;font-weight:700}
.tgo-purchase-v1733 .tp-flow span.bad{background:#fee2e2;color:#991b1b;border-color:#fecaca}
.tgo-purchase-v1733 .tp-flow-big{display:flex;align-items:center;gap:9px;flex-wrap:wrap;color:#334155}
.tgo-purchase-v1733 .tp-flow-big span{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:9px 11px;font-weight:800}
.tgo-purchase-v1733 .tp-flow-big b{color:#ef4444}
.tgo-purchase-v1733 .tp-warn{border-color:#fed7aa!important;background:#fff7ed!important;color:#9a3412!important}
.tgo-purchase-v1733 .tgo31-table td{vertical-align:top}

/* v17.33.6: Sidebar active state + normalize T-Purchase/T-Store logo sizing */
.sidebar .nav-item.active{
  background:#EFF6FC!important;
  border-left-color:var(--fluent-blue, #2563eb)!important;
  color:var(--fluent-text, #111827)!important;
  font-weight:800!important;
  box-shadow:inset 3px 0 0 var(--fluent-blue, #2563eb), 0 1px 2px rgba(15,23,42,.04);
}
.sidebar .nav-item.active .nav-item-badge{
  background:#dbeafe!important;
  color:#1d4ed8!important;
}
.tgo31-nav-logo{
  width:24px!important;
  height:24px!important;
  max-width:24px!important;
  max-height:24px!important;
  padding:0!important;
  margin:0!important;
  object-fit:contain!important;
  background:transparent!important;
  border-radius:4px!important;
}
.module-icon-wrap .tgo31-module-card-logo,
.tgo31-module-card-logo{
  width:72px!important;
  height:72px!important;
  max-width:72px!important;
  max-height:72px!important;
  object-fit:contain!important;
  background:transparent!important;
  border-radius:12px!important;
}
@media(max-width:520px){
  .module-icon-wrap .tgo31-module-card-logo,
  .tgo31-module-card-logo{width:56px!important;height:56px!important;max-width:56px!important;max-height:56px!important;}
}


/* V1.36: module logo parity + hide disabled modules instead of flashing grey cards */
.tgo31-nav-logo.tgo36-asset-nav-logo{
  width:24px!important;height:24px!important;max-width:24px!important;max-height:24px!important;
  object-fit:contain!important;background:transparent!important;border-radius:4px!important;
}
.module-icon-wrap .tgo31-module-card-logo.tgo36-asset-card-logo{
  width:72px!important;height:72px!important;max-width:72px!important;max-height:72px!important;
  object-fit:contain!important;background:transparent!important;border-radius:12px!important;
}
.sidebar .nav-item.tgo-module-disabled,
.module-card.tgo-module-disabled{
  display:none!important;
}
html:not(.tgo-nav-perms-pending) .sidebar .nav-item[data-module-nav][aria-disabled="true"],
html:not(.tgo-nav-perms-pending) .module-card[data-module][aria-disabled="true"]{
  display:none!important;
}
@media(max-width:520px){
  .module-icon-wrap .tgo31-module-card-logo.tgo36-asset-card-logo{
    width:56px!important;height:56px!important;max-width:56px!important;max-height:56px!important;
  }
}
