/* ============================================
   HeyTutor Curriculum Dashboard - Styles
   Font: Quicksand | Scrollbars: Peach
   ============================================ */

/* Google Picker must appear above modals */
.picker-dialog { z-index: 10003 !important; }
.picker-dialog-bg { z-index: 10002 !important; }

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f3f7;
}

/* ---- Scrollbar Styling (Peach, wider) ---- */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #fdf0ec;
}

::-webkit-scrollbar-thumb {
  background: #ff9a7b;
  border-radius: 6px;
  border: 2px solid #fdf0ec;
}

::-webkit-scrollbar-thumb:hover {
  background: #ff7e57;
}

/* Firefox scrollbar */
* {
  scrollbar-width: auto;
  scrollbar-color: #ff9a7b #fdf0ec;
}

/* ---- Sign-In Screen ---- */
#sign-in-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #53327d 0%, #7928ec 50%, #30ced0 100%);
}

#sign-in-screen .sign-in-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 420px;
  width: 90%;
}

#sign-in-screen .sign-in-card .logo-area {
  margin-bottom: 24px;
}

#sign-in-screen .sign-in-card .logo-area svg {
  width: 200px;
  height: auto;
}

#sign-in-screen .sign-in-card h2 {
  font-size: 18px;
  color: #666;
  font-weight: 500;
  margin-bottom: 32px;
}

#sign-in-screen .sign-in-card .g-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 32px;
  background: #fff;
  border: 2px solid #d9d9d9;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

#sign-in-screen .sign-in-card .g-signin-btn:hover {
  border-color: #7928ec;
  box-shadow: 0 2px 12px rgba(121,40,236,0.15);
}

/* ---- App Layout ---- */
#app-container {
  display: none;
  height: 100vh;
  flex-direction: column;
}

#app-container.active {
  display: flex;
}

/* ---- Header ---- */
#header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: #fff;
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid #e8e4ed;
  flex-shrink: 0;
  z-index: 100;
}

#header .header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

#header .header-center {
  text-align: center;
}

#header .header-center h1 {
  font-size: 18px;
  font-weight: 700;
  color: #53327d;
  letter-spacing: 0.3px;
}

#header .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}

/* Hamburger dropdown wrapper */
.hamburger-wrap {
  position: relative;
  z-index: 101;
  pointer-events: auto;
}

#header .header-left .sidebar-toggle {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

#header .header-left .sidebar-toggle:hover {
  background: #f0ecf5;
}

.hamburger-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  z-index: 2001;
  min-width: 200px;
  padding: 6px 0;
  margin-top: 4px;
  animation: fadeIn 0.15s ease;
}

.hamburger-dropdown.show {
  display: block;
}

.hamburger-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}

.hamburger-dropdown button:hover {
  background: #f5f0fa;
}

.hamburger-dropdown button i {
  width: 18px;
  text-align: center;
  font-size: 13px;
  color: #7928ec;
}

#header .header-left .logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}

#header .header-left .logo-link svg {
  height: 32px;
  width: auto;
}

#header .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #666;
}

#header .user-info .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #7928ec;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

#header .sign-out-btn {
  padding: 6px 16px;
  background: none;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

#header .sign-out-btn:hover {
  border-color: #7928ec;
  color: #7928ec;
}

/* ---- Main Body ---- */
#main-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ---- Sidebar ---- */
#sidebar {
  width: 280px;
  background: #fff;
  border-right: 1px solid #e8e4ed;
  overflow-y: auto;
  flex-shrink: 0;
  transition: width 0.25s ease, opacity 0.25s ease;
  padding: 12px 0;
}

#sidebar.collapsed {
  width: 0;
  overflow: hidden;
  padding: 0;
  border-right: none;
}

#sidebar .sidebar-section {
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(237, 229, 247, 0.12);
}

#sidebar .sidebar-category {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #333;
  transition: background 0.2s, color 0.15s;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

#sidebar .sidebar-category:hover {
  background: linear-gradient(90deg, #f5f0fa 0%, #faf8ff 100%);
  color: #53327d;
}

#sidebar .sidebar-category .cat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

#sidebar .sidebar-category .cat-label {
  flex: 1;
  min-width: 0;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
}

#sidebar .sidebar-category .cat-chevron {
  margin-left: auto;
  font-size: 11px;
  color: #7928ec;
  transition: transform 0.2s;
  flex-shrink: 0;
}

#sidebar .sidebar-category.expanded .cat-chevron {
  transform: rotate(90deg);
}

#sidebar .sidebar-items {
  display: none;
  padding: 2px 0 8px 0;
}

#sidebar .sidebar-items.show {
  display: block;
}

/* Sidebar subcategory header */
.sidebar-subcategory-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px 5px 46px;
  font-size: 11px;
  font-weight: 700;
  color: #7928ec;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #f5f0ff 0%, transparent 100%);
  border-left: 3px solid #b59cdb;
  margin-top: 4px;
  cursor: default;
  transition: background 0.2s;
}

.sidebar-subcategory-header:hover {
  background: linear-gradient(90deg, #ede5f7 0%, #faf8ff 100%);
}

/* Collapsible subcategory items */
.sidebar-sub-items {
  display: none;
  padding: 0;
}

.sidebar-sub-items.show {
  display: block;
}

/* Nested child sub-subcategory styling */
.sidebar-subcategory-header.sidebar-sub-child {
  font-size: 11px;
  border-left-color: #d4c4eb;
  background: linear-gradient(90deg, #faf7fe 0%, #ffffff 100%);
}

.sidebar-sub-items-nested {
  display: none;
  padding: 0;
}

.sidebar-sub-items-nested.show {
  display: block;
}

#sidebar .sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 52px;
  font-size: 12.5px;
  font-weight: 500;
  color: #444;
  cursor: pointer;
  transition: background 0.2s, border-left-color 0.2s, color 0.15s;
  text-decoration: none;
  border: none;
  border-left: 3px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.35;
}

#sidebar .sidebar-item:hover {
  background: linear-gradient(90deg, #f5f0fa 0%, #faf8ff 100%);
  color: #53327d;
  border-left-color: #7928ec !important;
}

#sidebar .sidebar-item.active {
  background: linear-gradient(90deg, #ede5f7 0%, #f5f0ff 100%);
  color: #7928ec;
  font-weight: 700;
  border-left-color: #7928ec !important;
}

#sidebar .sidebar-item .item-type-icon {
  font-size: 10px;
  flex-shrink: 0;
}

#sidebar .sidebar-item span {
  flex: 1;
  min-width: 0;
}

/* Archived items in sidebar */
#sidebar .sidebar-item.archived-item {
  opacity: 0.5;
  text-decoration: line-through;
}

/* ---- Content Area ---- */
#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  background: #f5f3f7;
}

/* ---- Home Grid ---- */
#home-view {
  padding: 40px;
}

#home-view .home-subtitle {
  font-size: 15px;
  font-weight: 500;
  color: #666;
  margin-bottom: 32px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.category-card {
  border-radius: 16px;
  padding: 24px 22px 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.category-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(transparent, rgba(0,0,0,0.13));
  border-radius: 0 0 16px 16px;
  pointer-events: none;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}

.category-card .card-icon {
  font-size: 28px;
  opacity: 0.9;
}

.category-card .card-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.category-card .card-subtitle {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
  margin-top: auto;
  position: relative;
  z-index: 1;
  letter-spacing: 0.3px;
}

.category-card .card-desc {
  font-size: 11px;
  line-height: 1.45;
  opacity: 0.78;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  z-index: 1;
  margin-top: -2px;
}

.category-card .card-icon,
.category-card .card-name {
  position: relative;
  z-index: 1;
}

/* Archived category card */
.category-card.archived-card {
  background: #e0dce5 !important;
  color: #888 !important;
}

/* ---- Tracker View ---- */
#tracker-view {
  display: none;
  padding: 0;
  height: 100%;
  flex-direction: column;
}

#tracker-view.active {
  display: flex;
}

.tracker-header {
  padding: 20px 28px 0 28px;
  background: #fff;
  border-bottom: 1px solid #e8e4ed;
  flex-shrink: 0;
}

.tracker-header .breadcrumb {
  font-size: 12px;
  font-weight: 500;
  color: #999;
  margin-bottom: 8px;
}

.tracker-header .breadcrumb a,
#category-view .breadcrumb a {
  color: #7928ec;
  text-decoration: none;
  cursor: pointer;
}

/* Breadcrumb links: pointer cursor */
.breadcrumb a, .breadcrumb span {
  cursor: pointer;
}

.tracker-header .breadcrumb a:hover {
  text-decoration: underline;
}

.tracker-header .tracker-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tracker-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
}

.tracker-header .tracker-title-row h2 {
  margin-bottom: 0;
  flex: 1;
}

/* ---- Page Menu (three-line) ---- */
.page-menu-wrap {
  position: relative;
}

.page-menu-btn {
  background: none;
  border: 1px solid #e0dce5;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: #666;
  font-size: 16px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-menu-btn:hover {
  background: #f0ecf5;
  border-color: #7928ec;
  color: #7928ec;
}

.page-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  z-index: 2001;
  min-width: 200px;
  padding: 6px 0;
  margin-top: 4px;
  animation: fadeIn 0.15s ease;
}

.page-menu-dropdown.show {
  display: block;
}

.page-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}

.page-menu-dropdown button:hover {
  background: #f5f0fa;
}

.page-menu-dropdown button.danger {
  color: #e53e3e;
}

.page-menu-dropdown button.danger:hover {
  background: #fef2f2;
}

.page-menu-dropdown button i {
  width: 16px;
  text-align: center;
  font-size: 12px;
}

/* ---- Share Link Button ---- */
.share-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 6px 0;
}

.share-link-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #e0dce5;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  color: #555;
  background: #f9f7fb;
}

.share-link-copy-btn {
  background: #7928ec;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.share-link-copy-btn:hover {
  background: #6520cc;
}

/* ---- Toolbar ---- */
.sheet-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0 10px 0;
  flex-wrap: wrap;
  border-top: 1px solid #ece8f1;
  margin-top: 8px;
}

.toolbar-btn {
  background: none;
  border: 1px solid #e0dce5;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  color: #555;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.toolbar-btn:hover {
  background: #f0ecf5;
  border-color: #7928ec;
  color: #7928ec;
}

.toolbar-btn.active {
  background: #7928ec;
  color: #fff;
  border-color: #7928ec;
}

.toolbar-separator {
  width: 1px;
  height: 24px;
  background: #e0dce5;
  margin: 0 4px;
}

.tracker-header .tracker-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}

.tracker-header .search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f3f7;
  border: 1px solid #e0dce5;
  border-radius: 8px;
  padding: 7px 14px;
  flex: 1;
  max-width: 400px;
}

.tracker-header .search-box i {
  color: #999;
  font-size: 13px;
}

.tracker-header .search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  color: #333;
  font-family: inherit;
}

.tracker-header .tab-selector {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 0;
}

.tracker-header .tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: 12.5px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  /* Allow tab titles to wrap */
  white-space: normal;
  word-wrap: break-word;
  max-width: 180px;
  text-align: center;
  transition: all 0.15s;
  font-family: inherit;
}

.tracker-header .tab-btn:hover {
  color: #7928ec;
}

.tracker-header .tab-btn.active {
  color: #7928ec;
  border-bottom-color: #7928ec;
  font-weight: 700;
}

.save-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #7928ec;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(121,40,236,0.3);
  z-index: 1000;
  display: none;
  animation: fadeInUp 0.3s ease;
}

.save-indicator.error {
  background: #e53e3e;
}

.save-indicator.show {
  display: block;
}

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

/* ---- Table Container ---- */
.table-container {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: auto;
}

.table-container thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-container th {
  background: #53327d;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  border-right: 1px solid rgba(255,255,255,0.15);
  min-width: 80px;
}

.table-container td {
  padding: 8px 12px;
  border-bottom: 1px solid #ece8f1;
  border-right: 1px solid #ece8f1;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 400px;
  min-width: 60px;
  vertical-align: top;
  background: #fff;
  transition: background 0.15s;
}

/* Checkbox Cells */
.cell-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #7928ec;
}

td:has(.cell-checkbox) {
  text-align: center;
  padding: 4px;
}

/* Contenteditable Text Wrapping */
td[contenteditable] {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 80px;
  max-width: 400px;
}

.table-container td[contenteditable="true"]:focus {
  outline: 2px solid #7928ec;
  outline-offset: -2px;
  background: #faf7fe;
}

.table-container td[contenteditable="true"]:hover {
  background: #fbf9fe;
}

.table-container tr:nth-child(even) td {
  background: #faf9fc;
}

.table-container tr:nth-child(even) td[contenteditable="true"]:focus {
  background: #faf7fe;
}

/* Row number column */
.table-container .row-num {
  background: #f0ecf5 !important;
  color: #999;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  min-width: 40px;
  max-width: 50px;
  padding: 8px 6px;
  user-select: none;
}

/* ---- Link Card ---- */
.doc-preview-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Overlay bar: Edit button (left) + Zoom controls (right) */
.preview-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(250, 248, 255, 0.95);
  border-bottom: 1px solid #ede5f7;
  z-index: 10;
  flex-shrink: 0;
}

.preview-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #30ced0;
  color: #fff;
  border: none;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.preview-edit-btn:hover {
  background: #28b5b7;
}

.preview-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0;
  background: #7928ec;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(121,40,236,0.18);
}

.preview-zoom-btn {
  background: none;
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background 0.15s;
}

.preview-zoom-btn:hover {
  background: rgba(255,255,255,0.2);
}

.preview-zoom-level {
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 0 3px;
  min-width: 36px;
  text-align: center;
  user-select: none;
}

/* Default iframe style — actual scale set by JS */
.doc-preview-iframe {
  width: 166.67%;
  height: calc((100vh - 180px) / 0.60);
  transform: scale(0.60);
  transform-origin: top left;
  border: none;
  background: #fff;
}

/* ---- No-Preview Placeholder ---- */
.preview-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #faf7fe 0%, #f0eaf8 40%, #e8f7f7 100%);
  min-height: calc(100vh - 220px);
}

.preview-placeholder-inner {
  text-align: center;
  padding: 48px 40px;
  max-width: 420px;
}

.preview-placeholder-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7928ec 0%, #30ced0 100%);
  color: #fff;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(121, 40, 236, 0.2);
}

.preview-placeholder h3 {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px;
}

.preview-placeholder p {
  font-size: 13px;
  color: #888;
  margin: 0 0 20px;
  line-height: 1.5;
}

.preview-placeholder-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #30ced0;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  text-decoration: none;
  transition: background 0.15s;
}

.preview-placeholder-link:hover {
  background: #28b5b7;
}

.preview-placeholder-divider {
  width: 60px;
  height: 1px;
  background: #d4c4eb;
  margin: 28px auto;
}

.preview-placeholder-sub {
  font-size: 12px;
  color: #999;
  margin: 0 0 12px;
}

.preview-placeholder-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7928ec 0%, #9b59b6 100%);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: opacity 0.15s;
  box-shadow: 0 4px 16px rgba(121, 40, 236, 0.2);
}

.preview-placeholder-upload:hover {
  opacity: 0.9;
}

/* ---- Custom Preview Image ---- */
.custom-preview-wrap {
  flex: 1;
  overflow: auto;
  background: #f5f3f7;
  display: flex;
  justify-content: center;
  padding: 12px;
}

.custom-preview-img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  object-fit: contain;
}

.link-card-container {
  padding: 40px 28px;
  display: flex;
  justify-content: center;
}

.link-card {
  background: #fff;
  border-radius: 14px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  max-width: 500px;
  width: 100%;
}

.link-card .link-icon {
  font-size: 48px;
  color: #7928ec;
  margin-bottom: 16px;
}

.link-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.link-card p {
  font-size: 14px;
  font-weight: 500;
  color: #666;
  margin-bottom: 24px;
}

.link-card a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #7928ec;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.2s;
  font-family: inherit;
}

.link-card a:hover {
  background: #6520cc;
}

/* ---- Loading Spinner ---- */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e8e4ed;
  border-top-color: #7928ec;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-container p {
  color: #999;
  font-size: 14px;
  font-weight: 500;
}

/* ---- Error / No Access ---- */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 12px;
  text-align: center;
}

.error-container i {
  font-size: 40px;
  color: #d9d9d9;
}

.error-container h3 {
  font-size: 18px;
  font-weight: 700;
  color: #666;
}

.error-container p {
  font-size: 14px;
  font-weight: 500;
  color: #999;
  max-width: 400px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    z-index: 99;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
  }

  #sidebar.collapsed {
    width: 0;
  }

  #home-view {
    padding: 24px 16px;
  }

  .category-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .category-card {
    min-height: 120px;
    padding: 20px 16px;
  }

  #header .header-center h1 {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Category List View ---- */
#category-view {
  display: none;
  padding: 32px 28px;
}

#category-view.active {
  display: block;
}

#category-view .cat-view-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

#category-view .cat-view-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

#category-view .cat-view-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #333;
}

.tracker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

/* Subcategory header in category view */
.tracker-subcategory-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #7928ec;
  border-bottom: 1px solid #ece8f1;
  background: #f8f5ff;
  border-radius: 8px;
  margin-top: 8px;
  transition: background 0.15s;
}
.tracker-subcategory-header:hover {
  background: #f0ebfa;
}
.accordion-body {
  grid-column: 1 / -1;
}

.tracker-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #ece8f1;
  text-decoration: none;
  color: inherit;
}

.tracker-list-item:hover {
  border-color: #7928ec;
  box-shadow: 0 2px 12px rgba(121,40,236,0.1);
  transform: translateY(-1px);
}

.tracker-list-item.tli-selected {
  border-color: #7928ec;
  background: #f3eefe;
  box-shadow: 0 0 0 2px rgba(121,40,236,0.25);
}

.tracker-list-item .tli-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.tracker-list-item .tli-info {
  flex: 1;
  min-width: 0;
}

.tracker-list-item .tli-name {
  font-weight: 700;
  font-size: 13.5px;
  color: #333;
  /* Allow text wrapping */
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.35;
}

.tracker-list-item .tli-type {
  font-size: 11.5px;
  font-weight: 500;
  color: #999;
  margin-top: 2px;
}

.tracker-list-item .tli-arrow {
  color: #b59cdb;
  font-size: 13px;
}

/* Archived tracker items */
.tracker-list-item.archived {
  opacity: 0.5;
  background: #f0eff2;
  border-color: #e0dce5;
}

.tracker-list-item.archived .tli-name {
  text-decoration: line-through;
  color: #999;
}

/* ---- Custom description tooltip ---- */
.tli-description {
  font-size: 11px;
  font-weight: 500;
  color: #888;
  margin-top: 3px;
  font-style: italic;
  line-height: 1.3;
}

.tracker-list-item[title] {
  position: relative;
}

/* ---- Gear / Ellipsis Button on Tracker Items ---- */
.tracker-list-item .tli-gear {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.tracker-list-item .tli-gear:hover {
  color: #7928ec;
  background: #f0ecf5;
}

/* ---- Add Link Button (in category view) ---- */
.tracker-list-add {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: #faf7fe;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px dashed #d4c4eb;
  color: inherit;
}

.tracker-list-add:hover {
  border-color: #7928ec;
  background: #f0ecf5;
}

/* ---- Link Management Modal ---- */
.links-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.links-modal {
  background: #fff;
  border-radius: 14px;
  width: 90%;
  max-width: 460px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}

.links-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e8e4ed;
}

.links-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.links-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.links-modal-close:hover {
  color: #333;
}

.links-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.links-modal-body label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  margin-bottom: 6px;
  margin-top: 14px;
}

.links-modal-body label:first-child {
  margin-top: 0;
}

.links-modal-body label .required {
  color: #e53e3e;
}

.links-modal-body input,
.links-modal-body select,
.links-modal-body textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  background: #fff;
  transition: border-color 0.15s;
  font-family: inherit;
}

.links-modal-body textarea {
  resize: vertical;
  min-height: 60px;
}

.links-modal-body input:focus,
.links-modal-body select:focus,
.links-modal-body textarea:focus {
  outline: none;
  border-color: #7928ec;
  box-shadow: 0 0 0 3px rgba(121,40,236,0.1);
}

.links-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid #e8e4ed;
}

.links-btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
}

.links-btn-primary {
  background: #7928ec;
  color: #fff;
}

.links-btn-primary:hover {
  background: #6520cc;
}

.links-btn-secondary {
  background: #f0ecf5;
  color: #555;
}

.links-btn-secondary:hover {
  background: #e0dce5;
}

/* ---- Destination Tree Picker ---- */
.dest-tree {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  overflow: hidden;
}
.dest-tree-item {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  border-bottom: 1px solid #f0ecf5;
  transition: background 0.12s;
  user-select: none;
}
.dest-tree-item:last-child { border-bottom: none; }
.dest-tree-item:hover { background: #f8f5fc; }
.dest-tree-item.selected { background: #ede5f9; color: #7928ec; font-weight: 700; }
.dest-tree-item .dest-chevron {
  width: 18px;
  text-align: center;
  font-size: 10px;
  color: #999;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s;
}
.dest-tree-item .dest-chevron.open { transform: rotate(90deg); }
.dest-tree-item .dest-icon {
  margin-right: 6px;
  font-size: 12px;
  flex-shrink: 0;
}
.dest-tree-children { display: none; }
.dest-tree-children.open { display: block; }

/* ---- Context Menu ---- */
.links-context-menu {
  position: fixed;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  z-index: 2001;
  min-width: 180px;
  padding: 6px 0;
  animation: fadeIn 0.15s ease;
}

.links-context-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}

.links-context-menu button:hover {
  background: #f5f0fa;
}

.links-context-menu button.danger {
  color: #e53e3e;
}

.links-context-menu button.danger:hover {
  background: #fef2f2;
}

.links-context-menu button i {
  width: 16px;
  text-align: center;
  font-size: 12px;
}

/* ---- Accordion Tree in Context Menus ---- */
.ctx-accordion {
  max-height: 240px;
  overflow-y: auto;
}
.ctx-tree-node {
  user-select: none;
}
.ctx-tree-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: #444;
  text-align: left;
  transition: background 0.1s;
}
.ctx-tree-toggle:hover {
  background: #f5f0fa;
}
.ctx-tree-chevron {
  font-size: 9px;
  transition: transform 0.2s;
  color: #999;
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}
.ctx-tree-chevron.open {
  transform: rotate(90deg);
}
.ctx-tree-children {
  display: none;
  padding-left: 14px;
}
.ctx-tree-children.open {
  display: block;
}
.ctx-tree-leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px 7px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: #333;
  text-align: left;
  transition: background 0.1s;
}
.ctx-tree-leaf:hover {
  background: #ede9fe;
}
.ctx-tree-leaf i {
  width: 14px;
  text-align: center;
  font-size: 11px;
}

/* ---- Quill Editor Overrides ---- */
#updates-editor-wrap .ql-toolbar {
  border: none;
  border-bottom: 1px solid #e5e1eb;
  background: #faf8ff;
  font-family: Quicksand, sans-serif;
}
#updates-editor-wrap .ql-container {
  border: none;
  font-family: Quicksand, sans-serif;
  font-size: 15px;
}
#updates-editor-wrap .ql-editor {
  padding: 20px 28px;
  line-height: 1.7;
}
#updates-content h1 { font-size: 2em; font-weight: 700; margin: 0.5em 0; }
#updates-content h2 { font-size: 1.5em; font-weight: 700; margin: 0.5em 0; }
#updates-content h3 { font-size: 1.17em; font-weight: 700; margin: 0.5em 0; }
#updates-content ul, #updates-content ol { padding-left: 24px; }
#updates-content table { border-collapse: collapse; width: 100%; margin: 12px 0; }
#updates-content td, #updates-content th { border: 1px solid #ddd; padding: 8px 12px; }

/* ---- Sidebar Category Row ---- */
.sidebar-cat-row {
  display: flex;
  align-items: center;
}

.sidebar-cat-row .sidebar-category {
  flex: 1;
  min-width: 0;
}

.sidebar-cat-menu {
  background: none;
  border: none;
  color: #b59cdb;
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 8px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.sidebar-cat-menu:hover {
  color: #7928ec !important;
  background: #f0ecf5;
}

/* ---- Sidebar Item Pop-out Button ---- */
.sidebar-item-popout {
  background: none;
  border: none;
  color: transparent;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  margin-left: auto;
  transition: all 0.15s;
  flex-shrink: 0;
}

.sidebar-item:hover .sidebar-item-popout {
  color: #bbb;
}

.sidebar-item-popout:hover {
  color: #7928ec !important;
  background: #f0ecf5;
}

/* ---- Tracker List Item Actions ---- */
.tli-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.tli-actions button {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.15s;
}

.tli-actions button:hover {
  color: #7928ec;
  background: #f0ecf5;
}

.tli-actions .tli-delete:hover {
  color: #e53e3e;
  background: #fef2f2;
}

.tli-actions .tli-archive:hover {
  color: #e6a817;
  background: #fef9e7;
}

.tracker-list-item:hover .tli-actions button {
  color: #999;
}

/* ---- Drag & Drop Styles ---- */
.category-card.dragging,
.tracker-list-item.dragging,
.sidebar-section.dragging {
  opacity: 0.4;
}

.category-card.drag-over {
  outline: 2px dashed #7928ec;
  outline-offset: -2px;
}

.tracker-list-item.drag-over {
  border-color: #7928ec;
  box-shadow: 0 0 0 2px rgba(121,40,236,0.2);
}

.sidebar-section.drag-above {
  border-top: 2px solid #7928ec;
}

.sidebar-section.drag-below {
  border-bottom: 2px solid #7928ec;
}

.category-card[draggable="true"] {
  cursor: grab;
}

.category-card[draggable="true"]:active {
  cursor: grabbing;
}

.tracker-list-item[draggable="true"] {
  cursor: grab;
}

.tracker-list-item[draggable="true"]:active {
  cursor: grabbing;
}

/* Cross-category drop zone */
.sidebar-items .sidebar-item.drag-over-item {
  background: #ede5f7;
  box-shadow: 0 0 0 2px rgba(121,40,236,0.3);
}

/* ---- Pop-out / Floating Windows ---- */
.popout-window {
  position: fixed;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 400px;
  min-height: 300px;
  animation: popoutOpen 0.25s ease;
}

@keyframes popoutOpen {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes popoutClose {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

.popout-window.maximized {
  border-radius: 0;
}

.popout-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #53327d;
  color: #fff;
  padding: 10px 16px;
  cursor: move;
  flex-shrink: 0;
  user-select: none;
}

.popout-title {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 12px;
}

.popout-controls {
  display: flex;
  gap: 4px;
}

.popout-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.15s;
}

.popout-btn:hover {
  background: rgba(255,255,255,0.3);
}

.popout-close:hover {
  background: #e53e3e;
}

.popout-body {
  flex: 1;
  overflow: auto;
  position: relative;
}

.popout-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, #d4c4eb 50%);
  border-radius: 0 0 12px 0;
}

/* ---- Header Link (Meet the Team) ---- */
.header-link {
  font-size: 13px;
  font-weight: 600;
  color: #7928ec;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.header-link:hover {
  color: #53327d;
  text-decoration: underline;
}

/* ---- Zoom Controls (inline in header) ---- */
.zoom-controls {
  display: none;
}

.zoom-btn {
  background: none;
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s;
}

.zoom-btn:hover {
  background: rgba(255,255,255,0.2);
}

.zoom-level {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 4px;
  min-width: 42px;
  text-align: center;
  user-select: none;
}

/* ---- Comment/Description Display ---- */
.tracker-comment {
  margin-top: 4px;
  padding: 8px 12px;
  background: #faf7fe;
  border-left: 3px solid #7928ec;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  font-style: italic;
}

/* Create blank doc buttons in add modal */
.create-blank-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.create-blank-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px dashed #d4c4eb;
  border-radius: 8px;
  background: #faf7fe;
  color: #7928ec;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.create-blank-btn:hover {
  background: #ede5f7;
  border-color: #7928ec;
}

/* ---- Meet the Team Page ---- */
#team-view {
  display: none;
  padding: 40px;
}

#team-view.active {
  display: block;
}

#admin-view {
  display: none;
  padding: 40px;
}

#admin-view.active {
  display: block;
}

.team-outer-frame {
  border: 1px solid #ff9a7b;
  border-radius: 8px;
  padding: 5px;
  display: inline-block;
  max-width: 1100px;
  margin: 0 auto;
}

.team-inner-frame {
  border: 10px solid #000;
  border-radius: 6px;
  background: #fff;
  padding: 40px;
}

.team-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #53327d;
  margin-bottom: 36px;
}

.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
}

.team-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 180px;
}

.team-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #30ced0;
  margin-bottom: 14px;
}

.team-name {
  font-size: 15px;
  font-weight: 700;
  color: #7928ec;
  margin-bottom: 4px;
}

.team-title-role {
  font-size: 12.5px;
  font-weight: 500;
  font-style: italic;
  color: #b59cdb;
  margin-bottom: 6px;
  line-height: 1.3;
}

.team-email {
  font-size: 12px;
  font-weight: 500;
  color: #666666;
  text-decoration: none;
}

.team-email:hover {
  text-decoration: underline;
}

/* ---- Login Info Page ---- */
#logins-view {
  display: none;
  padding: 40px;
}

#logins-view.active {
  display: block;
}

.logins-title {
  font-size: 22px;
  font-weight: 700;
  color: #53327d;
  margin-bottom: 28px;
}

.login-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ece8f1;
  margin-bottom: 14px;
  max-width: 600px;
  transition: box-shadow 0.2s;
}

.login-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.login-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.login-card-info {
  flex: 1;
  min-width: 0;
}

.login-card-site {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.login-card-site a {
  color: #7928ec;
  text-decoration: none;
}

.login-card-site a:hover {
  text-decoration: underline;
}

.login-card-creds {
  font-size: 12.5px;
  color: #666;
  line-height: 1.5;
}

.login-card-creds .login-label {
  font-weight: 600;
  color: #555;
}

/* ---- Sidebar Footer (Login Info link) ---- */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #e8e4ed;
  margin-top: auto;
}

.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: #faf7fe;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #7928ec;
  font-family: inherit;
  transition: background 0.15s;
}

.sidebar-footer-btn:hover {
  background: #ede5f7;
}

.sidebar-footer-btn i {
  font-size: 14px;
}

.sidebar-footer-btn + .sidebar-footer-btn {
  margin-top: 4px;
}

/* ---- Weekly Updates & Priorities ---- */
#updates-view { display: none; padding: 24px 32px; }
#updates-view.active { display: block; }

/* ---- Director's Corner ---- */
#director-view { display: none; padding: 24px 32px; }
#director-view.active { display: block; }

.director-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #ede5f7;
}

.director-header-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7928ec, #53327d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  flex-shrink: 0;
}

.director-compose {
  background: #faf7fe;
  border: 2px solid #ede5f7;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 28px;
}

.director-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d4c4eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.director-input:focus {
  outline: none;
  border-color: #7928ec;
}

.director-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d4c4eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.director-textarea:focus {
  outline: none;
  border-color: #7928ec;
}

.director-post-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #7928ec, #53327d);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.director-post-btn:hover {
  opacity: 0.9;
}

.director-post {
  background: #fff;
  border: 1.5px solid #ede5f7;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  transition: box-shadow 0.2s;
}

.director-post:hover {
  box-shadow: 0 4px 16px rgba(121, 40, 236, 0.08);
}

.director-post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.director-post-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.director-post-date {
  font-size: 11px;
  color: #999;
  font-weight: 500;
}

.director-post-body {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

.director-action-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: #faf7fe;
  color: #7928ec;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s;
}

.director-action-btn:hover {
  background: #ede5f7;
}

.director-action-btn.danger {
  color: #e53e3e;
}

.director-action-btn.danger:hover {
  background: #fee;
}

/* ---- Director Section Labels ---- */
.director-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #ede5f7;
}

.slack-setup-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f5ff, #faf7fe);
  border: 1.5px dashed #d4c4eb;
  border-radius: 12px;
  margin-bottom: 8px;
}

.slack-setup-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #4A154B;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* ---- Slack Content ---- */
.slack-canvas-content {
  background: #fff;
  border: 1.5px solid #ede5f7;
  border-radius: 12px;
  overflow: hidden;
}

.slack-canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8f5ff, #faf7fe);
  border-bottom: 1px solid #ede5f7;
}

.slack-canvas-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slack-canvas-title-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.slack-canvas-updated {
  font-size: 11px;
  color: #999;
  font-weight: 500;
}

.slack-canvas-body {
  padding: 20px 24px;
  font-size: 14px;
  color: #444;
  line-height: 1.7;
}

.slack-canvas-body h1, .slack-canvas-body h2, .slack-canvas-body h3 {
  color: #333;
  margin: 16px 0 8px;
}

.slack-canvas-body h1 { font-size: 22px; }
.slack-canvas-body h2 { font-size: 18px; }
.slack-canvas-body h3 { font-size: 15px; }

.slack-canvas-body ul, .slack-canvas-body ol {
  padding-left: 24px;
  margin: 8px 0;
}

.slack-canvas-body li {
  margin: 4px 0;
}

.slack-canvas-body pre {
  background: #f5f2f8;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  overflow-x: auto;
}

.slack-canvas-body code {
  background: #f0ebf5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.slack-canvas-body a {
  color: #7928ec;
  text-decoration: none;
}

.slack-canvas-body a:hover {
  text-decoration: underline;
}

.slack-message {
  background: #fff;
  border: 1.5px solid #ede5f7;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.slack-message:hover {
  box-shadow: 0 2px 10px rgba(121, 40, 236, 0.06);
}

.slack-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slack-message-user {
  font-weight: 700;
  font-size: 13px;
  color: #333;
}

.slack-message-date {
  font-size: 11px;
  color: #999;
}

.slack-message-text {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

.slack-message-text strong { color: #333; }
.slack-message-text code {
  background: #f0ebf5;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}

.slack-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #fff5f5;
  border: 1.5px solid #fed7d7;
  border-radius: 10px;
  color: #c53030;
  font-size: 13px;
  font-weight: 600;
}

.slack-error i {
  font-size: 18px;
}

/* ---- Capture Preview Prompt ---- */
.capture-prompt-overlay {
  position: absolute;
  inset: 0;
  background: rgba(83, 50, 125, 0.35);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.capture-prompt-overlay.show {
  opacity: 1;
}

.capture-prompt {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(121, 40, 236, 0.22), 0 2px 16px rgba(0,0,0,0.10);
  padding: 28px 32px;
  text-align: center;
  max-width: 300px;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border: 2px solid #ede5f7;
}

.capture-prompt-overlay.show .capture-prompt {
  transform: scale(1);
  opacity: 1;
}

.capture-prompt-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}

.capture-prompt-close:hover {
  color: #333;
}

.capture-prompt-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7928ec, #53327d);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 22px;
  color: #fff;
}

.capture-prompt-text {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin: 0 0 16px;
  line-height: 1.4;
}

.capture-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #30ced0, #28b5b7);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

.capture-prompt-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.capture-prompt-btn:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

/* ---- Icon Picker Grid ---- */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e0dce5;
  border-radius: 8px;
  background: #faf7fe;
}

.icon-picker-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  color: #555;
  transition: all 0.15s;
  background: #fff;
}

.icon-picker-item:hover {
  border-color: #7928ec;
  color: #7928ec;
  background: #f0ecf5;
}

.icon-picker-item.selected {
  border-color: #7928ec;
  background: #7928ec;
  color: #fff;
}

.icon-picker-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.icon-picker-upload label {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px dashed #d4c4eb;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #7928ec;
  margin: 0 !important;
  transition: all 0.15s;
}

.icon-picker-upload label:hover {
  background: #f0ecf5;
  border-color: #7928ec;
}

/* ---- Open in Sheets (primary toolbar button) ---- */
/* Legacy — kept for any remaining references */
.toolbar-btn-open-sheets {
  display: none;
}

/* ---- Share Link Visible Display ---- */
.share-link-display {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 12px;
  background: #faf7fe;
  border: 1px solid #e0dce5;
  border-radius: 8px;
}

.share-link-display input {
  flex: 1;
  border: none;
  background: none;
  font-size: 12px;
  font-family: inherit;
  color: #555;
  outline: none;
  min-width: 0;
}

.share-link-display button {
  background: #7928ec;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s;
}

.share-link-display button:hover {
  background: #6520cc;
}

/* ---- Sidebar Item Drag Styles ---- */
#sidebar .sidebar-item[draggable="true"] {
  cursor: grab;
}

#sidebar .sidebar-item[draggable="true"]:active {
  cursor: grabbing;
}

#sidebar .sidebar-item.dragging {
  opacity: 0.4;
}

#sidebar .sidebar-item.drag-over-item {
  background: #ede5f7;
  box-shadow: 0 0 0 2px rgba(121,40,236,0.3);
}

/* Multi-select highlight */
#sidebar .sidebar-item.multi-selected {
  background: linear-gradient(90deg, #ede5f7 0%, #e0f7f8 100%);
  border-left-color: #30ced0 !important;
  box-shadow: inset 0 0 0 1px rgba(48,206,208,0.3);
}

#sidebar .sidebar-item.multi-selected::before {
  content: '\f14a';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  font-size: 10px;
  color: #30ced0;
  position: absolute;
  left: 36px;
}

/* Sidebar subcategory drag styles */
.sidebar-subcategory-header[draggable="true"] {
  cursor: grab;
}

.sidebar-subcategory-header.dragging {
  opacity: 0.4;
}

/* ---- Sidebar Search Box ---- */
.sidebar-search {
  padding: 12px 14px 8px;
  border-bottom: 1px solid #e8e4ed;
}

.sidebar-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #53327d;
  border-radius: 8px;
  padding: 8px 12px;
}

.sidebar-search-box i {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}

.sidebar-search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 12.5px;
  font-weight: 500;
  width: 100%;
  color: #fff;
  font-family: inherit;
}

.sidebar-search-box input::placeholder {
  color: rgba(255,255,255,0.5);
}

.sidebar-search-results {
  display: none;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}

.sidebar-search-result {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
  line-height: 1.3;
}

.sidebar-search-result:hover {
  background: #f5f0fa;
}

.sidebar-search-result span {
  flex: 1;
  min-width: 0;
  white-space: normal;
  word-wrap: break-word;
}

.sidebar-search-result small {
  font-size: 10px;
  color: #999;
  flex-shrink: 0;
  white-space: nowrap;
}

.sidebar-search-empty {
  padding: 12px 10px;
  font-size: 12px;
  color: #999;
  text-align: center;
}

.sidebar-search-view-all {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #7928ec;
  text-align: center;
  font-family: inherit;
  border-top: 1px solid #ece8f1;
  transition: background 0.15s;
}
.sidebar-search-view-all:hover {
  background: #f5f0fa;
}

/* ---- Full Search Results Page ---- */
#search-view {
  display: none;
  padding: 24px 32px;
}

.search-results-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.search-results-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #3a2066;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-results-header h2 i {
  font-size: 16px;
  color: #7928ec;
}
.search-results-count {
  font-size: 14px;
  color: #777;
}
.search-results-count strong {
  color: #3a2066;
}

.search-results-empty {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}
.search-results-empty p {
  margin: 12px 0 0;
  font-size: 16px;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.search-result-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e8e4ed;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  background: #fff;
}
.search-result-card:hover {
  border-color: #c5b3e3;
  box-shadow: 0 4px 16px rgba(121,40,236,0.10);
  transform: translateY(-2px);
}

.search-result-preview {
  width: 100%;
  height: 160px;
  background: #f8f5fc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-result-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.search-result-no-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f0fa 0%, #ede5f7 100%);
}
.search-result-no-preview i {
  font-size: 36px;
  color: #c5b3e3;
}

.search-result-info {
  padding: 12px 14px;
}
.search-result-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #2d2d2d;
  line-height: 1.35;
  margin-bottom: 8px;
  word-break: break-word;
}
.search-result-name mark {
  background: #ffe066;
  color: inherit;
  padding: 1px 2px;
  border-radius: 2px;
}
.search-result-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.search-result-category {
  font-size: 11px;
  color: #666;
  font-weight: 500;
}
.search-result-type {
  font-size: 11px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 4px;
}
.search-result-type i {
  font-size: 10px;
}

@media (max-width: 768px) {
  #search-view {
    padding: 16px;
  }
  .search-results-grid {
    grid-template-columns: 1fr;
  }
  .search-result-preview {
    height: 120px;
  }
}

/* ---- Update Notification Banner (lower-right corner) ---- */
.update-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 320px;
}
.update-banner.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.update-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #3a2066 0%, #5a2d9e 100%);
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  box-shadow: 0 6px 24px rgba(58, 32, 102, 0.4);
  border-radius: 12px;
}
.update-banner-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.update-banner-icon i {
  font-size: 13px;
  color: #30ced0;
}
.update-banner-text {
  flex: 1;
  min-width: 0;
}
.update-banner-text strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 1px;
}
.update-banner-text span {
  font-size: 11px;
  opacity: 0.85;
  line-height: 1.3;
}
.update-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.update-banner-btn {
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.update-banner-btn:active {
  transform: scale(0.97);
}
.update-banner-btn.refresh {
  background: #30ced0;
  color: #1a1a2e;
}
.update-banner-btn.refresh:hover {
  background: #5ee0e2;
}
.update-banner-btn.dismiss {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 5px 8px;
}
.update-banner-btn.dismiss:hover {
  background: rgba(255,255,255,0.25);
}

@media (max-width: 600px) {
  .update-banner {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}

/* ---- Subcategory Drag Handle & Dragging State ---- */
.sub-drag-handle {
  opacity: 0;
  transition: opacity 0.15s;
  cursor: grab !important;
}
.accordion-header:hover .sub-drag-handle {
  opacity: 0.5;
}
.accordion-header:hover .sub-drag-handle:hover {
  opacity: 1;
}
.accordion-header.sub-dragging {
  opacity: 0.4;
  background: #f5f0fa;
}
.sidebar-subcategory-header[draggable="true"] {
  cursor: pointer;
}
.sidebar-subcategory-header[draggable="true"]:active {
  cursor: grabbing;
}

/* Tracker drag handle within subcategories */
.tli-drag-handle {
  opacity: 0;
  transition: opacity 0.15s;
  cursor: grab !important;
}
.tracker-list-item:hover .tli-drag-handle {
  opacity: 0.5;
}
.tracker-list-item:hover .tli-drag-handle:hover {
  opacity: 1;
}
.tracker-list-item.sub-dragging {
  opacity: 0.4;
  background: #f5f0fa;
}

/* Rubber-band selection box */
.rubber-band-select {
  position: fixed;
  border: 2px solid rgba(121, 40, 236, 0.6);
  background: rgba(121, 40, 236, 0.08);
  border-radius: 3px;
  pointer-events: none;
  z-index: 9999;
}

/* Up/Down reorder buttons */
.tli-reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-right: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.tracker-list-item:hover .tli-reorder-btns { opacity: 0.6; }
.tli-reorder-btns button {
  background: none;
  border: none;
  padding: 0 3px;
  cursor: pointer;
  color: #999;
  font-size: 9px;
  line-height: 1;
}
.tli-reorder-btns button:hover { color: #7928ec; }

/* ---- Subcategory Action Buttons (in category view) ---- */
.sub-action-btn {
  background: none;
  border: none;
  color: #b59cdb;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  transition: all 0.15s;
}

.sub-action-btn:hover {
  color: #7928ec;
  background: #f0ecf5;
}

/* ---- Category View Color Accent ---- */
#category-view .breadcrumb {
  padding-left: 12px;
  cursor: pointer;
}

#category-view .cat-view-header {
  padding: 4px 0 20px;
}

#category-view .cat-view-header h2 {
  background: linear-gradient(90deg, #53327d, #7928ec);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
