/* Manager Dashboard Styles - Web Organizer */
:root {
  --bg-app: #090d16;
  --bg-sidebar: #0f172a;
  --bg-header: rgba(15, 23, 42, 0.8);
  --bg-card: rgba(30, 41, 59, 0.6);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --bg-input: rgba(15, 23, 42, 0.8);
  --bg-modal: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.15);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --accent: #a855f7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-full: 9999px;

  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.light-mode {
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.85);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;
  --bg-modal: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(0, 0, 0, 0.15);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  z-index: 10;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 16px var(--primary-glow);
}

.brand-text h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 500;
}

.action-buttons-group {
  padding: 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Navigation Section */
.nav-section {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-subtle);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-item-title-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow: hidden;
}

.nav-item .badge-small {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
}

.nav-item .badge-accent {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.badge-subtle {
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 600;
}

.categories-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Subcategories Styling in Sidebar Navigation */
.subcat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
  margin-top: 2px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  margin-left: 14px;
}

.subcat-list.hidden {
  display: none !important;
}

.subcat-toggle-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 9px;
  padding: 2px 5px;
  margin-left: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.subcat-toggle-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.15);
}

/* Level 3 Nested Subcategories (Fases de Materias) */
.nested-subcat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 10px;
  margin-top: 2px;
  margin-bottom: 4px;
  border-left: 2px solid rgba(56, 189, 248, 0.3);
  margin-left: 10px;
}

.nested-subcat-list.hidden {
  display: none !important;
}

.nested-subcat-item {
  padding: 4px 8px !important;
  font-size: 11.5px !important;
  opacity: 0.92;
}

.nested-subcat-item:hover {
  background: rgba(56, 189, 248, 0.08);
}

.cat-nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cat-nav-item.drag-over {
  background: rgba(99, 102, 241, 0.3) !important;
  border: 1px dashed var(--primary) !important;
  box-shadow: 0 0 12px var(--primary-glow);
  transform: scale(1.02);
}

.cat-nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.cat-nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.cat-icon-symbol {
  flex-shrink: 0;
}

.cat-name-marquee-container {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 13px;
  display: block;
  transition: color 0.2s ease;
}

.cat-nav-item:hover .cat-name {
  color: var(--text-main);
}

.cat-actions {
  display: opacity;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cat-nav-item:hover .cat-actions {
  opacity: 1;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 6px;
}

.tag-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-pill:hover, .tag-pill.active {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: var(--primary);
}

/* Sidebar Cloud Sync Info Box (Global Status) */
.sidebar-sync-card {
  margin: 0 12px 10px 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-sync-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-sync-card.connected {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.22);
}

.sidebar-sync-card.connected:hover {
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(16, 185, 129, 0.4);
}

.sidebar-sync-card.unlinked {
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed rgba(99, 102, 241, 0.35);
}

.sidebar-sync-card.unlinked:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.55);
}

.sidebar-sync-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-sync-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.sidebar-sync-card.connected .sidebar-sync-title-row {
  color: #34d399;
}

.sidebar-sync-card.unlinked .sidebar-sync-title-row {
  color: #818cf8;
}

.sidebar-sync-cloud-icon {
  flex-shrink: 0;
}

.sidebar-sync-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.sidebar-sync-dot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-sync-dot-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
}

.sidebar-sync-card.connected .sidebar-sync-dot-badge .status-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse-dot 2s infinite;
}

.sidebar-sync-card.unlinked .sidebar-sync-dot-badge .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
}

.sidebar-sync-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-sync-account {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-sync-datetime {
  font-size: 10px;
  color: var(--text-subtle);
  font-weight: 500;
  letter-spacing: -0.1px;
}

.sidebar-sync-card.connected .sidebar-sync-datetime {
  color: #94a3b8;
}

.sidebar-sync-card.unlinked .sidebar-sync-datetime {
  color: #fbbf24;
  font-size: 10px;
  line-height: 1.3;
}

.sidebar-sync-card.pulse-sync {
  animation: liveSyncGlow 1.2s ease-out;
}

@keyframes liveSyncGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
    border-color: rgba(52, 211, 153, 0.8);
  }
  50% {
    box-shadow: 0 0 16px 2px rgba(52, 211, 153, 0.4);
    border-color: rgba(52, 211, 153, 0.6);
  }
  100% {
    box-shadow: none;
    border-color: rgba(52, 211, 153, 0.25);
  }
}

.sidebar-sync-countdown-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  color: #34d399;
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: 0.2px;
}

.sidebar-sync-countdown-row svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-sync-countdown-row.syncing {
  color: #60a5fa;
}

.sidebar-sync-countdown-row.syncing svg {
  animation: spin 1s linear infinite;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-icon-text {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  cursor: pointer;
  flex: 1;
  transition: all 0.2s ease;
}

.btn-icon-text:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-icon-only {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-app);
}

/* Main Header */
.main-header {
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 5;
}

.search-bar-container {
  flex: 1;
  max-width: 540px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-subtle);
  pointer-events: none;
}

.main-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 10px 38px 10px 42px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.main-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 14px;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: var(--radius-md);
}

.view-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.view-btn.active, .view-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Banner Header */
.view-banner {
  padding: 24px 28px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.banner-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px currentColor;
  display: inline-block;
}

.view-banner h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.badge-large {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
}

.banner-description {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.banner-actions {
  display: flex;
  gap: 10px;
}

.filter-status-bar {
  padding: 8px 28px;
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a5b4fc;
  font-size: 12px;
}

.btn-text {
  background: none;
  border: none;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* Links Container */
.links-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.links-container.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  grid-auto-rows: max-content;
  align-items: start;
}

.links-container.list-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Link Card (Grid View) */
.link-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 145px;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}

.link-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-main-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.favicon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.favicon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.card-titles {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-link-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.card-link-title:hover {
  color: var(--primary);
}

.card-domain-badge {
  font-size: 11px;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.star-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s ease;
}

.star-btn:hover, .star-btn.starred {
  color: var(--warning);
  transform: scale(1.15);
}

.card-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 32px;
  margin: 6px 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.card-cat-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.card-actions-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn-sm {
  background: none;
  border: none;
  color: var(--text-subtle);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Link Card (List View) */
.links-container.list-view .link-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 16px;
  height: auto;
  min-height: 54px;
}

.links-container.list-view .card-top {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.links-container.list-view .card-main-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.links-container.list-view .card-titles {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.links-container.list-view .card-link-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.links-container.list-view .card-body {
  display: none;
}

.links-container.list-view .card-footer {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  gap: 12px;
  flex-shrink: 0;
}

/* Empty State */
.empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  width: 100%;
  min-height: calc(100vh - 240px);
  margin: auto;
  grid-column: 1 / -1;
  justify-self: center;
  align-self: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-subtle);
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.full-width {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: white;
}

.cat-actions-hover {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.cat-nav-item:hover .cat-actions-hover {
  opacity: 1;
}

.cat-action-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 11px;
  border-radius: 4px;
}

.cat-action-btn:hover {
  color: var(--danger);
  background: rgba(255, 255, 255, 0.1);
}

/* QR Code Modal Styles */
.modal-qr-large {
  max-width: 720px !important;
  width: 94% !important;
}

.qr-modal-grid {
  display: grid !important;
  grid-template-columns: 1fr 220px !important;
  gap: 24px !important;
  align-items: start !important;
  padding: 22px 24px !important;
}

@media (max-width: 640px) {
  .qr-modal-grid {
    grid-template-columns: 1fr !important;
  }
  .qr-right-col {
    border-left: none !important;
    border-top: 1px solid var(--border-color);
    padding-left: 0 !important;
    padding-top: 18px;
    width: 100% !important;
  }
}

.qr-left-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  width: 100%;
}

.qr-right-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border-color);
  padding-left: 24px;
  width: 100%;
  box-sizing: border-box;
}

.cat-nav-item.drag-reorder-over {
  border-bottom: 2px solid var(--primary) !important;
  background: rgba(99, 102, 241, 0.25) !important;
}

.qr-action-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-top: 8px !important;
  width: 100% !important;
}

.qr-action-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}

.qr-action-buttons .btn {
  white-space: nowrap !important;
  padding: 7px 12px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
}

#qr-modal-telegram-btn {
  background: rgba(56, 189, 248, 0.08) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

#qr-modal-telegram-btn:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  color: #7dd3fc !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25) !important;
}

.qr-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.qr-favicon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qr-info-titles {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.qr-info-titles h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-url-link {
  font-size: 11px;
  color: #818cf8;
  text-decoration: none;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-url-link:hover {
  text-decoration: underline;
}

.qr-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-notes-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  width: 100%;
  text-align: left;
  line-height: 1.4;
}

.qr-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.qr-code-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.qr-instruction {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.qr-code-container {
  background: white;
  padding: 12px;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
}

.link-card {
  cursor: pointer;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

#apa-modal,
#guide-viewer-modal,
#grade-modal {
  z-index: 1200 !important;
}

#apa-modal .modal,
#guide-viewer-modal .modal,
#grade-modal .modal {
  z-index: 1201 !important;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: visible;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1000;
}

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

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.modal-form, .modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 {
  flex: 1;
}

.input, .select, .textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.select option {
  background-color: #1e293b;
  color: #f8fafc;
  padding: 8px 12px;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.color-presets {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.color-btn.selected, .color-btn:hover {
  transform: scale(1.2);
  border-color: white;
}

#cat-input-custom-color {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
}

.form-checkbox-row {
  display: flex;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 4px 0;
}

.backup-section h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.backup-section p {
  font-size: 12px;
  color: var(--text-muted);
}

.margin-top-sm {
  margin-top: 8px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}

.toast-item {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.hidden {
  display: none !important;
}

/* Floating Multi-Select Action Bar */
.batch-floating-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-xl);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 1000;
  animation: slideUpFloating 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFloating {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.batch-floating-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.batch-floating-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Selected Card Styling in Multi-Select Mode */
.link-card.batch-selected {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px var(--primary), 0 8px 24px var(--primary-glow) !important;
  background: rgba(99, 102, 241, 0.12) !important;
}

/* --- UNIVERSITY MODULE STYLES --- */
.university-view-container {
  padding: 24px 32px;
  flex: 1;
  overflow-y: auto;
}

/* --- University Top Header Banner --- */
.uni-top-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.uni-top-banner-main {
  flex: 1;
  min-width: 240px;
}

.uni-top-banner-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.uni-top-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.uni-top-banner-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.uni-top-banner-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.uni-top-banner-widgets {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.uni-banner-widget {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.uni-banner-widget:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.uni-banner-widget-icon {
  font-size: 15px;
  line-height: 1;
}

.uni-banner-widget-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.uni-banner-widget-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.uni-banner-widget-val {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

/* --- Enlarged Symmetrical Top KPI Metric Cards --- */
.uni-stats-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.uni-stat-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.uni-stat-hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.uni-stat-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.uni-stat-hero-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.uni-stat-hero-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uni-stat-hero-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* --- Uniform Aesthetic Section Divider --- */
.uni-section-divider {
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: rgba(99, 102, 241, 0.28);
  margin: 10px 0 22px 0;
}

[data-theme="light"] .uni-section-divider {
  background: rgba(99, 102, 241, 0.2);
}

/* --- Meetings List Modal Item Styles --- */
.meetings-modal-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meeting-list-item {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.meeting-list-item:hover {
  transform: translateX(3px);
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.05);
}

.meeting-list-item-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.meeting-list-item-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.uni-meeting-platform-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

[data-theme="light"] .uni-meeting-platform-badge {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.uni-meeting-subj-badge {
  font-size: 11px;
  font-weight: 600;
  color: #60a5fa;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.meeting-list-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  margin: 0;
  line-height: 1.35;
  word-break: break-word;
}

.meeting-list-item-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.meeting-list-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Banner Widget 2 Clickable Hover Effect */
.uni-banner-widget.clickable:hover {
  border-color: rgba(245, 158, 11, 0.6) !important;
  background: rgba(245, 158, 11, 0.08) !important;
  transform: translateY(-1px);
}
.uni-banner-widget.clickable:active {
  transform: translateY(0);
}

/* --- Breadcrumbs & Action Navbar --- */
.uni-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.uni-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.uni-crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 600;
  transition: color 0.2s;
}

.uni-crumb.active {
  color: var(--text-main);
}

.uni-crumb:hover {
  color: #60a5fa;
}

.uni-crumb-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

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

/* --- Symmetrical Subjects Grid & Minimalist Cards --- */
.uni-subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.uni-subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.uni-subject-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  border-color: rgba(96, 165, 250, 0.4);
}

.uni-subject-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.uni-subject-card-code {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.uni-subject-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

/* Progress bar based on grades */
.uni-subject-progress-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uni-subject-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.uni-subject-progress-val {
  color: var(--text-main);
  font-weight: 700;
}

.uni-subject-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.uni-subject-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease, background 0.4s ease;
}

.uni-subject-passing-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.uni-approved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
}

.uni-pending-grade-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
}

.uni-subject-next-due {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

/* --- Selected Subject Activities Detail View --- */
.uni-subject-banner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.uni-activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.uni-activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.uni-activity-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  border-color: rgba(96, 165, 250, 0.35);
}

.uni-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.uni-card-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.uni-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.uni-card-desc-preview {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.uni-unit-badge {
  font-size: 11px;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  box-sizing: border-box;
  font-weight: 600;
}

.uni-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  box-sizing: border-box;
}

.status-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-in-progress {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.status-submitted {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Modality Badges with Distinct Cyan and Violet Colors & Outline Icon Style */
.uni-modality-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  box-sizing: border-box;
}

.modality-individual {
  background: rgba(6, 182, 212, 0.12);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.modality-group {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Interactive Status Flow Buttons (Identical size and height to left due-badge) */
.act-flow-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  height: 26px;
  box-sizing: border-box;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  outline: none;
  user-select: none;
  font-family: inherit;
}

.btn-flow-start {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.btn-flow-start:hover {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(59, 130, 246, 0.55);
  color: #93c5fd;
  transform: translateY(-1px);
}

.btn-flow-start:active {
  transform: translateY(0);
}

.btn-flow-submit {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.btn-flow-submit:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
  transform: translateY(-1px);
}

.btn-flow-submit:active {
  transform: translateY(0);
}

.btn-flow-grade {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.28);
}

.btn-flow-grade:hover {
  background: rgba(99, 102, 241, 0.24);
  border-color: rgba(99, 102, 241, 0.55);
  color: #c7d2fe;
  transform: translateY(-1px);
}

.btn-flow-grade:active {
  transform: translateY(0);
}

.uni-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
  flex-wrap: wrap;
}

.uni-due-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  height: 26px;
  box-sizing: border-box;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.due-urgent {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.due-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.due-normal {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.due-overdue {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.uni-grade-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  height: 26px;
  box-sizing: border-box;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

/* Activity Progress Bar */
.uni-act-progress-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 4px 0;
}

.uni-act-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
}

.uni-act-progress-val {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.uni-act-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.uni-act-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease, background 0.3s ease;
}

/* Multi-Attachments Styles */
.uni-attach-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  transition: background 0.2s, border-color 0.2s;
}

.uni-attach-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(96, 165, 250, 0.3);
}

.uni-subject-subnav button {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.uni-subject-subnav button:hover {
  transform: translateY(-1px);
}

.uni-card-doc-pill:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(96, 165, 250, 0.35) !important;
  transform: translateY(-1px);
}

.uni-attach-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.uni-attach-file-name {
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uni-attach-file-size {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.uni-attach-remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  opacity: 0.75;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, background 0.2s;
}

.uni-attach-remove-btn:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.12);
}

/* Fix browser datetime/date/time icon contrast in dark theme */
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.3);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.modal-lg {
  max-width: 650px;
}

.modal-sync-layout {
  max-width: 560px !important;
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.1);
}

/* --- Cloud Sync Enhanced Card Styles --- */
.sync-card {
  position: relative;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  padding: 16px 18px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.sync-card-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #10b981, #f59e0b);
}

.sync-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.sync-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sync-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  flex-shrink: 0;
}

.sync-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 2px 0;
  letter-spacing: -0.2px;
}

.sync-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sync-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-disconnected {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.badge-disconnected .status-dot {
  background: #94a3b8;
}

.badge-connected {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-connected .status-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Custom In-Web Dialog Modals (Replaces native browser alerts) */
#custom-confirm-modal .modal,
#custom-alert-modal .modal {
  animation: modalPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPopIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Telegram Bot Integration Modal Styling */
#telegram-modal {
  z-index: 1250 !important;
}

#telegram-modal .modal {
  z-index: 1251 !important;
}

.telegram-status-card {
  transition: all 0.2s ease;
}

.telegram-status-card.connected {
  background: rgba(56, 189, 248, 0.08) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

.telegram-status-card.connected #telegram-connection-badge {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.telegram-status-card.connected .status-dot {
  background: #38bdf8 !important;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

/* Password Protection & Sync Security Modals */
#create-id-modal,
#verify-sync-modal,
#change-pass-modal {
  z-index: 1300 !important;
}

#create-id-modal .modal,
#verify-sync-modal .modal,
#change-pass-modal .modal {
  z-index: 1301 !important;
  animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn-toggle-pw {
  transition: color 0.15s ease, transform 0.15s ease;
}

.btn-toggle-pw:hover {
  color: var(--text-main) !important;
  transform: scale(1.1);
}

.btn-toggle-pw:active {
  transform: scale(0.95);
}

.form-error-msg {
  animation: errorShake 0.3s ease;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* =========================================================
   ACADEMIC STUDY READER & SPACIOUS DOCUMENT VIEWER STYLES
   ========================================================= */

#guide-viewer-modal {
  z-index: 1500 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
}

#guide-viewer-modal.hidden {
  display: none !important;
}

.modal-study-reader {
  width: 95vw !important;
  max-width: 1440px !important;
  height: 92vh !important;
  max-height: 94vh !important;
  min-height: 550px !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #0f172a !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(59, 130, 246, 0.12) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1501 !important;
}

/* Fullscreen Maximized State */
#guide-viewer-modal.fullscreen {
  padding: 0 !important;
}

#guide-viewer-modal.fullscreen .modal-study-reader {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}

/* Header */
.study-reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.study-reader-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.study-reader-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  flex-shrink: 0;
}

.study-reader-title-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.study-reader-filename {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
  line-height: 1.2;
}

.study-reader-submeta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.study-meta-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.study-meta-dim {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

/* Controls */
.study-reader-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.study-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  height: 32px;
  box-sizing: border-box;
}

.study-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.study-ctrl-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.study-close-btn {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
  padding: 6px !important;
  border-radius: 7px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  width: 32px !important;
  height: 32px !important;
}

.study-close-btn:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ffffff !important;
}

/* Body & Split View */
.study-reader-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  min-height: 0;
  background: #090d16;
}

.study-reader-main-canvas {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
}

.study-reader-main-canvas iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0b0f19;
}

/* Text / Code File Readable View */
.study-text-viewer-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0b0f19;
  color: #e2e8f0;
}

.study-text-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.study-text-content {
  flex: 1;
  overflow: auto;
  padding: 18px 24px;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: #060911;
}

/* Activity Study Companion Sidebar */
.study-reader-sidebar {
  width: 360px;
  min-width: 300px;
  max-width: 400px;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
}

.study-reader-sidebar.collapsed {
  display: none !important;
}

.study-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.study-sidebar-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px;
}

.study-sidebar-act-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.3;
  text-transform: uppercase;
}

.study-sidebar-desc-text {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 6px;
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Sibling items inside study sidebar */
.study-sibling-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.study-sibling-doc-item:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}

.study-sibling-doc-item.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
}

.study-sibling-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Floating Selection & Highlight Toolbar */
.study-highlight-bubble {
  position: absolute;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 5px 10px;
  backdrop-filter: blur(12px);
  transform: translate(-50%, -100%);
  margin-top: -10px;
  animation: bubblePop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.study-highlight-bubble.hidden {
  display: none !important;
}

@keyframes bubblePop {
  from {
    opacity: 0;
    transform: translate(-50%, -85%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

.study-bubble-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
}

.study-color-pill {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
}

.study-color-pill:hover {
  transform: scale(1.25);
  border-color: #ffffff;
  box-shadow: 0 0 8px currentColor;
}

.study-color-pill.color-yellow { background: #eab308; }
.study-color-pill.color-green  { background: #10b981; }
.study-color-pill.color-blue   { background: #3b82f6; }
.study-color-pill.color-pink   { background: #ec4899; }
.study-color-pill.color-orange { background: #f97316; }

.study-color-pill-custom,
.study-composer-color-pill-custom {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.study-composer-color-pill-custom {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
}

.study-color-pill-custom:hover,
.study-composer-color-pill-custom:hover {
  transform: scale(1.25);
  border-color: #ffffff;
  box-shadow: 0 0 8px #a855f7;
}

.study-composer-color-pill-custom.active {
  transform: scale(1.25);
  border-color: #ffffff;
  box-shadow: 0 0 8px #a855f7;
}

.study-color-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
}

.study-color-custom-swatch,
.study-composer-custom-swatch {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.study-bubble-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}

.study-bubble-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.study-bubble-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Quick Study Composer inside Sidebar */
.study-quick-composer {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.15s ease;
}

.study-quick-composer:focus-within {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(0, 0, 0, 0.38);
}

.study-composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.study-composer-colors {
  display: flex;
  align-items: center;
  gap: 5px;
}

.study-composer-color-pill {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.12s ease;
}

.study-composer-color-pill:hover {
  transform: scale(1.2);
}

.study-composer-color-pill.active {
  transform: scale(1.25);
  border-color: #ffffff;
  box-shadow: 0 0 8px currentColor;
}

.study-composer-color-pill.color-yellow { background: #eab308; }
.study-composer-color-pill.color-green  { background: #10b981; }
.study-composer-color-pill.color-blue   { background: #3b82f6; }
.study-composer-color-pill.color-pink   { background: #ec4899; }
.study-composer-color-pill.color-orange { background: #f97316; }

/* Highlights List & Cards inside Sidebar */
.study-highlights-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.study-highlight-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left-width: 4px;
  border-radius: 7px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
  position: relative;
}

.study-highlight-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.study-highlight-card.hl-yellow { border-left-color: #eab308; background: rgba(234, 179, 8, 0.04); }
.study-highlight-card.hl-green  { border-left-color: #10b981; background: rgba(16, 185, 129, 0.04); }
.study-highlight-card.hl-blue   { border-left-color: #3b82f6; background: rgba(59, 130, 246, 0.04); }
.study-highlight-card.hl-pink   { border-left-color: #ec4899; background: rgba(236, 72, 153, 0.04); }
.study-highlight-card.hl-orange { border-left-color: #f97316; background: rgba(249, 115, 22, 0.04); }

.study-highlight-quote {
  font-size: 11.5px;
  color: var(--text-main);
  line-height: 1.45;
  font-style: italic;
  word-break: break-word;
}

.study-highlight-note-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 11px;
  color: #93c5fd;
  line-height: 1.4;
  word-break: break-word;
}

.study-highlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.study-highlight-meta {
  font-size: 10px;
  color: var(--text-muted);
}

.study-highlight-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.study-hl-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.study-hl-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.study-hl-action-btn.btn-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.study-highlights-empty {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 18px 10px;
  line-height: 1.5;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

@media (max-width: 900px) {
  .study-reader-body {
    flex-direction: column;
  }
  .study-reader-sidebar {
    width: 100%;
    max-width: 100%;
    height: 260px;
  }
  .study-btn-label {
    display: none;
  }
}

/* PDF Direct Document Renderer & In-Text Highlighting */
.pdf-viewer-scroll {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: auto !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 20px 10px 100px 10px;
  box-sizing: border-box;
  background: #0b0f19;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.pdf-viewer-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.pdf-viewer-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 6px;
}

.pdf-viewer-scroll::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.45);
  border-radius: 6px;
  border: 2px solid rgba(15, 23, 42, 0.7);
}

.pdf-viewer-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.75);
}

.pdf-quick-toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 10;
}

.pdf-page-wrapper {
  position: relative;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  margin: 0 auto 24px auto;
  user-select: text;
  flex-shrink: 0 !important;
  display: block;
}

.pdf-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pdf-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  line-height: 1;
  transform-origin: 0 0;
  pointer-events: auto;
  user-select: text;
}

.pdf-text-layer span,
.pdf-text-layer br {
  position: absolute;
  color: transparent !important;
  cursor: text;
  white-space: pre;
  transform-origin: 0% 0%;
  line-height: 1;
  pointer-events: auto;
  user-select: text;
}

.pdf-text-layer ::selection {
  background: rgba(59, 130, 246, 0.4);
  color: transparent;
}

/* Direct Visual Highlight Overlay on Text (Clean Highlighter Look) */
.pdf-highlight-mark {
  position: absolute;
  border-radius: 2px;
  pointer-events: auto;
  cursor: pointer;
  mix-blend-mode: multiply;
  transition: opacity 0.15s ease;
  z-index: 5;
  border: none !important;
}

.pdf-highlight-mark:hover {
  opacity: 0.85;
}

.pdf-highlight-mark.hl-yellow { background: rgba(253, 224, 71, 0.55); }
.pdf-highlight-mark.hl-green  { background: rgba(110, 231, 183, 0.55); }
.pdf-highlight-mark.hl-blue   { background: rgba(147, 197, 253, 0.55); }
.pdf-highlight-mark.hl-pink   { background: rgba(249, 168, 212, 0.55); }
.pdf-highlight-mark.hl-orange { background: rgba(253, 186, 116, 0.55); }

/* Page Number Badge */
.pdf-page-num-badge {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 10;
}

/* ==========================================================================
   MOBILE & TOUCH ADAPTIVE SYSTEM (RESPONSIVE WEB APP / PWA)
   ========================================================================== */

/* Mobile-only and Desktop-only helpers */
.mobile-only {
  display: none !important;
}

.mobile-top-bar {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Base Mobile Breakpoint (<= 768px) */
@media (max-width: 768px) {
  .mobile-only {
    display: flex !important;
  }

  .desktop-only {
    display: none !important;
  }

  body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 78px; /* Space for bottom nav */
    padding-top: 56px; /* Space for mobile top bar */
  }

  .app-layout {
    display: block;
    height: auto;
    min-height: 100vh;
    width: 100%;
  }

  /* -------------------------------------------------------------
     1. TOP HEADER & OFF-CANVAS SIDEBAR DRAWER
     ------------------------------------------------------------- */
  .mobile-top-bar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 14px;
    align-items: center;
    justify-content: space-between;
    z-index: 990;
    box-sizing: border-box;
  }

  .mobile-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
  }

  .mobile-icon-btn:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.92);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-logo {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
  }

  .mobile-brand-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-main);
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  /* Off-Canvas Sidebar Drawer */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 82vw;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    z-index: 999;
    background: var(--bg-sidebar);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.6);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
  }

  .sidebar-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
  }

  .sidebar-close-btn:active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
  }

  /* -------------------------------------------------------------
     2. BOTTOM NAVIGATION APP BAR
     ------------------------------------------------------------- */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-around;
    z-index: 990;
    box-sizing: border-box;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  }

  .mob-nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: color 0.15s ease, transform 0.1s ease;
    user-select: none;
  }

  .mob-nav-btn.active {
    color: var(--primary);
  }

  .mob-nav-btn:active {
    transform: scale(0.92);
  }

  .mob-nav-fab {
    position: relative;
    top: -12px;
  }

  .fab-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
    transition: transform 0.15s ease;
  }

  .mob-nav-fab:active .fab-circle {
    transform: scale(0.9);
  }

  /* -------------------------------------------------------------
     3. MAIN CONTENT & HEADER ADJUSTMENTS
     ------------------------------------------------------------- */
  .main-content {
    flex: 1;
    width: 100%;
    min-width: 0;
    overflow-y: visible;
    padding: 12px;
    height: auto;
  }

  .main-header {
    flex-direction: column;
    gap: 10px;
    padding: 6px 0 12px 0;
    background: transparent;
    border-bottom: none;
  }

  .search-bar-container {
    width: 100%;
    max-width: 100%;
  }

  .main-search-input {
    font-size: 16px; /* Prevents auto zoom in mobile Safari */
    height: 44px;
    padding: 0 38px 0 40px;
  }

  .view-controls {
    width: 100%;
    justify-content: space-between;
  }

  /* -------------------------------------------------------------
     4. RESPONSIVE GRID & CARDS
     ------------------------------------------------------------- */
  .links-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding-bottom: 20px;
  }

  .link-card {
    padding: 14px !important;
    border-radius: var(--radius-lg) !important;
  }

  .link-card-actions {
    opacity: 1 !important; /* Always visible on mobile touch */
    gap: 8px;
  }

  .link-card-actions button {
    min-width: 36px;
    min-height: 36px;
  }

  /* Banner adjustments */
  .view-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-lg);
  }

  .banner-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .banner-actions .btn {
    flex: 1;
    justify-content: center;
  }

  /* -------------------------------------------------------------
     5. UNIVERSITY MODULE MOBILE OPTIMIZATIONS
     ------------------------------------------------------------- */
  .university-nav-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 6px;
    gap: 8px !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .uni-tab-btn {
    white-space: nowrap;
    padding: 8px 14px;
    flex-shrink: 0;
  }

  .university-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .subject-card, .activity-card, .meeting-card {
    padding: 14px !important;
  }

  .activities-filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: 4px;
    gap: 6px;
  }

  .activity-filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* -------------------------------------------------------------
     6. MODALS TO BOTTOM SHEETS ON MOBILE
     ------------------------------------------------------------- */
  .modal {
    padding: 0 !important;
    align-items: flex-end !important; /* Open from bottom */
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    max-height: 88dvh !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    padding: 20px 16px 24px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
  }

  .modal-header {
    position: sticky;
    top: -20px;
    background: var(--bg-modal);
    z-index: 5;
    padding: 4px 0 12px 0;
    margin-bottom: 12px;
  }

  .modal-footer {
    position: sticky;
    bottom: -24px;
    background: var(--bg-modal);
    z-index: 5;
    padding: 12px 0 0 0;
    margin-top: 14px;
  }

  .input, select, textarea {
    font-size: 16px !important; /* Prevents auto zoom in iOS Safari */
    min-height: 42px;
  }
}



