/******************************************************************************/ 
/* Top-level tab CONTAINER (Workspace / Help)                                 */
/******************************************************************************/ 
.top-tab-panel { 
  /* draw the box for the content ONLY (no line above the tabs) */ 
  border: 1px solid var(--border, #dfe3e8); 
  border-top: none; /* ⬅ remove border above tabs */ 
  border-radius: 0 0px 10px 10px; /* ⬅ no rounding on the top-left edge */ 
  background: #fff; 
  margin-top: 0; /* flush with tab strip */ 
  position: relative; 
  z-index: 1; /* sits under the tab buttons */
} 

/* keep the tabs visually attached to the panel */ 
.top-tabs { 
  position: relative; 
  z-index: 2; 
  margin-bottom: 1px; 
  border-bottom: 1px solid var(--border, #dfe3e8); 
}

/* tab buttons (Workspace / Help) */ 
.top-tab { 
  font-size: 14px; /* ⬅ set consistent text size */
}

/* if your tabs have rounded bottoms when selected, keep them squared so they blend */ 
.top-tab[aria-selected="true"] { 
  border-bottom-left-radius: 0; 
  border-bottom-right-radius: 0; 
}

/******************************************************************************/ 
/* Inner function panels (Filter/Edit/Delete/Create etc.)                      */
/******************************************************************************/ 
.tab-panel { 
  display: none; 
  margin-top: 8px; 
  padding: 28px 12px 12px; 
  border: 1px solid var(--border, #dfe3e8); 
  border-radius: 8px; 
  background: #fafafa; 
  width: 100%; 
  position: relative;
} 
.tab-panel.active { display: block; }

#excelFilterPanel,
#wordFilterPanel,
#powerpointFilterPanel,
#excelDeletePanel,
#wordDeletePanel,
#powerpointDeletePanel,
#excelRecreatePanel,
#excelRecentActivityPanel,
#wordRecentActivityPanel,
#powerpointRecentActivityPanel {
  padding-top: 12px;
}

#excelCreateRangePanel {
  padding-top: 40px;
}

#excelCreateRangePanel .button-row {
  flex-direction: column;
  flex-wrap: nowrap;
}

#excelCreateRangePanel .button-row > button {
  flex: none;
  width: 100%;
}

.panel-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.panel-close-btn:hover,
.panel-close-btn:focus-visible {
  background: var(--brand);
  color: #ffffff;
  border: 0;
  outline: 0;
}

/* Form rows */
.button-row { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin-top: 6px; 
} 
.button-row > input,
.button-row > button { 
  flex: 1; 
  min-width: 120px; 
}

.filter-stack {
  flex-direction: column;
  flex-wrap: nowrap;
}

.filter-stack > input,
.filter-stack > button,
.filter-stack > .filter-select {
  flex: none;
  width: 100%;
}

.filter-text-input {
  flex: 1 1 100%;
  width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-muted, #6b7280);
  font-size: 14px;
  font-weight: 400;
  box-sizing: border-box;
  box-shadow: none;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
}

.filter-text-input::placeholder {
  color: var(--ink-muted, #6b7280);
  font-size: 14px;
  font-weight: 400;
}

.button-row .filter-select {
  position: relative;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
}

.filter-select-btn {
  width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-muted, #6b7280);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.filter-select-btn:hover,
.filter-select-btn:focus-visible {
  background: #fff;
  color: var(--ink-muted, #6b7280);
}

.filter-select-btn::after {
  content: "\25BE";
  float: right;
  color: #6b7280;
}

.filter-select.open .filter-select-btn {
  border-color: var(--brand, #059669);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

.filter-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.filter-select-menu[hidden] {
  display: none;
}

.filter-option {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  justify-content: start;
  padding: 6px 10px 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  margin: 0;
}

.filter-option:hover {
  background: #f3f4f6;
}

.filter-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
  border: 1px solid #9ca3af;
  border-radius: 2px;
  background: #fff;
  position: relative;
  box-sizing: border-box;
  align-self: center;
}

.filter-option input[type="checkbox"]:checked {
  background: var(--brand, #059669);
  border-color: var(--brand, #059669);
}

.filter-option input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 3px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-option-text {
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #111827;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.filter-empty {
  padding: 8px 6px;
  color: #6b7280;
  font-size: 13px;
}

/* Edit panels */
#powerpointEditPanel select,
#powerpointEditPanel input[type="text"],
#wordEditPanel select,
#wordEditPanel input[type="text"],
#excelEditPanel select,
#excelEditPanel input[type="text"] { 
  width: 100%; 
  margin-top: 4px; 
}

/* Fix for input width issue (ensures proper width in both environments) */
#excelNewFileInput {
  width: 100%;            /* Ensure the input takes up the full width */
  box-sizing: border-box; /* Include padding and borders in width calculation */
  margin-top: 4px;        /* Adjust margin for spacing */
}
#wordNewFileInput {
  width: 100%;            /* Ensure the input takes up the full width */
  box-sizing: border-box; /* Include padding and borders in width calculation */
  margin-top: 4px;        /* Adjust margin for spacing */
}
#powerpointNewFileInput {
  width: 100%;            /* Ensure the input takes up the full width */
  box-sizing: border-box; /* Include padding and borders in width calculation */
  margin-top: 4px;        /* Adjust margin for spacing */
}

/* Create Link panel: stack input & button */
#createLinkPanel .button-row { 
  flex-direction: column; 
  gap: 8px; 
  width: 100%; 
} 
#createLinkPanel .button-row input, 
#createLinkPanel .button-row button { 
  flex: 0 0 auto; 
  width: 100%; 
  min-width: 0; 
}

/******************************************************************************/ 
/* More panel buttons: white → dark green on hover                             */
/******************************************************************************/ 

#excelMorePanel button { 
  background: #ffffff !important; /* white fill */ 
  color: var(--brand) !important; /* green text */ 
  border: 1.5px solid var(--brand) !important; 
  border-radius: 10px !important; 
  padding: 6px 12px !important; /* smaller height */ 
  font-size: 14px !important; 
  font-weight: 600 !important; 
  line-height: 1.3 !important; 
}

/* Hover: dark green fill + white text */ 
#excelMorePanel button:hover { 
  background: var(--brand-dark) !important; /* dark green fill */ 
  color: #ffffff !important; /* white text */ 
  border-color: var(--brand-dark) !important; /* border matches fill */
}

#wordMorePanel button { 
  background: #ffffff !important; /* white fill */ 
  color: var(--brand) !important; /* green text */ 
  border: 1.5px solid var(--brand) !important; 
  border-radius: 10px !important; 
  padding: 6px 12px !important; /* smaller height */ 
  font-size: 14px !important; 
  font-weight: 600 !important; 
  line-height: 1.3 !important; 
}

/* Hover: dark green fill + white text */ 
#wordMorePanel button:hover { 
  background: var(--brand-dark) !important; /* dark green fill */ 
  color: #ffffff !important; /* white text */ 
  border-color: var(--brand-dark) !important; /* border matches fill */
}

/******************************************************************************/
/* More actions list overrides                                                */
/******************************************************************************/

#excelMorePanel,
#wordMorePanel,
#powerpointMorePanel {
  padding: 10px 0 0;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 8px;
  background: #fafafa;
}

#excelMorePanel .more-actions-list,
#wordMorePanel .more-actions-list,
#powerpointMorePanel .more-actions-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: transparent;
  border-radius: 8px;
  overflow: hidden;
}

#excelMorePanel .more-action-btn,
#wordMorePanel .more-action-btn,
#powerpointMorePanel .more-action-btn,
#excelMorePanel .more-action-toggle,
#wordMorePanel .more-action-toggle,
#powerpointMorePanel .more-action-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 18px 24px 18px 52px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  text-align: left;
  cursor: pointer;
  box-shadow: none !important;
  transition: background .15s ease, color .15s ease;
}

#powerpointMorePanel .more-action-btn,
#powerpointMorePanel .more-action-toggle {
  min-height: 30px;
}

#wordMorePanel .more-action-toggle,
#powerpointMorePanel .more-action-toggle {
  padding-left: 36px;
}

#excelMorePanel .more-action-btn,
#wordMorePanel .more-action-btn {
  padding-left: 45px;
}

#excelMorePanel .more-action-btn::after,
#wordMorePanel .more-action-btn::after,
#powerpointMorePanel .more-action-btn::after,
#excelMorePanel .more-action-toggle::after,
#wordMorePanel .more-action-toggle::after,
#powerpointMorePanel .more-action-toggle::after {
  content: "";
  position: absolute;
  left: 32px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: #d1d5db;
}

#excelMorePanel .more-action-btn:last-child,
#wordMorePanel .more-action-btn:last-child,
#powerpointMorePanel .more-action-btn:last-child,
#excelMorePanel .more-action-toggle:last-child,
#wordMorePanel .more-action-toggle:last-child,
#powerpointMorePanel .more-action-toggle:last-child {
  border-bottom: 0 !important;
}

#excelMorePanel .more-action-btn:last-child::after,
#wordMorePanel .more-action-btn:last-child::after,
#powerpointMorePanel .more-action-btn:last-child::after,
#excelMorePanel .more-action-toggle:last-child::after,
#wordMorePanel .more-action-toggle:last-child::after,
#powerpointMorePanel .more-action-toggle:last-child::after {
  display: none;
}

#excelMorePanel .more-action-btn:hover,
#wordMorePanel .more-action-btn:hover,
#powerpointMorePanel .more-action-btn:hover,
#excelMorePanel .more-action-toggle:hover,
#wordMorePanel .more-action-toggle:hover,
#powerpointMorePanel .more-action-toggle:hover {
  background: #fff !important;
  color: #111827 !important;
}

#excelMorePanel .more-action-btn::before,
#wordMorePanel .more-action-btn::before,
#powerpointMorePanel .more-action-btn::before,
#excelMorePanel .more-action-toggle::before,
#wordMorePanel .more-action-toggle::before,
#powerpointMorePanel .more-action-toggle::before {
  content: "";
  position: absolute;
  left: 32px;
  right: 16px;
  top: 4px;
  bottom: 4px;
  border-radius: 6px;
  background: transparent;
  transition: background .15s ease;
  z-index: 0;
}

#excelMorePanel .more-action-btn:hover::before,
#wordMorePanel .more-action-btn:hover::before,
#powerpointMorePanel .more-action-btn:hover::before,
#excelMorePanel .more-action-toggle:hover::before,
#wordMorePanel .more-action-toggle:hover::before,
#powerpointMorePanel .more-action-toggle:hover::before {
  background: #e5e7eb;
}

#excelMorePanel .more-action-leading,
#wordMorePanel .more-action-leading,
#powerpointMorePanel .more-action-leading {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

#excelMorePanel .more-action-trailing,
#wordMorePanel .more-action-trailing,
#powerpointMorePanel .more-action-trailing {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  position: relative;
  z-index: 1;
}

#excelMorePanel .more-action-icon,
#wordMorePanel .more-action-icon,
#powerpointMorePanel .more-action-icon {
  width: auto;
  flex: 0 0 auto;
  color: #6b7280 !important;
  text-align: left;
}

#excelMorePanel .more-action-icon {
  margin-left: 25px;
}

#wordMorePanel .more-action-checkbox,
#powerpointMorePanel .more-action-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand);
  position: relative;
  z-index: 1;
}

.recent-activity-header {
  margin: 0 0 8px;
  color: #111827;
}

.recent-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.recent-activity-item {
  border: 1px solid #e5e7eb;
  border-left-width: 4px;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.recent-activity-item--error {
  border-left-color: #dc2626;
}

.recent-activity-item--warning {
  border-left-color: #f59e0b;
}

.recent-activity-item--success {
  border-left-color: #16a34a;
}

.recent-activity-item--info {
  border-left-color: #6b7280;
}

.recent-activity-meta {
  color: #6b7280;
  font-size: 12px;
  margin-bottom: 4px;
}

.recent-activity-text {
  color: #111827;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.recent-activity-empty {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
}

@media (hover: none) {
  .panel-close-btn:hover,
  .panel-close-btn:focus-visible {
    background: #e5e7eb;
    color: #6b7280;
    border: 0;
    outline: 0;
  }

  .filter-select-btn:hover,
  .filter-select-btn:focus-visible {
    border-color: var(--border, #dfe3e8);
    box-shadow: none;
  }

  .filter-option:hover {
    background: transparent;
  }

  #excelMorePanel button:hover,
  #wordMorePanel button:hover {
    background: inherit !important;
    color: inherit !important;
  }

  #excelMorePanel .more-action-btn:hover,
  #wordMorePanel .more-action-btn:hover,
  #powerpointMorePanel .more-action-btn:hover,
  #excelMorePanel .more-action-toggle:hover,
  #wordMorePanel .more-action-toggle:hover,
  #powerpointMorePanel .more-action-toggle:hover {
    background: #fff !important;
    color: #111827 !important;
  }

  #excelMorePanel .more-action-btn:hover::before,
  #wordMorePanel .more-action-btn:hover::before,
  #powerpointMorePanel .more-action-btn:hover::before,
  #excelMorePanel .more-action-toggle:hover::before,
  #wordMorePanel .more-action-toggle:hover::before,
  #powerpointMorePanel .more-action-toggle:hover::before {
    background: transparent;
  }
}
