:root {
  --blue: #005BAA;
  --light-green: #89BA17;
  --light-blue: #00B4ED;
  --yellow: #FFE900;
  --dark-green: #00A656;
  --dark-blue: #005BAA;
  --dark-gray: #4D4F53;
  --mid-gray: #9A9B9C;
  --light-gray-a: #BCBDBC;
  --light-gray-b: #C9CAC8;
  --white: #ffffff;
  --off-white: #F7F8FA;
  --sidebar-width: 400px;
  --sidebar-collapsed-width: 80px;
  --border: rgba(77, 79, 83, 0.18);
  --shadow: 0 18px 42px rgba(0, 91, 170, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--dark-gray);
  background: var(--off-white);
}

body.dark-mode {
  --white: #17212b;
  --off-white: #0d141c;
  --dark-gray: #f4f7fb;
  --mid-gray: #aab4bf;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.utility-shell {
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 26px 24px;
  transition: width 0.25s ease, min-width 0.25s ease, padding 0.25s ease;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  padding: 24px 10px;
}

.sidebar-header {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: start;
  gap: 10px;
  margin-bottom: 28px;
}

.sidebar-home,
.sidebar-close {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--dark-gray);
  font-size: 19px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  transition: 0.2s ease;
}

.sidebar-home:hover,
.sidebar-close:hover {
  background: var(--off-white);
  color: var(--blue);
}

.brand-title {
  margin: 0;
  font-size: 25px;
  line-height: 1.1;
  font-weight: 900;
  color: var(--blue);
}

.brand-subtitle {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--dark-gray);
}

.collapsed-icon { display: none; }

.sidebar.collapsed .expanded-icon { display: none; }

.sidebar.collapsed .collapsed-icon {
  display: inline;
  font-size: 18px;
}

.sidebar.collapsed .brand-area,
.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .recent-block,
.sidebar.collapsed .favorites-block,
.sidebar.collapsed .category-label,
.sidebar.collapsed .category-chevron,
.sidebar.collapsed .tool-text,
.sidebar.collapsed .favorite-toggle {
  display: none !important;
}

.sidebar.collapsed .sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.sidebar-search {
  position: relative;
  margin-bottom: 22px;
}

.sidebar-search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mid-gray);
  font-size: 18px;
}

.sidebar-search input {
  width: 100%;
  border: 1px solid var(--light-gray-a);
  background: var(--off-white);
  border-radius: 22px;
  padding: 14px 16px 14px 50px;
  outline: none;
  color: var(--dark-gray);
}

.sidebar-section-title {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--mid-gray);
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 800;
}

.recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.recent-chip {
  border: 0;
  border-radius: 999px;
  padding: 8px 15px;
  background: var(--off-white);
  color: var(--dark-gray);
  font-weight: 500;
  transition: 0.2s ease;
}

.recent-chip.active,
.recent-chip:hover {
  background: var(--blue);
  color: #fff;
}

.favorite-list {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
}

.favorite-item {
  border: 0;
  background: var(--off-white);
  color: var(--dark-gray);
  border-radius: 14px;
  padding: 9px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  text-align: left;
  font-size: 12px;
}

.favorite-item:hover {
  background: rgba(0, 180, 237, 0.12);
}

.category-block { margin-bottom: 10px; }

.category-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--dark-gray);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 4px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
}

.category-button:hover {
  background: rgba(0, 180, 237, 0.08);
}

.sidebar.collapsed .category-button {
  justify-content: center;
  padding: 13px 0;
  margin-bottom: 8px;
}

.category-icon {
  width: 32px;
  min-width: 32px;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.category-label { flex: 1; }

.category-chevron { transition: transform 0.2s ease; }

.category-button[aria-expanded="true"] .category-chevron {
  transform: rotate(90deg);
}

.tool-list {
  padding: 4px 0 8px;
  display: none;
}

.tool-list.show {
  display: block;
}

.sidebar.collapsed .tool-list {
  display: block !important;
}

.tool-nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--dark-gray);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-radius: 18px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar.collapsed .tool-nav-item {
  justify-content: center;
  padding: 13px 0;
  border-radius: 18px;
  margin-bottom: 8px;
}

.tool-nav-item:hover {
  background: rgba(0, 180, 237, 0.08);
}

.tool-nav-item.active {
  background: linear-gradient(90deg, var(--blue), var(--light-blue));
  color: #fff;
}

.tool-icon {
  width: 28px;
  min-width: 28px;
  display: grid;
  place-items: center;
  font-size: 19px;
}

.tool-text { flex: 1; }
.tool-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-status-badge {
  display: inline-block;
  background: #FFE900;
  color: #4D4F53;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.2;
}
.favorite-toggle {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  opacity: 0.85;
}

.workspace {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  transition: 0.25s ease;
}

.topbar {
    display: flex;
    justify-content: end;
    gap: 20px;
    margin-bottom: 12px;
}
header.topbar .headertxt {
    display: none;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 900;
}

.topbar h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  color: var(--dark-gray);
}

.topbar p {
  margin: 6px 0 0;
  color: var(--mid-gray);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-card {
  min-height: 210px;
  background: linear-gradient(135deg, var(--blue), var(--light-blue));
  border-radius: 30px;
  padding: 34px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.hero-pill {
  background: rgba(255, 255, 255, 0.18);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.hero-card h3 {
  max-width: 670px;
  margin: 18px 0 10px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
}

.hero-card p {
  max-width: 760px;
  margin: 0;
  color: rgba(255,255,255,0.86);
}

.hero-icon {
  width: 130px;
  height: 130px;
  min-width: 130px;
  border-radius: 34px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.16);
  font-size: 56px;
  align-self: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  font-size: 18px;
  color: var(--blue);
  line-height: 1;
}

.stat-card span {
  color: var(--mid-gray);
  font-weight: 700;
  font-size: 13px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading h3 {
  margin: 0;
  font-weight: 900;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--mid-gray);
}

.tool-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.tool-card {
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 24px;
  padding: 20px;
  min-height: 190px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 91, 170, 0.4);
}

.tool-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: rgba(0, 180, 237, 0.11);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 23px;
  margin-bottom: 16px;
}

.tool-card h4 {
  font-size: 14px;
  font-weight: 900;
  margin: 0 0 8px;
}

.tool-card p {
  margin: 0;
  color: var(--mid-gray);
  font-size: 12px;
}

.tool-card small {
  display: block;
  color: var(--blue);
  font-weight: 800;
  margin-top: 12px;
}

.tool-card-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--yellow);
  color: #323232;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 9px;
}

.app-view {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 28px;
  min-height: 100vh;
  box-shadow: var(--shadow);
  padding: 14px;
  position: relative;
  animation: fadeIn 0.25s ease;
}

.iframe-loader {
  position: absolute;
  inset: 14px;
  z-index: 5;
  border-radius: 22px;
  background: rgba(247, 248, 250, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.iframe-loader.d-none {
  display: none !important;
}
.recent-block {
    display: none;
}
.topbar-actions #themeToggle, .topbar-actions #favoriteCurrentBtn {
    font-size: 10px;
}
iframe {
  width: 100%;
  min-height: 100vh;
  border: 0;
  border-radius: 22px;
  background: #fff;
  transition: opacity 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
  :root { --sidebar-width: 330px; }
  .workspace { padding: 18px; }
  .topbar, .hero-card { flex-direction: column; }
}

@media (max-width: 760px) {
  .utility-shell { display: block; }

  .sidebar,
  .sidebar.collapsed {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: relative;
  }

  .sidebar.collapsed .brand-area,
  .sidebar.collapsed .sidebar-search,
  .sidebar.collapsed .recent-block,
  .sidebar.collapsed .favorites-block,
  .sidebar.collapsed .category-label,
  .sidebar.collapsed .category-chevron,
  .sidebar.collapsed .tool-text,
  .sidebar.collapsed .favorite-toggle {
    display: initial !important;
  }

  .workspace { height: auto; }
  .hero-card h3 { font-size: 28px; }
}
