@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 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: all var(--snappy);
}

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

.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  gap: 24px;
  justify-content: center;
  padding: 0;
}

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

.sidebar.collapsed .sidebar-toggle {
  transform: rotate(180deg);
  margin: 0 auto;
}

/* 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: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all var(--snappy);
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 12px;
}

.sidebar-item-icon {
  font-size: 18px;
  color: var(--text-dim);
  transition: all 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: var(--accent-faded);
  color: var(--text-title);
}

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

.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 12px 0 10px;
  background: var(--accent-faded);
  color: var(--text-title);
  border: none;
  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(--bg-surface);
}

.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;
  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;
}


.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;
  gap: 12px;
  width: 100%;
  padding: 14px 0 16px;
  background: var(--bg-app);
  position: sticky;
  top: 0;
  z-index: 300;
  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 {
  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 {
  padding-top: 26px;
}

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

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

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

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

.delete-data-table-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: rgba(255, 80, 80, 0.7);
  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.08);
  border-color: rgba(255, 68, 68, 0.2);
  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: var(--accent-faded) !important;
  color: var(--text-title) !important;
}

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

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

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

/* 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: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.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,
.data-table .task-tags {
  display: none !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: 8px !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: 8px !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: 50%;
}

.select-all-checkbox,
.row-checkbox {
  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;
}

.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;
}

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;
}

.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;
  bottom: 24px;
  right: 24px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.message-container.success {
  border-left: 3px solid var(--color-success);
}

.message-container.error {
  border-left: 3px solid var(--color-danger);
}

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

/* 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-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: var(--accent-faded);
  color: var(--text-title);
}

.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 */


/* Precise alignment for checkboxes in tables */
.data-table th:first-child,
.data-table td:first-child {
  width: 40px !important;
  text-align: center !important;
  padding: 0 !important;
  vertical-align: middle !important;
}

.select-all-checkbox,
.row-checkbox {
  margin: 0 auto !important;
  display: block !important;
  cursor: pointer;
}


/* 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: center !important;
  padding: 8px 0 !important;
}

#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;
}

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

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

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

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



.data-table td:last-child {
  padding: 12px 16px !important;
  text-align: right !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

.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 centering */
.select-all-checkbox,
.row-checkbox,
.task-done,
.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 {
  table-layout: auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

#tasks .data-table-container,
#egds .tab-panel-table,
#finances .tab-panel-table,
#youtube .tab-panel-table,
#projects .tab-panel-table {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  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;
}

#tasks .data-table-container::-webkit-scrollbar,
#egds .tab-panel-table::-webkit-scrollbar,
#finances .tab-panel-table::-webkit-scrollbar,
#youtube .tab-panel-table::-webkit-scrollbar,
#projects .tab-panel-table::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.table-edge-scrollbar {
  position: absolute;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 40;
}

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

.table-edge-scrollbar .table-edge-thumb {
  position: absolute;
  right: 0;
  top: 0;
  width: 1px;
  border-radius: 0;
  background: #ffffff;
}

#tasks .data-table th,
#tasks .data-table td,
#egds .data-table th,
#egds .data-table td,
#finances .data-table th,
#finances .data-table td,
#youtube .data-table th,
#youtube .data-table td,
#projects .data-table th,
#projects .data-table td {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

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

#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 {
  display: none;
}

body.egds-active .page-header {
  display: none;
}

body.egds-active .tab-content {
  padding-top: 0;
  padding-bottom: 26px;
  overflow: hidden;
}

body.tasks-active .page-header-left {
  display: none;
}

body.tasks-active .page-header {
  display: none;
}

body.tasks-active .tab-content {
  padding-top: 0;
  padding-bottom: 26px;
  overflow: hidden;
}

body.finances-active .page-header-left {
  display: none;
}

body.finances-active .page-header {
  display: none;
}

body.finances-active .tab-content {
  padding-top: 0;
  padding-bottom: 26px;
  overflow: hidden;
}

body.youtube-active .page-header-left {
  display: none;
}

body.youtube-active .page-header {
  display: none;
}

body.youtube-active .tab-content {
  padding-top: 0;
  padding-bottom: 26px;
  overflow: hidden;
}

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 {
  display: none;
}

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 {
  display: none;
}

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 {
  padding-top: 0;
}

body.projects-active .tab-content {
  padding-bottom: 26px;
  overflow: hidden;
}

/* 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;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.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;
}

.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;
  padding: 10px 12px !important;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

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

.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: translateY(-1px);
  /* Візуальна корекція центрування відносно тексту */
}

.checkbox-group label {
  font-size: 13px !important;
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  transform: translateY(1px);
  /* Візуальна корекція центрування відносно чекбоксу */
}



/* 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 */
}


#finances .col-balance,
#finances .col-amount {
  font-weight: bold !important;
}

#finances .col-currency {
  color: var(--text-dim) !important;
}

#finances .data-table th.col-checkbox,
#finances .data-table td.col-checkbox {
  width: 40px !important;
  min-width: 40px !important;
  text-align: center !important;
  padding: 8px 0 !important;
}


/* 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 - Restored */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 600px;
  margin: 0;
  overflow-y: auto;
  padding: 20px 0 32px 0;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  background-color: var(--card-bg);
  border: 2px solid var(--accent-blue);
  border-radius: 50%;
  margin: 0 auto 20px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 163, 255, 0.4);
}

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

.avatar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.avatar-overlay i {
  color: white;
  font-size: 24px;
}

.profile-sections {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.profile-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-app);
}

.profile-section-label {
  color: var(--text-muted);
  font-size: 13px;
}

.profile-section-value {
  color: var(--text-title);
  font-weight: 500;
}

.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);
}

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