/******************************************************************************/
/* Toolbar, Tabs & Dropdowns                                                  */
/******************************************************************************/

/* Toolbar container */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* start from the left */
  gap: 0;                      /* no space between icon buttons */
  padding: 2px 8px;
  flex-wrap: wrap;
}

/* Make +Create appear first (left) and push the rest to the right */
.toolbar .primary {
  order: -1;          /* move to the left edge */
  margin-right: auto; /* push icon group to the right */
}

/* Icon buttons in toolbar */
.tab-btn {
  background: #fff;                         /* hollow button */
  border: 1.5px solid var(--brand);         /* brand border */
  color: var(--brand);
  padding: 6px;
  font-size: 14px;
  border-radius: 8px;                       /* round corners */
  line-height: 1;
  cursor: pointer;
  transition:
    background .2s ease,
    color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

.tab-btn:hover {
  background: var(--brand);                 /* fill on hover */
  color: #fff;
  border-color: var(--brand);
}

.tab-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tab-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px var(--brand-dark, #008c5a); /* accessible focus */
}

.tab-btn + .tab-btn {
  margin-left: 3px;   /* tweak 4–8px to taste */
}

/* Ensure BOTH Excel & Word toolbars align with table edge (no right pad) */
[id$="Toolbar"] {
  width: 100%;
  box-sizing: border-box;
  padding-right: 0;   /* align right edge with table */
}

/* Top tabs (Workspace / Help) */
.top-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 8px 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: #fff;
}
.top-tab {
  position: relative;
  appearance: none;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  color: var(--ink-muted);
  padding: 10px 16px;
  border-radius: 10px 10px 0 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  top: 1px;
}
.top-tab:hover { background: #f8fafc; }
.top-tab[aria-selected="true"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  border-bottom: none;
  z-index: 2;
}
.top-tab-panel {
  border: 1px solid var(--border);
  border-radius: 0 10px 10px 10px;
  background: #fff;
  padding: 12px;
  position: relative;
  z-index: 1;
  margin-top: -1px;
}

/* Menus / dropdowns */
.menu-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  color: #555;
  transition: color .2s ease;
}
.menu-btn:hover { color: var(--brand); }

.dropdown { position: relative; display: inline-block; }

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: #fff;
  min-width: 120px;
  border: 1px solid #ddd;
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  z-index: 10;
  padding: 6px; /* space so primary items can fill nicely */
}
.dropdown:hover .dropdown-content { display: block; }

/* Plain link items in dropdown */
.dropdown-content a {
  display: block;
  padding: 8px 12px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  border-radius: 4px;
}
.dropdown-content a:hover { background-color: #f5f5f5; }

/* Primary item inside toolbar dropdown */
.toolbar .dropdown-content .primary {
  display: block;
  width: 100%;
  background: var(--brand) !important;
  color: #fff !important;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 6px 10px;
  text-decoration: none;
  text-align: left;
  font-weight: 600;
}
.toolbar .dropdown-content .primary:hover {
  background: var(--brand-dark) !important;
  border-color: var(--brand-dark);
}

/* Title (keep toolbar untouched) */
#excelUI > h3,
#wordUI > h3 {
  margin: 0 0 6px !important;  /* small gap above toolbar */
  font-size: 22px;             /* bigger title */
  font-weight: 700;
  line-height: 1.2;
}

/* Title + subtitle */
#excelUI > .page-title,
#wordUI  > .page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

#excelUI > .page-subtitle,
#wordUI  > .page-subtitle {
  margin: 4px 0 20px;
  font-size: 14px;
  color: var(--ink-muted, #6b7280);
}


/* Align toolbar content with table edges */
[id$="Toolbar"] {
  width: 100%;
  box-sizing: border-box;
  padding-left: 0 !important;  /* remove extra indent */
  padding-right: 0 !important; /* keep right edge flush too */
}

/* Keep +Create anchored to the left; no unintended margins */
.toolbar .primary {
  margin-left: 0;
}

