/* ========== sidebar_toggle.css ========== */
/* ==========================================================================
   Sidebar Toggle - Enhanced Collapsible Sidebar
   Adds smooth transitions, collapsed strip, keyboard shortcut support,
   and improved responsive behavior to Redmine's sidebar.
   ========================================================================== */

/* ---------- Transition animations ---------- */

/* Smooth transitions when toggling sidebar (only when .animate class is present) */
#main.animate #sidebar {
  transition: inline-size 200ms ease, padding-inline 200ms ease, min-inline-size 200ms ease;
}

#main.animate #content {
  transition: flex-grow 200ms ease;
}

/* ---------- Sidebar switch panel - always visible ---------- */

/* Override: keep sidebar-switch-panel visible even when collapsed */
#main.collapsiblesidebar #sidebar-switch-panel {
  visibility: visible !important;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

/* ---------- Flash prevention ---------- */
/* These rules use body[data-sidebar-collapsed] set by inline script   */
/* BEFORE jQuery/JS runs, preventing the visible flash of expanded     */
/* sidebar that then collapses.                                        */

body[data-sidebar-collapsed="true"] #main.collapsiblesidebar #sidebar {
  inline-size: 24px !important;
  min-inline-size: 24px;
  padding-inline: 0;
  overflow: hidden;
}

body[data-sidebar-collapsed="true"] #main.collapsiblesidebar #sidebar-wrapper {
  display: none;
}

body[data-sidebar-collapsed="true"] #main.collapsiblesidebar #sidebar-switch-panel {
  margin-inline-start: 0;
  padding-inline-end: 0;
  inline-size: 24px;
}

/* ---------- Collapsed state - 24px strip ---------- */

#main.collapsedsidebar #sidebar {
  inline-size: 24px !important;
  min-inline-size: 24px;
  padding-inline: 0;
  overflow: hidden;
  border-inline-start: 1px solid var(--oc-gray-4);
  background: var(--oc-gray-0);
}

#main.collapsedsidebar #sidebar-switch-panel {
  margin-inline-start: 0;
  padding-inline-end: 0;
  inline-size: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#main.collapsedsidebar #sidebar-switch-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  inline-size: 24px;
}

#main.collapsedsidebar #sidebar-switch-button svg {
  margin: 0;
}

#main.collapsedsidebar #sidebar-wrapper {
  display: none;
}

/* ---------- Expanded state refinements ---------- */

#main.collapsiblesidebar:not(.collapsedsidebar) #sidebar-switch-panel {
  margin-block-end: 4px;
  border-block-end: 1px solid var(--oc-gray-3);
  padding-block-end: 2px;
}

#main.collapsiblesidebar:not(.collapsedsidebar) #sidebar-switch-button {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-block: 4px;
  padding-inline: 4px 4px;
  border-radius: 3px;
}

#main.collapsiblesidebar:not(.collapsedsidebar) #sidebar-switch-button svg {
  stroke: var(--oc-gray-6);
}

#main.collapsiblesidebar:not(.collapsedsidebar) #sidebar-switch-button:hover svg {
  stroke: var(--oc-gray-8);
}

/* ---------- Keyboard shortcut hint (tooltip) ---------- */

#sidebar-switch-button {
  position: relative;
}

#sidebar-switch-button[title] {
  cursor: pointer;
}

/* ---------- Dark mode support ---------- */

html[data-theme="dark"] #main.collapsedsidebar #sidebar {
  background: var(--oc-gray-8);
  border-inline-start-color: var(--oc-gray-6);
}

html[data-theme="dark"] #main.collapsedsidebar #sidebar-switch-button:hover {
  background-color: var(--oc-gray-7);
}

html[data-theme="dark"] #main.collapsiblesidebar:not(.collapsedsidebar) #sidebar-switch-panel {
  border-block-end-color: var(--oc-gray-6);
}

html[data-theme="dark"] #main.collapsiblesidebar:not(.collapsedsidebar) #sidebar-switch-button svg {
  stroke: var(--oc-gray-5);
}

html[data-theme="dark"] #main.collapsiblesidebar:not(.collapsedsidebar) #sidebar-switch-button:hover svg {
  stroke: var(--oc-gray-3);
}

/* ---------- Responsive: mobile overlay behavior ---------- */

@media screen and (max-width: 899px) {
  /* On mobile, the sidebar is handled by the flyout menu, so hide toggle */
  #sidebar-switch-panel {
    display: none !important;
  }

  /* Collapsed sidebar should be fully hidden on mobile */
  #main.collapsedsidebar #sidebar {
    display: none;
  }
}

/* ========== unread_issues.css ========== */
/* Unread Issues Visual Indicators */

/* Unread issue row styling */
table.issues tr.unread > td {
  border-left: 3px solid #4a90d9;
  font-weight: 600;
}

table.issues tr.unread > td:first-child {
  border-left: 3px solid #4a90d9;
}

/* Blue dot indicator before issue ID */
table.issues tr.unread td.id {
  position: relative;
  padding-left: 18px;
}

table.issues tr.unread td.id::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #4a90d9;
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
}

/* Bold subject for unread issues */
table.issues tr.unread td.subject {
  font-weight: 700;
}

/* Fade animation when marking as read */
table.issues tr.marking-as-read > td {
  transition: all 0.4s ease-out;
  border-left-color: transparent;
  font-weight: normal;
}

table.issues tr.marking-as-read td.id::before {
  transition: opacity 0.4s ease-out;
  opacity: 0;
}

table.issues tr.marking-as-read td.subject {
  transition: font-weight 0.4s ease-out;
  font-weight: normal;
}

/* Unread count badge in project menu / navigation */
.unread-issues-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background-color: #4a90d9;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  margin-left: 4px;
  vertical-align: middle;
}

/* Unread issues toolbar (above issue list) */
.unread-issues-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Mark all as read button */
.mark-all-issues-read {
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #f5f5f5;
  font-size: 12px;
  line-height: 1.5;
}

.mark-all-issues-read:hover {
  background: #e8e8e8;
  border-color: #999;
}

.mark-all-issues-read:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Menu badge positioning */
.unread-issues-menu-badge {
  position: relative;
  top: -1px;
}

/* Dark mode support */
html[data-theme="dark"] table.issues tr.unread > td {
  border-left-color: #6ab0f3;
}

html[data-theme="dark"] table.issues tr.unread > td:first-child {
  border-left-color: #6ab0f3;
}

html[data-theme="dark"] table.issues tr.unread td.id::before {
  background-color: #6ab0f3;
}

html[data-theme="dark"] .unread-issues-badge {
  background-color: #6ab0f3;
  color: #1e1e1e;
}

html[data-theme="dark"] table.issues tr.marking-as-read > td {
  border-left-color: transparent;
}

html[data-theme="dark"] .mark-all-issues-read {
  background: #3a3a3a;
  border-color: #555;
  color: #ddd;
}

html[data-theme="dark"] .mark-all-issues-read:hover {
  background: #4a4a4a;
  border-color: #777;
}

/* ========== favorites.css ========== */
/* Favorites / Starred Items */

/* Star toggle button */
a.favorite-btn {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: #9E9E9E;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0 2px;
  vertical-align: middle;
  transition: color 0.15s ease, transform 0.15s ease;
}

a.favorite-btn:hover {
  color: #FFB300;
  transform: scale(1.2);
  text-decoration: none;
}

a.favorite-btn.favorited {
  color: #FFB300;
}

a.favorite-btn.favorited:hover {
  color: #FF8F00;
}

/* Star bounce animation */
@keyframes favorite-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

a.favorite-btn.favorite-animate {
  animation: favorite-bounce 0.4s ease;
}

/* Star column in issue and project lists */
td.favorite, th.favorite {
  width: 24px;
  text-align: center;
  padding: 2px 4px;
}

th.favorite {
  font-size: 16px;
}

/* Favorites index page */
.favorites-page .tabs-container {
  margin-bottom: 20px;
}

.favorites-page .tab-filters {
  display: inline-flex;
  gap: 0;
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 15px;
}

.favorites-page .tab-filters a {
  padding: 6px 16px;
  text-decoration: none;
  color: #555;
  background: #f8f8f8;
  border-right: 1px solid #d7d7d7;
  font-size: 0.9em;
}

.favorites-page .tab-filters a:last-child {
  border-right: none;
}

.favorites-page .tab-filters a.active {
  background: #628db6;
  color: #fff;
}

.favorites-page .tab-filters a:hover:not(.active) {
  background: #eee;
}

.favorites-page .favorites-section {
  margin-bottom: 25px;
}

.favorites-page .favorites-section h3 {
  border-bottom: 1px solid #e4e4e4;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.favorites-page table.favorites-list {
  width: 100%;
}

.favorites-page table.favorites-list td {
  padding: 5px 8px;
  border-bottom: 1px solid #f0f0f0;
}

.favorites-page table.favorites-list td.favorite-star {
  width: 24px;
  text-align: center;
}

.favorites-page table.favorites-list td.favorite-info {
  font-size: 0.85em;
  color: #888;
}

.favorites-page .no-favorites {
  color: #999;
  font-style: italic;
  padding: 10px 0;
}

/* Star in project overview */
.project-overview-star {
  margin-left: 8px;
  vertical-align: middle;
}

/* Star in issue show page - near reaction */
.issue-favorite {
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

/* Star in project jump menu */
.drdn-items .favorite-star-jump {
  color: #FFB300;
  margin-right: 4px;
  font-size: 14px;
}

/* My Page favorites block */
.mypage-box .favorites-block table {
  width: 100%;
}

.mypage-box .favorites-block td {
  padding: 4px 6px;
  border-bottom: 1px solid #f0f0f0;
}

.mypage-box .favorites-block td.star-col {
  width: 24px;
  text-align: center;
}

.mypage-box .favorites-block .issue-status {
  font-size: 0.85em;
}

.mypage-box .favorites-block .issue-info {
  font-size: 0.85em;
  color: #888;
}

/* Dark mode support */
html[data-theme="dark"] a.favorite-btn {
  color: #666;
}

html[data-theme="dark"] a.favorite-btn:hover {
  color: #FFB300;
}

html[data-theme="dark"] a.favorite-btn.favorited {
  color: #FFB300;
}

html[data-theme="dark"] a.favorite-btn.favorited:hover {
  color: #FFC107;
}

html[data-theme="dark"] .favorites-page .tab-filters {
  border-color: #555;
}

html[data-theme="dark"] .favorites-page .tab-filters a {
  background: #333;
  color: #ccc;
  border-right-color: #555;
}

html[data-theme="dark"] .favorites-page .tab-filters a.active {
  background: #4a7aaa;
  color: #fff;
}

html[data-theme="dark"] .favorites-page .tab-filters a:hover:not(.active) {
  background: #444;
}

html[data-theme="dark"] .favorites-page .favorites-section h3 {
  border-bottom-color: #555;
}

html[data-theme="dark"] .favorites-page table.favorites-list td {
  border-bottom-color: #444;
}

html[data-theme="dark"] .favorites-page .no-favorites {
  color: #777;
}

html[data-theme="dark"] .mypage-box .favorites-block td {
  border-bottom-color: #444;
}

html[data-theme="dark"] .mypage-box .favorites-block .issue-info {
  color: #999;
}

/* ========== announcements.css ========== */
/* Announcement Banners Styles */

.announcement-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-left: 4px solid;
  margin: 0;
  font-size: 0.9em;
  line-height: 1.4;
}

.announcement-banner + .announcement-banner {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.announcement-banner .banner-content {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.announcement-banner .banner-content strong {
  white-space: nowrap;
  flex-shrink: 0;
}

.announcement-banner .banner-message {
  word-break: break-word;
}

.announcement-banner .banner-dismiss {
  background: none;
  border: none;
  font-size: 1.4em;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 12px;
  line-height: 1;
  opacity: 0.7;
  flex-shrink: 0;
}

.announcement-banner .banner-dismiss:hover {
  opacity: 1;
}

/* Banner type: Info (blue) */
.banner-info {
  background-color: #E3F2FD;
  color: #1565C0;
  border-left-color: #1E88E5;
}

.banner-info .banner-dismiss {
  color: #1565C0;
}

/* Banner type: Warning (yellow/amber) */
.banner-warning {
  background-color: #FFF8E1;
  color: #E65100;
  border-left-color: #FF8F00;
}

.banner-warning .banner-dismiss {
  color: #E65100;
}

/* Banner type: Success (green) */
.banner-success {
  background-color: #E8F5E9;
  color: #2E7D32;
  border-left-color: #43A047;
}

.banner-success .banner-dismiss {
  color: #2E7D32;
}

/* Banner type: Danger (red) */
.banner-danger {
  background-color: #FFEBEE;
  color: #C62828;
  border-left-color: #E53935;
}

.banner-danger .banner-dismiss {
  color: #C62828;
}

/* Admin: Announcement type badges */
.announcement-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.85em;
  font-weight: bold;
  line-height: 1.4;
}

.announcement-type-badge.badge-info {
  background-color: #E3F2FD;
  color: #1565C0;
}

.announcement-type-badge.badge-warning {
  background-color: #FFF8E1;
  color: #E65100;
}

.announcement-type-badge.badge-success {
  background-color: #E8F5E9;
  color: #2E7D32;
}

.announcement-type-badge.badge-danger {
  background-color: #FFEBEE;
  color: #C62828;
}

/* Admin table: disabled rows */
table.announcements tr.disabled td {
  opacity: 0.5;
}

/* Announcement preview in form */
#announcement-preview {
  background: #f9f9f9;
  padding: 10px;
  border-radius: 4px;
}

#announcement-preview h3 {
  margin-top: 0;
  font-size: 0.95em;
  color: #666;
}

/* Dark mode support */
html[data-theme="dark"] .banner-info {
  background-color: #1a2a3a;
  color: #90CAF9;
  border-left-color: #42A5F5;
}

html[data-theme="dark"] .banner-info .banner-dismiss {
  color: #90CAF9;
}

html[data-theme="dark"] .banner-warning {
  background-color: #3a2a1a;
  color: #FFE082;
  border-left-color: #FFB300;
}

html[data-theme="dark"] .banner-warning .banner-dismiss {
  color: #FFE082;
}

html[data-theme="dark"] .banner-success {
  background-color: #1a2a1a;
  color: #A5D6A7;
  border-left-color: #66BB6A;
}

html[data-theme="dark"] .banner-success .banner-dismiss {
  color: #A5D6A7;
}

html[data-theme="dark"] .banner-danger {
  background-color: #3a1a1a;
  color: #EF9A9A;
  border-left-color: #EF5350;
}

html[data-theme="dark"] .banner-danger .banner-dismiss {
  color: #EF9A9A;
}

html[data-theme="dark"] .announcement-type-badge.badge-info {
  background-color: #1a2a3a;
  color: #90CAF9;
}

html[data-theme="dark"] .announcement-type-badge.badge-warning {
  background-color: #3a2a1a;
  color: #FFE082;
}

html[data-theme="dark"] .announcement-type-badge.badge-success {
  background-color: #1a2a1a;
  color: #A5D6A7;
}

html[data-theme="dark"] .announcement-type-badge.badge-danger {
  background-color: #3a1a1a;
  color: #EF9A9A;
}

html[data-theme="dark"] #announcement-preview {
  background: #2a2a2a;
}

html[data-theme="dark"] #announcement-preview h3 {
  color: #aaa;
}

html[data-theme="dark"] .announcement-banner + .announcement-banner {
  border-top-color: rgba(255, 255, 255, 0.05);
}

/* Responsive: wrap text on small screens */
@media screen and (max-width: 768px) {
  .announcement-banner .banner-content {
    flex-direction: column;
    gap: 2px;
  }

  .announcement-banner .banner-content strong {
    white-space: normal;
  }

  .announcement-banner {
    padding: 8px 12px;
    font-size: 0.85em;
  }
}

/* ========== realtime.css ========== */
/* Redmine - Real-time Updates Styles
 * Toast notifications, update banners, and kanban animations
 */

/* ---- Toast Container ---- */
.realtime-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-width: 400px;
  pointer-events: none;
}

/* ---- Toast Notification ---- */
.realtime-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-left: 4px solid #2196F3;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  max-width: 400px;
  word-wrap: break-word;
}

.realtime-toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.realtime-toast-hiding {
  opacity: 0;
  transform: translateX(100%);
}

/* Toast types */
.realtime-toast-issue_created {
  border-left-color: #4CAF50;
}

.realtime-toast-issue_updated {
  border-left-color: #2196F3;
}

.realtime-toast-issue_status_changed {
  border-left-color: #FF9800;
}

.realtime-toast-comment_added {
  border-left-color: #9C27B0;
}

.realtime-toast-content {
  flex: 1;
  min-width: 0;
}

.realtime-toast-message {
  font-size: 13px;
  color: #333;
  word-break: break-word;
}

.realtime-toast-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 0 0 8px;
  flex-shrink: 0;
}

.realtime-toast-close:hover {
  color: #333;
}

/* ---- Update Banner (Issue List Page) ---- */
.realtime-update-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: #e8f4fd;
  border: 1px solid #b3d8ef;
  border-radius: 4px;
  font-size: 13px;
  color: #1a5276;
  animation: realtime-banner-slide-in 0.3s ease;
}

.realtime-banner-text {
  flex: 1;
  font-weight: 600;
}

.realtime-banner-refresh {
  color: #1a5276;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

.realtime-banner-refresh:hover {
  color: #0d3b5e;
}

.realtime-banner-dismiss {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: #1a5276;
  cursor: pointer;
  padding: 0;
}

.realtime-banner-dismiss:hover {
  color: #0d3b5e;
}

@keyframes realtime-banner-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Journal Update Notice (Issue Show Page) ---- */
.realtime-journal-notice {
  padding: 10px 16px;
  margin: 12px 0;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  font-size: 13px;
  color: #856404;
  animation: realtime-banner-slide-in 0.3s ease;
}

.realtime-journal-notice-text {
  font-weight: 600;
}

.realtime-journal-notice-refresh {
  color: #856404;
  text-decoration: underline;
  margin-left: 8px;
}

.realtime-journal-notice-refresh:hover {
  color: #5a4303;
}

/* ---- Kanban Card Animations ---- */
.kanban-card-moving {
  opacity: 0.5;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.kanban-card-arrived {
  animation: kanban-card-highlight 2s ease;
}

@keyframes kanban-card-highlight {
  0% {
    background-color: #fff9c4;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
  }
  100% {
    background-color: inherit;
    box-shadow: none;
  }
}

/* ---- Kanban Flash Message ---- */
.kanban-flash {
  padding: 8px 16px;
  margin: 8px 0;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 4px;
  font-size: 13px;
  color: #2e7d32;
}

/* ---- Dark Mode Support ---- */
html[data-theme="dark"] .realtime-toast {
  background: #2d333b;
  border-color: #444c56;
  color: #cdd9e5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .realtime-toast-message {
  color: #cdd9e5;
}

html[data-theme="dark"] .realtime-toast-close {
  color: #768390;
}

html[data-theme="dark"] .realtime-toast-close:hover {
  color: #cdd9e5;
}

html[data-theme="dark"] .realtime-update-banner {
  background: #1c2a3a;
  border-color: #2d4a6a;
  color: #79b8e8;
}

html[data-theme="dark"] .realtime-banner-refresh {
  color: #79b8e8;
}

html[data-theme="dark"] .realtime-banner-refresh:hover {
  color: #a5d4f5;
}

html[data-theme="dark"] .realtime-banner-dismiss {
  color: #79b8e8;
}

html[data-theme="dark"] .realtime-journal-notice {
  background: #3a3000;
  border-color: #665500;
  color: #ffd54f;
}

html[data-theme="dark"] .realtime-journal-notice-text {
  color: #ffd54f;
}

html[data-theme="dark"] .realtime-journal-notice-refresh {
  color: #ffd54f;
}

html[data-theme="dark"] .realtime-journal-notice-refresh:hover {
  color: #ffe082;
}

html[data-theme="dark"] .kanban-flash {
  background: #1a2e1a;
  border-color: #2e5a2e;
  color: #81c784;
}

html[data-theme="dark"] .kanban-card-arrived {
  animation: kanban-card-highlight-dark 2s ease;
}

@keyframes kanban-card-highlight-dark {
  0% {
    background-color: #3a3500;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
  }
  100% {
    background-color: inherit;
    box-shadow: none;
  }
}

/* ========== tags.css ========== */
/* Issue Tags Styles */

/* Tag badge - pill/chip style */
.tag-badge {
  display: inline-block;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* Smaller badge for issue list */
table.list .tag-badge {
  padding: 1px 8px;
  font-size: 10px;
  line-height: 16px;
  border-radius: 10px;
}

/* Tags display on issue show page */
.issue-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Tags in issue list column */
.tag-badges-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
}

/* Removable badge in issue form */
.tag-badge-removable {
  cursor: default;
  position: relative;
  padding-right: 20px;
}

.tag-badge-removable .tag-remove {
  cursor: pointer;
  margin-left: 4px;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  opacity: 0.7;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
}

.tag-badge-removable .tag-remove:hover {
  opacity: 1;
}

/* Tag input container on issue form */
.issue-tags-input-container {
  margin-top: 8px;
}

.issue-tags-input-container p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.issue-tags-input-container label {
  min-width: 170px;
  text-align: right;
  padding-right: 5px;
}

.tag-badges-container {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

#issue_tag_input {
  width: 200px;
}

/* jQuery UI autocomplete menu for tags */
.ui-autocomplete .tag-badge {
  margin: 2px 0;
}

/* ---- Admin Tags Page ---- */

.tags-admin {
  max-width: 800px;
}

.tag-form-container {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.tag-form-container h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.tag-form-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Color picker grid (5x4) */
.color-picker-grid {
  display: inline-grid;
  grid-template-columns: repeat(10, 28px);
  gap: 6px;
  vertical-align: middle;
}

.color-circle {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  box-sizing: border-box;
  transition: border-color 0.15s, transform 0.15s;
}

.color-circle:hover {
  transform: scale(1.15);
  border-color: rgba(0,0,0,0.3);
}

.color-circle.selected {
  border-color: #333;
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

.tag-preview-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tags list table */
.tags-list .color-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 6px;
}

.tags-list .tag-count {
  text-align: center;
}

.tags-list code {
  font-size: 11px;
  color: #666;
}

/* ---- Dark Mode ---- */

html[data-theme="dark"] .tag-form-container {
  background: #2a2a2a;
  border-color: #444;
}

html[data-theme="dark"] .color-circle.selected {
  border-color: #ccc;
  box-shadow: 0 0 0 2px #333, 0 0 0 4px #ccc;
}

html[data-theme="dark"] .color-circle:hover {
  border-color: rgba(255,255,255,0.4);
}

html[data-theme="dark"] .tags-list code {
  color: #aaa;
}

/* ========== checklists.css ========== */
/* Redmine Issue Checklists */

/* Section container */
.checklist-section {
  margin: 12px 0;
}

.checklist-section h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.checklist-count {
  font-weight: normal;
  color: #888;
  font-size: 12px;
}

/* Progress bar */
.checklist-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.checklist-progress-bar {
  flex: 1;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  max-width: 400px;
}

.checklist-progress-fill {
  height: 100%;
  background-color: #4caf50;
  border-radius: 4px;
  transition: width 0.3s ease;
  min-width: 0;
}

.checklist-progress-text {
  font-size: 12px;
  color: #666;
  min-width: 36px;
  text-align: right;
}

/* Checklist items list */
.checklist-items {
  list-style: none;
  padding: 0;
  margin: 0 0 6px 0;
}

.checklist-item {
  display: flex;
  align-items: center;
  padding: 5px 4px;
  border-radius: 3px;
  gap: 6px;
  min-height: 30px;
  border-bottom: 1px solid transparent;
}

.checklist-item:hover {
  background-color: #f5f5f5;
}

/* Drag handle */
.checklist-drag-handle {
  cursor: grab;
  color: #bbb;
  font-size: 14px;
  padding: 0 2px;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}

.checklist-drag-handle:hover {
  color: #888;
}

.checklist-drag-handle:active {
  cursor: grabbing;
}

/* Sortable placeholder */
.checklist-sort-placeholder {
  height: 30px;
  background-color: #e8f0fe;
  border: 1px dashed #90caf9;
  border-radius: 3px;
  list-style: none;
  margin: 2px 0;
}

/* Checkbox */
.checklist-checkbox-label {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.checklist-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #4caf50;
}

/* Subject text */
.checklist-item-subject {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  cursor: text;
  padding: 1px 4px;
  border-radius: 2px;
  word-break: break-word;
}

.checklist-items.checklist-sortable .checklist-item-subject:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

/* Done item styling */
.checklist-item-done .checklist-item-subject,
.checklist-item-subject-done {
  text-decoration: line-through;
  color: #999;
}

.checklist-item-done {
  opacity: 0.7;
}

/* Inline edit input */
.checklist-inline-edit {
  flex: 1;
  font-size: 13px;
  padding: 2px 4px;
  border: 1px solid #4ea1d3;
  border-radius: 2px;
  outline: none;
  box-shadow: 0 0 0 2px rgba(78, 161, 211, 0.2);
}

/* Assignee avatar */
.checklist-item-assignee {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.checklist-item-assignee img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  vertical-align: middle;
}

/* Due date */
.checklist-item-due-date {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

.checklist-item-overdue {
  color: #c0392b;
  font-weight: bold;
}

/* Delete button */
.checklist-item-delete {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 12px;
}

.checklist-item:hover .checklist-item-delete {
  opacity: 0.6;
}

.checklist-item-delete:hover {
  opacity: 1 !important;
}

/* Add item input */
.checklist-add-form {
  margin-top: 4px;
  padding-left: 24px;
}

.checklist-new-item-input {
  width: 100%;
  max-width: 500px;
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid #d7d7d7;
  border-radius: 3px;
  outline: none;
  background: transparent;
}

.checklist-new-item-input:focus {
  border-color: #4ea1d3;
  box-shadow: 0 0 0 2px rgba(78, 161, 211, 0.2);
}

.checklist-new-item-input::placeholder {
  color: #aaa;
  font-style: italic;
}

/* ==================== Dark mode ==================== */
html[data-theme="dark"] .checklist-item:hover {
  background-color: #2a2a2a;
}

html[data-theme="dark"] .checklist-progress-bar {
  background-color: #3a3a3a;
}

html[data-theme="dark"] .checklist-progress-text {
  color: #aaa;
}

html[data-theme="dark"] .checklist-count {
  color: #aaa;
}

html[data-theme="dark"] .checklist-drag-handle {
  color: #555;
}

html[data-theme="dark"] .checklist-drag-handle:hover {
  color: #999;
}

html[data-theme="dark"] .checklist-sort-placeholder {
  background-color: #1e3a5f;
  border-color: #2a6496;
}

html[data-theme="dark"] .checklist-item-done .checklist-item-subject,
html[data-theme="dark"] .checklist-item-subject-done {
  color: #666;
}

html[data-theme="dark"] .checklist-items.checklist-sortable .checklist-item-subject:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .checklist-inline-edit {
  background-color: #2a2a2a;
  border-color: #4ea1d3;
  color: #ddd;
}

html[data-theme="dark"] .checklist-item-due-date {
  color: #999;
}

html[data-theme="dark"] .checklist-item-overdue {
  color: #e74c3c;
}

html[data-theme="dark"] .checklist-new-item-input {
  border-color: #444;
  color: #ddd;
  background-color: transparent;
}

html[data-theme="dark"] .checklist-new-item-input:focus {
  border-color: #4ea1d3;
}

html[data-theme="dark"] .checklist-new-item-input::placeholder {
  color: #666;
}

/* ==================== Print ==================== */
@media print {
  .checklist-drag-handle,
  .checklist-item-delete,
  .checklist-add-form {
    display: none !important;
  }

  .checklist-item {
    opacity: 1 !important;
    padding: 2px 0;
  }

  .checklist-item-done .checklist-item-subject,
  .checklist-item-subject-done {
    text-decoration: line-through;
    color: #666;
  }

  .checklist-progress-bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .checklist-progress-fill {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ========== reactions.css ========== */
/* ============================================
   Emoji Reactions - Enhanced Reaction System
   ============================================ */

/* --- Reactions Wrapper --- */
.emoji-reactions-wrapper {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

/* Ensure old .reaction div containers play nicely */
div.issue.details .reaction,
div.message .reaction,
div.news .reaction,
div.wiki-page .reaction {
  float: inline-end;
  font-size: 0.9em;
  margin-block-start: 0.5em;
  margin-inline-start: 10px;
  clear: inline-end;
}

.journals .journal-actions .emoji-reactions-wrapper {
  display: inline-flex;
}

/* --- Emoji Reaction Pills --- */
.emoji-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  color: #57606a;
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.emoji-reaction-pill:hover {
  text-decoration: none;
  background: #eaeef2;
  border-color: #bbc0c5;
  transform: scale(1.05);
}

.emoji-reaction-pill:active {
  transform: scale(0.95);
  text-decoration: none;
}

.emoji-reaction-pill.reacted {
  background: #ddf4ff;
  border-color: #54aeff;
  color: #0969da;
  font-weight: 600;
}

.emoji-reaction-pill.reacted:hover {
  background: #b6e3ff;
  border-color: #218bff;
}

.emoji-reaction-pill.readonly {
  cursor: default;
  opacity: 0.8;
}

.emoji-reaction-pill.readonly:hover {
  transform: none;
  background: #f6f8fa;
  border-color: #d0d7de;
}

/* --- Add Reaction Button --- */
.emoji-add-reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  border: 1px dashed #d0d7de;
  background: transparent;
  color: #8b949e;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.emoji-add-reaction-btn:hover {
  background: #f6f8fa;
  border-color: #bbc0c5;
  color: #57606a;
  border-style: solid;
  transform: scale(1.05);
}

.emoji-add-reaction-btn:active {
  transform: scale(0.95);
}

.emoji-add-reaction-btn .emoji-picker-icon {
  font-size: 14px;
  line-height: 1;
}

.emoji-add-reaction-btn .emoji-picker-plus {
  font-size: 12px;
  font-weight: bold;
  opacity: 0.7;
}

/* --- Emoji Picker Popup --- */
.emoji-picker-popup {
  position: absolute;
  z-index: 10000;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 8px;
  min-width: 240px;
  max-width: 320px;
  opacity: 0;
  transform: scale(0.9) translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.emoji-picker-popup.emoji-picker-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.emoji-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px;
  border-bottom: 1px solid #eaeef2;
  margin-bottom: 6px;
}

.emoji-picker-title {
  font-size: 12px;
  font-weight: 600;
  color: #57606a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emoji-picker-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #8b949e;
  padding: 0 2px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.emoji-picker-close:hover {
  background: #f6f8fa;
  color: #57606a;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}

.emoji-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.emoji-picker-item:hover {
  background: #f3f4f6;
  transform: scale(1.2);
}

.emoji-picker-item:active {
  transform: scale(0.9);
}

.emoji-picker-item .emoji-char {
  font-size: 22px;
  line-height: 1;
}

.emoji-picker-item.already-reacted {
  background: #ddf4ff;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px #54aeff;
}

.emoji-picker-item.already-reacted:hover {
  background: #b6e3ff;
}

/* --- Animations --- */
@keyframes emojiBounce {
  0% { transform: scale(1); }
  25% { transform: scale(1.25); }
  50% { transform: scale(0.9); }
  75% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.emoji-bounce {
  animation: emojiBounce 0.5s ease;
}

@keyframes emojiPillAppear {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.emoji-pill-new {
  animation: emojiPillAppear 0.4s ease;
}

@keyframes emojiPillRemove {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

.emoji-pill-removing {
  animation: emojiPillRemove 0.3s ease forwards;
}

/* --- Tooltip enhancement for reaction pills --- */
.emoji-reaction-pill[title] {
  position: relative;
}

/* --- Dark mode support --- */
[data-theme="dark"] .emoji-reaction-pill {
  background: #21262d;
  border-color: #30363d;
  color: #c9d1d9;
}

[data-theme="dark"] .emoji-reaction-pill:hover {
  background: #30363d;
  border-color: #484f58;
}

[data-theme="dark"] .emoji-reaction-pill.reacted {
  background: #0d1d30;
  border-color: #1f6feb;
  color: #58a6ff;
}

[data-theme="dark"] .emoji-reaction-pill.reacted:hover {
  background: #1a2f4e;
  border-color: #388bfd;
}

[data-theme="dark"] .emoji-reaction-pill.readonly {
  opacity: 0.6;
}

[data-theme="dark"] .emoji-reaction-pill.readonly:hover {
  background: #21262d;
  border-color: #30363d;
}

[data-theme="dark"] .emoji-add-reaction-btn {
  border-color: #30363d;
  color: #8b949e;
}

[data-theme="dark"] .emoji-add-reaction-btn:hover {
  background: #21262d;
  border-color: #484f58;
  color: #c9d1d9;
}

[data-theme="dark"] .emoji-picker-popup {
  background: #161b22;
  border-color: #30363d;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .emoji-picker-header {
  border-bottom-color: #21262d;
}

[data-theme="dark"] .emoji-picker-title {
  color: #8b949e;
}

[data-theme="dark"] .emoji-picker-close {
  color: #8b949e;
}

[data-theme="dark"] .emoji-picker-close:hover {
  background: #21262d;
  color: #c9d1d9;
}

[data-theme="dark"] .emoji-picker-item:hover {
  background: #21262d;
}

[data-theme="dark"] .emoji-picker-item.already-reacted {
  background: #0d1d30;
  box-shadow: inset 0 0 0 2px #1f6feb;
}

[data-theme="dark"] .emoji-picker-item.already-reacted:hover {
  background: #1a2f4e;
}

/* --- Responsive adjustments --- */
@media screen and (max-width: 899px) {
  .emoji-picker-popup {
    min-width: 200px;
  }

  .emoji-picker-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .emoji-picker-item {
    width: 36px;
    height: 36px;
  }

  .emoji-picker-item .emoji-char {
    font-size: 18px;
  }
}

/* --- Override old reaction button wrapper for backward compat --- */
.reaction-button-wrapper .reaction-button {
  display: none;
}

/* ========== dependency_graph.css ========== */
/* ── Dependency Graph ─────────────────────────────────────────── */

#dependency-graph-container {
  position: relative;
}

/* ── Toolbar ─────────────────────────────────────────────────── */

#dg-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 0;
}

.dg-filters-form fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dg-filters-form fieldset legend {
  font-weight: bold;
  font-size: 11px;
  padding: 0 4px;
  color: #666;
}

.dg-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dg-filter-group label {
  font-size: 11px;
  color: #555;
  white-space: nowrap;
}

.dg-filter-group select {
  font-size: 11px;
  padding: 2px 4px;
  max-width: 150px;
}

.dg-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.dg-actions .btn-small,
.dg-filter-group .btn-small {
  padding: 3px 8px;
  font-size: 11px;
}

/* ── Main Area ───────────────────────────────────────────────── */

#dg-main-area {
  display: flex;
  gap: 10px;
  position: relative;
}

#dg-svg-wrapper {
  flex: 1;
  position: relative;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
  overflow: hidden;
}

#dg-svg {
  width: 100%;
  min-height: 600px;
  height: 70vh;
  display: block;
  cursor: grab;
}

#dg-svg:active {
  cursor: grabbing;
}

/* ── Tooltip ─────────────────────────────────────────────────── */

.dg-tooltip {
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 100;
  pointer-events: none;
  max-width: 300px;
}

.dg-tooltip strong {
  color: #333;
}

.dg-tt-label {
  font-weight: 600;
  color: #666;
}

/* ── Graph Elements ──────────────────────────────────────────── */

.dg-node {
  transition: opacity 0.2s;
}

.dg-node:hover circle:first-child {
  stroke-width: 4;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.2));
}

.dg-node-id {
  pointer-events: none;
  user-select: none;
}

.dg-node-subject {
  pointer-events: none;
  user-select: none;
}

.dg-edge {
  transition: opacity 0.2s;
}

.dg-edge-label {
  pointer-events: none;
  user-select: none;
  font-style: italic;
}

/* ── Legend ───────────────────────────────────────────────────── */

.dg-legend {
  flex-shrink: 0;
  width: 180px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  background: #fefefe;
  font-size: 11px;
  max-height: 70vh;
  overflow-y: auto;
}

.dg-legend h4 {
  margin: 0 0 8px;
  font-size: 12px;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

.dg-legend-section {
  margin-bottom: 10px;
}

.dg-legend-section h5 {
  margin: 0 0 4px;
  font-size: 11px;
  color: #666;
}

.dg-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.dg-legend-item svg {
  flex-shrink: 0;
}

.dg-legend-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Minimap ─────────────────────────────────────────────────── */

#dg-minimap {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 150px;
  height: 100px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: rgba(255,255,255,0.9);
  overflow: hidden;
  z-index: 10;
}

#dg-minimap-svg {
  width: 150px;
  height: 100px;
}

/* ── Loading / Empty ─────────────────────────────────────────── */

.dg-loading {
  text-align: center;
  padding: 40px;
  color: #888;
  font-size: 14px;
}

.dg-empty {
  text-align: center;
  padding: 40px;
  color: #999;
}

.dg-empty p {
  font-size: 14px;
  margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media screen and (max-width: 900px) {
  #dg-main-area {
    flex-direction: column;
  }

  .dg-legend {
    width: auto;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .dg-legend-section {
    margin-bottom: 0;
  }

  #dg-svg {
    min-height: 400px;
    height: 50vh;
  }

  .dg-filters-form fieldset {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Dark Mode ───────────────────────────────────────────────── */

html[data-theme="dark"] #dg-svg-wrapper {
  background: #1e1e1e;
  border-color: #444;
}

html[data-theme="dark"] .dg-tooltip {
  background: #2d2d2d;
  border-color: #555;
  color: #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

html[data-theme="dark"] .dg-tooltip strong {
  color: #eee;
}

html[data-theme="dark"] .dg-tt-label {
  color: #aaa;
}

html[data-theme="dark"] .dg-legend {
  background: #2d2d2d;
  border-color: #444;
  color: #ccc;
}

html[data-theme="dark"] .dg-legend h4 {
  border-bottom-color: #444;
  color: #ddd;
}

html[data-theme="dark"] .dg-legend-section h5 {
  color: #999;
}

html[data-theme="dark"] .dg-filters-form fieldset {
  border-color: #444;
}

html[data-theme="dark"] .dg-filters-form fieldset legend {
  color: #999;
}

html[data-theme="dark"] .dg-filter-group label {
  color: #aaa;
}

html[data-theme="dark"] .dg-node-id {
  fill: #ddd;
}

html[data-theme="dark"] .dg-node-subject {
  fill: #aaa;
}

html[data-theme="dark"] .dg-edge-label {
  opacity: 0.8;
}

html[data-theme="dark"] #dg-minimap {
  background: rgba(40,40,40,0.9);
  border-color: #555;
}

html[data-theme="dark"] .dg-empty {
  color: #777;
}

html[data-theme="dark"] .dg-loading {
  color: #777;
}

/* CSS custom properties for minimap, overridden in dark mode */
:root {
  --dg-minimap-bg: #f8f8f8;
  --dg-minimap-border: #ccc;
}

html[data-theme="dark"] {
  --dg-minimap-bg: #2a2a2a;
  --dg-minimap-border: #555;
}

/* ── Print ───────────────────────────────────────────────────── */

@media print {
  #dg-toolbar,
  #dg-minimap,
  .dg-actions,
  .dg-filters-form {
    display: none !important;
  }

  #dg-svg-wrapper {
    border: none;
    overflow: visible;
  }

  #dg-svg {
    height: auto;
    min-height: 400px;
  }

  .dg-legend {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .dg-tooltip {
    display: none !important;
  }
}

/* ========== automation_rules.css ========== */
/**
 * Automation Rules styles
 */

/* Condition and Action rows */
.condition-row,
.action-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: var(--oc-gray-0, #f8f9fa);
  border: 1px solid var(--oc-gray-3, #dee2e6);
  border-radius: 4px;
}

.condition-row select,
.action-row select {
  min-width: 140px;
}

.condition-field,
.action-type {
  min-width: 160px !important;
}

.condition-operator {
  min-width: 130px !important;
}

.condition-value-wrapper,
.action-value-wrapper {
  flex: 1;
}

.condition-value-wrapper select,
.action-value-wrapper select,
.condition-value-wrapper input,
.action-value-wrapper input {
  width: 100%;
  box-sizing: border-box;
}

.action-value-wrapper textarea {
  width: 100%;
  box-sizing: border-box;
}

.remove-condition,
.remove-action {
  flex-shrink: 0;
  padding: 4px;
  color: var(--oc-red-7, #c92a2a);
  opacity: 0.7;
}

.remove-condition:hover,
.remove-action:hover {
  opacity: 1;
}

/* Fieldset styles */
#automation-conditions,
#automation-actions {
  margin-top: 12px;
}

#automation-conditions legend,
#automation-actions legend {
  font-weight: bold;
  font-size: 1em;
}

#automation-conditions .small,
#automation-actions .small {
  color: var(--oc-gray-6, #868e96);
  margin-top: 0;
  margin-bottom: 10px;
}

/* Rules list table */
.automation-rules-list tr.disabled td {
  opacity: 0.5;
}

.automation-rules-list tr.disabled td.buttons {
  opacity: 1;
}

.automation-rules-list td.center {
  text-align: center;
}

/* Add links */
#add-condition,
#add-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ========== approval_chains.css ========== */
/* ================================
   Approval Chains - Project Settings
   ================================ */

.approval-chains-list .center {
  text-align: center;
}

/* ================================
   Step Builder (Chain Form)
   ================================ */

#approval-steps-table {
  margin-bottom: 10px;
}

#approval-steps-table .step-number-col {
  width: 40px;
  text-align: center;
}

#approval-steps-table .step-name-input {
  width: 100%;
}

.approval-step-row td {
  vertical-align: middle;
}

.approver-type-select {
  width: 100%;
}

.approver-role-select {
  width: 100%;
}

.approver-autocomplete {
  width: 100%;
}

.approver-name-display {
  font-weight: bold;
}

.approver-name-display .clear-approver {
  color: #c00;
  text-decoration: none;
  margin-left: 5px;
  font-size: 16px;
  font-weight: normal;
}

.approver-name-display .clear-approver:hover {
  color: #900;
}

#add-approval-step {
  cursor: pointer;
}

/* ================================
   Approval Status on Issue Page
   ================================ */

.approval-workflows-section {
  margin: 15px 0;
}

.approval-workflows-section h3 {
  margin-bottom: 10px;
}

.approval-chain-status {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
  background: #fafbfc;
}

.approval-chain-status h4 {
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.approval-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.approval-badge-pending {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
}

.approval-badge-approved {
  background: #d4edda;
  color: #155724;
  border: 1px solid #28a745;
}

.approval-badge-rejected {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #dc3545;
}

/* Step Progress Indicator */
.approval-steps-progress {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 15px 0;
  padding: 0 10px;
  overflow-x: auto;
}

.approval-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  flex: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  margin: 0 auto;
  transition: all 0.2s ease;
}

.step-circle-approved {
  background: #28a745;
  color: #fff;
  border: 2px solid #218838;
}

.step-circle-rejected {
  background: #dc3545;
  color: #fff;
  border: 2px solid #c82333;
}

.step-circle-current {
  background: #fff;
  color: #007bff;
  border: 3px solid #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
  animation: pulse-approval 2s infinite;
}

.step-circle-waiting {
  background: #fff;
  color: #999;
  border: 2px solid #ddd;
}

.step-icon {
  font-size: 16px;
  line-height: 1;
}

.step-number-indicator {
  font-size: 14px;
  font-weight: bold;
}

@keyframes pulse-approval {
  0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(0, 123, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

/* Connector lines between steps (using ::after pseudo-element) */
.approval-step-item {
  position: relative;
}

.approval-step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  right: -50%;
  height: 3px;
  z-index: 0;
  background: #ddd;
}

.approval-step-item.step-approved:not(:last-child)::after {
  background: #28a745;
}

/* Step Labels */
.step-label {
  text-align: center;
  margin-top: 8px;
  max-width: 120px;
}

.step-name {
  font-weight: bold;
  font-size: 12px;
  color: #333;
  line-height: 1.3;
}

.step-approver {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

.step-decision-info {
  font-size: 10px;
  color: #888;
  margin-top: 4px;
}

.step-decision-by {
  display: block;
}

.step-decision-time {
  display: block;
}

.step-decision-comments {
  font-style: italic;
  color: #555;
  margin-top: 3px;
  font-size: 11px;
}

/* Approve/Reject Buttons */
.approval-actions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.approval-comments-field {
  margin-bottom: 10px;
}

.approval-comments-field label {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 12px;
}

.approval-comment-input {
  width: 100%;
  max-width: 600px;
  padding: 6px 8px;
  border: 1px solid #d7d7d7;
  border-radius: 3px;
  font-size: 13px;
}

.approval-buttons {
  display: flex;
  gap: 10px;
}

.btn-approve,
.btn-reject {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  border: none;
  transition: all 0.15s ease;
}

.btn-approve {
  background: #28a745;
  color: #fff;
  border: 1px solid #218838;
}

.btn-approve:hover {
  background: #218838;
  color: #fff;
  text-decoration: none;
}

.btn-approve.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-reject {
  background: #dc3545;
  color: #fff;
  border: 1px solid #c82333;
}

.btn-reject:hover {
  background: #c82333;
  color: #fff;
  text-decoration: none;
}

.btn-reject.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Waiting message */
.approval-waiting-message {
  margin-top: 10px;
  padding: 8px 12px;
  background: #e2e3e5;
  border-radius: 4px;
  color: #383d41;
  font-size: 12px;
}

.approval-pending-text {
  margin: 0;
}

/* Request Approval Section */
.approval-request-section {
  margin-top: 10px;
  padding: 10px 15px;
  background: #f0f4f8;
  border: 1px dashed #adb5bd;
  border-radius: 4px;
}

.approval-request-section .inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.approval-request-section label {
  font-weight: bold;
  white-space: nowrap;
}

.approval-request-section select {
  min-width: 200px;
}

.approval-request-section .btn {
  padding: 4px 12px;
  background: #007bff;
  color: #fff;
  border: 1px solid #0069d9;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.approval-request-section .btn:hover {
  background: #0069d9;
}

/* ================================
   Approval Chain Status Borders
   ================================ */

.approval-chain-status.approval-approved {
  border-color: #28a745;
  background: #f6fef7;
}

.approval-chain-status.approval-rejected {
  border-color: #dc3545;
  background: #fef6f6;
}

.approval-chain-status.approval-pending {
  border-color: #ffc107;
  background: #fffef6;
}

/* ================================
   Dark Mode Support
   ================================ */

html[data-theme="dark"] .approval-chain-status {
  background: #1e1e1e;
  border-color: #444;
}

html[data-theme="dark"] .approval-chain-status.approval-approved {
  border-color: #28a745;
  background: #1a2e1a;
}

html[data-theme="dark"] .approval-chain-status.approval-rejected {
  border-color: #dc3545;
  background: #2e1a1a;
}

html[data-theme="dark"] .approval-chain-status.approval-pending {
  border-color: #ffc107;
  background: #2e2a1a;
}

html[data-theme="dark"] .step-name {
  color: #ddd;
}

html[data-theme="dark"] .step-approver {
  color: #aaa;
}

html[data-theme="dark"] .step-circle-current {
  background: #1e1e1e;
}

html[data-theme="dark"] .step-circle-waiting {
  background: #2a2a2a;
  color: #777;
  border-color: #555;
}

html[data-theme="dark"] .approval-waiting-message {
  background: #333;
  color: #ccc;
}

html[data-theme="dark"] .approval-request-section {
  background: #2a2a2a;
  border-color: #555;
}

html[data-theme="dark"] .approval-comment-input {
  background: #2a2a2a;
  color: #ddd;
  border-color: #555;
}

html[data-theme="dark"] .approval-step-item:not(:last-child)::after {
  background: #555;
}

html[data-theme="dark"] .approval-step-item.step-approved:not(:last-child)::after {
  background: #28a745;
}

/* ========== timer.css ========== */
/**
 * Redmine - Start/Stop Time Tracking Timer
 * Styles for the persistent timer bar and start buttons.
 */

/* ===== Timer Bar (fixed at bottom) ===== */

#timer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: var(--oc-gray-9);
  color: var(--oc-gray-1);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
  font-size: 0.8125rem;
  animation: timer-slide-up 0.3s ease-out;
}

#timer-bar.timer-bar-hiding {
  animation: timer-slide-down 0.3s ease-in forwards;
}

@keyframes timer-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes timer-slide-down {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}

.timer-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  max-width: 100%;
  flex-wrap: wrap;
}

/* ── Info section (issue + clock) ── */

.timer-bar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.timer-bar-issue-link {
  color: var(--oc-blue-3);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.timer-bar-issue-link:hover {
  color: var(--oc-blue-2);
  text-decoration: underline;
}

.timer-bar-clock {
  font-family: "SF Mono", "Consolas", "Liberation Mono", monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--oc-green-4);
  letter-spacing: 0.5px;
  min-width: 75px;
}

/* ── Action buttons ── */

.timer-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--oc-gray-6);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8125rem;
  cursor: pointer;
  background: var(--oc-gray-8);
  color: var(--oc-gray-1);
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.timer-btn:hover {
  background: var(--oc-gray-7);
  border-color: var(--oc-gray-5);
}

.timer-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.timer-btn-pause {
  font-size: 0.7rem;
  padding: 4px 8px;
}

.timer-btn-stop {
  color: var(--oc-red-4);
  font-size: 1rem;
  padding: 2px 8px;
}

.timer-btn-stop:hover {
  background: var(--oc-red-9);
  border-color: var(--oc-red-6);
}

.timer-btn-discard {
  font-size: 1rem;
  padding: 2px 8px;
  color: var(--oc-gray-5);
}

.timer-btn-discard:hover {
  color: var(--oc-red-4);
  background: var(--oc-gray-8);
}

/* ── Log form (shown after Stop) ── */

.timer-bar-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timer-activity-select {
  background: var(--oc-gray-8);
  color: var(--oc-gray-1);
  border: 1px solid var(--oc-gray-6);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8125rem;
  max-width: 180px;
}

.timer-activity-select:focus {
  border-color: var(--oc-blue-5);
  outline: none;
}

.timer-comments-input {
  background: var(--oc-gray-8);
  color: var(--oc-gray-1);
  border: 1px solid var(--oc-gray-6);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8125rem;
  width: 200px;
  max-width: 300px;
}

.timer-comments-input:focus {
  border-color: var(--oc-blue-5);
  outline: none;
}

.timer-comments-input::placeholder {
  color: var(--oc-gray-5);
}

.timer-bar-hours {
  font-family: "SF Mono", "Consolas", "Liberation Mono", monospace;
  font-weight: 600;
  color: var(--oc-green-4);
  font-size: 0.8125rem;
}

.timer-btn-submit {
  background: var(--oc-green-8);
  border-color: var(--oc-green-6);
  color: var(--oc-white);
}

.timer-btn-submit:hover {
  background: var(--oc-green-7);
  border-color: var(--oc-green-5);
}

.timer-btn-cancel {
  color: var(--oc-gray-4);
  border-color: var(--oc-gray-7);
}

/* ── Message ── */

.timer-bar-message {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.8125rem;
}

.timer-msg-success {
  color: var(--oc-green-3);
}

.timer-msg-error {
  color: var(--oc-red-4);
}

/* ===== Start Timer Button on Issue Pages ===== */

.timer-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.timer-start-btn .timer-btn-icon {
  font-size: 0.7rem;
}

.timer-start-btn.timer-running {
  color: var(--oc-green-7);
}

/* ===== Dark Mode Adjustments ===== */

[data-theme="dark"] #timer-bar {
  background: #1a1b1e;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .timer-bar-issue-link {
  color: var(--oc-blue-4);
}

[data-theme="dark"] .timer-activity-select,
[data-theme="dark"] .timer-comments-input {
  background: var(--oc-gray-8);
  border-color: var(--oc-gray-6);
}

/* ===== Responsive ===== */

@media screen and (max-width: 899px) {
  .timer-bar-inner {
    padding: 6px 10px;
    gap: 8px;
  }

  .timer-bar-issue-link {
    max-width: 200px;
    font-size: 0.75rem;
  }

  .timer-comments-input {
    width: 140px;
  }
}

/* ========== sprint.css ========== */
/**
 * Redmine - project management software
 * Sprint View Styles
 */

/* ===== Sprint Header ===== */
.sprint-header {
  margin: 12px 0 20px;
  padding: 12px 16px;
  background: var(--oc-blue-0, #e7f5ff);
  border: 1px solid var(--oc-blue-2, #a5d8ff);
  border-radius: 6px;
}

.sprint-date-range {
  font-size: 0.95em;
}

.sprint-days-info {
  color: var(--oc-gray-6, #868e96);
  font-size: 0.85em;
  margin-left: 8px;
}

/* ===== Stats Cards Row ===== */
.sprint-stats-row {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.sprint-stat-card {
  flex: 1;
  min-width: 120px;
  padding: 14px 16px;
  background: var(--oc-gray-0, #f8f9fa);
  border: 1px solid var(--oc-gray-3, #dee2e6);
  border-radius: 6px;
  text-align: center;
}

.sprint-stat-value {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--oc-blue-7, #1c7ed6);
  line-height: 1.2;
}

.sprint-stat-label {
  font-size: 0.78em;
  color: var(--oc-gray-6, #868e96);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Burndown Chart ===== */
.sprint-burndown-section {
  margin: 28px 0;
}

.sprint-burndown-section h3 {
  margin-bottom: 12px;
}

.sprint-burndown-container {
  position: relative;
  height: 380px;
  padding: 12px;
  background: var(--oc-white, #ffffff);
  border: 1px solid var(--oc-gray-3, #dee2e6);
  border-radius: 6px;
}

/* ===== Backlog Section ===== */
.sprint-backlog-section {
  margin: 28px 0;
}

.sprint-backlog-section h3 {
  margin-bottom: 12px;
}

.sprint-backlog-table th {
  white-space: nowrap;
}

.sprint-backlog-table td.done_ratio {
  min-width: 100px;
}

.sprint-backlog-table td.numeric {
  text-align: right;
}

.sprint-backlog-table th.numeric {
  text-align: right;
}

.sprint-backlog-table td.estimated_hours {
  font-variant-numeric: tabular-nums;
}

/* ===== Sidebar Stats ===== */
.sprint-sidebar-stats {
  width: 100%;
  font-size: 0.9em;
}

.sprint-sidebar-stats th {
  text-align: left;
  padding: 3px 8px 3px 0;
  font-weight: 600;
  color: var(--oc-gray-7, #495057);
  white-space: nowrap;
}

.sprint-sidebar-stats td {
  text-align: right;
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}

/* ===== Progress Bar Override ===== */
.sprint-stats-row + table.progress {
  margin: 0 0 20px;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .sprint-header {
  background: rgba(34, 139, 230, 0.1);
  border-color: rgba(34, 139, 230, 0.3);
}

[data-theme="dark"] .sprint-stat-card {
  background: var(--oc-gray-8, #343a40);
  border-color: var(--oc-gray-7, #495057);
}

[data-theme="dark"] .sprint-stat-value {
  color: var(--oc-blue-4, #4dabf7);
}

[data-theme="dark"] .sprint-stat-label {
  color: var(--oc-gray-5, #adb5bd);
}

[data-theme="dark"] .sprint-burndown-container {
  background: var(--oc-gray-8, #343a40);
  border-color: var(--oc-gray-7, #495057);
}

[data-theme="dark"] .sprint-sidebar-stats th {
  color: var(--oc-gray-3, #dee2e6);
}

[data-theme="dark"] .sprint-days-info {
  color: var(--oc-gray-5, #adb5bd);
}

/* ===== Responsive ===== */
@media screen and (max-width: 899px) {
  .sprint-stats-row {
    flex-wrap: wrap;
  }

  .sprint-stat-card {
    min-width: 100px;
    flex: 1 1 calc(33% - 12px);
  }

  .sprint-burndown-container {
    height: 280px;
  }
}

@media screen and (max-width: 599px) {
  .sprint-stat-card {
    flex: 1 1 calc(50% - 12px);
  }

  .sprint-burndown-container {
    height: 220px;
  }
}

/* ========== timesheets.css ========== */
/* Timesheets - Weekly Timesheet Grid Styles */

.timesheets-container {
  padding: 0;
}

/* Week Navigation */
.timesheet-week-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.week-nav-prev,
.week-nav-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  text-decoration: none;
  font-size: 14px;
  color: #505050;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  background: #fff;
}

.week-nav-prev:hover,
.week-nav-next:hover {
  background: #e8e8e8;
  text-decoration: none;
}

.week-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.btn-this-week {
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  background: #fff;
  color: #505050;
  text-decoration: none;
}

.btn-this-week:hover {
  background: #e8e8e8;
  text-decoration: none;
}

/* Status Badge */
.timesheet-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timesheet-status-badge.status-draft {
  background: #f5f5f5;
  color: #757575;
  border: 1px solid #e0e0e0;
}

.timesheet-status-badge.status-submitted {
  background: #fff8e1;
  color: #f57f17;
  border: 1px solid #ffcc02;
}

.timesheet-status-badge.status-approved {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #81c784;
}

.timesheet-status-badge.status-rejected {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* Grid Table */
.timesheet-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.timesheet-grid thead th {
  background: #f0f0f0;
  padding: 6px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #d7d7d7;
  white-space: nowrap;
}

.timesheet-grid .issue-col {
  width: 280px;
  min-width: 280px;
  text-align: left;
  padding-left: 8px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
}

.timesheet-grid thead .issue-col {
  background: #f0f0f0;
  z-index: 2;
}

.timesheet-grid .day-col {
  width: auto;
}

.timesheet-grid .total-col {
  width: 70px;
  min-width: 70px;
  text-align: center;
  font-weight: 600;
}

.timesheet-grid .day-name {
  font-weight: 600;
  font-size: 11px;
  color: #666;
}

.timesheet-grid .day-date {
  font-size: 13px;
  color: #333;
}

/* Weekend columns */
.timesheet-grid .weekend {
  background-color: #fafafa;
}

/* Today highlight */
.timesheet-grid .today {
  background-color: #e3f2fd;
}

.timesheet-grid thead .today {
  background-color: #bbdefb;
}

/* Rows */
.timesheet-grid tbody td {
  border: 1px solid #e0e0e0;
  padding: 2px;
  vertical-align: middle;
}

.timesheet-grid .timesheet-row td.issue-col {
  padding: 4px 8px;
  background: #fff;
}

.issue-info {
  display: block;
}

.issue-link {
  font-weight: 600;
  color: #1565c0;
  margin-right: 4px;
}

.issue-subject {
  font-size: 12px;
  color: #555;
}

.activity-name {
  display: block;
  font-size: 11px;
  color: #888;
  font-style: italic;
}

.no-issue {
  color: #999;
  font-style: italic;
  font-size: 12px;
}

/* Hours cells */
.hours-cell {
  text-align: center;
  padding: 0 !important;
}

.hours-cell.has-hours {
  background-color: #f1f8e9;
}

.hours-cell .hours-input {
  width: 100%;
  height: 100%;
  min-height: 30px;
  border: none;
  text-align: center;
  font-size: 13px;
  padding: 4px 2px;
  background: transparent;
  box-sizing: border-box;
  outline: none;
}

.hours-cell .hours-input:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px #1976d2;
  border-radius: 2px;
}

.hours-cell .hours-input.saving {
  background: #fff9c4;
}

.hours-cell .hours-input.saved {
  background: #c8e6c9;
}

.hours-cell .hours-input.error {
  background: #ffcdd2;
}

.hours-cell .hours-display {
  display: block;
  padding: 6px 2px;
  font-size: 13px;
  color: #333;
}

/* Row total */
.row-total {
  font-weight: 600;
  text-align: center;
  background: #f5f5f5;
}

/* Totals row */
.totals-row td {
  background: #e8eaf6 !important;
  border-top: 2px solid #9fa8da;
  padding: 6px 4px;
  text-align: center;
}

.totals-row .issue-col {
  text-align: left;
  padding-left: 8px;
  background: #e8eaf6 !important;
}

.grand-total {
  background: #c5cae9 !important;
  font-size: 14px;
}

/* No data row */
.no-data td {
  text-align: center;
  padding: 40px 0;
  color: #999;
  font-style: italic;
}

/* Action buttons */
.timesheet-actions {
  margin-top: 16px;
  padding: 12px 0;
  text-align: right;
}

.btn-submit-timesheet {
  padding: 6px 16px;
  background: #1976d2;
  color: #fff !important;
  border-radius: 3px;
  text-decoration: none;
  font-weight: 600;
}

.btn-submit-timesheet:hover {
  background: #1565c0;
  text-decoration: none;
}

/* Detail info */
.timesheet-detail-info {
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.timesheet-detail-info p {
  margin: 0 0 8px 0;
  line-height: 1.6;
}

.timesheet-detail-info p:last-child {
  margin-bottom: 0;
}

/* Pending Approvals List */
.timesheets-pending-list {
  width: 100%;
}

.timesheets-pending-list th {
  white-space: nowrap;
}

.timesheets-pending-list .checkbox {
  width: 30px;
  text-align: center;
}

.timesheets-pending-list .hours {
  text-align: center;
  font-weight: 600;
}

.timesheet-review-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-approve {
  color: #2e7d32 !important;
}

.btn-approve:hover {
  color: #1b5e20 !important;
}

.btn-reject {
  color: #c62828 !important;
}

.btn-reject:hover {
  color: #b71c1c !important;
}

/* Reject form */
.reject-form {
  margin-top: 8px;
}

.reject-form-inner {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.reject-comments {
  flex: 1;
  min-width: 200px;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 3px;
  resize: vertical;
}

.btn-reject-confirm {
  background: #c62828;
  color: #fff;
  border: none;
  padding: 4px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.btn-reject-confirm:hover {
  background: #b71c1c;
}

.btn-cancel {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

/* Bulk actions bar */
.bulk-actions {
  margin-top: 12px;
  padding: 8px 12px;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Dark mode support */
html[data-theme="dark"] .timesheet-week-nav {
  background: #2d2d2d;
  border-color: #444;
}

html[data-theme="dark"] .week-label {
  color: #e0e0e0;
}

html[data-theme="dark"] .week-nav-prev,
html[data-theme="dark"] .week-nav-next {
  background: #3a3a3a;
  border-color: #555;
  color: #ccc;
}

html[data-theme="dark"] .week-nav-prev:hover,
html[data-theme="dark"] .week-nav-next:hover {
  background: #4a4a4a;
}

html[data-theme="dark"] .btn-this-week {
  background: #3a3a3a;
  border-color: #555;
  color: #ccc;
}

html[data-theme="dark"] .timesheet-status-badge.status-draft {
  background: #333;
  color: #aaa;
  border-color: #555;
}

html[data-theme="dark"] .timesheet-status-badge.status-submitted {
  background: #4a3800;
  color: #ffb74d;
  border-color: #665200;
}

html[data-theme="dark"] .timesheet-status-badge.status-approved {
  background: #1b3a1b;
  color: #81c784;
  border-color: #2e5c2e;
}

html[data-theme="dark"] .timesheet-status-badge.status-rejected {
  background: #3a1b1b;
  color: #ef9a9a;
  border-color: #5c2e2e;
}

html[data-theme="dark"] .timesheet-grid thead th {
  background: #2a2a2a;
  border-color: #444;
  color: #ccc;
}

html[data-theme="dark"] .timesheet-grid tbody td {
  border-color: #444;
}

html[data-theme="dark"] .timesheet-grid .weekend {
  background-color: #262626;
}

html[data-theme="dark"] .timesheet-grid .today {
  background-color: #1a2a3a;
}

html[data-theme="dark"] .timesheet-grid thead .today {
  background-color: #1a3050;
}

html[data-theme="dark"] .timesheet-grid thead .issue-col {
  background: #2a2a2a;
}

html[data-theme="dark"] .timesheet-grid .timesheet-row td.issue-col {
  background: #1e1e1e;
}

html[data-theme="dark"] .hours-cell.has-hours {
  background-color: #1a2a1a;
}

html[data-theme="dark"] .hours-cell .hours-input {
  color: #e0e0e0;
}

html[data-theme="dark"] .hours-cell .hours-input:focus {
  background: #2a2a2a;
  box-shadow: inset 0 0 0 2px #42a5f5;
}

html[data-theme="dark"] .hours-cell .hours-input.saving {
  background: #3a3500;
}

html[data-theme="dark"] .hours-cell .hours-input.saved {
  background: #1b3a1b;
}

html[data-theme="dark"] .hours-cell .hours-input.error {
  background: #3a1b1b;
}

html[data-theme="dark"] .hours-cell .hours-display {
  color: #ccc;
}

html[data-theme="dark"] .row-total {
  background: #2a2a2a;
}

html[data-theme="dark"] .totals-row td {
  background: #2a2a3a !important;
  border-top-color: #555;
}

html[data-theme="dark"] .totals-row .issue-col {
  background: #2a2a3a !important;
}

html[data-theme="dark"] .grand-total {
  background: #333344 !important;
}

html[data-theme="dark"] .issue-link {
  color: #64b5f6;
}

html[data-theme="dark"] .issue-subject {
  color: #aaa;
}

html[data-theme="dark"] .activity-name {
  color: #888;
}

html[data-theme="dark"] .timesheet-detail-info {
  background: #2d2d2d;
  border-color: #444;
}

html[data-theme="dark"] .day-name {
  color: #999;
}

html[data-theme="dark"] .day-date {
  color: #ccc;
}

html[data-theme="dark"] .reject-comments {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #555;
}

html[data-theme="dark"] .bulk-actions {
  background: #1a2a3a;
  border-color: #2a4a6a;
}

/* ========== workload.css ========== */
/**
 * Redmine - project management software
 * Copyright (C) 2006-  Jean-Philippe Lang
 * This code is released under the GNU General Public License.
 *
 * Team Workload / Resource Allocation Styles
 */

/* ===== Week Selector ===== */

#workload-week-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--oc-gray-0);
  border: 1px solid var(--oc-gray-3);
  border-radius: 6px;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
}

.week-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--oc-gray-3);
  border-radius: 4px;
  background: var(--oc-white);
  color: var(--oc-gray-7);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s;
}

.week-nav-btn:hover {
  background: var(--oc-gray-1);
  border-color: var(--oc-gray-4);
  text-decoration: none;
}

.week-label {
  font-size: 0.875rem;
  color: var(--oc-gray-7);
}

.week-today-link {
  font-size: 0.8125rem;
  color: var(--oc-blue-7);
}

.week-range-detail {
  font-size: 0.8125rem;
  color: var(--oc-gray-5);
}

.week-capacity-note {
  font-style: italic;
}

/* ===== Summary KPI Cards ===== */

.workload-summary {
  margin-bottom: 16px;
}

.workload-summary .kpi-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.workload-summary .kpi-card {
  flex: 1 1 0;
  min-width: 100px;
  padding: 14px 16px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--oc-gray-2);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.workload-summary .kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.workload-summary .kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.workload-summary .kpi-value small {
  font-size: 0.875rem;
  font-weight: 400;
  opacity: 0.6;
}

.workload-summary .kpi-label {
  font-size: 0.6875rem;
  color: var(--oc-gray-6);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
}

.kpi-wl-members { background: var(--oc-indigo-0); }
.kpi-wl-members .kpi-value { color: var(--oc-indigo-7); }

.kpi-wl-open { background: var(--oc-blue-0); }
.kpi-wl-open .kpi-value { color: var(--oc-blue-7); }

.kpi-wl-remaining { background: var(--oc-orange-0); }
.kpi-wl-remaining .kpi-value { color: var(--oc-orange-7); }

.kpi-wl-logged { background: var(--oc-teal-0); }
.kpi-wl-logged .kpi-value { color: var(--oc-teal-7); }

.kpi-wl-overdue { background: var(--oc-red-0); }
.kpi-wl-overdue .kpi-value { color: var(--oc-red-7); }

.kpi-wl-utilization { background: var(--oc-grape-0); }
.kpi-wl-utilization .kpi-value { color: var(--oc-grape-7); }

/* ===== Workload Table ===== */

.workload-table-wrapper {
  margin-bottom: 20px;
  overflow-x: auto;
}

.workload-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--oc-gray-3);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.8125rem;
}

.workload-table thead th {
  background: var(--oc-gray-0);
  border-bottom: 2px solid var(--oc-gray-3);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--oc-gray-7);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
}

.workload-table thead th.sortable {
  cursor: pointer;
  position: relative;
  padding-right: 20px;
}

.workload-table thead th.sortable:hover {
  background: var(--oc-gray-1);
}

.workload-table thead th.sortable::after {
  content: '\2195';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6875rem;
  opacity: 0.3;
}

.workload-table thead th.sort-asc::after {
  content: '\2191';
  opacity: 0.8;
}

.workload-table thead th.sort-desc::after {
  content: '\2193';
  opacity: 0.8;
}

.workload-table tbody tr {
  transition: background 0.1s;
}

.workload-table tbody tr:hover {
  background: var(--oc-gray-0);
}

.workload-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--oc-gray-2);
  vertical-align: middle;
}

.workload-table tbody tr:last-child td {
  border-bottom: none;
}

/* Member column */
.wl-col-member {
  min-width: 180px;
}

.wl-member-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wl-member-info .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wl-member-name-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wl-member-name {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.wl-member-name a {
  color: var(--oc-gray-8);
}

.wl-member-name a:hover {
  color: var(--oc-blue-7);
}

.wl-member-roles {
  font-size: 0.6875rem;
  color: var(--oc-gray-5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

/* Numeric columns */
.wl-col-numeric {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.wl-col-numeric a {
  font-weight: 600;
  color: var(--oc-blue-7);
}

.wl-zero {
  color: var(--oc-gray-4);
}

/* Hours column with bar */
.wl-col-hours {
  min-width: 140px;
}

.wl-hours-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wl-hours-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wl-hours-value small {
  font-size: 0.6875rem;
  font-weight: 400;
  opacity: 0.7;
}

.wl-hours-bar-track {
  height: 6px;
  background: var(--oc-gray-2);
  border-radius: 3px;
  overflow: hidden;
}

.wl-hours-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

/* Utilization column */
.wl-col-utilization {
  min-width: 120px;
}

.wl-utilization-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.wl-utilization-value {
  font-weight: 700;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.wl-utilization-bar-track {
  width: 100%;
  height: 6px;
  background: var(--oc-gray-2);
  border-radius: 3px;
  overflow: hidden;
}

.wl-utilization-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 0;
}

/* Color levels */
.wl-level-ok {
  color: var(--oc-green-7);
}

.wl-level-ok.wl-hours-bar-fill,
.wl-level-ok.wl-utilization-bar-fill {
  background: var(--oc-green-5);
}

.wl-level-warning {
  color: var(--oc-yellow-8);
}

.wl-level-warning.wl-hours-bar-fill,
.wl-level-warning.wl-utilization-bar-fill {
  background: var(--oc-yellow-5);
}

.wl-level-over {
  color: var(--oc-red-7);
}

.wl-level-over.wl-hours-bar-fill,
.wl-level-over.wl-utilization-bar-fill {
  background: var(--oc-red-5);
}

/* Logged hours */
.wl-logged-hours {
  font-variant-numeric: tabular-nums;
  color: var(--oc-gray-7);
}

.wl-logged-hours small {
  font-size: 0.6875rem;
  opacity: 0.6;
}

/* Due this week badge */
.wl-due-badge {
  display: inline-block;
  background: var(--oc-orange-1);
  color: var(--oc-orange-8);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Overdue badge */
.wl-overdue-badge {
  display: inline-block;
  background: var(--oc-red-1);
  color: var(--oc-red-7);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.75rem;
}

.wl-overdue-badge a {
  color: var(--oc-red-7);
}

.wl-overdue-badge a:hover {
  color: var(--oc-red-9);
}

/* ===== Workload Distribution Chart ===== */

.workload-chart-section {
  margin-bottom: 20px;
}

.workload-chart-container {
  position: relative;
  height: 300px;
}

/* ===== Unassigned Issues ===== */

.workload-unassigned {
  margin-bottom: 20px;
}

.wl-unassigned-text {
  font-size: 0.875rem;
  color: var(--oc-gray-7);
  margin-bottom: 8px;
}

.wl-unassigned-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--oc-orange-7);
  margin-right: 6px;
}

/* ===== Responsive ===== */

@media screen and (max-width: 1200px) {
  .workload-summary .kpi-card {
    flex: 1 1 calc(33.333% - 8px);
  }
}

@media screen and (max-width: 900px) {
  #workload-week-selector {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .workload-summary .kpi-card {
    flex: 1 1 calc(50% - 6px);
  }

  .workload-chart-container {
    height: 250px;
  }
}

@media screen and (max-width: 600px) {
  .workload-summary .kpi-card {
    flex: 1 1 100%;
  }

  .wl-member-roles {
    display: none;
  }
}

/* ===== Dark Mode ===== */

[data-theme="dark"] #workload-week-selector {
  background: rgba(255,255,255,0.03);
  border-color: var(--oc-gray-7);
}

[data-theme="dark"] .week-nav-btn {
  background: var(--oc-gray-8);
  border-color: var(--oc-gray-6);
  color: var(--oc-gray-3);
}

[data-theme="dark"] .week-nav-btn:hover {
  background: var(--oc-gray-7);
}

[data-theme="dark"] .week-label {
  color: var(--oc-gray-3);
}

[data-theme="dark"] .week-range-detail {
  color: var(--oc-gray-5);
}

[data-theme="dark"] .workload-summary .kpi-card {
  border-color: var(--oc-gray-7);
}

[data-theme="dark"] .kpi-wl-members { background: rgba(102, 119, 204, 0.12); }
[data-theme="dark"] .kpi-wl-open { background: rgba(28, 126, 214, 0.12); }
[data-theme="dark"] .kpi-wl-remaining { background: rgba(247, 103, 7, 0.12); }
[data-theme="dark"] .kpi-wl-logged { background: rgba(18, 184, 134, 0.12); }
[data-theme="dark"] .kpi-wl-overdue { background: rgba(240, 62, 62, 0.12); }
[data-theme="dark"] .kpi-wl-utilization { background: rgba(174, 62, 201, 0.12); }

[data-theme="dark"] .workload-summary .kpi-label {
  color: var(--oc-gray-5);
}

[data-theme="dark"] .workload-summary .kpi-value {
  filter: brightness(1.2);
}

[data-theme="dark"] .workload-table {
  border-color: var(--oc-gray-7);
}

[data-theme="dark"] .workload-table thead th {
  background: rgba(255,255,255,0.03);
  border-bottom-color: var(--oc-gray-7);
  color: var(--oc-gray-4);
}

[data-theme="dark"] .workload-table thead th.sortable:hover {
  background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .workload-table tbody tr:hover {
  background: rgba(255,255,255,0.04);
}

[data-theme="dark"] .workload-table tbody td {
  border-bottom-color: var(--oc-gray-8);
}

[data-theme="dark"] .wl-member-name a {
  color: var(--oc-gray-2);
}

[data-theme="dark"] .wl-member-roles {
  color: var(--oc-gray-5);
}

[data-theme="dark"] .wl-zero {
  color: var(--oc-gray-6);
}

[data-theme="dark"] .wl-logged-hours {
  color: var(--oc-gray-4);
}

[data-theme="dark"] .wl-hours-bar-track,
[data-theme="dark"] .wl-utilization-bar-track {
  background: var(--oc-gray-7);
}

[data-theme="dark"] .wl-due-badge {
  background: rgba(247, 103, 7, 0.15);
  color: var(--oc-orange-4);
}

[data-theme="dark"] .wl-overdue-badge {
  background: rgba(240, 62, 62, 0.15);
  color: var(--oc-red-4);
}

[data-theme="dark"] .wl-overdue-badge a {
  color: var(--oc-red-4);
}

[data-theme="dark"] .widget-card {
  background: var(--oc-gray-9);
  border-color: var(--oc-gray-7);
}

[data-theme="dark"] .wl-unassigned-text {
  color: var(--oc-gray-4);
}

[data-theme="dark"] .wl-unassigned-count {
  color: var(--oc-orange-4);
}

/* ========== enhanced_gantt.css ========== */
/* Enhanced Gantt Chart Styles */

/* ---- Container ---- */
#enhanced-gantt-container {
  position: relative;
  width: 100%;
  font-size: 13px;
}

/* ---- Toolbar ---- */
#eg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 3px;
  align-items: center;
}

#eg-toolbar label {
  font-weight: bold;
  font-size: 12px;
  margin-right: 2px;
}

#eg-toolbar select {
  font-size: 12px;
  padding: 2px 4px;
  margin-right: 8px;
  max-width: 150px;
}

.eg-toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.eg-zoom-btn.active {
  background: #628db6;
  color: #fff;
  border-color: #4a7a9e;
}

.eg-critical-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: normal !important;
  cursor: pointer;
}

.eg-critical-toggle input[type="checkbox"] {
  margin: 0;
}

/* ---- Main layout ---- */
#eg-main {
  display: flex;
  border: 1px solid #ccc;
  border-radius: 3px;
  overflow: hidden;
  height: calc(100vh - 220px);
  min-height: 400px;
  background: #fff;
}

/* ---- Task list (left panel) ---- */
#eg-task-list {
  width: 400px;
  min-width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #ccc;
  overflow: hidden;
}

#eg-task-header {
  display: flex;
  background: #eee;
  border-bottom: 2px solid #ccc;
  font-weight: bold;
  font-size: 11px;
  min-height: 50px;
  align-items: flex-end;
  padding-bottom: 4px;
  flex-shrink: 0;
}

.eg-th {
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eg-col-id { width: 40px; flex-shrink: 0; text-align: right; }
.eg-col-subject { flex: 1; min-width: 80px; }
.eg-col-assignee { width: 80px; flex-shrink: 0; }
.eg-col-start { width: 70px; flex-shrink: 0; }
.eg-col-due { width: 70px; flex-shrink: 0; }
.eg-col-progress { width: 35px; flex-shrink: 0; text-align: right; }

#eg-task-rows {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.eg-task-row {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
  height: 32px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.eg-task-row:hover {
  background: #f5f9fc;
}

.eg-task-row.eg-selected {
  background: #e8f0fe;
}

.eg-task-row.eg-critical-row {
  background: #fff5f5;
}

.eg-task-row.eg-critical-row:hover {
  background: #ffe8e8;
}

.eg-td {
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.eg-td.eg-col-id { width: 40px; flex-shrink: 0; text-align: right; color: #888; }
.eg-td.eg-col-subject { flex: 1; min-width: 80px; }
.eg-td.eg-col-assignee { width: 80px; flex-shrink: 0; color: #666; }
.eg-td.eg-col-start { width: 70px; flex-shrink: 0; color: #666; }
.eg-td.eg-col-due { width: 70px; flex-shrink: 0; color: #666; }
.eg-td.eg-col-progress { width: 35px; flex-shrink: 0; text-align: right; color: #666; }

.eg-subject-link {
  color: #169;
  text-decoration: none;
}

.eg-subject-link:hover {
  text-decoration: underline;
}

.eg-indent {
  display: inline-block;
}

/* ---- Splitter ---- */
#eg-splitter {
  width: 5px;
  cursor: col-resize;
  background: #ddd;
  flex-shrink: 0;
  transition: background 0.15s;
}

#eg-splitter:hover {
  background: #628db6;
}

/* ---- Timeline (right panel) ---- */
#eg-timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#eg-timeline-header {
  display: flex;
  flex-direction: column;
  background: #eee;
  border-bottom: 2px solid #ccc;
  min-height: 50px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.eg-header-row {
  display: flex;
  height: 25px;
}

.eg-header-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ddd;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
  flex-shrink: 0;
}

.eg-header-cell.eg-month-cell {
  background: #e8e8e8;
}

#eg-timeline-body {
  flex: 1;
  overflow: auto;
  position: relative;
}

#eg-svg {
  position: absolute;
  top: 0;
  left: 0;
}

/* ---- Grid ---- */
.eg-grid-weekend {
  fill: rgba(0, 0, 0, 0.03);
}

.eg-grid-line {
  stroke: #eee;
  stroke-width: 1;
}

.eg-today-line {
  stroke: #e74c3c;
  stroke-width: 2;
  stroke-dasharray: 6, 3;
}

.eg-row-line {
  stroke: #f0f0f0;
  stroke-width: 1;
}

/* ---- Task bars ---- */
.eg-bar {
  cursor: pointer;
  transition: filter 0.15s;
}

.eg-bar:hover {
  filter: brightness(1.08);
}

.eg-bar-bg {
  rx: 3;
  ry: 3;
  stroke: rgba(0, 0, 0, 0.2);
  stroke-width: 1;
}

.eg-bar-progress {
  rx: 3;
  ry: 3;
  opacity: 0.5;
}

.eg-bar-label {
  font-size: 10px;
  fill: #333;
  pointer-events: none;
}

.eg-bar-critical .eg-bar-bg {
  stroke: #e74c3c;
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(231, 76, 60, 0.5));
}

.eg-bar-selected .eg-bar-bg {
  stroke: #333;
  stroke-width: 2;
}

/* Parent/summary bars */
.eg-bar-parent .eg-bar-bg {
  rx: 0;
  ry: 0;
}

/* Milestone diamonds */
.eg-milestone {
  cursor: pointer;
}

.eg-milestone polygon {
  stroke: rgba(0, 0, 0, 0.3);
  stroke-width: 1;
}

.eg-milestone.eg-bar-critical polygon {
  stroke: #e74c3c;
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(231, 76, 60, 0.5));
}

/* Drag handles */
.eg-drag-handle {
  cursor: ew-resize;
  fill: transparent;
}

.eg-drag-handle:hover {
  fill: rgba(0, 0, 0, 0.1);
}

.eg-bar.eg-dragging {
  opacity: 0.7;
}

/* ---- Dependency arrows ---- */
.eg-dep-arrow {
  fill: none;
  stroke: #999;
  stroke-width: 1.5;
  marker-end: url(#eg-arrow);
}

.eg-dep-arrow.eg-dep-critical {
  stroke: #e74c3c;
  stroke-width: 2;
  marker-end: url(#eg-arrow-critical);
}

/* ---- Baseline overlay ---- */
.eg-baseline-bar {
  opacity: 0.35;
  rx: 3;
  ry: 3;
  stroke-dasharray: 4, 2;
  stroke-width: 1;
}

.eg-baseline-ahead {
  fill: #27ae60;
  stroke: #1e8449;
}

.eg-baseline-behind {
  fill: #e74c3c;
  stroke: #c0392b;
}

.eg-baseline-ontrack {
  fill: #95a5a6;
  stroke: #7f8c8d;
}

/* ---- Tooltip ---- */
.eg-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  z-index: 1000;
  pointer-events: none;
  max-width: 350px;
  white-space: nowrap;
}

.eg-tooltip strong {
  color: #fff;
  display: block;
  margin-bottom: 4px;
}

.eg-tooltip .eg-tt-row {
  display: flex;
  gap: 8px;
}

.eg-tooltip .eg-tt-label {
  color: #aaa;
  min-width: 70px;
}

/* ---- Loading ---- */
#eg-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  font-size: 14px;
  color: #666;
}

/* ---- Dark mode ---- */
html[data-theme="dark"] #eg-toolbar {
  background: #2d2d2d;
  border-color: #444;
}

html[data-theme="dark"] #eg-toolbar label {
  color: #ccc;
}

html[data-theme="dark"] #eg-main {
  border-color: #444;
  background: #1e1e1e;
}

html[data-theme="dark"] #eg-task-list {
  border-right-color: #444;
}

html[data-theme="dark"] #eg-task-header {
  background: #2d2d2d;
  border-bottom-color: #444;
  color: #ccc;
}

html[data-theme="dark"] .eg-task-row {
  border-bottom-color: #333;
  color: #ccc;
}

html[data-theme="dark"] .eg-task-row:hover {
  background: #2a3a4a;
}

html[data-theme="dark"] .eg-task-row.eg-selected {
  background: #2a3a5a;
}

html[data-theme="dark"] .eg-task-row.eg-critical-row {
  background: #3a2020;
}

html[data-theme="dark"] .eg-task-row.eg-critical-row:hover {
  background: #4a2525;
}

html[data-theme="dark"] .eg-td.eg-col-id { color: #888; }
html[data-theme="dark"] .eg-td.eg-col-assignee,
html[data-theme="dark"] .eg-td.eg-col-start,
html[data-theme="dark"] .eg-td.eg-col-due,
html[data-theme="dark"] .eg-td.eg-col-progress { color: #999; }

html[data-theme="dark"] .eg-subject-link { color: #5ba3d9; }

html[data-theme="dark"] #eg-splitter { background: #444; }
html[data-theme="dark"] #eg-splitter:hover { background: #5ba3d9; }

html[data-theme="dark"] #eg-timeline-header {
  background: #2d2d2d;
  border-bottom-color: #444;
  color: #ccc;
}

html[data-theme="dark"] .eg-header-cell {
  border-right-color: #444;
  border-bottom-color: #444;
  color: #ccc;
}

html[data-theme="dark"] .eg-header-cell.eg-month-cell {
  background: #333;
}

html[data-theme="dark"] .eg-grid-weekend {
  fill: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .eg-grid-line {
  stroke: #333;
}

html[data-theme="dark"] .eg-row-line {
  stroke: #2a2a2a;
}

html[data-theme="dark"] .eg-bar-label {
  fill: #ccc;
}

html[data-theme="dark"] .eg-dep-arrow {
  stroke: #666;
}

html[data-theme="dark"] .eg-tooltip {
  background: rgba(40, 40, 40, 0.95);
  border: 1px solid #555;
}

html[data-theme="dark"] #eg-loading {
  background: rgba(30, 30, 30, 0.8);
  color: #aaa;
}

html[data-theme="dark"] .eg-zoom-btn.active {
  background: #3a7ab5;
  border-color: #2a6090;
}

/* ========== pivot_table.css ========== */
/* ========== Pivot Table Analysis Styles ========== */

/* Container */
#pivot-container {
  width: 100%;
}

/* Toolbar */
#pivot-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

#pivot-toolbar .pivot-toolbar-left,
#pivot-toolbar .pivot-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

#pivot-toolbar label {
  font-weight: bold;
  font-size: 0.85em;
  white-space: nowrap;
}

#pivot-toolbar select {
  font-size: 0.85em;
  padding: 3px 6px;
  max-width: 200px;
}

/* Main layout: config panel + table area */
#pivot-main {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* Configuration Panel */
#pivot-config-panel {
  width: 260px;
  min-width: 220px;
  flex-shrink: 0;
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  background: #fafafa;
  padding: 10px;
  font-size: 0.85em;
}

#pivot-config-panel h3 {
  margin: 0 0 10px 0;
  padding: 0 0 6px 0;
  border-bottom: 2px solid #628db6;
  font-size: 1.1em;
  color: #333;
}

.pivot-zone-section {
  margin-bottom: 12px;
}

.pivot-zone-section h4 {
  margin: 0 0 4px 0;
  font-size: 0.95em;
  color: #555;
  font-weight: 600;
}

/* Drop Zones */
.pivot-drop-zone {
  min-height: 36px;
  padding: 4px;
  border: 2px dashed #ccc;
  border-radius: 4px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.pivot-drop-zone.pivot-field-list {
  border-style: solid;
  border-color: #ddd;
  max-height: 180px;
  overflow-y: auto;
}

.pivot-drop-target {
  transition: border-color 0.2s, background-color 0.2s;
}

.pivot-drop-target.ui-sortable-over,
.pivot-drop-target:hover {
  border-color: #628db6;
  background: #f0f7ff;
}

.pivot-drop-placeholder {
  font-size: 0.8em;
  color: #aaa;
  font-style: italic;
  padding: 4px;
  pointer-events: none;
}

/* Field Chips */
.pivot-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.82em;
  font-weight: 500;
  cursor: grab;
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
  transition: box-shadow 0.15s;
}

.pivot-chip:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.pivot-chip:active {
  cursor: grabbing;
}

.pivot-chip-dimension {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #90caf9;
}

.pivot-chip-measure {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #a5d6a7;
}

.pivot-chip-remove {
  background: none;
  border: none;
  font-size: 1.1em;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  padding: 0 0 0 2px;
  line-height: 1;
}

.pivot-chip-remove:hover {
  opacity: 1;
}

.pivot-chip-placeholder {
  height: 26px;
  border: 2px dashed #90caf9;
  border-radius: 12px;
  background: #e3f2fd;
  min-width: 60px;
}

/* Value zone */
#pivot-value-zone {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#pivot-value-zone select {
  font-size: 0.85em;
  padding: 2px 4px;
}

/* Filter UI */
.pivot-filter-group {
  margin-top: 6px;
}

.pivot-filter-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85em;
  margin-bottom: 2px;
}

.pivot-filter-select {
  width: 100%;
  font-size: 0.82em;
  min-height: 60px;
  max-height: 100px;
}

/* Table Area */
#pivot-table-area {
  flex: 1;
  min-width: 0;
  overflow: auto;
}

#pivot-table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 260px);
  border: 1px solid #d7d7d7;
  border-radius: 4px;
}

/* Pivot Table */
.pivot-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85em;
}

.pivot-table th,
.pivot-table td {
  border: 1px solid #d7d7d7;
  padding: 5px 8px;
  text-align: center;
  white-space: nowrap;
}

.pivot-table th {
  background: #f0f0f0;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.pivot-header-label {
  background: #628db6 !important;
  color: #fff !important;
  text-align: left !important;
  min-width: 100px;
}

.pivot-header-col {
  background: #e8eef4 !important;
  color: #333;
  min-width: 70px;
}

.pivot-header-row {
  background: #f5f7fa !important;
  color: #333;
  text-align: left !important;
  font-weight: 500;
  min-width: 100px;
}

.pivot-header-total {
  background: #dde6ee !important;
  color: #333;
  font-weight: 700;
}

/* Cell styles */
.pivot-cell-value {
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s;
}

.pivot-clickable {
  cursor: pointer;
}

.pivot-clickable:hover {
  outline: 2px solid #628db6;
  outline-offset: -2px;
}

.pivot-cell-total {
  background: #eef2f7 !important;
  font-weight: 600;
}

.pivot-cell-grand-total {
  background: #dde6ee !important;
  font-weight: 700;
}

.pivot-totals-row th,
.pivot-totals-row td {
  border-top: 2px solid #628db6;
}

/* Loading */
#pivot-loading {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 1.1em;
}

/* Summary */
#pivot-summary {
  margin-top: 8px;
  font-size: 0.85em;
  color: #666;
  text-align: right;
  padding-right: 4px;
}

/* ========== Drill-down Modal ========== */
.pivot-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pivot-modal-content {
  background: #fff;
  border-radius: 6px;
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.pivot-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  background: #f8f9fa;
  border-radius: 6px 6px 0 0;
}

.pivot-modal-header h3 {
  margin: 0;
  font-size: 1em;
  color: #333;
}

.pivot-modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
  color: #666;
  padding: 0 4px;
  line-height: 1;
}

.pivot-modal-close-btn:hover {
  color: #c00;
}

.pivot-modal-body {
  padding: 12px 16px;
  overflow: auto;
  flex: 1;
}

.pivot-modal-body table {
  width: 100%;
}

.pivot-modal-body table th,
.pivot-modal-body table td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 0.9em;
}

.pivot-modal-body table th {
  background: #f5f5f5;
  font-weight: 600;
}

.pivot-modal-body table a {
  color: #628db6;
  text-decoration: none;
}

.pivot-modal-body table a:hover {
  text-decoration: underline;
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
  #pivot-main {
    flex-direction: column;
  }

  #pivot-config-panel {
    width: 100%;
    min-width: 0;
  }

  #pivot-table-wrapper {
    max-height: 60vh;
  }
}

/* ========== Dark Mode ========== */
html[data-theme="dark"] #pivot-toolbar {
  background: #2a2a2a;
  border-color: #444;
}

html[data-theme="dark"] #pivot-toolbar label {
  color: #ccc;
}

html[data-theme="dark"] #pivot-config-panel {
  background: #1e1e1e;
  border-color: #444;
}

html[data-theme="dark"] #pivot-config-panel h3 {
  color: #ddd;
  border-bottom-color: #5a8ab5;
}

html[data-theme="dark"] .pivot-zone-section h4 {
  color: #bbb;
}

html[data-theme="dark"] .pivot-drop-zone {
  background: #2a2a2a;
  border-color: #555;
}

html[data-theme="dark"] .pivot-drop-zone.pivot-field-list {
  border-color: #555;
}

html[data-theme="dark"] .pivot-drop-target.ui-sortable-over,
html[data-theme="dark"] .pivot-drop-target:hover {
  border-color: #5a8ab5;
  background: #1a2a3a;
}

html[data-theme="dark"] .pivot-drop-placeholder {
  color: #666;
}

html[data-theme="dark"] .pivot-chip-dimension {
  background: #1a3a5c;
  color: #90caf9;
  border-color: #2a5a8a;
}

html[data-theme="dark"] .pivot-chip-measure {
  background: #1b3a1b;
  color: #a5d6a7;
  border-color: #2a5a2a;
}

html[data-theme="dark"] #pivot-table-wrapper {
  border-color: #444;
}

html[data-theme="dark"] .pivot-table th,
html[data-theme="dark"] .pivot-table td {
  border-color: #444;
}

html[data-theme="dark"] .pivot-table th {
  background: #2a2a2a;
  color: #ddd;
}

html[data-theme="dark"] .pivot-header-label {
  background: #3a6a8a !important;
  color: #fff !important;
}

html[data-theme="dark"] .pivot-header-col {
  background: #2a3a4a !important;
  color: #ccc;
}

html[data-theme="dark"] .pivot-header-row {
  background: #252525 !important;
  color: #ccc;
}

html[data-theme="dark"] .pivot-header-total {
  background: #2a3a4a !important;
  color: #ddd;
}

html[data-theme="dark"] .pivot-cell-value {
  color: #ddd;
}

html[data-theme="dark"] .pivot-cell-total {
  background: #252d36 !important;
  color: #ddd;
}

html[data-theme="dark"] .pivot-cell-grand-total {
  background: #2a3a4a !important;
  color: #fff;
}

html[data-theme="dark"] .pivot-totals-row th,
html[data-theme="dark"] .pivot-totals-row td {
  border-top-color: #5a8ab5;
}

html[data-theme="dark"] .pivot-clickable:hover {
  outline-color: #5a8ab5;
}

html[data-theme="dark"] #pivot-summary {
  color: #999;
}

/* Dark mode heat map override */
html[data-theme="dark"] .pivot-cell-value[data-intensity] {
  color: #fff;
}

/* Dark mode modal */
html[data-theme="dark"] .pivot-modal-content {
  background: #1e1e1e;
}

html[data-theme="dark"] .pivot-modal-header {
  background: #2a2a2a;
  border-bottom-color: #444;
}

html[data-theme="dark"] .pivot-modal-header h3 {
  color: #ddd;
}

html[data-theme="dark"] .pivot-modal-close-btn {
  color: #aaa;
}

html[data-theme="dark"] .pivot-modal-close-btn:hover {
  color: #ff6b6b;
}

html[data-theme="dark"] .pivot-modal-body table th {
  background: #2a2a2a;
  color: #ccc;
}

html[data-theme="dark"] .pivot-modal-body table td {
  color: #ccc;
  border-bottom-color: #333;
}

html[data-theme="dark"] .pivot-modal-body table a {
  color: #6aaddf;
}

html[data-theme="dark"] .pivot-filter-group label {
  color: #bbb;
}

html[data-theme="dark"] .pivot-filter-select {
  background: #2a2a2a;
  color: #ccc;
  border-color: #555;
}

html[data-theme="dark"] #pivot-toolbar select,
html[data-theme="dark"] #pivot-value-zone select {
  background: #2a2a2a;
  color: #ccc;
  border-color: #555;
}

/* ========== ical.css ========== */
/* iCal Calendar Subscription Styles */

/* Modal overlay */
.ical-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ical-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
}

/* Modal content */
.ical-modal-content {
  position: relative;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 10001;
}

.ical-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #ddd;
}

.ical-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.ical-modal-close {
  font-size: 24px;
  line-height: 1;
  color: #666;
  text-decoration: none;
  cursor: pointer;
  padding: 0 4px;
}

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

.ical-modal-body {
  padding: 20px;
}

.ical-modal-body > p {
  margin-top: 0;
  color: #555;
}

/* URL groups */
.ical-url-group {
  margin-bottom: 16px;
}

.ical-url-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 13px;
  color: #333;
}

.ical-url-field {
  display: flex;
  gap: 6px;
}

.ical-url-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: monospace;
  font-size: 12px;
  background: #f8f8f8;
  color: #333;
  cursor: text;
}

.ical-url-input:focus {
  border-color: #4a90d9;
  outline: none;
  box-shadow: 0 0 3px rgba(74, 144, 217, 0.3);
}

/* Copy button */
.ical-copy-btn {
  padding: 6px 14px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #f0f0f0;
  color: #333;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

.ical-copy-btn:hover {
  background: #e0e0e0;
  border-color: #bbb;
}

.ical-copy-btn.copied {
  background: #4caf50;
  border-color: #43a047;
  color: #fff;
}

/* Instructions */
.ical-instructions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.ical-instructions h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.ical-instructions ul {
  margin: 0;
  padding-left: 20px;
}

.ical-instructions li {
  margin-bottom: 6px;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

/* Warning */
.ical-warning {
  margin-top: 16px;
  padding: 10px 14px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 3px;
}

.ical-warning p {
  margin: 0;
  font-size: 12px;
  color: #856404;
}

/* Icon for subscribe button */
a.icon-calendar {
  padding-left: 20px;
}

/* Dark mode support */
html[data-theme="dark"] .ical-modal-content {
  background: #2a2a2a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .ical-modal-header {
  border-bottom-color: #444;
}

html[data-theme="dark"] .ical-modal-header h3 {
  color: #e0e0e0;
}

html[data-theme="dark"] .ical-modal-close {
  color: #999;
}

html[data-theme="dark"] .ical-modal-close:hover {
  color: #ddd;
}

html[data-theme="dark"] .ical-modal-body > p {
  color: #aaa;
}

html[data-theme="dark"] .ical-url-group label {
  color: #ccc;
}

html[data-theme="dark"] .ical-url-input {
  background: #1e1e1e;
  border-color: #555;
  color: #ddd;
}

html[data-theme="dark"] .ical-url-input:focus {
  border-color: #5a9fd4;
  box-shadow: 0 0 3px rgba(90, 159, 212, 0.4);
}

html[data-theme="dark"] .ical-copy-btn {
  background: #3a3a3a;
  border-color: #555;
  color: #ddd;
}

html[data-theme="dark"] .ical-copy-btn:hover {
  background: #4a4a4a;
  border-color: #666;
}

html[data-theme="dark"] .ical-copy-btn.copied {
  background: #388e3c;
  border-color: #2e7d32;
  color: #fff;
}

html[data-theme="dark"] .ical-instructions {
  border-top-color: #444;
}

html[data-theme="dark"] .ical-instructions h4 {
  color: #ddd;
}

html[data-theme="dark"] .ical-instructions li {
  color: #aaa;
}

html[data-theme="dark"] .ical-warning {
  background: #3d3520;
  border-color: #665c2e;
}

html[data-theme="dark"] .ical-warning p {
  color: #d4a937;
}

html[data-theme="dark"] .ical-modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

/* ========== chat_webhooks.css ========== */
/* Chat Webhooks Styles */

/* Platform badges */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.9em;
  font-weight: 500;
  white-space: nowrap;
}

.platform-badge .platform-icon {
  font-size: 1.1em;
}

.platform-slack {
  background-color: #f0e6f6;
  color: #4A154B;
}

.platform-discord {
  background-color: #e8eaf6;
  color: #5865F2;
}

.platform-teams {
  background-color: #e3f2fd;
  color: #6264A7;
}

.platform-google_chat {
  background-color: #e8f5e9;
  color: #1a73e8;
}

/* Webhook list table */
.chat-webhooks-list {
  width: 100%;
}

.chat-webhooks-list th.chat-webhook-platform,
.chat-webhooks-list td.chat-webhook-platform {
  width: 140px;
}

.chat-webhooks-list th.chat-webhook-events,
.chat-webhooks-list td.chat-webhook-events {
  width: 120px;
}

.chat-webhooks-list th.chat-webhook-status,
.chat-webhooks-list td.chat-webhook-status {
  width: 70px;
  text-align: center;
}

.chat-webhooks-list td.chat-webhook-url {
  font-family: monospace;
  font-size: 0.85em;
  color: #666;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-webhooks-list tr.disabled td {
  opacity: 0.5;
}

.chat-webhooks-list tr.disabled td.buttons {
  opacity: 1;
}

/* Event count badge */
.event-count {
  display: inline-block;
  padding: 1px 8px;
  background-color: #e0e0e0;
  border-radius: 10px;
  font-size: 0.85em;
  cursor: help;
}

.no-events {
  color: #999;
  font-style: italic;
  font-size: 0.85em;
}

/* Event checkboxes grid */
.chat-webhook-events-fieldset {
  margin-top: 10px;
}

.chat-webhook-events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 16px;
  padding: 8px 0;
}

.chat-webhook-event-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: normal;
  padding: 3px 0;
}

.chat-webhook-event-label:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.chat-webhook-event-label input[type="checkbox"] {
  margin: 0;
}

/* Platform help text */
.chat-webhook-platform-help {
  margin: 8px 0;
  padding: 8px 12px;
  background-color: #fffde7;
  border: 1px solid #fff9c4;
  border-radius: 3px;
}

.chat-webhook-platform-help .help-text {
  margin: 0;
  font-size: 0.9em;
  color: #666;
}

/* Test button */
.chat-webhook-test-btn {
  cursor: pointer;
}

.chat-webhook-test-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.chat-webhook-test-btn.loading::after {
  content: ' ...';
}

/* Test result indicators */
.chat-webhook-test-result {
  display: inline-block;
  margin-left: 4px;
  font-size: 1.1em;
  font-weight: bold;
}

.chat-webhook-test-result.test-success {
  color: #4CAF50;
}

.chat-webhook-test-result.test-failure {
  color: #F44336;
}

/* Toggle cursor */
.chat-webhook-toggle {
  cursor: pointer;
}

/* Dark mode support */
html[data-theme="dark"] .platform-slack {
  background-color: #2d1f33;
  color: #d4a6e0;
}

html[data-theme="dark"] .platform-discord {
  background-color: #1a1c3a;
  color: #8b8ff0;
}

html[data-theme="dark"] .platform-teams {
  background-color: #1a2530;
  color: #8b8dcc;
}

html[data-theme="dark"] .platform-google_chat {
  background-color: #1a2b1f;
  color: #5fa8e8;
}

html[data-theme="dark"] .event-count {
  background-color: #444;
  color: #ccc;
}

html[data-theme="dark"] .no-events {
  color: #777;
}

html[data-theme="dark"] .chat-webhooks-list td.chat-webhook-url {
  color: #aaa;
}

html[data-theme="dark"] .chat-webhook-platform-help {
  background-color: #2a2a1a;
  border-color: #444;
}

html[data-theme="dark"] .chat-webhook-platform-help .help-text {
  color: #bbb;
}

html[data-theme="dark"] .chat-webhook-event-label:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Responsive: 2 columns on smaller screens */
@media screen and (max-width: 900px) {
  .chat-webhook-events-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 600px) {
  .chat-webhook-events-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== wysiwyg_editor.css ========== */
/**
 * Redmine WYSIWYG Editor Styles
 *
 * Styles for the Visual (WYSIWYG) editor toggle feature.
 * Matches jstoolbar look and feel.
 *
 * Copyright (C) 2026  Redmine contributors
 * This code is released under the GNU General Public License.
 */

/* ===== WYSIWYG Toolbar ===== */

.wysiwyg-toolbar {
    display: inline-block;
    vertical-align: bottom;
    padding-inline-start: 6px;
    padding-block-end: 2px;
    block-size: 26px;
}

.wysiwyg-toolbar .wysiwyg-btn {
    margin-inline-end: 2px;
    inline-size: 24px;
    block-size: 24px;
    padding: 4px;
    border-style: solid;
    border-width: 1px;
    border-color: var(--oc-gray-4);
    background-color: var(--oc-gray-0);
    background-position: 50% 50%;
    background-repeat: no-repeat;
    cursor: pointer;
    opacity: 0.7;
    background-size: 16px 16px;
}

.wysiwyg-toolbar .wysiwyg-btn:hover {
    border-color: var(--oc-gray-5);
    background-color: var(--oc-gray-3);
    opacity: 1;
}

.wysiwyg-toolbar .wysiwyg-btn:active {
    background-color: var(--oc-gray-4);
}

.wysiwyg-toolbar .wysiwyg-btn span {
    display: none;
}

/* Text-based buttons (undo/redo arrows, hr) */
.wysiwyg-toolbar .wysiwyg-btn.wysiwyg-btn-text {
    font-size: 14px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    color: var(--oc-gray-7);
    background-image: none !important;
}

.wysiwyg-toolbar .wysiwyg-btn.wysiwyg-btn-text:hover {
    color: var(--oc-gray-9);
}

/* ===== Contenteditable Editor ===== */

.wysiwyg-editor {
    border: 1px solid var(--oc-gray-4);
    background-color: var(--oc-white);
    color: var(--oc-gray-9);
    padding: 10px 12px;
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    box-sizing: border-box;
    width: 100%;
}

.wysiwyg-editor:focus {
    border-color: var(--oc-blue-5);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ===== Formatted Content Inside the Editor ===== */

.wysiwyg-editor h1 {
    font-size: 1.6em;
    font-weight: bold;
    margin: 0.6em 0 0.4em;
    padding-block-end: 4px;
    border-block-end: 1px solid var(--oc-gray-3);
    color: var(--oc-gray-9);
}

.wysiwyg-editor h2 {
    font-size: 1.35em;
    font-weight: bold;
    margin: 0.5em 0 0.3em;
    color: var(--oc-gray-9);
}

.wysiwyg-editor h3 {
    font-size: 1.15em;
    font-weight: bold;
    margin: 0.4em 0 0.3em;
    color: var(--oc-gray-9);
}

.wysiwyg-editor h4,
.wysiwyg-editor h5,
.wysiwyg-editor h6 {
    font-size: 1em;
    font-weight: bold;
    margin: 0.4em 0 0.2em;
    color: var(--oc-gray-8);
}

.wysiwyg-editor p {
    margin: 0.5em 0;
}

.wysiwyg-editor ul,
.wysiwyg-editor ol {
    padding-inline-start: 24px;
    margin: 0.4em 0;
}

.wysiwyg-editor li {
    margin-block-end: 2px;
}

.wysiwyg-editor blockquote {
    border-inline-start: 3px solid var(--oc-blue-3);
    padding: 4px 12px;
    margin: 0.5em 0;
    color: var(--oc-gray-7);
    background-color: var(--oc-gray-0);
}

.wysiwyg-editor pre {
    background-color: var(--oc-gray-0);
    border: 1px solid var(--oc-gray-3);
    border-radius: 3px;
    padding: 8px 12px;
    overflow-x: auto;
    font-family: monospace, monospace;
    font-size: 0.92em;
    margin: 0.5em 0;
}

.wysiwyg-editor code {
    background-color: var(--oc-gray-0);
    border: 1px solid var(--oc-gray-3);
    border-radius: 2px;
    padding: 1px 4px;
    font-family: monospace, monospace;
    font-size: 0.92em;
}

.wysiwyg-editor pre code {
    background: none;
    border: none;
    padding: 0;
}

.wysiwyg-editor a {
    color: var(--oc-blue-7);
    text-decoration: underline;
}

.wysiwyg-editor a:hover {
    color: var(--oc-blue-9);
}

.wysiwyg-editor hr {
    border: none;
    border-block-start: 1px solid var(--oc-gray-4);
    margin: 1em 0;
}

.wysiwyg-editor img {
    max-width: 100%;
    height: auto;
}

.wysiwyg-editor table {
    border-collapse: collapse;
    margin: 0.5em 0;
}

.wysiwyg-editor table th,
.wysiwyg-editor table td {
    border: 1px solid var(--oc-gray-4);
    padding: 4px 8px;
}

.wysiwyg-editor table th {
    background-color: var(--oc-gray-1);
    font-weight: bold;
}

/* ===== Visual Tab ===== */

#content .jstTabs.tabs li a.tab-visual {
    /* Same styling as other tabs - inherited from .tabs a */
}

#content .jstTabs.tabs li a.tab-visual.selected {
    background-color: var(--oc-white);
    border: 1px solid var(--oc-gray-4);
    border-block-end: 1px solid var(--oc-white);
}

/* ===== Dark Mode Support ===== */

[data-theme="dark"] .wysiwyg-editor {
    background-color: var(--oc-gray-8);
    color: var(--oc-gray-2);
    border-color: var(--oc-gray-6);
}

[data-theme="dark"] .wysiwyg-editor:focus {
    border-color: var(--oc-blue-4);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .wysiwyg-editor h1 {
    color: var(--oc-gray-1);
    border-block-end-color: var(--oc-gray-6);
}

[data-theme="dark"] .wysiwyg-editor h2,
[data-theme="dark"] .wysiwyg-editor h3 {
    color: var(--oc-gray-1);
}

[data-theme="dark"] .wysiwyg-editor h4,
[data-theme="dark"] .wysiwyg-editor h5,
[data-theme="dark"] .wysiwyg-editor h6 {
    color: var(--oc-gray-2);
}

[data-theme="dark"] .wysiwyg-editor blockquote {
    border-inline-start-color: var(--oc-blue-6);
    background-color: var(--oc-gray-7);
    color: var(--oc-gray-3);
}

[data-theme="dark"] .wysiwyg-editor pre {
    background-color: var(--oc-gray-9);
    border-color: var(--oc-gray-6);
}

[data-theme="dark"] .wysiwyg-editor code {
    background-color: var(--oc-gray-7);
    border-color: var(--oc-gray-6);
}

[data-theme="dark"] .wysiwyg-editor pre code {
    background: none;
    border: none;
}

[data-theme="dark"] .wysiwyg-editor a {
    color: var(--oc-blue-4);
}

[data-theme="dark"] .wysiwyg-editor a:hover {
    color: var(--oc-blue-3);
}

[data-theme="dark"] .wysiwyg-editor hr {
    border-block-start-color: var(--oc-gray-6);
}

[data-theme="dark"] .wysiwyg-editor table th,
[data-theme="dark"] .wysiwyg-editor table td {
    border-color: var(--oc-gray-6);
}

[data-theme="dark"] .wysiwyg-editor table th {
    background-color: var(--oc-gray-7);
}

[data-theme="dark"] .wysiwyg-toolbar .wysiwyg-btn {
    border-color: var(--oc-gray-6);
    background-color: var(--oc-gray-7);
}

[data-theme="dark"] .wysiwyg-toolbar .wysiwyg-btn:hover {
    border-color: var(--oc-gray-5);
    background-color: var(--oc-gray-6);
}

[data-theme="dark"] .wysiwyg-toolbar .wysiwyg-btn.wysiwyg-btn-text {
    color: var(--oc-gray-3);
}

[data-theme="dark"] .wysiwyg-toolbar .wysiwyg-btn.wysiwyg-btn-text:hover {
    color: var(--oc-gray-1);
}

/* ========== computed_fields.css ========== */
/* ============================================
   Computed Custom Fields - Styles
   ============================================ */

/* ---- Formula Editor (Admin UI) ---- */

.computed-field-editor {
  margin-top: 10px;
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  padding: 10px;
  background: #fafafa;
}

.computed-field-editor legend {
  font-weight: bold;
  padding: 0 6px;
}

.formula-editor-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.formula-input-area {
  width: 100%;
}

.formula-input-area label {
  font-weight: bold;
  display: block;
  margin-bottom: 4px;
}

.formula-textarea {
  width: 100%;
  min-height: 60px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #333;
  resize: vertical;
  box-sizing: border-box;
}

.formula-textarea:focus {
  border-color: #628db6;
  outline: none;
  box-shadow: 0 0 3px rgba(98, 141, 182, 0.4);
}

/* Validation status */
.formula-validation {
  font-size: 12px;
  margin-top: 4px;
  min-height: 18px;
}

.formula-valid {
  color: #2b8a3e;
}

.formula-invalid {
  color: #c92a2a;
}

/* ---- Field Reference Chips ---- */

.formula-field-refs h4,
.formula-functions-ref h4,
.formula-preview-section h4 {
  font-size: 12px;
  color: #666;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-chips,
.function-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.field-chip,
.function-chip {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  background: #e8f0fe;
  color: #1a56db;
  border: 1px solid #b4d1ff;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.field-chip:hover,
.function-chip:hover {
  background: #c6ddff;
  border-color: #7aabff;
}

.field-chip:active,
.function-chip:active {
  background: #a3c9ff;
}

.field-chip-cf {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.field-chip-cf:hover {
  background: #fde68a;
  border-color: #f59e0b;
}

.function-chip {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

.function-chip:hover {
  background: #dcfce7;
  border-color: #4ade80;
}

/* ---- Formula Preview ---- */

.formula-preview-section {
  border-top: 1px solid #e0e0e0;
  padding-top: 8px;
}

.formula-test-inputs p {
  margin: 4px 0;
}

.formula-test-inputs label {
  display: inline-block;
  min-width: 140px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  color: #555;
}

.formula-test-input {
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.formula-test-inputs .info {
  font-size: 11px;
  color: #888;
  margin: 0 0 6px 0;
  font-style: italic;
}

#formula-preview-btn {
  margin-top: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}

.formula-preview-result {
  margin-top: 8px;
  padding: 6px 10px;
  min-height: 20px;
  font-size: 13px;
}

.formula-success {
  color: #2b8a3e;
}

.formula-error {
  color: #c92a2a;
}

.formula-computing {
  color: #666;
  font-style: italic;
}

/* ---- Computed Field Display in Issues ---- */

.computed-fields-readonly {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #ddd;
}

.computed-field-display {
  margin: 4px 0;
}

.computed-field-display label {
  font-weight: bold;
  color: #555;
}

.computed-field-display .computed-value {
  padding: 2px 6px;
  background: #f0f7ff;
  border-radius: 3px;
  font-weight: 500;
}

.computed-field-icon {
  font-size: 14px;
  cursor: help;
  vertical-align: middle;
  margin-right: 2px;
}

/* Badge style for computed fields in issue show view */
.attribute .computed-field-icon {
  font-size: 12px;
}

/* ---- Dark Mode ---- */

html[data-theme="dark"] .computed-field-editor {
  background: #2d2d2d;
  border-color: #444;
}

html[data-theme="dark"] .formula-textarea {
  background: #1e1e1e;
  color: #d4d4d4;
  border-color: #555;
}

html[data-theme="dark"] .formula-textarea:focus {
  border-color: #628db6;
  box-shadow: 0 0 3px rgba(98, 141, 182, 0.3);
}

html[data-theme="dark"] .formula-valid {
  color: #6bcb77;
}

html[data-theme="dark"] .formula-invalid {
  color: #ff6b6b;
}

html[data-theme="dark"] .field-chip {
  background: #1e3a5f;
  color: #93c5fd;
  border-color: #3b82f6;
}

html[data-theme="dark"] .field-chip:hover {
  background: #1e40af;
  border-color: #60a5fa;
}

html[data-theme="dark"] .field-chip-cf {
  background: #451a03;
  color: #fcd34d;
  border-color: #92400e;
}

html[data-theme="dark"] .field-chip-cf:hover {
  background: #78350f;
  border-color: #f59e0b;
}

html[data-theme="dark"] .function-chip {
  background: #052e16;
  color: #86efac;
  border-color: #166534;
}

html[data-theme="dark"] .function-chip:hover {
  background: #14532d;
  border-color: #22c55e;
}

html[data-theme="dark"] .formula-field-refs h4,
html[data-theme="dark"] .formula-functions-ref h4,
html[data-theme="dark"] .formula-preview-section h4 {
  color: #aaa;
}

html[data-theme="dark"] .formula-preview-section {
  border-top-color: #444;
}

html[data-theme="dark"] .formula-test-inputs label {
  color: #bbb;
}

html[data-theme="dark"] .formula-test-input {
  background: #1e1e1e;
  color: #d4d4d4;
  border-color: #555;
}

html[data-theme="dark"] .formula-test-inputs .info {
  color: #888;
}

html[data-theme="dark"] .formula-success {
  color: #6bcb77;
}

html[data-theme="dark"] .formula-error {
  color: #ff6b6b;
}

html[data-theme="dark"] .computed-fields-readonly {
  border-top-color: #444;
}

html[data-theme="dark"] .computed-field-display .computed-value {
  background: #1a2332;
  color: #d4d4d4;
}

html[data-theme="dark"] .computed-field-display label {
  color: #bbb;
}

/* ========== activity_heatmap.css ========== */
/* Activity Heatmap & Charts Styles */

#activity-charts-page {
  max-width: 1200px;
  margin: 0 auto;
}

.activity-charts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.activity-charts-header h2 {
  margin: 0;
}

.activity-charts-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.year-selector select {
  padding: 4px 8px;
  border: 1px solid #d1d5da;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
}

/* Sections */
.activity-charts-section {
  margin-bottom: 30px;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 20px;
}

.activity-charts-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #24292e;
  border-bottom: 1px solid #e1e4e8;
  padding-bottom: 10px;
}

/* Heatmap */
.heatmap-container {
  overflow-x: auto;
  padding: 5px 0;
}

.heatmap-svg {
  display: block;
}

.heatmap-cell {
  outline: 1px solid rgba(27, 31, 35, 0.06);
  outline-offset: -1px;
  transition: outline-color 0.1s;
}

.heatmap-cell:hover {
  outline: 2px solid rgba(27, 31, 35, 0.4);
  outline-offset: -1px;
}

.heatmap-month-label {
  font-size: 11px;
  fill: #586069;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.heatmap-day-label {
  font-size: 11px;
  fill: #586069;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.heatmap-stats {
  margin-bottom: 10px;
  font-size: 14px;
  color: #24292e;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.heatmap-total {
  font-weight: 600;
}

.heatmap-streak {
  color: #586069;
  font-size: 13px;
}

/* Legend */
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 8px;
  font-size: 12px;
  color: #586069;
}

.heatmap-legend-cell {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  outline: 1px solid rgba(27, 31, 35, 0.06);
}

.heatmap-legend-label {
  margin: 0 3px;
}

/* Tooltip */
.heatmap-tooltip {
  position: absolute;
  background: #24292e;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  line-height: 1.5;
}

.heatmap-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #24292e transparent transparent transparent;
}

/* Loading */
.heatmap-loading,
.treemap-loading {
  text-align: center;
  padding: 40px;
  color: #586069;
  font-size: 14px;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-card {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 15px;
}

.chart-card h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
}

.chart-wrapper {
  position: relative;
  height: 250px;
}

.chart-card-wide {
  border: none;
  padding: 0;
}

.chart-wrapper-wide {
  height: 300px;
}

/* Treemap */
.treemap-container {
  overflow: hidden;
  border-radius: 4px;
}

.treemap-svg {
  display: block;
  width: 100%;
}

.treemap-node rect {
  transition: opacity 0.15s;
}

.treemap-node:hover rect {
  opacity: 0.85;
}

.treemap-label {
  fill: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.treemap-value {
  fill: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.treemap-controls {
  margin-bottom: 10px;
  display: flex;
  gap: 15px;
}

.treemap-controls label {
  font-size: 13px;
  cursor: pointer;
  color: #24292e;
}

.treemap-controls input[type="radio"] {
  margin-right: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .activity-charts-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Dark Mode */
html[data-theme="dark"] .activity-charts-section {
  background: #0d1117;
  border-color: #30363d;
}

html[data-theme="dark"] .activity-charts-section h3 {
  color: #c9d1d9;
  border-bottom-color: #30363d;
}

html[data-theme="dark"] .heatmap-stats {
  color: #c9d1d9;
}

html[data-theme="dark"] .heatmap-streak {
  color: #8b949e;
}

html[data-theme="dark"] .heatmap-month-label,
html[data-theme="dark"] .heatmap-day-label {
  fill: #8b949e;
}

html[data-theme="dark"] .heatmap-legend {
  color: #8b949e;
}

html[data-theme="dark"] .heatmap-legend-cell {
  outline-color: rgba(240, 246, 252, 0.1);
}

html[data-theme="dark"] .heatmap-cell {
  outline-color: rgba(240, 246, 252, 0.06);
}

html[data-theme="dark"] .heatmap-cell:hover {
  outline-color: rgba(240, 246, 252, 0.4);
}

html[data-theme="dark"] .heatmap-tooltip {
  background: #1b1f23;
  color: #e1e4e8;
}

html[data-theme="dark"] .heatmap-tooltip::after {
  border-color: #1b1f23 transparent transparent transparent;
}

html[data-theme="dark"] .year-selector select {
  background: #0d1117;
  border-color: #30363d;
  color: #c9d1d9;
}

html[data-theme="dark"] .chart-card {
  background: #0d1117;
  border-color: #30363d;
}

html[data-theme="dark"] .chart-card h4 {
  color: #c9d1d9;
}

html[data-theme="dark"] .treemap-controls label {
  color: #c9d1d9;
}

html[data-theme="dark"] .heatmap-loading,
html[data-theme="dark"] .treemap-loading {
  color: #8b949e;
}

/* ========== code_review.css ========== */
/* Code Review / Pull Request Integration Styles */

/* ============================================
   Pull Request Cards on Issue Page
   ============================================ */

.pull-requests-section {
  margin: 8px 0;
}

.pull-request-card {
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fafafa;
  transition: border-color 0.2s;
}

.pull-request-card:hover {
  border-color: #999;
}

.pr-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.pr-title-link {
  font-weight: 600;
  color: #169;
  text-decoration: none;
}

.pr-title-link:hover {
  text-decoration: underline;
}

/* ============================================
   State Badges
   ============================================ */

.pr-state-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.badge-pr-open {
  background-color: #2ea44f;
  color: #fff;
}

.badge-pr-merged {
  background-color: #8250df;
  color: #fff;
}

.badge-pr-closed {
  background-color: #cf222e;
  color: #fff;
}

/* ============================================
   Provider Badges
   ============================================ */

.pr-provider-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pr-provider-github {
  background-color: #24292f;
  color: #fff;
}

.pr-provider-gitlab {
  background-color: #fc6d26;
  color: #fff;
}

.pr-provider-bitbucket {
  background-color: #0052cc;
  color: #fff;
}

/* ============================================
   PR Details Row
   ============================================ */

.pr-details {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #666;
}

.pr-branch code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 11px;
  background: #eef;
  padding: 1px 5px;
  border-radius: 3px;
  color: #476582;
}

.pr-author {
  color: #555;
}

/* ============================================
   CI Status Indicators
   ============================================ */

.ci-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}

.ci-ci-success,
.ci-success {
  background-color: #2ea44f;
}

.ci-ci-failure,
.ci-failure {
  background-color: #cf222e;
}

.ci-ci-pending,
.ci-pending {
  background-color: #bf8700;
  animation: ci-pulse 1.5s ease-in-out infinite;
}

@keyframes ci-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.pr-ci-status {
  display: inline-flex;
  align-items: center;
}

.pr-ci-success {
  color: #1a7f37;
}

.pr-ci-failure {
  color: #cf222e;
}

.pr-ci-pending {
  color: #9a6700;
}

/* ============================================
   Review Status Badges
   ============================================ */

.pr-review-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}

.badge-review-approved {
  background-color: #dafbe1;
  color: #1a7f37;
  border: 1px solid #aee5be;
}

.badge-review-changes-requested {
  background-color: #ffebe9;
  color: #cf222e;
  border: 1px solid #ffbeb8;
}

.badge-review-pending {
  background-color: #fff8c5;
  color: #9a6700;
  border: 1px solid #f5e0a0;
}

/* ============================================
   Additions / Deletions Stats
   ============================================ */

.pr-stats {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 11px;
  display: inline-flex;
  gap: 6px;
}

.pr-additions {
  color: #1a7f37;
  font-weight: 600;
}

.pr-deletions {
  color: #cf222e;
  font-weight: 600;
}

.pr-commits {
  color: #666;
  font-size: 11px;
}

.pr-merged-at {
  color: #8250df;
  font-size: 11px;
  font-style: italic;
}

/* ============================================
   Code Review Settings Form
   ============================================ */

.code-review-settings-form .box {
  margin-bottom: 16px;
}

.code-review-secret-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.code-review-secret-field {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
}

.code-review-generate-secret,
.code-review-copy-secret,
.code-review-copy-url {
  cursor: pointer;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #f5f5f5;
  color: #333;
}

.code-review-generate-secret:hover,
.code-review-copy-secret:hover,
.code-review-copy-url:hover {
  background: #e8e8e8;
  border-color: #999;
}

.copied {
  background: #dafbe1 !important;
  border-color: #aee5be !important;
  color: #1a7f37 !important;
}

.code-review-webhook-info {
  margin-top: 8px;
}

.code-review-webhook-info th {
  text-align: right;
  padding-right: 10px;
  white-space: nowrap;
  width: 160px;
}

.code-review-webhook-info code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  background: #eef;
  padding: 1px 5px;
  border-radius: 3px;
}

/* ============================================
   Dark Mode Support
   ============================================ */

html[data-theme="dark"] .pull-request-card {
  background: #21262d;
  border-color: #30363d;
}

html[data-theme="dark"] .pull-request-card:hover {
  border-color: #58a6ff;
}

html[data-theme="dark"] .pr-title-link {
  color: #58a6ff;
}

html[data-theme="dark"] .pr-details {
  color: #8b949e;
}

html[data-theme="dark"] .pr-branch code {
  background: #161b22;
  color: #79c0ff;
  border: 1px solid #30363d;
}

html[data-theme="dark"] .pr-author {
  color: #8b949e;
}

html[data-theme="dark"] .pr-commits {
  color: #8b949e;
}

html[data-theme="dark"] .badge-review-approved {
  background-color: #1b3626;
  color: #3fb950;
  border-color: #26492e;
}

html[data-theme="dark"] .badge-review-changes-requested {
  background-color: #3d1519;
  color: #f85149;
  border-color: #551720;
}

html[data-theme="dark"] .badge-review-pending {
  background-color: #3b2e00;
  color: #d29922;
  border-color: #4e3c00;
}

html[data-theme="dark"] .pr-ci-success {
  color: #3fb950;
}

html[data-theme="dark"] .pr-ci-failure {
  color: #f85149;
}

html[data-theme="dark"] .pr-ci-pending {
  color: #d29922;
}

html[data-theme="dark"] .pr-additions {
  color: #3fb950;
}

html[data-theme="dark"] .pr-deletions {
  color: #f85149;
}

html[data-theme="dark"] .pr-merged-at {
  color: #bc8cff;
}

html[data-theme="dark"] .code-review-secret-field {
  background: #161b22;
  color: #c9d1d9;
  border-color: #30363d;
}

html[data-theme="dark"] .code-review-generate-secret,
html[data-theme="dark"] .code-review-copy-secret,
html[data-theme="dark"] .code-review-copy-url {
  background: #21262d;
  color: #c9d1d9;
  border-color: #30363d;
}

html[data-theme="dark"] .code-review-generate-secret:hover,
html[data-theme="dark"] .code-review-copy-secret:hover,
html[data-theme="dark"] .code-review-copy-url:hover {
  background: #30363d;
  border-color: #58a6ff;
}

html[data-theme="dark"] .code-review-webhook-info code {
  background: #161b22;
  color: #79c0ff;
}

html[data-theme="dark"] .pr-provider-github {
  background-color: #c9d1d9;
  color: #24292f;
}

/* ========== dms.css ========== */
/* DMS - Document Management System Styles */

/* Toolbar */
.dms-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}
.dms-toolbar-left h2 {
  margin: 0;
  font-size: 1.2em;
}
.dms-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dms-toolbar-right a {
  white-space: nowrap;
}

/* View toggle buttons */
.dms-view-toggle {
  display: inline-flex;
  border: 1px solid #ccc;
  border-radius: 3px;
  overflow: hidden;
  margin-left: 8px;
}
.dms-view-btn {
  display: inline-block;
  padding: 3px 8px;
  text-decoration: none;
  color: #555;
  background: #f8f8f8;
  border-right: 1px solid #ccc;
  font-size: 14px;
  line-height: 1.4;
}
.dms-view-btn:last-child {
  border-right: none;
}
.dms-view-btn:hover {
  background: #eee;
}
.dms-view-btn.active {
  background: #628db6;
  color: #fff;
}

/* Breadcrumb */
.dms-breadcrumb {
  padding: 8px 0;
  margin-bottom: 12px;
  font-size: 0.95em;
}
.dms-breadcrumb a {
  color: #628db6;
  text-decoration: none;
}
.dms-breadcrumb a:hover {
  text-decoration: underline;
}
.dms-breadcrumb-sep {
  margin: 0 6px;
  color: #999;
}
.dms-breadcrumb-current {
  color: #333;
  font-weight: bold;
}

/* New folder & upload forms */
.dms-new-folder-form,
.dms-upload-form,
.dms-new-version-form,
.dms-move-form {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
}
.dms-new-folder-form h3,
.dms-upload-form h3,
.dms-new-version-form h3,
.dms-move-form h3 {
  margin-top: 0;
}

/* Dropzone */
.dms-dropzone {
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s ease;
  background: #fafafa;
}
.dms-dropzone-active,
.dms-dropzone:hover {
  border-color: #628db6;
  background: #f0f6fc;
}
.dms-dropzone-text {
  font-size: 1.1em;
  color: #666;
  margin: 0 0 8px 0;
}
.dms-dropzone-subtext {
  color: #999;
  font-size: 0.9em;
}
.dms-dropzone-icon {
  font-size: 2em;
  margin-bottom: 8px;
}

/* Content area drag highlight */
.dms-content.dms-dragover {
  background: #f0f6fc;
  outline: 2px dashed #628db6;
  outline-offset: -4px;
  border-radius: 4px;
}

/* Upload progress */
.dms-upload-progress {
  margin-top: 10px;
}
.dms-progress-bar {
  height: 20px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.dms-progress-fill {
  height: 100%;
  background: #628db6;
  border-radius: 10px;
  transition: width 0.3s ease;
}
.dms-progress-text {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.85em;
  color: #666;
}

/* List view table */
.dms-list-view {
  width: 100%;
}
.dms-list-view th {
  text-align: left;
  border-bottom: 1px solid #ddd;
  padding: 6px 8px;
  font-weight: bold;
  font-size: 0.85em;
  color: #666;
  white-space: nowrap;
}
.dms-list-view td {
  padding: 6px 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.dms-list-view tr:hover {
  background: #f5f5f5;
}
.dms-list-view tr.selected {
  background: #e8f0fe;
}
.dms-col-name {
  min-width: 200px;
}
.dms-col-size {
  width: 100px;
  white-space: nowrap;
}
.dms-col-modified {
  width: 140px;
  white-space: nowrap;
}
.dms-col-author {
  width: 120px;
}
.dms-col-version {
  width: 60px;
  text-align: center;
}
.dms-col-actions {
  width: 140px;
  white-space: nowrap;
  text-align: right;
}

/* File/Folder icons */
.dms-icon {
  display: inline-block;
  width: 18px;
  text-align: center;
  margin-right: 6px;
  font-size: 14px;
  vertical-align: middle;
}
.dms-icon-folder::before {
  content: "\1F4C1";
}
.dms-icon-file::before {
  content: "\1F4C4";
}
/* Extension-specific icons */
.dms-icon-pdf::before { content: "\1F4C4"; }
.dms-icon-doc::before, .dms-icon-docx::before { content: "\1F4C4"; }
.dms-icon-xls::before, .dms-icon-xlsx::before { content: "\1F4CA"; }
.dms-icon-ppt::before, .dms-icon-pptx::before { content: "\1F4CA"; }
.dms-icon-jpg::before, .dms-icon-jpeg::before, .dms-icon-png::before,
.dms-icon-gif::before, .dms-icon-svg::before, .dms-icon-webp::before { content: "\1F5BC"; }
.dms-icon-zip::before, .dms-icon-rar::before, .dms-icon-gz::before,
.dms-icon-tar::before { content: "\1F4E6"; }
.dms-icon-mp4::before, .dms-icon-avi::before, .dms-icon-mov::before { content: "\1F3A5"; }
.dms-icon-mp3::before, .dms-icon-wav::before { content: "\1F3B5"; }

/* Lock indicator */
.dms-lock-indicator {
  font-size: 12px;
  margin-left: 4px;
  vertical-align: middle;
}
.dms-file-locked {
  opacity: 0.85;
}

/* Version badge */
.dms-version-badge {
  display: inline-block;
  background: #628db6;
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.8em;
  font-weight: bold;
}
.dms-version-current-label {
  font-size: 0.85em;
  color: #666;
  font-style: italic;
}
.dms-current-version {
  background: #f0f6fc;
}

/* Grid view */
.dms-grid-view {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 0;
}
.dms-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  padding: 12px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  text-align: center;
  transition: all 0.15s ease;
  cursor: pointer;
}
.dms-grid-item:hover {
  border-color: #628db6;
  background: #f5f9fc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.dms-grid-item.selected {
  border-color: #628db6;
  background: #e8f0fe;
}
.dms-grid-icon {
  font-size: 36px;
  margin-bottom: 6px;
  line-height: 1;
}
.dms-grid-icon.dms-icon-folder::before { content: "\1F4C1"; }
.dms-grid-icon.dms-icon-file::before { content: "\1F4C4"; }
.dms-grid-icon.dms-icon-pdf::before { content: "\1F4C4"; }
.dms-grid-icon.dms-icon-doc::before, .dms-grid-icon.dms-icon-docx::before { content: "\1F4C4"; }
.dms-grid-icon.dms-icon-xls::before, .dms-grid-icon.dms-icon-xlsx::before { content: "\1F4CA"; }
.dms-grid-icon.dms-icon-jpg::before, .dms-grid-icon.dms-icon-jpeg::before,
.dms-grid-icon.dms-icon-png::before, .dms-grid-icon.dms-icon-gif::before,
.dms-grid-icon.dms-icon-svg::before { content: "\1F5BC"; }
.dms-grid-icon.dms-icon-zip::before, .dms-grid-icon.dms-icon-rar::before { content: "\1F4E6"; }
.dms-grid-icon.dms-icon-mp4::before, .dms-grid-icon.dms-icon-avi::before { content: "\1F3A5"; }
.dms-grid-icon.dms-icon-mp3::before, .dms-grid-icon.dms-icon-wav::before { content: "\1F3B5"; }

.dms-grid-name {
  font-size: 0.85em;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.3;
}
.dms-grid-meta {
  font-size: 0.75em;
  color: #999;
  margin-top: 4px;
}

/* File detail page */
.dms-file-info {
  margin-bottom: 16px;
}
.dms-file-info .attributes th {
  text-align: right;
  padding: 4px 12px 4px 0;
  color: #666;
  font-weight: normal;
  white-space: nowrap;
  width: 140px;
}
.dms-file-info .attributes td {
  padding: 4px 0;
}
.dms-file-breadcrumb {
  margin-bottom: 16px;
}
.dms-file-actions {
  margin: 16px 0;
  display: flex;
  gap: 12px;
}
.dms-file-actions a {
  display: inline-block;
}

/* Preview */
.dms-preview {
  margin: 20px 0;
}
.dms-preview-image {
  max-width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.dms-preview-pdf {
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Version history table */
.dms-version-table {
  width: 100%;
}

/* Dark mode support */
html[data-theme="dark"] .dms-toolbar {
  border-bottom-color: #444;
}
html[data-theme="dark"] .dms-breadcrumb a {
  color: #8bb8e8;
}
html[data-theme="dark"] .dms-breadcrumb-current {
  color: #ddd;
}
html[data-theme="dark"] .dms-view-btn {
  background: #333;
  color: #ccc;
  border-color: #555;
}
html[data-theme="dark"] .dms-view-btn:hover {
  background: #444;
}
html[data-theme="dark"] .dms-view-btn.active {
  background: #4a7aaa;
  color: #fff;
}
html[data-theme="dark"] .dms-new-folder-form,
html[data-theme="dark"] .dms-upload-form,
html[data-theme="dark"] .dms-new-version-form,
html[data-theme="dark"] .dms-move-form {
  background: #2a2a2a;
  border-color: #444;
}
html[data-theme="dark"] .dms-dropzone {
  border-color: #555;
  background: #2a2a2a;
}
html[data-theme="dark"] .dms-dropzone-active,
html[data-theme="dark"] .dms-dropzone:hover {
  border-color: #6ba3d6;
  background: #1e2d3d;
}
html[data-theme="dark"] .dms-dropzone-text {
  color: #aaa;
}
html[data-theme="dark"] .dms-list-view th {
  border-bottom-color: #444;
  color: #aaa;
}
html[data-theme="dark"] .dms-list-view td {
  border-bottom-color: #333;
}
html[data-theme="dark"] .dms-list-view tr:hover {
  background: #333;
}
html[data-theme="dark"] .dms-list-view tr.selected {
  background: #2a3a4a;
}
html[data-theme="dark"] .dms-grid-item {
  border-color: #444;
  color: #ddd;
}
html[data-theme="dark"] .dms-grid-item:hover {
  border-color: #6ba3d6;
  background: #2a3a4a;
}
html[data-theme="dark"] .dms-grid-item.selected {
  border-color: #6ba3d6;
  background: #253545;
}
html[data-theme="dark"] .dms-grid-meta {
  color: #777;
}
html[data-theme="dark"] .dms-version-badge {
  background: #4a7aaa;
}
html[data-theme="dark"] .dms-current-version {
  background: #253545;
}
html[data-theme="dark"] .dms-file-info .attributes th {
  color: #aaa;
}
html[data-theme="dark"] .dms-content.dms-dragover {
  background: #1e2d3d;
  outline-color: #6ba3d6;
}
html[data-theme="dark"] .dms-progress-bar {
  background: #444;
}
html[data-theme="dark"] .dms-progress-fill {
  background: #4a7aaa;
}
html[data-theme="dark"] .dms-preview-image,
html[data-theme="dark"] .dms-preview-pdf {
  border-color: #444;
}

/* Responsive */
@media screen and (max-width: 899px) {
  .dms-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .dms-col-author,
  .dms-col-version {
    display: none;
  }
  .dms-grid-item {
    width: 100px;
  }
}

/* ========== digest.css ========== */
/* =============================================
   Digest Settings Styles
   ============================================= */

/* Settings form layout */
#digest-settings-form .box.tabular p {
  margin: 8px 0;
}

#digest-settings-form .box.tabular label {
  width: 180px;
  display: inline-block;
  font-weight: bold;
  text-align: right;
  margin-right: 8px;
}

#digest-settings-form .box.tabular select {
  min-width: 180px;
}

#digest-settings-form .box.tabular input[type="checkbox"] {
  margin-right: 4px;
}

#digest-settings-form .box.tabular input[type="checkbox"] + label {
  width: auto;
  text-align: left;
  font-weight: normal;
}

/* Actions box */
#digest-actions {
  margin-top: 20px;
}

#digest-actions h3 {
  margin-bottom: 12px;
}

#digest-actions p {
  margin: 8px 0;
}

#digest-test-status {
  font-size: 0.9em;
  font-style: italic;
}

/* Preview area */
#digest-preview-area {
  background-color: #ffffff;
  max-height: 500px;
  overflow-y: auto;
}

#digest-preview-area h1 {
  font-size: 1.2em;
}

#digest-preview-area table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 8px;
}

#digest-preview-area th,
#digest-preview-area td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid #e9ecef;
}

#digest-preview-area th {
  background-color: #f1f3f5;
}

/* My Account page digest section */
.digest-account-section {
  margin-top: 8px;
}

.digest-account-section p {
  margin: 4px 0;
}

/* =============================================
   Dark Mode Support
   ============================================= */

html[data-theme="dark"] #digest-settings-form .box.tabular {
  background-color: #2b2b2b;
  border-color: #444;
}

html[data-theme="dark"] #digest-actions {
  background-color: #2b2b2b;
  border-color: #444;
}

html[data-theme="dark"] #digest-preview-area {
  background-color: #1e1e1e;
  border-color: #444;
  color: #ccc;
}

html[data-theme="dark"] #digest-preview-area th {
  background-color: #333;
  color: #ddd;
}

html[data-theme="dark"] #digest-preview-area td {
  border-bottom-color: #444;
}

html[data-theme="dark"] #digest-preview-area .project-header {
  background-color: #1a5276;
}

html[data-theme="dark"] #digest-preview-area .summary-box {
  background-color: #333;
  border-color: #555;
}

html[data-theme="dark"] #digest-test-status {
  color: #aaa;
}

/* ========== project_templates.css ========== */
/* Project Templates Styles */

/* Template badge */
.template-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  background-color: #628db6;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

/* Template list table */
.project-templates-list {
  margin-top: 16px;
}

.project-templates-list td.name {
  white-space: nowrap;
}

.project-templates-list td.description {
  color: #888;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-templates-list td.clone-count {
  text-align: center;
}

.project-templates-list td.buttons {
  white-space: nowrap;
  text-align: right;
}

.project-templates-list td.buttons a {
  margin-left: 8px;
}

/* Header area */
.project-templates-header {
  margin-bottom: 16px;
}

.project-templates-header .subtitle {
  color: #888;
  margin-top: 4px;
}

/* Actions section */
.project-templates-actions {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #ddd;
}

.project-templates-actions h3 {
  margin-bottom: 8px;
}

.project-templates-actions p {
  margin-bottom: 8px;
}

.project-templates-actions select {
  margin-right: 8px;
}

/* Template preview card */
.template-preview-card {
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 20px;
}

.template-preview-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
  color: #555;
}

.template-preview-details p {
  margin: 4px 0;
  font-size: 0.95em;
}

.template-preview-details strong {
  display: inline-block;
  min-width: 120px;
  color: #555;
}

/* Clone options fieldset */
#clone-options {
  margin-top: 16px;
}

#clone-options label.floating {
  min-width: 160px;
}

/* No templates message */
.project-templates-list + .nodata,
p.nodata {
  padding: 20px;
  text-align: center;
}

/* New project page template selector */
.template-selector-box {
  background: #f0f4f8;
  border: 1px solid #c0d0e0;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.template-selector-box label {
  font-weight: bold;
  margin-right: 8px;
}

.template-selector-box select {
  min-width: 300px;
}

.template-selector-box .info {
  display: block;
  margin-top: 4px;
  font-style: italic;
  color: #888;
}

/* Dark mode support */
html[data-theme="dark"] .template-badge {
  background-color: #4a7a9b;
  color: #e0e0e0;
}

html[data-theme="dark"] .template-preview-card {
  background: #2a2a2a;
  border-color: #444;
}

html[data-theme="dark"] .template-preview-card h3 {
  border-bottom-color: #444;
  color: #bbb;
}

html[data-theme="dark"] .template-preview-details strong {
  color: #bbb;
}

html[data-theme="dark"] .project-templates-list td.description {
  color: #999;
}

html[data-theme="dark"] .project-templates-actions {
  border-top-color: #444;
}

html[data-theme="dark"] .project-templates-header .subtitle {
  color: #999;
}

html[data-theme="dark"] .template-selector-box {
  background: #2a2e34;
  border-color: #444;
}

html[data-theme="dark"] .template-selector-box .info {
  color: #999;
}
