/* ===================================================================
   0) ТЕМА / ЗМІННІ
   =================================================================== */
:root{
  --bg:#0b0b0c;
  --fg:#f3f3f5;
  --muted:#b5b8c0;
  --card:#15161a;
  --line:#26262f;
  --accent:#0066cc;
  --hover-button: #202228;
  --danger: #ff3b30;
  --tile:#111215;
  --shadow-1:0 10px 26px rgba(0,0,0,.25);
  --shadow-2:0 18px 40px rgba(0,0,0,.45);
}

/* Світла тема */
body.light-theme {
  --bg: #f5f5f7;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --card: #ffffff;
  --line: #d2d2d7;
  --accent: #0066cc;
  --hover-button: #e8e8ed;
  --danger: #ff3b30;
  --tile: #fafafa;
  --shadow-1: 0 10px 26px rgba(0,0,0,.08);
  --shadow-2: 0 18px 40px rgba(0,0,0,.12);
}

body.light-theme .card-actions .ghost {
  background: transparent;
  border: 1px solid #d2d2d7;
  color: #1d1d1f;
}

body.light-theme .card-actions .ghost:hover {
  background: #e8e8ed;
}

/* ===================================================================
   1) БАЗА
   =================================================================== */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--fg);
  font-family: 'Geologica', sans-serif;
  font-size:16px; line-height:1.5;
}
a{color:var(--accent); text-decoration:none}
a:hover{filter:brightness(1.2)}

/* Хедер та контейнер */
.app-header{position:sticky; top:0; z-index:50; background:var(--tile); border-bottom:1px solid var(--line)}
.header-inner{padding:15px 30px; display:flex; align-items:center; justify-content:space-between}

.logo{
  width: 150px;
  height: 40px;
  background-image: url('logo-chronix.svg');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  cursor: pointer;
  transition: background-image 0.3s ease;
}

/* Зміна логотипу для світлої теми */
body.light-theme .logo {
  background-image: url('logo-chronix-dark.svg');
}
.user-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-width: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease-in-out;
}

.muted{color:var(--muted)}

.user-pill:hover{ background:var(--hover-button) }

#breadcrumbs{
    padding: 0 0 25px 0;
    font-size:14px; 
    min-height: 21px;
    display: flex; /* Для вирівнювання */
    align-items: center; /* Для вирівнювання */
}
#breadcrumbs .sep{margin:0 6px; color: var(--muted); opacity:.5}

/* Посилання на попередні сторінки - білі */
#breadcrumbs a {
    color: var(--fg);
    text-decoration: none;
    transition: color .15s;
}
#breadcrumbs a:hover {
    color: var(--accent); /* Стають синіми при наведенні */
}

/* Назва поточної сторінки - синя */
#breadcrumbs span {
    color: var(--accent);
    font-weight: 500;
}

#app-container{max-width:1440px; margin:0 auto; padding:25px}
#app {
    display: block;
    width: 100%;
    min-height: 1px;
}

/* Модифікатор для розтягування контейнера на всю ширину */
#app-container.is-fullwidth {
    max-width: none; /* Знімаємо обмеження по ширині */
    padding-left: 30px;  /* Встановлюємо бічні відступи як у хедера */
    padding-right: 30px;
}

/* ===================================================================
   2) КНОПКИ
   =================================================================== */
button{font:inherit; cursor:pointer}
button.primary{
  background:var(--accent); color:#fff; border:0; padding:10px 14px;
  border-radius:10px; transition:.15s;
}
button.primary:hover{
  filter:brightness(1.);
  transform: scale(1.05);
}
button.primary:active{transform:scale(.98)}
button.danger{
  background:var(--danger); color:#fff; border:0; padding:10px 14px;
  border-radius:10px; transition:.15s;
}
button.danger:hover{filter:brightness(1.1)}
button.danger:active{transform:scale(.98)}
button.ghost{
  background:transparent; color:var(--fg); border:1px solid var(--line);
  padding:10px 14px; border-radius:10px; transition:.15s;
}
button.ghost:hover{
  background:var(--hover-button);
  transform: scale(1.05);
}
button.ghost:active{transform:scale(.98)}

.icon-btn{
  width:40px; height:40px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--line); background:transparent; color:var(--fg);
  border-radius:999px; font-size:18px; transition:.15s;
}
.icon-btn:hover{background:var(--hover-button)}
.icon-btn:active{transform:scale(.95)}

.toolbar{display:flex; align-items:center; gap:10px; margin:10px 0}
.toolbar .spacer{flex:1}

/* ===================================================================
   3) ПЛИТКИ КАНАЛІВ
   =================================================================== */
.grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:18px;
}
.tile{
  position:relative; 
  height:400px; 
  background:var(--tile); 
  color:#fff; 
  border:0;
  border-radius:12px; 
  padding:30px; 
  text-align:left; 
  font-size:20px; 
  box-shadow:var(--shadow-1);
  cursor:pointer;
  transition: transform .15s ease-out, box-shadow .15s ease-out; 
  background-repeat:no-repeat;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

body.light-theme .tile {
  color: #1d1d1f;
}

/* Затемнення зверху, завжди видиме для тексту */
.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 50%);
  z-index: 1;
}

body.light-theme .tile::before {
  background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, transparent 50%);
}

/* Затемнення знизу, з'являється при наведенні для кнопок */
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 40%);
  z-index: 1;
  opacity: 0; /* Сховано за замовчуванням */
  transition: opacity .3s ease-out; /* Плавна поява */
}

body.light-theme .tile::after {
  background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, transparent 40%);
}

/* При наведенні мишки показуємо нижнє затемнення */
.tile:hover::after {
  opacity: 1;
}
.tile:hover{
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,.35);
}
.tile:active{transform:scale(.995)}

.tile-title, .tile-desc {
  position: relative; /* Необхідно для z-index */
  z-index: 2; /* Розміщуємо текст над затемненням */
}

.tile-title{font-weight:800; font-size:28px; margin-bottom:6px; text-wrap:balance}
.tile-desc{
  font-size:14px; opacity:.95; max-width:95%;
  display:-webkit-box; -webkit-line-clamp:5; line-clamp:5; -webkit-box-orient:vertical; overflow:hidden;
}

.tile-actions{
  position:absolute; 
  right:10px; 
  bottom:10px; 
  display:flex; 
  gap:10px;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease-out, transform .2s ease-out;
}
.tile:hover .tile-actions {
  opacity: 1;
  transform: translateY(0);
}
/* === Кнопки дій на картках (Редагувати / Видалити) === */
.tile-actions .mini {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: #fff;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  transition: background 0.15s ease-out, border-color 0.15s ease-out, transform 0.05s ease-out, color 0.15s ease-out;
}

/* --- РЕДАГУВАТИ --- */
.tile-actions .mini[data-act="edit"] {
  opacity: 0.8;
  color: #fff;
}
.tile-actions .mini[data-act="edit"]:hover {
  background: var(--accent);
  opacity: 1;
  color: #fff;
}

/* --- ВИДАЛИТИ --- */
.tile-actions .mini[data-act="del"] {
  opacity: 0.8;
  color: #ffffff;
}
.tile-actions .mini[data-act="del"]:hover {
  background: var(--danger);
  opacity: 1;
  color: #fff;
}

/* --- Загальна поведінка при натисканні --- */
.tile-actions .mini:active {
  transform: scale(0.95);
}

/* ===================================================================
   4) СПИСКИ/РЯДИ
   =================================================================== */
.list{display:flex; flex-direction:column; gap:12px}
.row{
  background:var(--tile); color:var(--fg); border-radius:12px; padding:12px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  box-shadow:var(--shadow-1); transition:background .15s ease, transform .06s ease, box-shadow .15s ease;
}
.row.clickable{cursor:pointer}
.row.clickable:hover{background:#17181c}
.row .left{display:flex; align-items:center; gap:12px}
.icon-square{
  width:48px; height:48px; background:var(--tile); color:var(--fg);
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:10px; font-size:20px; flex-shrink:0;
  border: 1px solid var(--line);
}

/* Світла тема: чорні іконки на білому */
body.light-theme .icon-square {
  background: #ffffff;
  color: #1d1d1f;
  border: 1px solid #d2d2d7;
}
.icon-square i{font-size:18px}
.row-right{display:flex; align-items:center; gap:6px}
.row-right .small{font-size:12px; padding:6px 8px}

/* Візуал для перетягуваного рядка у списках (канали/папки) */
.list .row.is-dragging {
  opacity: .55 !important;
  transform: scale(.995);            /* легке зменшення */
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}

/* На час перетягування прибираємо переходи, щоб не "тремтіло" */
.list.dragging .row {
  transition: none !important;
}


/* ===================================================================
   6) КАНБАН
   =================================================================== */
.board{
  display:flex;
  gap:16px;
  overflow-x:visible;
  padding-bottom:6px;
  align-items: stretch; 
  margin: 18px 0;
  
}

.lane{
  flex: 1;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding-left:20px;
  padding-right:20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-1);
}
.lane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0px;
  min-height: 32px;
  justify-content: space-between; /* ДОДАЙТЕ ЦЕЙ РЯДОК */
}

.lane-title {
  font-size: 16px;
  font-weight: 700;
  padding: 0; /* Прибираємо старий padding, який створював нерівність */
}

/* ДОДАЙТЕ ЦЕЙ НОВИЙ БЛОК для налаштування кнопки "+" */
.lane-head .ghost.small[data-act="addCard"] {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Забороняє кнопці стискатися */
}
.lane-drop{
  min-height: 140px;
  padding: 6px; /* Додамо трохи внутрішнього відступу */
 border: 1px dashed transparent; /* Додаємо пунктирну рамку */
  border-radius: 12px; /* Закруглюємо кути */
  flex-grow: 1;
  transition: background-color .2s ease, border-color .2s ease; /* Плавність */
}

/* Стилі для порожньої колонки */
.lane-drop.is-empty {
  position: relative; /* Потрібно для позиціонування тексту */
  display: flex;
  align-items: center;
  justify-content: center;
}
.lane-drop.is-empty::before {
  content: 'Перетягніть сюди';
  color: var(--muted);
  font-size: 14px;
}

/* Ефект при перетягуванні картки над колонкою */
.lane-drop.drag-over {
  background: rgba(0, 145, 229, 0.1);
  border-color: var(--accent);
}

.card-item{
  position: relative;
  background:var(--tile); color:var(--fg); border:1px solid var(--line); border-radius:10px; padding:12px; margin:6px 0;
  cursor:grab; user-select: none;
  transition: opacity .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-item.dragging{
  opacity: .35;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.card-title-text { font-weight: 600; line-height: 1.4; }
.card-desc-text {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.card-meta {
    display: flex;
    justify-content: space-between;;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}
.card-actions {
    display: flex;
    gap: 6px;
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity .15s;
    background: var(--tile);
    padding: 4px;
    border-radius: 8px;
}

.card-item:hover .card-actions { opacity: 1; }
/* ДОДАЙТЕ ЦЕЙ БЛОК: Стилі для пріоритетів карток */
.card-item.priority-urgent {
    border-left: 4px solid #e57373; /* Червоний */
}
.card-item.priority-medium {
    border-left: 4px solid #FFD54F; /* Жовтий */
}
.card-item.priority-low {
    border-left: 4px solid #81C784; /* Зелений */
}
.card-actions .ghost.small {
  padding: 5px; font-size: 11px; line-height: 1;
  border-radius: 6px; width: 26px; height: 26px; flex-shrink: 0;
  border: none;
}
.card-actions .ghost.small:hover { background-color: #2a2b2f; }

/* Стилі для пріоритетів та протермінованих карток */
.card-item.priority-urgent {
    border-left: 4px solid #e57373; /* Червоний */
}
.card-item.priority-medium {
    border-left: 4px solid #FFD54F; /* Жовтий */
}
.card-item.priority-low {
    border-left: 4px solid #81C784; /* Зелений */
}

.card-item.overdue {
    background-color: rgba(88, 1, 0, 0.15); /* Червонуватий фон */
    border-color: #e53935; /* Червона рамка */
}

/* Логіка показу дати/лічильника при наведенні */
.card-item .card-countdown {
    display: none; /* Ховаємо лічильник за замовчуванням */
}
.card-item:hover .card-date {
    display: none; /* При наведенні ховаємо дату */
}
.card-item:hover .card-countdown {
    display: block; /* ... і показуємо лічильник */
}

/* Виняток для карток "Без терміну" */
.card-item.priority-none:hover .card-date {
    display: block;
}
.card-item.priority-none:hover .card-countdown {
    display: none;
}

/* Кольори для тексту лічильника */
.card-item.priority-urgent .card-countdown { color: #e57373; font-weight: bold; }
.card-item.priority-medium .card-countdown { color: #FFD54F; font-weight: bold; }
.card-item.priority-low .card-countdown { color: #81C784; font-weight: bold; }

/* ===================================================================
   7) МОДАЛКИ
   =================================================================== */
.modal{position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.5)}
.modal.hidden{display:none}
.modal-card{width:min(560px,92vw); background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-2); overflow:hidden}
.modal-head,.modal-foot{display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--line)}
.modal-foot{border-top:1px solid var(--line); border-bottom:0}
.modal-body{padding:14px 16px; display:flex; flex-direction:column; gap:16px}

.modal-body input[type="text"], .modal-body textarea{
  width:100%; background:var(--tile);; color:var(--fg); border:1px solid var(--line);
  border-radius:10px; padding:10px; outline:none; font: inherit;
}
.modal-body textarea{min-height:120px; resize:vertical}

.btn-group{display:flex; gap:10px; flex-wrap:wrap}
.btn-choice {
    /* Додаємо ці властивості для керування відступом */
    display: inline-flex;
    align-items: center;
    gap: 8px; /* <--- Відступ між іконкою та текстом */

    /* Ваші існуючі стилі */
    transition: background .15s ease, box-shadow .15s ease, transform .06s ease, color .15s ease, border-color .15s ease;
}
.btn-choice.is-selected{background:var(--accent); border-color:var(--accent); color:#fff; box-shadow:0 8px 20px rgba(0,145,229,.25)}
.btn-choice.is-selected:hover{filter:brightness(1.05)}
.btn-choice.is-selected:active{transform:scale(.98)}

/* Кольори для кнопок вибору пріоритету (з ефектом світіння) */
.btn-choice[data-priority="urgent"].is-selected { 
    background-color: #e57373; 
    border-color: #e57373; 
    box-shadow: 0 8px 20px rgba(229, 115, 115, 0.3);
}
.btn-choice[data-priority="medium"].is-selected { 
    background-color: #FFD54F; 
    border-color: #FFD54F; 
    color: #222; 
    box-shadow: 0 8px 20px rgba(255, 213, 79, 0.3);
}
.btn-choice[data-priority="low"].is-selected { 
    background-color: #81C784; 
    border-color: #81C784; 
    box-shadow: 0 8px 20px rgba(129, 199, 132, 0.3);
}
.btn-choice[data-priority="none"].is-selected { 
    background-color: var(--accent); 
    border-color: var(--accent); 
    box-shadow: 0 8px 20px rgba(0, 145, 229, .25);
}

/* Кольори для кнопок вибору пріоритету */
.btn-choice[data-priority="urgent"].is-selected { 
    background-color: #e57373; 
    border-color: #e57373; 
    box-shadow: 0 8px 20px rgba(229, 115, 115, 0.3); /* Червоне світіння */
}
.btn-choice[data-priority="medium"].is-selected { 
    background-color: #FFD54F; 
    border-color: #FFD54F; 
    color: #222; 
    box-shadow: 0 8px 20px rgba(255, 213, 79, 0.3); /* Жовте світіння */
}
.btn-choice[data-priority="low"].is-selected { 
    background-color: #81C784; 
    border-color: #81C784; 
    box-shadow: 0 8px 20px rgba(129, 199, 132, 0.3); /* Зелене світіння */
}
.btn-choice[data-priority="none"].is-selected { 
    background-color: var(--accent); 
    border-color: var(--accent); 
    box-shadow: 0 8px 20px rgba(0, 145, 229, .25); /* Синє світіння (стандартне) */
}

.cover-preview{
  border:1px dashed var(--line); border-radius:12px; height:180px; display:flex;
  align-items:center; justify-content:center; color:var(--muted); background:var(--tile);;
  background-size:cover; background-position:center
}
.img-hint{ font-size: 13px; color: var(--muted); }

#icon-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(48px,1fr)); gap:10px; max-height:360px; overflow:auto;
}
.icon-btn.icon-choice{
  height:48px; display:flex; align-items:center; justify-content:center; background:#0f1014; color:#fff;
  border:1px solid var(--line); border-radius:10px; transition:.15s;
}
.icon-btn.icon-choice:hover{filter:brightness(1.1)}
.icon-btn.icon-choice.picked{background:var(--accent); border-color:var(--accent)}



/* ===================================================================
   9) ДОПОМІЖНІ КЛАСИ
   =================================================================== */
.hidden-by-js {
    display: none !important;
}

#auth-overlay.hidden-by-js {
  display: none !important;
  animation: none !important; /* не запускаємо fade-in, коли він схований */
}

.app-header.hidden-by-js {
  display: none !important;
}


/* ===================================================================
   10) СТИЛІ ДЛЯ РЕДАКТОРА QUILL.JS
   =================================================================== */
.text-editor-card {
    padding: 0; /* Прибираємо внутрішні відступи, щоб редактор прилягав до країв */
}
.ql-toolbar {
    background: #1f2024;
    border: none !important;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    padding: 12px !important;
    border-bottom: 1px solid var(--line) !important;
}

body.light-theme .ql-toolbar {
  background: #ffffff !important;
  border-color: #d2d2d7 !important;
}

.ql-toolbar .ql-stroke {
    stroke: var(--muted);
}
.ql-toolbar .ql-fill {
    fill: var(--muted);
}
.ql-toolbar .ql-picker-label {
    color: var(--muted);
}
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke {
    stroke: var(--fg);
}
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button:hover .ql-fill {
    fill: var(--fg);
}
.ql-snow .ql-toolbar button.ql-active .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,
.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke {
    stroke: var(--accent);
}
.ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,
.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill {
    fill: var(--accent);
}

.ql-container {
    border: none !important;
    
}
.ql-editor {
    min-height: 400px;
     background-color: var(--card); /* Встановлюємо темний фон */
    color: var(--fg);              /* Встановлюємо світлий колір тексту */
    color: var(--fg);
    font-family: 'Geologica', sans-serif;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    font-size: 16px;
    padding: 16px;
}
.ql-editor.ql-blank::before {
    color: var(--muted);
    font-style: normal;
    left: 16px;
}
.ql-snow .ql-picker.ql-size .ql-picker-label::before, 
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
    content: attr(data-value) 'px' !important;
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before { content: 'Малий' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before { content: 'Великий' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before { content: 'Дуже великий' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before { content: 'Малий' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before { content: 'Великий' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before { content: 'Дуже великий' !important; }



/* ===================================================================
   12) ФІНАЛЬНІ СТИЛІ ДЛЯ HANDSONTABLE
   =================================================================== */
  /* Головний контейнер таблиці */
  #table-outer-wrapper {
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
  padding: 0;
}

#table-container {
  border: none; /* прибираємо border звідси */
  border-radius: 0; /* прибираємо radius звідси */
  box-shadow: none; /* прибираємо shadow звідси */
  overflow: hidden;
  position: relative;
  background: var(--card);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

/* Внутрішній wrapper - scroll */
#handsontable-wrapper {
  width: 100%;
  overflow: auto;
}

.handsontable .wtHider {
  min-height: 0 !important;
  height: auto !important;
}

.handsontable .wtHolder {
  min-height: 0 !important;
}


/* Перевизначаємо стандартні кольори Handsontable, використовуючи ваші змінні */
    .handsontable td,
    .handsontable th {
    /* Кольори фону */

    background-color: var(--card) !important; /* Примусовий темний фон */
    color: #fff !important; /* Примусовий світлий текст */
    border-color: #3A3B3F !important;  /* Примусовий колір ліній */
    --ht-color-background: var(--card) !important;
    --ht-color-header-background: #1f2024  !important;
    --ht-color-row-header-background: #1f2024 !important;
    --ht-color-current-header-background: #333 !important;
    
    /* Встановлюємо висоту рядка, щоб вирівняти все по вертикалі */
    line-height: 2.0 !important; /* Спробуйте значення від 1.5 до 2.5 */

    /* Залишаємо відступи тільки по горизонталі */
    padding-left: 10px !important;
    padding-right: 10px !important;

    /* Кольори тексту */
    --ht-color-text: var(--fg);
    --ht-color-header-text: var(--fg);
    --ht-color-row-header-text: var(--muted);

    /* Кольори рамок */
    --ht-color-border: var(--line);
    --ht-color-table-border: var(--line);
    
    /* Кольори виділення */
    --ht-color-accent: var(--accent);
    --ht-color-selection-background: rgba(0, 145, 225, 0.2);
    --ht-color-selection-border: var(--accent);
}



/* Прибираємо зовнішні рамки таблиці */
.handsontable table {
  border: none !important;
}

.handsontable .wtHolder {
  border: none !important;
}

.handsontable .ht_master table,
.handsontable .ht_clone_top table,
.handsontable .ht_clone_left table,
.handsontable .ht_clone_corner table {
  border: none !important;
}

/* Залишаємо тільки внутрішні лінії (ліва та верхня) */
.handsontable td,
.handsontable th {
  border-left: 1px solid #27282b !important;
  border-top: 1px solid #27282b !important;
  border-right: none !important;
  border-bottom: none !important;
}

/* Прибираємо лінії зліва у першій колонці та зверху у першому рядку */
.handsontable td:first-child,
.handsontable th:first-child {
  border-left: none !important;
}

.handsontable tr:first-child td,
.handsontable tr:first-child th {
  border-top: none !important;
}

/* Світла тема для Handsontable */
body.light-theme .handsontable td,
body.light-theme .handsontable th {
  background-color: #ffffff !important;
  color: #1d1d1f !important;
  border-color: #d2d2d7 !important;
  --ht-color-background: #ffffff !important;
  --ht-color-header-background: #f5f5f7 !important;
  --ht-color-row-header-background: #f5f5f7 !important;
  --ht-color-current-header-background: #e8e8ed !important;
}

body.light-theme .handsontable {
  --ht-color-text: #1d1d1f !important;
  --ht-color-header-text: #1d1d1f !important;
  --ht-color-row-header-text: #1d1d1f !important;
  --ht-color-border: #d2d2d7 !important;
  --ht-color-table-border: #d2d2d7 !important;
  --ht-color-accent: #0066cc !important;
  --ht-color-selection-background: rgba(0, 102, 204, 0.2) !important;
  --ht-color-selection-border: #0066cc !important;
}

.handsontable th {
    font-weight: 600 !important;
    filter: brightness(85%); /* Робить фон на 15% темнішим */
}

body.light-theme .handsontable th {
  filter: brightness(95%);
}

body.light-theme .handsontable textarea {
  background-color: #ffffff !important;
  color: #1d1d1f !important;
}

body.light-theme .handsontable .handsontableInput {
  background-color: #ffffff !important;
  color: #1d1d1f !important;
}

body.light-theme .handsontable .htEditor {
  background-color: #ffffff !important;
  color: #1d1d1f !important;
}


/* ============= Контекстне меню Handsontable ============= */

/* Основний контейнер */
.htContextMenu {
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: var(--shadow-2) !important;
  border: 1px solid var(--line) !important;
  background: var(--card) !important;
  padding: 0 !important;
  max-width: fit-content !important;
  width: auto !important;
}

/* Прибираємо фони з усіх вкладених елементів */
.htContextMenu *, .htContextMenu table, .htContextMenu tbody, .htContextMenu thead, 
.htContextMenu tr, .htContextMenu td {
  background: transparent !important;
  background-color: transparent !important;
}

/* Таблиця */
.htContextMenu table {
  border: none !important;
  width: 100% !important;
  margin: 0 !important;
  border-spacing: 0 !important;
  border-collapse: collapse !important;
}

.htContextMenu .wtHolder {
  height: auto !important;
}

/* Прибираємо scrollbar */
.htContextMenu .wtHolder, .htContextMenu .ht_master {
  overflow: visible !important;
  width: 100% !important;
}

/* Пункти меню */
.htContextMenu td {
  color: var(--fg) !important;
  padding-left: 0px !important;
  padding-right: 0px !important;
  padding-top: 0 !important;
padding-bottom: 0 !important;
  border: none !important;
}

.htItemWrapper{
  margin: 0px !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
}
.htContextMenu .htSeparator .htItemWrapper {
  padding-top: 0px !important;
  padding-bottom: 0px !important;
}

/* Ховер */
.htContextMenu .htItemWrapper:hover {
  background-color: rgba(255, 255, 255, 0.1) !important; /* світліший фон для темної теми */
  color: var(--fg) !important;
}



.htContextMenu tbody tr td.current .htItemWrapper {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--fg) !important;
}

/* Розділювач */
.htContextMenu .htSeparator {
  height: 1px !important;
  background: var(--line) !important;
}

/* Розділювач */
body.light-theme .htContextMenu .htSeparator {
  height: 1px !important;
  background: var(--hover-button) !important;
}


/* Світла тема */
body.light-theme .htContextMenu {
  background: var(--card) !important;
  border-color: var(--line) !important;
}

body.light-theme .htContextMenu .htItemWrapper:hover {
  background-color: rgba(0, 0, 0, 0.05) !important; /* темніший для світлої теми */
}

.htContextMenu td.htDisabled .htItemWrapper {
  color: var(--muted) !important; /* Робимо текст сірим */
  opacity: 0.6; /* Трохи приглушуємо */
  cursor: not-allowed; /* Курсор "заборонено" */
}

/* Прибираємо ефект "ховеру" (підсвітку) для неактивних пунктів */
.htContextMenu td.htDisabled.current .htItemWrapper,
.htContextMenu td.htDisabled:hover .htItemWrapper {
  background-color: transparent !important;
}



/* Кастомний стиль поля редагування у Handsontable */
.handsontableInput {
  background-color: #424249 !important;   /* твій колір фону під час редагування */
  color: #f3f3f5 !important;              /* колір тексту */
  /* border: 1px solid #f1b93e !important;   /* рамка (можеш змінити або прибрати) */
  /* box-shadow: 0 0 0px rgba(241,185,62,0.3) !important; /* м’яке світіння */
  /* border-radius: 6px !important;          /* трохи округлити поле */
  /* padding: 4px 6px !important;            /* щоб текст не торкався країв */
}


/* ===================================================================
   РОЗДІЛЯЄМО ТЕКСТ ТА ІКОНКУ В ЗАГОЛОВКАХ (змінено порядок)
   =================================================================== */

.handsontable th > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* flex-direction: row-reverse; */
  width: 100%;
}


/* ===== HOT: своя стрілка у заголовку, рідні кнопки непомітні ===== */

/* Шапка — відносне позиціювання й видимі переповнення (на випадок накладань) */
.handsontable thead th {
  position: relative !important;
  overflow: visible !important;
}

/* Текст заголовка зліва; справа залишаємо місце під стрілку/кнопку */
.handsontable thead th .colHeader {
  display: block !important;
  text-align: left !important;
  padding: 8px 26px 8px 10px !important;   /* Збільшені вертикальні відступи (зверху і знизу) */
  text-align: left !important;
  box-sizing: border-box !important;
  font-weight: 600;
}

/* 1) Рідні кнопки меню — невидимі, але приймають кліки */
.handsontable thead th .htDropdownMenuButton,
.handsontable thead th .htFiltersMenuButton,
.handsontable thead th button[aria-label*="menu"],
.handsontable thead th button[aria-label*="Menu"],
.handsontable thead th button.changeType {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  opacity: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: auto !important;
  z-index: 2 !important;
  display: none !important; /* ВАЖЛИВОЮ, прибрав на деякий час */
}
/* Прибираємо будь-які внутрішні іконки в цих кнопках */
.handsontable thead th .htDropdownMenuButton > *,
.handsontable thead th .htFiltersMenuButton > *,
.handsontable thead th button[aria-label*="menu"] > *,
.handsontable thead th button[aria-label*="Menu"] > *,
.handsontable thead th button.changeType > * {
  display: none !important;
}

/* 2) Наша єдина стрілка — псевдоелемент у .colHeader */
.handsontable thead th .colHeader::after {
  content: "▼";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%) scaleY(0.95);
  font-size: 11px;
  color: #9aa0a6;
  line-height: 1;
  pointer-events: none;  
  z-index: 1;  
  display: none !important; /* ВАЖЛИВОЮ, прибрав на деякий час */
}

/* Ховер-ефект */
.handsontable thead th:hover .colHeader::after {
  color: var(--accent, #0091e5);
}

/* ===================================================================
   Вирівнювання тексту в самій клітинці заголовка (th)
   =================================================================== */
.handsontable thead th {
  padding-left: 6px !important;   /* зменшує стандартний внутрішній відступ */
  text-align: left !important;
}

.handsontable thead th .colHeader {
  padding-left: 0 !important;     /* прибирає подвійну відстань */
  justify-content: flex-start !important;
  text-align: left !important;
}

/* --- Курсор для чекбоксів у таблиці (v3 - фінал) --- */

/* 1. Застосовуємо до самої клітинки */
.handsontable td.htCheckbox {
    cursor: pointer !important;
}

/* 2. Застосовуємо до самого <input> та <label> всередині */
.handsontable td.htCheckbox input,
.handsontable td.htCheckbox label {
    cursor: pointer !important;
}

/* Приглушені номери рядків */
.handsontable tbody th .relative {
  color: var(--muted) !important;
  opacity: 0.6;
}
/* ===================================================================
   СТИЛІ ДЛЯ ВЕРСІЇ ДОДАТКУ
   =================================================================== */
.app-version {
    position: fixed;   /* Фіксуємо позицію відносно вікна браузера */
    right: 15px;       /* Відступ 15px від правого краю */
    bottom: 10px;      /* Відступ 10px від нижнього краю */
    color: var(--muted); /* Використовуємо ваш "приглушений" колір тексту */
    font-size: 12px;   /* Робимо шрифт маленьким */
    opacity: 0.5;      /* Робимо його напівпрозорим, щоб не заважав */
}


/* ===================== AUTH FORM ===================== */

#auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #0b0b0c); /* повністю затемнюємо фон */
  z-index: 9999;
  animation: fadeInOverlay 0.4s ease forwards;
}

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

.login {
  background: var(--card, #15161a);
  padding: 32px 36px;
  border-radius: 20px;
  min-width: 360px;
  border: 1px solid var(--line, #26262f);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: fadeInForm 0.5s ease-out;
}

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

.login h3 {
  color: var(--fg, #f3f3f5);
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 20px;
}

.login input {
  width: 100%;
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line, #2a2a33);
  background: var(--tile, #111215);
  color: var(--fg, #f3f3f5);
  font-size: 15px;
  outline: none;
  transition: border 0.25s, background 0.25s, box-shadow 0.25s;
}

.login input::placeholder {
  color: var(--muted, #b5b8c0);
  opacity: 0.9;
}

.login input:focus {
  border-color: var(--accent, #0091e5);
  background: var(--bg, #0b0b0c);
  box-shadow: 0 0 0 2px rgba(0, 145, 229, 0.2);
}

.login input:focus {
  border-color: var(--accent, #0091e5);
  background: var(--bg, #0b0b0c);
}

.login button {
  width: 100%;
  padding: 12px;
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid var(--line, #26262f);
  background: var(--accent, #0091e5);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.login button:hover {
  background: #00a3ff;
}

.login .muted {
  opacity: 0.7;
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted, #b5b8c0);
}

.app {
  display: none; /* головний інтерфейс приховано до входу */
}

.input-group {
  position: relative;
  width: 100%;
  margin: 10px 0;
}

.input-group i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted, #b5b8c0);
  font-size: 15px;
  pointer-events: none;
  transition: color 0.25s;
}

.input-group input {
  width: 100%;
  padding: 12px 14px 12px 38px; /* відступ під іконку */
  border-radius: 10px;
  border: 1px solid var(--line, #2a2a33);
  background: var(--tile, #111215);
  color: var(--fg, #f3f3f5);
  font-size: 15px;
  outline: none;
  transition: border 0.25s, background 0.25s, box-shadow 0.25s;
}

.input-group input::placeholder {
  color: var(--muted, #b5b8c0);
  opacity: 0.9;
}

.input-group input:focus {
  border-color: var(--accent, #0091e5);
  background: var(--bg, #0b0b0c);
  box-shadow: 0 0 0 2px rgba(0, 145, 229, 0.2);
}

.input-group input:focus + i {
  color: var(--accent, #0091e5);
}


.muted { opacity: 0.7; }

/* ===================================================================
   13) СТИЛІ ДЛЯ ВИКОНАВЦІВ (КАНБАН) - ОНОВЛЕНА ВЕРСІЯ
   =================================================================== */

/* --- Модальне вікно --- */
.performers-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #0f1014;
  min-height: 42px;
}

.performer-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--accent);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.performer-pill button {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.7;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
}
.performer-pill button:hover {
  opacity: 1;
}

.available-performers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.performer-choice-btn {
  background: var(--tile);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
}

.performer-choice-btn:hover {
  border-color: var(--accent);
  color: var(--fg);
}

.performer-choice-btn.is-selected {
  background: var(--fg); /* Білий фон */
  border-color: var(--fg);
  color: var(--bg); /* Темний текст */
  font-weight: 700;
}

/* --- Відображення на картці --- */
.card-performers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.performer-tag {
  font-size: 12px;
  background: var(--tile);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Стиль для групування полів у модалках */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px; /* Відступ між лейблом та полем */
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  text-align: center;
  padding: 24px;
}
.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
}
.stat-label {
  font-size: 14px;
  color: var(--muted);
}
.top-video-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  text-decoration: none;
  color: var(--fg);
  background: var(--tile);
  border-radius: 12px;
  transition: background .15s ease;
}
.top-video-card:hover {
  background: var(--hover-button);
  filter: none;
}
.top-video-card img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
}
.video-title {
  font-weight: 600;
}



/* ===================================================================
   СТИЛІ ДЛЯ ПОШУКУ В ХЕДЕРІ (v3 - Final)
   =================================================================== */

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Кнопка перемикання теми */
#theme-toggle {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  font-size: 18px;
  transition: .15s;
  cursor: pointer;
}

#theme-toggle:hover {
  background: var(--hover-button);
}

#theme-toggle:active {
  transform: scale(.95);
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  /* Початковий стан: круг */
  width: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px; /* Робить його круглим/капсулою */
  transition: all 0.3s ease-in-out;
}

/* Активний стан: розгорнута капсула */
.search-container.is-active {
  width: 280px;
  background: var(--tile);
}

#search-btn {
  /* Кнопка - це лише прозора область для кліку та іконки */
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 40px;
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 16px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
#search-btn:hover {
  background-color: var(--hover-button);
}

#search-btn i {
  position: relative;
  left: -1px;
  top: -1px;
}

.search-input {
  /* Поле вводу займає весь простір, але спочатку невидиме */
  height: 100%;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  color: var(--fg);
  background: transparent;
  border: none;
  padding: 8px 15px 8px 45px; /* Великий відступ зліва для іконки */
  opacity: 0; /* Сховано за замовчуванням */
  cursor: pointer;
  transition: opacity 0.2s ease-in-out 0.1s; /* Плавна поява з затримкою */
}

.search-container.is-active .search-input {
  opacity: 1; /* Стає видимим */
  cursor: text;
}

/* НОВЕ: Стиль для напівпрозорого плейсхолдера */
.search-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

/* Прибираємо стандартну іконку "хрестик" в полі пошуку */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* === Drag handle (перетягування) === */
/* === Drag handle (перетягування) === */
.drag-handle {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;                 /* Прибираємо рамку */
  background: transparent;      /* Робимо фон прозорим */
  color: var(--muted);          /* Робимо саму іконку трохи тьмянішою */
  border-radius: 8px;
  cursor: grab;
  opacity: 0.8;                 /* Змінюємо прозорість за замовчуванням */
  transition: all .15s ease;    /* Додаємо плавність */
}

.drag-handle:hover {
  opacity: 1;                   /* При наведенні робимо іконку непрозорою */
  color: var(--fg);             /* і світлою */
}

/* Ховаємо/показуємо хендл за ховером */
.tile .drag-grip-wrap,
.row .drag-grip-wrap {
  opacity: 0;
  transition: opacity .15s ease;
}
.tile:hover .drag-grip-wrap,
.row:hover .drag-grip-wrap {
  opacity: 1;
}
/* Hover для рядків у списку (папки/канали) */
.list .row:hover {
  background: var(--hover-button) !important;
  transform: translateX(2px);
}

/* Позиціонування хендла на плитці каналу */
.tile .drag-grip-wrap {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
}

/* --- DnD для гріду --- */
.grid.dragging-mode { cursor: grabbing; }
.grid.dragging-mode .tile { transition: none !important; }
.grid.dragging-mode .tile:hover { transform: none !important; box-shadow: var(--shadow-1) !important; }

.tile.is-dragging {
  opacity: .45;
  transform: scale(.98);
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
}

.tile-placeholder {
  visibility: hidden;            /* займає місце в сітці */
  background: var(--tile);
  border-radius: 12px;
  height: 400px;                 /* на випадок, якщо немає розмірів */
}


/* Оригінал картки прибираємо з потоку на час перетягування */
.tile.is-drag-origin-hidden { 
  display: none !important;
}

/* Плейсхолдер займає місце, але не малюється */
.tile-placeholder {
  visibility: hidden;
  background: var(--tile);
  border-radius: 12px;
  min-height: 400px;     /* залиши як у твоїх тайлів */
  /* ВАЖЛИВО: ширину не фіксуємо — нехай її дає грід */
}


.tile.is-ghost {
  opacity: 0.4;
  box-shadow: none;
  transform: none;
}

/* Стиль для елемента-заповнювача, який показує місце для вставки */
.tile-placeholder {
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed var(--line);
  border-radius: 12px;
  height: 400px; /* Така ж висота, як у звичайної плитки */
  box-sizing: border-box;
  /* Прибираємо ефекти, які нам не потрібні для плейсхолдера */
  box-shadow: none;
  transform: none;
}

/* Менше "тремтіння" при перетягуванні плиток */
.grid.dragging .tile { transition: none !important; }


/* Курсор для захвату */
[data-drag-handle] { cursor: grab; }
[data-drag-handle]:active { cursor: grabbing; }

/* Під час перетягування показуємо «grabbing» для всього контейнера */
.grid.dragging, .grid.dragging .tile { cursor: grabbing !important; }
.list.dragging, .list.dragging .row  { cursor: grabbing !important; }

.grid.dragging .tile,
.list.dragging .row { transition: none !important; }



/* ===================================================================
   14) СПОВІЩЕННЯ (NOTIFICATIONS)
   =================================================================== */

/* Контейнер для списку в модалці */
#notifications-list-container {
  display: flex;
  flex-direction: column;
  gap: 0px;
  max-height: 60vh; /* Обмежуємо висоту, щоб з'явився скрол */
  overflow-y: auto; /* Додаємо скрол */
  /* Ми прибираємо стандартні відступи .modal-body, 
     щоб скролбар був притиснутий до краю */
  padding: 4px; /* Маленький відступ, щоб елементи не прилипали */
}

/* Окремий елемент сповіщення */
.notification-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;       /* <--- ЗМІНЕНО */
  padding: 12px 16px;
  border-radius: 0;              /* <--- ЗМІНЕНО */
  border: none;                  /* <--- ЗМІНЕНО */
  border-bottom: 1px solid var(--line); /* <--- ДОДАНО */
}
.notification-content {
  flex-grow: 1;
  min-width: 0; /* Дозволяє тексту скорочуватись */
}

.notification-title {
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
  /* Захист від занадто довгих назв */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-deadline {
  font-size: 13px;
  color: var(--muted);
}

/* Кольори для дедлайнів (як на картках) */
.notification-deadline.priority-urgent { color: #e57373; font-weight: bold; }
.notification-deadline.priority-medium { color: #FFD54F; font-weight: bold; }
.notification-deadline.priority-low { color: #81C784; font-weight: bold; }
.notification-deadline.is-overdue {
  color: var(--muted) !important;       /* Робимо сірим з пріоритетом */
  font-weight: normal !important;   /* Прибираємо жирність з пріоритетом */
}
/* Кнопка "Перейти" */
.notification-item button {
  flex-shrink: 0; /* Щоб кнопка не стискалась */
  padding: 6px 10px; /* Трохи менша кнопка */
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notification-item button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Якщо сповіщень немає */
.notifications-empty {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
    font-size: 14px;
    line-height: 1.5;
}

/* Кнопка дзвіночка */
#notifications-btn {
    position: relative; /* Потрібно для позиціонування значка */
}

/* Червоний лічильник (значок) */
#notifications-badge {
    position: absolute;
    top: 4px;  /* Положення */
    right: 4px; /* Положення */
    min-width: 18px;
    height: 18px;
    border-radius: 99px;
    background: var(--danger); /* Червоний колір */
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px; /* Вирівнює текст по центру вертикально */
    text-align: center;
    padding: 0 5px; /* Горизонтальні відступи, якщо число > 9 */
    display: none; /* За замовчуванням сховано */
}

/* Клас, який показує лічильник */
#notifications-badge.is-visible {
    display: block;
    animation: badge-pop 0.3s ease-out;
}

@keyframes badge-pop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.notification-item:last-child {
  border-bottom: none;
}

/* Новий стиль для кнопки "Збережено" */
button.primary.is-saved {
    background: transparent;   /* <--- Прибирає фон */
    color: var(--muted);       /* Робить колір тексту приглушеним */
    border: 0;
    pointer-events: none;      /* <--- Робить кнопку неклікабельною */
    cursor: default;           /* Стандартний курсор */

    /* Скасовуємо ефекти при наведенні */
    filter: none;
    transform: none !important;
}

/* (Опціонально) Додає відступ для іконки-галочки,
   якщо ви захочете її додати */
button.primary.is-saved .fa-check {
    margin-right: 6px;
}

/* ===================================================================
   16) СТИЛІ ДЛЯ КАЛЕНДАРЯ
   =================================================================== */

#calendar-view-container {
    padding: 0 16px 16px 16px;
    background: #0f1014; /* Темніший фон для контрасту */
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--line);
    grid-template-rows: auto repeat(6, 1fr);
    min-height: 400px;
    height: 100%;
}

.calendar-header {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    padding: 10px 5px;
    background: var(--card);
    color: var(--muted);
}

.calendar-day {
    position: relative;
    min-height: 100px;
    padding: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
}

.calendar-day.other-month {
    color: var(--muted);
    opacity: 0.5;
    background: #111215; 
}

body.light-theme .calendar-day.other-month {
  color: #86868b;
  opacity: 1;
  background: #e9e9f0;
}

.calendar-day.is-today {
    background: #1a1f2c;
}

body.light-theme .calendar-day.is-today {
  background: #deeeff;
  color: #ffffff;
}

.calendar-day.is-today .day-number {
    color: var(--accent);
}

.day-number {
    display: block;
    text-align: right;
    margin-bottom: 4px;
}

/* --- Стилі для дедлайнів --- */
.deadline-dot {
    display: block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 99px;
    margin: 4px auto 0 0;
}

/* --- СТИЛЬ ДЛЯ TOOLTIP (як ви просили) --- */
.calendar-day[data-tooltip] {
    cursor: default; /* Показуємо, що тут щось є */
}

.calendar-day[data-tooltip]:hover::before {
    content: attr(data-tooltip); /* Беремо текст з атрибута */
    position: absolute;
    bottom: 105%; /* Показуємо над клітинкою */
    left: 0;
    width: max-content;
    max-width: 250px; /* Обмеження ширини */
    background: #000;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10;
    pointer-events: none; /* Щоб не заважав */
    white-space: pre-wrap; /* Дозволяє переносити рядки */
}

/* ===================================================================
   17) СТИЛІ ДЛЯ ОБ'ЄДНАНОЇ МОДАЛКИ
   =================================================================== */

.two-column-layout {
    display: flex;
    flex-direction: row !important;
    padding: 0 !important; /* Прибираємо стандартні відступи */
    max-height: 70vh; /* Загальна висота */
    gap: 0 !important;
}

.column-left {
    width: 50%;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column; /* Щоб список розтягувався */
}

.column-right {
    width: 50%;
    display: flex;
    flex-direction: column;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0; /* Заголовок не має стискатися */
}
.column-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 400; /* <--- Прибирає жирність */
    color: var(--muted); /* <--- Робить його тьмянішим (як підзаголовок) */
}

/* Налаштовуємо навігацію календаря */
.calendar-nav {
    padding: 6px 12px; /* Трохи менше */
    /* gap: 4px !important; - прибрано звідси */
}

/* 1. Змушує "розпірку" (spacer) розтягнутися */
.calendar-nav .spacer {
    flex: 1; 
}

/* 2. Нова група для кнопок (тут тепер відступ) */
.calendar-nav .button-group {
    display: flex;
    align-items: center;
    gap: 4px; /* <--- Ось ваш зменшений відступ */
}

.calendar-nav #calendar-modal-title {
    font-size: 16px;
    font-weight: 700;
}

/* Контейнер списку сповіщень */
#notifications-list-container {
    overflow-y: auto;
    flex-grow: 1; /* Список займає весь доступний простір */
    /* Стилі сповіщень з минулого разу (.notification-item) тут працюватимуть */
}

/* Контейнер календаря */
#calendar-view-container {
    overflow-y: auto; /* Додаємо скрол про всяк випадок */
    padding: 0px;
    background: #0f1014;
    flex-grow: 1;
}
/* Зробимо дні календаря трохи меншими, щоб краще вміщалися */
.calendar-day {
    min-height: 60px;
    padding: 6px;
    font-size: 13px;
}
.calendar-header {
    padding: 8px 4px;
    font-size: 12px;
}

/* --- Зменшуємо кнопки навігації календаря --- */
.calendar-nav button.ghost.small {
    padding: 5px 10px; /* Зменшуємо відступи (було 10px 14px) */
    font-size: 13px;   /* Зменшуємо шрифт */
    border-radius: 8px; /* Зменшуємо скруглення */
    height: 32px;      /* Фіксуємо висоту */
    line-height: 1;    /* Для кращого вирівнювання тексту */
}

/* Робимо кнопки-стрілки квадратними, щоб вони краще виглядали */
.calendar-nav button#calendar-prev-month,
.calendar-nav button#calendar-next-month {
    width: 32px;       /* Встановлюємо ширину рівну висоті */
    padding: 5px;      /* Скидаємо горизонтальний padding */
}

/* --- Новий ховер-ефект для кнопок календаря --- */
.calendar-nav .button-group .ghost.small:hover {
    background: var(--accent); /* Робимо фон синім */
    border-color: var(--accent); /* Також змінюємо рамку на синю */
    color: #fff;              /* Робимо текст/іконку білими */
    transform: none;           /* Прибираємо ефект збільшення */
}

/* --- Стилі для різнокольорових крапок дедлайнів --- */

/* 1. Контейнер, щоб крапки гарно розташовувались */
.deadline-dots-container {
    display: flex;
    flex-wrap: wrap; /* Дозволяє крапкам переноситись, якщо їх багато */
    gap: 4px;        /* Відстань між крапками */
    margin-top: 6px; /* Відступ від числа */
    padding-left: 2px; /* Легке вирівнювання */
    flex-grow: 1;                 /* Займає весь вільний простір під числом */
    align-content: flex-end;      /* Притискає крапки до НИЗУ контейнера */
    justify-content: flex-start;  /* Гарантує вирівнювання по лівому краю */
    padding-bottom: 4px;          /* Маленький відступ від самого низу */
}

/* 2. Базовий стиль крапки (тепер вона сіра за замовчуванням) */
.deadline-dot {
    width: 7px;
    height: 7px;
    background: var(--muted);
    border-radius: 99px;
    opacity: 0.6;
}

/* 3. Кольори терміновості (як у вашому канбані) */
.deadline-dot.dot-urgent {
    background: #e57373; /* Червоний */
    opacity: 1;
}
.deadline-dot.dot-medium {
    background: #FFD54F; /* Жовтий */
    opacity: 1;
}
.deadline-dot.dot-low {
    background: #81C784; /* Зелений */
    opacity: 1;
}

/* 4. Стиль для протермінованих (сірий) */
.deadline-dot.dot-overdue {
    background: var(--muted) !important; /* Примусово сірий */
    opacity: 0.6 !important;         /* Примусово тьмяний */
}

/* --- Оновлений заголовок модалки сповіщень --- */
#notifications-modal .modal-head > div {
    font-weight: 700; /* Робить головний заголовок жирним */
    font-size: 18px;  /* Трохи збільшуємо його */
    display: flex;    /* Для вирівнювання іконки */
    align-items: center;
    gap: 10px;        /* Відстань між іконкою та текстом */
}

/* ===================================================================
   18) КНОПКИ ДОДАВАННЯ РЯДКІВ/КОЛОНОК (HANDSONTABLE)
   =================================================================== */

/* 1. Головний wrapper, щоб кнопки позиціонувались відносно нього */
.table-controls-wrapper {
  position: relative;
  /* Додаємо трохи місця, щоб кнопки не вилазили за край */
  padding-right: 30px; 
  padding-bottom: 30px;
}

/* 2. Загальний стиль для кнопок "+" */
.table-add-btn {
  position: absolute;
  width: 20px;
  height: 20px;
  font-size: 14px;
  z-index: 10;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--muted);
  border-radius: 0 !important;
}

.table-add-btn:hover {
  color: var(--accent);
}

/* 3. Позиція кнопки "Додати колонку" (справа) */
.table-add-btn.add-col {
  top: 0; /* Встановлюємо зверху */
  right: 0; /* Притискаємо до правого краю wrapper'а */
}
/* 4. Позиція кнопки "Додати рядок" (знизу) */
.table-add-btn.add-row {
  bottom: 0; /* Притискаємо до низу wrapper'а */
  left: 10px; 
  transform: translateX(-50%); /* Точне центрування по горизонталі */
}