@import url("./_variables.css");

/* ========================================= */
/* BASE & RESET
/* ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* Icons Baseline */
i[class^="ri-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: normal;
}

/* ========================================= */
/* APP LAYOUT
/* ========================================= */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ========================================= */
/* SIDEBAR (Ultra Minimal)
/* ========================================= */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background-color: var(--bg-app);
  border-right: none;
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 50;
  padding: 24px 0 24px 16px;
}

.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
  padding: 24px 12px;
}

/* Profile Block */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 0 4px;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  overflow: hidden;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
}

.sidebar-username {
  color: var(--text-title);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
}

.sidebar-role {
  color: var(--text-dim);
  font-size: 11px;
}

.sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: background-color var(--snappy), color var(--snappy), transform var(--snappy);
}

.sidebar-toggle:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  justify-content: flex-start;
  padding: 0;
}

.sidebar.collapsed .sidebar-profile {
  width: 44px;
  justify-content: center;
  margin: 0;
}

.sidebar.collapsed .sidebar-user-info {
  display: none;
}

.sidebar.collapsed .sidebar-toggle {
  transform: rotate(180deg);
  margin: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
}

/* Search */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border-radius: var(--radius-md);
  margin-bottom: 32px;
  border: 1px solid var(--border-subtle);
  transition: all var(--snappy);
}

.sidebar-search:focus-within {
  border-color: var(--border-focus);
}

.sidebar-search-icon {
  color: var(--text-dim);
  font-size: 16px;
}

.sidebar-search input[type="search"] {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text-main) !important;
  font-size: 13px !important;
  width: 100% !important;
  padding: 0 !important;
}

.sidebar-search input[type="search"]::placeholder {
  color: var(--text-dim);
}

.sidebar.collapsed .sidebar-search {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-search input[type="search"] {
  display: none;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

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

.sidebar-section-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar.collapsed .sidebar-section-title {
  display: none;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--snappy), color var(--snappy), border-color var(--snappy);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.sidebar.collapsed .sidebar-item {
  display: grid;
  place-items: center;
  justify-content: center;
  inline-size: 44px !important;
  block-size: 44px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  flex: 0 0 44px !important;
  padding: 0 !important;
  gap: 0;
  margin: 0;
  box-sizing: border-box;
}

.sidebar-item-icon {
  font-size: 18px;
  color: var(--text-dim);
  transition: color var(--snappy);
}

.sidebar-item-text {
  font-size: 13px;
  font-weight: 500;
}

.sidebar.collapsed .sidebar-item-text {
  display: none;
}

.sidebar-item:hover:not(.disabled) {
  background: var(--bg-surface);
  color: var(--text-main);
}

.sidebar-item:hover:not(.disabled) .sidebar-item-icon {
  color: var(--text-main);
}

.sidebar-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.sidebar-item:focus {
  outline: none;
}

.sidebar-item:focus-visible {
  outline: none;
  border-color: var(--border-focus);
}

.sidebar-item.active .sidebar-item-icon {
  color: var(--text-main);
}

.sidebar-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========================================= */
/* MAIN CONTENT
/* ========================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  position: relative;
  overflow: hidden;
  /* Prevent body scroll, everything scrolls inside */
}

.tab-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Keep hidden here, scroll in the panel */
}

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

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-breadcrumb {
  display: none;
  /* Hide BlackBack text */
}

.page-title {
  font-size: 16px;
  /* Make title much smaller */
  font-weight: 500;
  color: var(--text-title);
  letter-spacing: -0.2px;
}

.add-data-table-item {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: var(--bg-surface);
  color: var(--text-title);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--snappy);
  font-size: 13px;
  font-weight: 500;
}

.add-data-table-item i {
  color: var(--text-title) !important;
}

.add-data-table-item:hover {
  background: var(--accent-faded);
  border-color: var(--border-focus);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  padding: 0 12px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: all var(--snappy);
  box-sizing: border-box;
}

.page-search:focus-within {
  border-color: var(--border-focus);
}

.page-search input[type="search"] {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text-main) !important;
  font-size: 13px !important;
  width: 160px !important;
  padding: 0 !important;
  height: 100% !important;
  line-height: 20px !important;
  caret-color: var(--text-main);
}

.page-search i {
  color: var(--text-dim);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sortable table headers - Unified Left Alignment */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-align: left !important;
}

/* Hide legacy sort icons if they exist in HTML to avoid doubling */
.data-table th .sort-icon {
  display: none !important;
}

.data-table th.sortable::after {
  content: ' ⇅';
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.25;
  transition: opacity var(--snappy);
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

.data-table th.sortable:hover {
  color: var(--text-main);
}

.data-table th.sortable:hover::after {
  opacity: 1 !important;
}




.data-table th.sort-asc::after {
  content: ' ↑';
  color: var(--text-main);
  opacity: 1;
}

.data-table th.sort-desc::after {
  content: ' ↓';
  color: var(--text-main);
  opacity: 1;
}


/* ========================================= */
/* TAB CONTENT & PANELS
/* ========================================= */
.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--content-padding) 32px var(--content-padding);
}

.sub-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sub-tab-panel {
  display: none;
  flex-direction: column;
  min-height: 0;
}

.sub-tab-panel.active {
  display: flex !important;
  flex: 1 1 auto;
}

#settings .sub-tab-content {
  flex: 1 1 auto;
  min-height: 0;
}

#settings .sub-tab-panel.active {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 0;
}


.tab-panel {
  display: none;
  flex-direction: column;
  min-height: 0;
}

.tab-panel.active {
  display: flex;
  flex: 1 1 auto;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.tab-panel-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  row-gap: 8px;
  width: 100%;
  padding: 18px 0 12px;
  background: var(--bg-app);
  position: sticky;
  top: 0;
  z-index: 1200;
  isolation: isolate;
  margin-bottom: 0;
}

body.egds-active .tab-panel-header::before,
body.tasks-active .tab-panel-header::before,
body.finances-active .tab-panel-header::before,
body.youtube-active .tab-panel-header::before,
body.training-active .tab-panel-header::before,
body.security-active .tab-panel-header::before,
body.profile-active .tab-panel-header::before,
body.statistics-active .tab-panel-header::before,
body.settings-active .tab-panel-header::before,
body.projects-active .tab-panel-header::before,
body.goals-active .tab-panel-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -40px;
  height: 40px;
  background: var(--bg-app);
  pointer-events: none;
}

body.egds-active .tab-panel-header,
body.tasks-active .tab-panel-header,
body.finances-active .tab-panel-header,
body.youtube-active .tab-panel-header,
body.training-active .tab-panel-header,
body.security-active .tab-panel-header,
body.profile-active .tab-panel-header,
body.statistics-active .tab-panel-header,
body.settings-active .tab-panel-header,
body.projects-active .tab-panel-header,
body.goals-active .tab-panel-header {
  padding-top: 26px;
}

.tab-panel-table {
  width: 100%;
}

.selected-data-table-item {
  display: none;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-muted);
  flex-shrink: 0;
}

.tab-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
  flex-shrink: 0;
}

.tab-header-right .page-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
}

.tab-header-right .search-container {
  margin-left: 0;
  min-width: 120px;
  flex: 1 1 220px;
  max-width: 360px;
}

.tab-header-right .page-search input[type="search"],
.tab-header-right .search-container input[type="search"] {
  width: 100% !important;
  min-width: 0;
}

.selected-data-table-item .sub-tab-icon {
  font-size: 14px;
  color: var(--text-dim);
}

.selected-data-table-item-badge {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-main);
}

.selected-data-table-item-label {
  font-size: 12px;
  line-height: 1;
  color: var(--text-dim);
  display: none;
}

.data-table-bulk-actions {
  display: none;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.task-bulk-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.task-bulk-more-toggle {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--snappy);
  white-space: nowrap;
}

.task-bulk-more-toggle:hover,
.task-bulk-more.is-open .task-bulk-more-toggle {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-focus);
  color: var(--text-main);
}

.task-bulk-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #111114;
  box-shadow: var(--shadow-md);
  z-index: 620;
}

.task-bulk-more.is-open .task-bulk-more-menu {
  display: flex;
}

.task-bulk-more-menu .task-bulk-action-btn {
  width: 100%;
  justify-content: flex-start;
}

.task-bulk-action-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--snappy);
  white-space: nowrap;
}

.task-bulk-action-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-focus);
  color: var(--text-main);
}

.tasks-smart-sort-toggle {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  margin-right: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--snappy);
  white-space: nowrap;
}

.tasks-smart-sort-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-focus);
  color: var(--text-main);
}

.tasks-smart-sort-toggle.active {
  background: rgba(106, 164, 255, 0.14);
  border-color: rgba(106, 164, 255, 0.42);
  color: #cfe0ff;
}

.delete-data-table-item {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: rgba(255, 68, 68, 0.04);
  border: 1px solid rgba(255, 68, 68, 0.22);
  border-radius: var(--radius-md);
  color: rgba(255, 80, 80, 0.88);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--snappy);
  flex-shrink: 0;
  white-space: nowrap;
}

.delete-data-table-item:hover {
  background: rgba(255, 68, 68, 0.1);
  border-color: rgba(255, 68, 68, 0.35);
  color: #ff4444;
}

.delete-data-table-item .sub-tab-icon {
  font-size: 16px;
  color: inherit;
}

.add-data-table-item {
  margin-left: 0;
  flex-shrink: 0;
}

/* Sub Tabs as clean text pills */
.sub-tab-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--snappy);
  flex-shrink: 0;
  white-space: nowrap;
}

.sub-tab-button.active {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-main) !important;
}

.sub-tab-button.active i {
  color: var(--text-main) !important;
}

.sub-tab-icon {
  font-size: 16px;
}

.sub-tab-button.active .sub-tab-icon {
  color: var(--text-main);
}

.sub-tab-button.is-static {
  cursor: default;
}

.sub-tabs-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1205;
}

.sub-tabs-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--snappy);
}

.sub-tabs-more-toggle:hover,
.sub-tabs-more.is-open .sub-tabs-more-toggle,
.sub-tabs-more-toggle.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.sub-tabs-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #111114;
  box-shadow: var(--shadow-md);
  z-index: 1300;
}

.sub-tabs-more.is-open .sub-tabs-more-menu {
  display: flex;
}

.sub-tabs-more-menu .sub-tab-button {
  width: 100%;
  justify-content: flex-start;
}

/* In-panel elements */
.search-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  padding: 0 12px;
  border-radius: var(--radius-md);
  height: 32px;
  margin-left: auto;
}

.search-container input[type="search"] {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text-main) !important;
  font-size: 13px !important;
  width: 200px !important;
  padding: 0 !important;
  height: 100% !important;
  line-height: 20px !important;
  caret-color: var(--text-main);
}

.page-search input[type="search"]::placeholder,
.search-container input[type="search"]::placeholder {
  transition: opacity 0.15s ease;
}

.page-search input[type="search"]:focus::placeholder,
.search-container input[type="search"]:focus::placeholder {
  opacity: 0;
}

.search-container i {
  color: var(--text-dim);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
}

.filter-button:hover {
  background: var(--border-focus);
}

/* ========================================= */
/* LISTS / DATA TABLES (Linear Style)
/* ========================================= */
.data-table-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  min-height: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table thead {
  position: relative;
  z-index: 23;
  background: #09090b;
}

.data-table thead tr {
  background: #09090b;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 24;
  background: #09090b !important;
  background-clip: padding-box;
}

.data-table th {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  position: relative;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.task-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-title);
  margin-bottom: 4px;
  line-height: 1.4;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  max-width: 100%;
}

.task-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.task-tag {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.2px;
}

/* Unified table look: tasks rows stay single-line like eGDS */
.data-table .task-title {
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--text-main) !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

.data-table .task-desc {
  display: -webkit-box !important;
}

.data-table .task-tags {
  display: flex !important;
}

.date-val {
  white-space: nowrap !important;
}

.col-category {
  min-width: 0;
}

.col-period {
  min-width: 0;
}

.col-limit {
  min-width: 0;
}

.col-checkbox {
  width: 32px;
  min-width: 32px;
  padding-left: 12px !important;
  padding-right: 0 !important;
  text-align: center;
}

.col-name {
  width: auto;
}



.task-timer-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.timer-button {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all var(--snappy);
  box-sizing: border-box;
}

.timer-button i {
  font-size: 18px;
  display: flex;
  line-height: 1;
}

.timer-button:hover {
  background: var(--accent-faded);
  border-color: var(--accent-base);
  color: var(--text-title);
}

.data-table th.col-checkbox {
  padding-left: 12px !important;
  padding-right: 0 !important;
}

/* Вилучено застарілі стилі кнопок дій */


/* Custom Checkbox */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--text-dim);
  border-radius: 4px !important;
  background: transparent;
  cursor: pointer;
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

input[type="checkbox"]:checked {
  background: var(--text-main);
  border-color: var(--text-main);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid var(--bg-app);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"].task-done {
  border-radius: 4px !important;
}

input[type="checkbox"].select-all-checkbox,
input[type="checkbox"].row-checkbox {
  border-radius: 50% !important;
}

.data-table td.col-checkbox .task-done {
  border-radius: 4px !important;
}

/* ========================================= */
/* FORMS & PANELS (Add/Edit)
/* ========================================= */
.add-edit-project-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.legacy-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1150;
  padding: 22px 16px;
  overflow: auto;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.legacy-modal.active {
  display: block !important;
}

.legacy-modal .add-edit-project-panel-header,
.legacy-modal .add-edit-project-panel-content,
.legacy-modal .add-edit-project-panel-actions {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}

.legacy-modal .add-edit-project-panel-header {
  margin-top: 24px;
  margin-bottom: 0;
  padding: 20px 22px 12px;
  border-top: 1px solid var(--border-subtle);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.legacy-modal .add-edit-project-panel-content {
  padding: 14px 22px 8px;
}

.legacy-modal .add-edit-project-panel-actions {
  margin-top: 0;
  padding: 14px 22px 20px;
  border-bottom: 1px solid var(--border-subtle);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

.add-edit-project-panel-header {
  margin-bottom: 20px;
}

.add-edit-project-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-title);
}

.add-edit-project-panel-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.add-edit-project-panel-row {
  display: flex;
  gap: 16px;
}

.add-edit-project-panel-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

.field-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"] {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 13px;
  transition: all var(--snappy);
}

input:focus {
  border-color: var(--text-dim);
  outline: none;
}

.add-edit-project-panel-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.edit-profile-panel .add-edit-project-panel-actions {
  justify-content: center;
}

.btn-save,
.btn-cancel {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--snappy);
}

.btn-save {
  background: var(--text-main);
  color: var(--bg-app);
  border: none;
}

.btn-save:hover {
  opacity: 0.9;
}

.btn-cancel {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-cancel:hover {
  background: var(--bg-surface);
}

/* ========================================= */
/* KANBAN BOARD
/* ========================================= */
.kanban-board {
  display: flex;
  gap: 16px;
  height: 100%;
  overflow-x: auto;
}

.kanban-column {
  min-width: 300px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kanban-column-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-title);
}

.kanban-column-count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-app);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.kanban-card {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: grab;
  transition: border var(--snappy);
}

.kanban-card:hover {
  border-color: var(--text-dim);
}

/* ========================================= */
/* NOTIFICATIONS
/* ========================================= */
.message-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 24px));
  min-width: 220px;
  padding: 12px 14px 12px 44px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.1px;
  color: var(--text-main);
  z-index: 1100;
  background: rgba(24, 24, 27, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.message-container::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateY(-50%);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.message-container::after {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.25);
}

.message-container.success {
  border-color: rgba(16, 185, 129, 0.28);
}

.message-container.error {
  border-color: rgba(239, 68, 68, 0.3);
}

.message-container.success::before {
  border-color: rgba(16, 185, 129, 0.85);
}

.message-container.error::before {
  border-color: rgba(239, 68, 68, 0.9);
}

.message-container.info::before {
  border-color: rgba(96, 165, 250, 0.85);
}

.message-container.success::after {
  background: rgba(16, 185, 129, 0.85);
}

.message-container.error::after {
  background: rgba(239, 68, 68, 0.9);
}

.message-container.info::after {
  background: rgba(96, 165, 250, 0.85);
}

.message-container.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-focus);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}



.add-edit-project-panel-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-more-btn {
  width: 28px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md) !important;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0;
  vertical-align: middle;
}

.row-more-btn:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.row-more-btn i {
  font-size: 16px;
  line-height: 1;
  display: none !important;
}

/* Hard fallback: always show vertical ellipsis even if icon font failed to load */
.row-more-btn::after {
  content: "⋮";
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-context-menu {
  position: absolute;
  z-index: 2000;
  background: var(--bg-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  min-width: 140px;
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
  opacity: 0;
  transition: transform var(--snappy), opacity var(--snappy);
  pointer-events: none;
}

.row-context-menu.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.row-context-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--snappy);
}

.row-context-menu .menu-item i {
  font-size: 14px;
  color: var(--text-dim);
  width: 16px;
  text-align: center;
}

.row-context-menu .menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-title);
}

.row-context-menu .menu-item.danger {
  color: var(--color-danger);
}

.row-context-menu .menu-item.danger i {
  color: var(--color-danger);
}

.row-context-menu .menu-item.danger:hover {
  background: var(--color-danger-bg);
}

.edit-data-table-item {
  width: 28px;
  height: 28px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text-dim);
}

.edit-data-table-item:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.timer-button {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--snappy);
}

.timer-button i {
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Замінено на компактне контекстне меню */





.sub-tab-button:hover {
  color: var(--text-main);
  background: var(--bg-surface);
}

.sub-tab-button.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.sub-tab-button i,
.sub-tab-button i.sub-tab-icon {
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.sub-tab-button span {
  font-weight: 500;
  pointer-events: none;
}

/* Precise alignment for checkboxes in tables */


/* Checkbox columns are narrow only when column is explicitly marked */
.data-table th.col-checkbox,
.data-table td.col-checkbox {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  text-align: left !important;
  padding: 12px 0 12px 12px !important;
  vertical-align: middle !important;
}

.select-all-checkbox,
.row-checkbox {
  margin: 0 !important;
  display: inline-block !important;
  cursor: pointer;
  vertical-align: middle;
}


/* Final table polishing: Align headers and columns perfectly */
.data-table th,
.data-table td {
  padding: 12px 16px !important;
  vertical-align: middle !important;
}

/* Task-only control columns sizing */
#tasks .data-table th.col-func,
#tasks .data-table td.col-checkbox {
  width: 40px !important;
  min-width: 40px !important;
  text-align: left !important;
  padding: 12px 0 12px 12px !important;
}

#tasks .data-table th.col-timer,
#tasks .data-table td.col-timer {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  text-align: center !important;
  padding: 8px 4px !important;
}

.data-table th.col-date,
.data-table td.col-date {
  white-space: nowrap !important;
}

#tasks .data-table th.col-actions,
#tasks .data-table td.col-actions {
  padding: 12px 16px !important;
  text-align: right !important;
}

#tasks .data-table th.col-name,
#tasks .data-table td.col-name {
  width: auto !important;
  max-width: none !important;
}

.tab-panel-header .sub-tab-button {
  flex-shrink: 0;
}

.tab-panel-header {
  flex-wrap: wrap;
  padding-top: 26px !important;
  padding-bottom: 6px !important;
  gap: 6px;
  row-gap: 6px;
}

.tab-header-right {
  flex: 0 0 auto;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 6px;
}

.tab-header-right .page-header-right {
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 6px;
}

.tab-header-right .search-container {
  flex: 1 1 180px;
  min-width: 72px;
  max-width: 260px;
}

@media (max-width: 1366px) {
  .tab-panel-header {
    row-gap: 6px;
  }

  .tab-header-right .search-container {
    min-width: 180px;
    max-width: 320px;
    flex: 1 1 220px;
  }
}


#tasks.bulk-selection-active .tab-header-right .search-container {
  flex: 0 1 112px;
  min-width: 56px;
  max-width: 112px;
}

.tab-header-right .page-search {
  transition: none !important;
}

/* Tables: auto height by content, but still shrink when viewport is small */
.sub-tab-panel .data-table-container,
.sub-tab-panel .tab-panel-table {
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
}

/* Action buttons column - Unified Alignment */
.data-table th.col-actions,
.data-table td.col-actions {
  text-align: right !important;
  padding: 12px 16px !important;
  width: 56px !important;
  min-width: 56px !important;
}

.data-table th.col-actions.sortable::after {
  margin-left: 6px;
  display: inline-block;
}



.timer-cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

/* Style for headers */
.data-table th {
  font-size: 13px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  white-space: nowrap !important;
}

/* Avoid doubled bottom line when table has header only (empty tbody) */
.data-table:has(tbody:empty) thead th {
  border-bottom: none !important;
}

/* Checkbox and timer alignment */
.select-all-checkbox,
.row-checkbox,
.task-done {
  display: inline-block !important;
  margin: 0 !important;
  vertical-align: middle;
}

.task-timer-controls {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 auto !important;
}

.task-timer-controls {
  width: 100% !important;
}


/* Modern and clean task tags */
.task-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 8px !important;
}

.task-tag {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-dim) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
}

.task-tag:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-main) !important;
  border-color: var(--accent-base) !important;
  cursor: default;
}



/* --- FINAL TABLE STYLES --- */
.data-table {
  border-collapse: collapse !important;
  width: 100% !important;
}

.data-table tbody tr:last-child,
.data-table tbody tr:last-child td {
  border-bottom: none !important;
}

.data-table td {
  /* Фіксовані відступи, які НІКОЛИ не змінюються */
  padding: 12px 16px !important;
  height: 54px !important;
  /* Гарантуємо однакову висоту рядка */
  box-sizing: border-box !important;
}

/* Hover: Subtle lifting effect */
.data-table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Ensuring row elements stay centered vertically */
.data-table td>* {
  vertical-align: middle;
}

/* Shared implementation for tasks and eGDS tables */
#tasks .data-table,
#egds .data-table,
#finances .data-table,
#youtube .data-table,
#projects .data-table,
#security .data-table,
#training .data-table,
#goals .data-table,
#settings .data-table {
  table-layout: auto;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.data-table-container,
.tab-panel-table {
  display: flex;
  flex-direction: column;
  /* Keep tables compact by content; don't stretch to full panel height */
  flex: 0 1 auto;
  min-height: auto;
  max-height: min(70dvh, calc(100dvh - 220px));
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.01);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

@media (max-width: 768px) {
  .data-table-container,
  .tab-panel-table {
    max-height: min(62dvh, calc(100dvh - 180px));
  }
}

.data-table-container::-webkit-scrollbar,
.tab-panel-table::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.table-edge-scrollbar {
  position: absolute;
  width: 1px;
  background: transparent;
  pointer-events: auto;
  cursor: ns-resize;
  user-select: none;
  z-index: 40;
}

.table-edge-scrollbar::before {
  content: "";
  position: absolute;
  left: -5.5px;
  top: 0;
  width: 12px;
  height: 100%;
}

.table-edge-scrollbar.is-hidden {
  opacity: 0;
}

.table-edge-scrollbar .table-edge-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  border-radius: 999px;
  background: #626262;
  box-shadow: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.table-edge-scrollbar:hover .table-edge-thumb {
  background: #707070;
  box-shadow: 0 0 0 1.5px #707070;
}

.table-bottom-scrollbar {
  position: absolute;
  height: 12px;
  background: transparent;
  pointer-events: auto;
  cursor: ew-resize;
  user-select: none;
  z-index: 40;
}

.table-bottom-scrollbar.is-hidden {
  opacity: 0;
}

.table-bottom-scrollbar .table-bottom-thumb {
  position: absolute;
  left: 0;
  top: 50%;
  height: 1px;
  border-radius: 999px;
  background: #626262;
  box-shadow: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.table-bottom-scrollbar:hover .table-bottom-thumb {
  background: #707070;
  box-shadow: 0 0 0 1.5px #707070;
}

.table-edge-scrollbar.is-dragging .table-edge-thumb {
  background: #828282;
  box-shadow: 0 0 0 2px #828282;
}

.table-bottom-scrollbar.is-dragging .table-bottom-thumb {
  background: #828282;
  box-shadow: 0 0 0 2px #828282;
}

#tasks .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#tasks .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#egds .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#egds .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#finances .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#finances .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#youtube .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#youtube .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#projects .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#projects .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#security .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#security .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#training .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#training .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#settings .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#settings .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#statistics .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#statistics .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#goals .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#goals .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer),
#profile .data-table th:not(.col-checkbox):not(.col-actions):not(.col-timer),
#profile .data-table td:not(.col-checkbox):not(.col-actions):not(.col-timer) {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* Tasks: keep one stable grid across all sub-tabs */
#tasks .sub-tab-panel .data-table {
  table-layout: fixed !important;
}

/* Unified table scroll host: same behavior across all tabs */
.data-table-container,
.tab-panel-table {
  overflow-x: auto !important;
  overflow-y: auto !important;
}

/* Unified sticky header for all data tables */
.data-table thead th {
  position: sticky !important;
  top: 0 !important;
}

.data-table thead th {
  z-index: 24 !important;
  background: #09090b !important;
}

/* Tasks header row (reference state) */
#tasks .data-table thead th {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}

#tasks .data-table thead th.col-actions,
#tasks .data-table thead th.col-func,
#tasks .data-table thead th.col-timer {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

#tasks .data-table thead th i[class^="ri-"] {
  font-size: 14px;
  line-height: 1;
}

/* Apply same compact header style to all non-tasks tables */
.tab-panel:not(#tasks) .data-table thead th {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}

.tab-panel:not(#tasks) .data-table thead th i[class^="ri-"] {
  font-size: 14px;
  line-height: 1;
}

#tasks .data-table th.col-date,
#tasks .data-table td.col-date {
  white-space: nowrap !important;
}

#tasks .data-table td.col-category,
#tasks .data-table td.col-period,
#tasks .data-table td.col-limit {
  white-space: nowrap;
}

#tasks .add-edit-project-panel,
#egds .add-edit-project-panel {
  margin-bottom: 12px;
}

/* Tasks: conditional alignment
   - rows with description/tags: top align
   - rows without extra content: middle align */
#tasks .data-table tbody tr.task-row-has-meta td {
  vertical-align: top !important;
  padding-top: 12px !important;
}

#tasks .data-table tbody tr:not(.task-row-has-meta) td {
  vertical-align: middle !important;
}

#egds select {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-app);
  color: var(--text-main);
}

body.egds-active .page-header-left,
body.tasks-active .page-header-left,
body.finances-active .page-header-left,
body.youtube-active .page-header-left,
body.training-active .page-header-left,
body.security-active .page-header-left,
body.profile-active .page-header-left,
body.statistics-active .page-header-left,
body.settings-active .page-header-left,
body.projects-active .page-header-left,
body.goals-active .page-header-left {
  display: none;
}

body.egds-active .page-header,
body.tasks-active .page-header,
body.finances-active .page-header,
body.youtube-active .page-header,
body.training-active .page-header,
body.security-active .page-header,
body.profile-active .page-header,
body.statistics-active .page-header,
body.settings-active .page-header,
body.projects-active .page-header,
body.goals-active .page-header {
  display: none;
}

body.egds-active .tab-content,
body.tasks-active .tab-content,
body.finances-active .tab-content,
body.youtube-active .tab-content,
body.training-active .tab-content,
body.security-active .tab-content,
body.profile-active .tab-content,
body.statistics-active .tab-content,
body.settings-active .tab-content,
body.projects-active .tab-content,
body.goals-active .tab-content {
  padding-top: 0;
  padding-bottom: 26px;
  padding-inline: 26px !important;
  overflow: hidden;
}

.tab-panel-header,
.sub-tab-content,
.sub-tab-panel .data-table-container {
  margin-inline: 0 !important;
}

body.statistics-active .tab-content {
  overflow-y: auto;
  overflow-x: hidden;
}

body.statistics-active #statistics .tab-header-right .page-header-right {
  display: none !important;
}

body.settings-active #settings .tab-header-right .page-header-right {
  display: none !important;
}

body.training-active #training .tab-header-right .page-header-right {
  display: none !important;
}

body.profile-active #profile .tab-header-right .page-header-right {
  display: none !important;
}

body.profile-active #profile .tab-panel-header {
  display: none;
}

/* Custom Modal Window Styles */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease-out;
}

.custom-modal.active {
  display: flex;
}

.custom-modal-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  border-radius: var(--radius-lg);
  width: 320px;
  max-height: calc(100vh - 32px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  text-align: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.custom-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

.custom-modal-close i {
  font-size: 16px;
  line-height: 1;
}

.custom-modal-close:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: #4d515b;
}

.custom-modal-title {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-title);
}

.custom-modal-message {
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
}

.custom-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.custom-modal-actions button {
  padding: 8px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: all 0.2s ease;
}

.btn-secondary {
  background: var(--border-subtle);
  color: var(--text-main);
}

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

.btn-danger {
  background: #ef4444;
  color: white;
}

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


/* Modal Styling Improvements */
.edit-modal-wide {
  width: 600px !important;
  max-width: 90vw !important;
  text-align: left !important;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  min-height: 0;
}

#add-task-modal .modal-form-scroll,
#edit-task-modal .modal-form-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  width: calc(100% - 12px);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 24px;
  padding-left: 4px;
  padding-right: 4px;
}

#add-task-modal .modal-form-scroll .modal-form-grid,
#edit-task-modal .modal-form-scroll .modal-form-grid {
  margin-bottom: 0;
}

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

.full-width {
  grid-column: span 2;
}


.field-input,
.field-select,
.field-textarea {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 8px !important;
  color: var(--text-main) !important;
  width: 100%;
  padding: 10px 12px !important;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.field-select-wrap {
  position: relative;
}

.field-select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #9ca3af;
  border-bottom: 2px solid #9ca3af;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  z-index: 4;
  transition: transform 120ms ease, border-color 120ms ease;
}

.field-select-wrap.is-open::after {
  transform: translateY(-35%) rotate(225deg);
  border-color: #c4cad8;
}

.field-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-main) !important;
  color-scheme: dark;
  padding-right: 44px !important;
  background-image: none;
  cursor: pointer;
}

.field-select-wrap > .field-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.field-select-trigger {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  text-align: left;
  padding: 10px 40px 10px 12px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}

.field-number-wrap {
  position: relative;
}

.field-input-number {
  padding-right: 44px !important;
  -moz-appearance: textfield;
}

.field-input-number::-webkit-outer-spin-button,
.field-input-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field-number-controls {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.field-number-btn {
  width: 20px;
  height: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.field-number-btn i {
  font-size: 10px;
  line-height: 1;
}

.field-number-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: #4d515b;
}

.field-select-wrap.is-open .field-select-trigger,
.field-select-trigger:focus-visible {
  border-color: #4b4e57;
  outline: none;
}

.field-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #242427 !important;
  border: 1px solid #3a3a40 !important;
  border-radius: 10px;
  box-shadow: none;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 15;
}

.field-select-wrap.is-open .field-select-menu {
  display: flex;
}

.field-select-menu::-webkit-scrollbar {
  width: 4px;
}

.field-select-menu::-webkit-scrollbar-thumb {
  background: rgba(148, 155, 173, 0.55);
  border-radius: 999px;
}

.field-select-option {
  width: 100%;
  border: none;
  border-radius: 8px;
  background: #242427 !important;
  color: var(--text-main);
  text-align: left;
  padding: 9px 10px;
  font-size: 14px;
  cursor: pointer;
}

.field-select-option:hover {
  background: #303036 !important;
}

.field-select-option.is-selected {
  background: #3a3a42 !important;
  color: var(--text-title);
}

.field-select option {
  background: #202024;
  color: var(--text-main);
}

.field-select option:checked {
  background: #2a2a31;
  color: var(--text-title);
}

.field-select option:disabled {
  color: var(--text-dim);
}

.date-field-wrap {
  position: relative;
}

.date-field-wrap .field-input {
  padding-left: 14px !important;
  padding-right: 42px !important;
}

.task-date-field-wrap .field-input {
  padding-right: 172px !important;
}

.date-picker-trigger {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--snappy), color var(--snappy), background var(--snappy);
}

.date-picker-trigger:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.06);
}

.date-today-trigger {
  position: absolute;
  top: 50%;
  right: 74px;
  transform: translateY(-50%);
  height: 28px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--snappy), color var(--snappy), background var(--snappy);
}

.date-today-trigger:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.06);
}

.date-shift-controls {
  position: absolute;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.date-shift-trigger {
  width: 100%;
  height: 50%;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--snappy), color var(--snappy), background var(--snappy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.date-shift-up {
  border-bottom: 1px solid var(--border-subtle);
}

.date-shift-trigger i {
  font-size: 12px;
}

.date-shift-trigger:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.native-date-picker {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.datetime-popover {
  position: fixed;
  z-index: 1200;
  width: 300px;
  background: #15161b;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.55);
  padding: 10px;
}

.datetime-popover[hidden] {
  display: none;
}

.dtp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dtp-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
}

.dtp-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dtp-month-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-title);
}

.dtp-weekdays,
.dtp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dtp-weekday {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 0;
}

.dtp-day {
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-size: 13px;
}

.dtp-day:hover {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.06);
}

.dtp-day.is-outside {
  color: rgba(255, 255, 255, 0.35);
}

.dtp-day.is-selected {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text-title);
}

.dtp-time {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.dtp-time-label {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 11px;
}

.dtp-time-sep {
  color: var(--text-dim);
  font-weight: 600;
}

.dtp-time-input {
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  text-align: center;
  outline: none;
}

.dtp-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.dtp-actions-left {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dtp-btn {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-radius: 8px;
  height: 32px;
  padding: 0 12px;
  cursor: pointer;
}

.dtp-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dtp-btn.apply {
  border-color: var(--border-focus);
}

.dtp-btn.ghost {
  color: var(--text-dim);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--text-muted) !important;
}

.field-textarea {
  resize: vertical;
  min-height: 120px;
}

#task-desc,
#edit-task-desc {
  max-width: 100%;
}

#add-task-modal .custom-modal-actions,
#edit-task-modal .custom-modal-actions {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(to top, var(--bg-surface), var(--bg-surface));
}

.checkbox-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin-top: 10px;
}

.checkbox-group input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  transform: none;
  vertical-align: middle;
}

.checkbox-group label {
  font-size: 13px !important;
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
  transform: none;
  display: inline-flex;
  align-items: center;
}

.user-tab-access-group {
  margin-top: 4px;
}

.user-tab-access {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 12px;
  width: 100%;
}

.user-tab-access-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 14px;
}

#settings .data-table th.col-name,
#settings .data-table td.col-name {
  width: 32%;
}

#settings .data-table th.col-value,
#settings .data-table td.col-value {
  width: 46%;
}

#settings .data-table th.col-date,
#settings .data-table td.col-date {
  width: 22%;
}

#settings .setting-input {
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color .16s ease, background .16s ease;
}

#settings .setting-input:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.04);
}

#settings .setting-value-static {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--text-main);
  font-weight: 500;
}

/* Improved Search Clear button style */
.search-clear {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: none !important;
  border: none !important;
  padding: 4px !important;
  cursor: pointer !important;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-dim) !important;
  z-index: 5;
}

.search-clear:hover {
  color: var(--text-main) !important;
}

.search-clear i {
  font-size: 16px !important;
}

.search-container {
  position: relative !important;
}

/* Page header search specific */
.page-search input {
  padding-right: 35px !important;
  /* Make room for the X button */
}


/* Hide default browser search clear button to prevent overlapping */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

/* Fix for Firefox */
input[type="search"] {
  appearance: none;
}

/* Modern Timer Design */
.task-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: #60a5fa;
  vertical-align: middle;
  line-height: 1;
  margin-left: 0;
  min-width: 64px;
  box-sizing: border-box;
}

.active-timer-badge {
  color: #60a5fa;
  /* Світло-синій (наприклад Tailwind blue-400) */
  animation: timer-blink-anim 2.5s infinite ease-in-out;
}

.task-timer.countdown {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
}

.task-timer.overtime {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.timer-blink {
  animation: timer-blink-anim 1.5s infinite ease-in-out;
}

@keyframes timer-blink-anim {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Tooltips */
[data-tooltip] {
  position: relative;
}

/* Smart Tooltips - Global Dynamic Tooltip Styles */
.smart-tooltip {
  position: fixed;
  padding: 6px 12px;
  background: var(--bg-surface);
  color: var(--text-title);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  z-index: 10000;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.smart-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.smart-tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  pointer-events: none;
}

/* Arrow Directions */
.smart-tooltip[data-pos="top"] .smart-tooltip-arrow {
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0 5px;
  border-color: var(--border-subtle) transparent transparent transparent;
}

.smart-tooltip[data-pos="bottom"] .smart-tooltip-arrow {
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 5px 5px 5px;
  border-color: transparent transparent var(--border-subtle) transparent;
}

.smart-tooltip[data-pos="left"] .smart-tooltip-arrow {
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px 0 5px 5px;
  border-color: transparent transparent transparent var(--border-subtle);
}

.smart-tooltip[data-pos="right"] .smart-tooltip-arrow {
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px 5px 5px 0;
  border-color: transparent var(--border-subtle) transparent transparent;
}

/* Profile Tab Styles */
.profile-content {
  display: grid;
  gap: 16px;
  width: min(860px, 100%);
  max-width: 100%;
  margin: 8px auto 0;
  padding: 8px 0 32px 0;
}

.profile-hero,
.profile-sections,
.profile-actions-card {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(8px);
}

.profile-hero {
  padding: 18px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  align-items: center;
}

.profile-avatar {
  width: 128px;
  height: 128px;
  background-color: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-avatar:hover {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-avatar:hover .avatar-overlay {
  opacity: 1;
}

.avatar-overlay i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  background: rgba(8, 12, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.profile-identity {
  min-width: 0;
}

.profile-kicker {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.profile-display-name {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text-title);
}

.profile-identity-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 12px;
}

.profile-chip i {
  color: var(--text-dim);
}

.profile-sections {
  padding: 0;
  overflow: hidden;
}

.profile-section {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-section:first-child {
  border-top: none;
}

.profile-section-label {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.profile-section-value {
  color: var(--text-title);
  font-weight: 600;
  font-size: 15px;
  justify-self: end;
}

.profile-actions-card {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#profile-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.edit-profile-button,
.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--snappy);
}

.logout-button {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.05);
}

.edit-profile-button:hover {
  background: var(--border-subtle);
  color: var(--text-title);
}

.logout-button:hover {
  background: var(--color-danger);
  color: #ffffff;
  border-color: var(--color-danger);
}

@media (max-width: 860px) {
  .profile-content {
    width: 100%;
    padding-right: 4px;
    padding-left: 4px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
  }

  .profile-display-name {
    font-size: 24px;
  }

  .profile-identity-meta {
    justify-content: center;
  }

  .profile-section {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 12px 14px;
  }

  .profile-section-label {
    font-size: 11px;
  }

  .profile-section-value {
    font-size: 14px;
    justify-self: start;
  }

  .profile-actions-card {
    flex-direction: column;
    align-items: flex-start;
  }

  #profile-actions {
    width: 100%;
  }

  .edit-profile-button,
  .logout-button {
    flex: 1 1 180px;
    justify-content: center;
  }
}

/* Deactivate legacy CSS tooltips */
[data-tooltip]::before,
[data-tooltip]::after {
  display: none !important;
  content: none !important;
}

/* ========================================= */
/* RESPONSIVE
/* ========================================= */
@media (max-width: 1200px) {
  .tab-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-search input[type="search"] {
    width: 130px !important;
  }

  .search-container input[type="search"] {
    width: 150px !important;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-w-collapsed);
    padding: 16px 10px;
  }

  .sidebar-user-info,
  .sidebar-section-title,
  .sidebar-item-text,
  .sidebar-search input[type="search"] {
    display: none;
  }

  .sidebar-header {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    padding: 0;
  }

  .sidebar-toggle {
    display: none !important;
  }

  .sidebar-item {
    justify-content: center;
    inline-size: 44px !important;
    block-size: 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    flex: 0 0 44px !important;
    padding: 0 !important;
    margin: 0 auto;
    border-radius: 12px;
    box-sizing: border-box;
  }

  .sidebar-search {
    justify-content: center;
    padding: 8px;
  }

  .tab-panel-header {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 8px;
  }

  .tab-header-right {
    width: 100%;
    justify-content: flex-end;
  }

  .sub-tab-button {
    padding: 6px 12px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .tab-content {
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: 16px;
  }

  .tab-panel-header {
    padding-top: 16px !important;
    padding-bottom: 10px;
    overflow: visible;
    scrollbar-width: none;
  }

  .tab-panel-header::-webkit-scrollbar {
    display: none;
  }

  .tab-header-right {
    width: auto;
    margin-left: auto;
    flex-shrink: 0;
  }

  .page-search,
  .search-container {
    height: 30px;
    padding: 0 10px;
  }

  .page-search input[type="search"],
  .search-container input[type="search"] {
    width: 110px !important;
    font-size: 12px !important;
  }

  .add-data-table-item {
    height: 30px;
    padding: 0 10px 0 8px;
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px !important;
  }

  .data-table td {
    font-size: 12px;
  }

  .task-title {
    font-size: 13px;
  }

  .task-desc {
    font-size: 11px;
  }

  .task-tag {
    font-size: 10px !important;
  }
}

.statistics-period-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-period-btn,
.stats-refresh-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.stats-period-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.stats-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bb-spin {
  animation: bbSpin 0.8s linear infinite;
}

@keyframes bbSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.statistics-dashboard {
  display: grid;
  gap: 18px;
  padding-bottom: 24px;
}

.statistics-section {
  display: grid;
  gap: 12px;
}

.statistics-section-title {
  margin: 0;
  font-size: 14px;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.statistics-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stats-kpi-card,
.stats-chart-card {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.015);
  border-radius: 14px;
  padding: 14px;
}

.stats-kpi-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.stats-kpi-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
}

.statistics-charts-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.statistics-secondary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-chart-title {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-main);
}

.stats-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.stats-card-head .stats-chart-title {
  margin-bottom: 0;
}

.stats-mini-switch {
  display: inline-flex;
  gap: 6px;
}

.stats-mini-btn {
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  padding: 0 10px;
  font-size: 11px;
  cursor: pointer;
}

.stats-mini-btn.active {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.stats-chart-body {
  min-height: 220px;
}

.stats-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 12px;
}

.stats-legend {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.stats-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.stats-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.stats-svg-line {
  width: 100%;
  height: 180px;
  display: block;
}

.stats-x-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(26px, 1fr));
  gap: 4px;
  margin-top: 8px;
}

.stats-x-labels span {
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
}

.stats-bar-row + .stats-bar-row {
  margin-top: 10px;
}

.stats-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}

.stats-bar-head span {
  color: var(--text-dim);
}

.stats-bar-head strong {
  color: var(--text-main);
}

.stats-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #7f90a6;
}

.stats-donut-wrap {
  width: 170px;
  height: 170px;
  margin: 0 auto 12px;
  position: relative;
}

.stats-donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
}

.stats-donut::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: var(--bg-surface);
}

.stats-donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  z-index: 2;
}

.stats-donut-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.stats-donut-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.stats-donut-legend-item span {
  color: var(--text-dim);
}

.stats-donut-legend-item strong {
  color: var(--text-main);
}

.stats-metric-inline {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.stats-metric-inline span {
  color: var(--text-dim);
}

.stats-metric-inline strong {
  color: var(--text-main);
}

.stats-progress-wrap {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.stats-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #8b9ab0;
  transition: width var(--snappy);
}

.stats-big-percent {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
}

.stats-list {
  display: grid;
  gap: 6px;
}

.stats-list-item {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.stats-list-item span {
  color: var(--text-dim);
}

.stats-list-item strong {
  color: var(--text-main);
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .statistics-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .statistics-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .statistics-charts-grid,
  .statistics-secondary-grid {
    grid-template-columns: 1fr;
  }

  .statistics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .statistics-kpi-grid {
    grid-template-columns: 1fr;
  }

  .stats-kpi-value {
    font-size: 18px;
  }

  .stats-donut-wrap {
    width: 140px;
    height: 140px;
  }
}

.training-section {
  display: grid;
  gap: 14px;
  padding-bottom: 24px;
}

.training-info {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.training-week,
.training-duration {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.training-label {
  color: var(--text-dim);
  font-size: 12px;
  margin-right: 6px;
}

.training-value {
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
}

.training-plan-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 14px;
}

.training-plan-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.training-plan-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.training-plan-chip {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(110, 193, 255, 0.45);
  background: rgba(110, 193, 255, 0.12);
  color: var(--text-main);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}

.training-plan-note,
.training-plan-progress {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.4;
}

.training-plan-progress {
  margin-top: 6px;
}

.training-week-status {
  margin-top: 10px;
  min-height: 30px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
}

.training-week-status.pending {
  border-color: rgba(255, 163, 87, 0.35);
  background: rgba(255, 163, 87, 0.12);
  color: #ffd39c;
}

.training-week-status.done {
  border-color: rgba(94, 230, 168, 0.45);
  background: rgba(94, 230, 168, 0.14);
  color: #8af0c1;
}

.training-form-title {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text-main);
}

.training-sets-form,
.training-current-session,
.training-today-sessions,
.training-history-filters {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
}

.training-form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.training-form-group {
  min-width: 180px;
  flex: 1 1 260px;
}

.training-form-group input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  padding: 0 10px;
}

.btn-add-set,
.btn-timer {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-add-set-plan {
  border-color: rgba(110, 193, 255, 0.45);
  background: rgba(110, 193, 255, 0.12);
}

.timer-display {
  font-size: 36px;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.training-sets-list {
  display: grid;
  gap: 8px;
}

.training-set-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.02);
}

.training-set-number {
  color: var(--text-dim);
  font-size: 12px;
}

.training-set-reps {
  color: var(--text-main);
  font-weight: 600;
}

.training-set-delete {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 80, 80, 0.3);
  background: rgba(255, 80, 80, 0.08);
  color: rgba(255, 110, 110, 0.95);
  cursor: pointer;
}

.training-today-title {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.training-session-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.training-session-result {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
}

.training-session-time {
  color: var(--text-dim);
  font-size: 12px;
}

.training-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.training-history-filters .filter-button {
  width: auto;
  min-width: 44px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  padding: 0 12px;
  white-space: nowrap;
  cursor: pointer;
}

.training-history-filters .filter-button.active {
  border-color: rgba(110, 193, 255, 0.5);
  background: rgba(110, 193, 255, 0.15);
}
