:root {
  --hover-bg: rgba(12, 101, 157, 0.1);
  --bg-main: #fcf8f3;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --text-main: #2d3748;
  --text-muted: #718096;
  --accent: #4a90e2;
  --accent-hover: #357abd;
  --header-bg: linear-gradient(135deg, #4a90e2 0%, #6b48ff 100%);
  --icon-note: #fefcbf;
  --icon-task: #c6f6d5;
  --icon-file: #e9d8fd;
  --star-yellow: #ecc94b;
  --section-title: #2b6cb0;
  --spacing-outer: 20px;
  --spacing-inner: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 6px;

  --primary: #2563eb;
  --primary-light: #3b82f6;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --gray-100: #f8fafc;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.8;
  color: #1a1a1a;
  margin: 0;
  padding: 0;
  background: var(--bg-main);
}

.container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
}

/* Шапка на всю ширину */
.header {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--gray-200);
}

.header .container {
  display: flex;
  align-items: center;
}
.blur-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"%3E%3Cfilter id="blur"%3E%3CfeGaussianBlur stdDeviation="20"/%3E%3C/filter%3E%3CradialGradient id="grad1" cx="0.4" cy="0.6" r="1"%3E%3Cstop offset="0%" style="stop-color:%23ff7043;stop-opacity:0.9"/%3E%3Cstop offset="100%" style="stop-color:%23f0f0f5;stop-opacity:0"/%3E%3C/radialGradient%3E%3CradialGradient id="grad2" cx="0.7" cy="0.3" r="1"%3E%3Cstop offset="0%" style="stop-color:%234caf50;stop-opacity:0.9"/%3E%3Cstop offset="100%" style="stop-color:%23f0f0f5;stop-opacity:0"/%3E%3C/radialGradient%3E%3CradialGradient id="grad3" cx="0.6" cy="0.7" r="1"%3E%3Cstop offset="0%" style="stop-color:%23ffca28;stop-opacity:0.9"/%3E%3Cstop offset="100%" style="stop-color:%23f0f0f5;stop-opacity:0"/%3E%3C/radialGradient%3E%3CradialGradient id="grad4" cx="0.3" cy="0.4" r="1"%3E%3Cstop offset="0%" style="stop-color:%23ff7043;stop-opacity:0.9"/%3E%3Cstop offset="100%" style="stop-color:%23f0f0f5;stop-opacity:0"/%3E%3C/radialGradient%3E%3CradialGradient id="grad5" cx="0.8" cy="0.5" r="1"%3E%3Cstop offset="0%" style="stop-color:%234caf50;stop-opacity:0.9"/%3E%3Cstop offset="100%" style="stop-color:%23f0f0f5;stop-opacity:0"/%3E%3C/radialGradient%3E%3CradialGradient id="grad6" cx="0.2" cy="0.8" r="1"%3E%3Cstop offset="0%" style="stop-color:%23ffca28;stop-opacity:0.9"/%3E%3Cstop offset="100%" style="stop-color:%23f0f0f5;stop-opacity:0"/%3E%3C/radialGradient%3E%3Crect width="300" height="300" fill="url(%23grad1)"/%3E%3Crect width="300" height="300" fill="url(%23grad2)"/%3E%3Crect width="300" height="300" fill="url(%23grad3)"/%3E%3Crect width="300" height="300" fill="url(%23grad4)"/%3E%3Crect width="300" height="300" fill="url(%23grad5)"/%3E%3Crect width="300" height="300" fill="url(%23grad6)"/%3E%3C/svg%3E');
  background-size: cover;
  opacity: 0.4;      
}

.logo {
  margin-right: 8px;
}

.profile {
  margin-left: 8px;
}

.logo, .profile {
    background: none;
    border: none;
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--gray-600);
    font-size: 16px;    
  font-size: 1.2em;
  /*color: #ffffff;*/
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  width: 30px;
  justify-content: center;
  transition: background 0.15s;
}

.logo:hover, .profile:hover {
  background: rgba(255, 255, 255, 0.2);
}

.search-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px var(--spacing-inner);
  color: var(--text-main);
  font-size: 15px;
  transition: background 0.2s, border 0.2s;
}

.search-bar:hover {
  background: rgba(255, 255, 255, 0.9);
}

.search-bar:focus {
  background: #ffffff;
  border-color: var(--accent);
  outline: none;
}

/* Карточка проекта */
.item-card {
  padding: 12px 12px 4px 12px;
  /*margin: 20px 0;*/
  position: relative;
}

/* Поле ввода */
.editable-field {
  border: none;
  outline: none;
  font-family: inherit;
  resize: none;
  padding: 8px; /* Убираем padding ВЕЗДЕ */
  margin: 0;
  width: 100%;
  overflow: hidden;
  line-height: 1.1;
  box-sizing: border-box;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 6px;
}
.editable-field:hover {
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
  border-radius: 6px;
}
.editing:focus {
  background: #ffffff;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
}
.item-title {
  font-size: 1.7em;
  font-weight: 400;
  color: #222;
  min-height: 1.7em;
}
.item-desc {
  font-size: 0.95em;
  user-select: text;
  cursor: default;
  color: #555;
  min-height: 3.6em; /* 3 строки текста */
}

/* Режим редактирования */
.editable-field.editable {
  border: 1px solid #7b1fa2;
  border-radius: 6px;
  padding: 8px; /* Убираем padding ВЕЗДЕ */
  background: white;
  font-size: inherit;
  margin: 0;
}
.item-title.editable {
  /*font-size: 1.8em;
  font-weight: 600;*/
}
.item-desc.editable {
  font-size: 0.95em;
  min-height: 3.6em; /* 3 строки текста */
}

/* Hover эффект */
.field-hover:hover .editable-field.readonly {
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
  border-radius: 6px;
  padding: 8px; /* Без padding */
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
  height: 1em;
  margin-bottom: 8px;
  margin-left: 8px;
}
.skeleton-title {
  height: 50px;
  margin-bottom: 16px;
  width: 70%;
}
.skeleton-desc {
  height: 0.95em;
  width: 90%;
  margin-bottom: 8px;
}
.skeleton-desc:last-child {
  width: 60%;
  margin-bottom: 8px;
}
.skeleton-item {
  height: 1.2em;
  width: 80%;
  margin-bottom: 12px;
}
.skeleton-item-short {
  width: 40%;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Остальные стили без изменений... */
.overview {
  padding: 12px;
  margin: 20px 0;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.17em;
  color: var(--section-title); /* Цвет акцента */
  margin: 0 0 4px 0;
  font-weight: 500;
  padding: 0px 0px 4px 8px;
  border-bottom: 1px solid #eee;
}
.item {
  display: flex;
  align-items: flex-start;
  padding: 6px 0;
  font-size: 0.95em;
  position: relative;
  word-wrap: break-word;
  border-radius: 6px;
  border-bottom: 1px dashed #f0f0f0;
}
.item:last-child { border-bottom: none; }
.item:hover {
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
}
.item i {
  width: 20px;
  margin-right: 8px;
  margin-left: 8px;
  font-size: 0.95em;
  flex-shrink: 0;
  margin-top: 8px;
}
.--task-due {
  color: #c62828;
  font-weight: 600;
  font-size: 0.85em;
  margin-top: 4px;
  display: block;
}
.pin-btn {
  position: absolute;
  right: 0;
  top: 8px;
  color: #888;
  cursor: pointer;
  font-size: 0.9em;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.item:hover .pin-btn {
  opacity: 1;
}
.pin-btn i {
  transition: color 0.2s ease;
}
.pinned .pin-btn i {
  color: #7b1fa2;
}

.input-container {
  padding: 12px;
  /*margin: 20px 0;*/
}
.input-header {
  font-size: 1.17em;
  color: var(--section-title); /* Цвет акцента */
  margin: 0 8px 8px 8px;
  font-weight: 500;
}
.input-container textarea {
  width: 100%;
  min-height: 78px;
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 6px;
  resize: none;
  font-family: inherit;
  font-size: 0.95em;
  background-color: white;
  box-sizing: border-box;
  overflow-y: hidden;
}
.input-container textarea:hover {
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
  border-radius: 6px;
}
.input-container textarea:focus {
  outline: unset;
  background: #ffffff;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
}
.input-actions {
  display: flex;
  justify-content: end; /*space-between;*/
  align-items: center;
  margin-top: 8px;
  font-size: 0.9em;
}
.input-actions .left {
  display: flex;
  gap: 8px;
  align-items: center;
}
.due-controls input {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95em;
  width: 100px;
}
.due-controls input:hover {
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
}
.due-controls input:focus {
  outline: unset;
  background: #ffffff;
  border: 1.5px solid var(--accent);
}
#due-date {
  accent-color: var(--accent);
  transform: scale(1.3);
}
.input-submit {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95em;
  cursor: pointer;
}
.input-submit:disabled {
  background: #e2e8f0;
  color: #a0aec0;
  opacity: 1;
}

.items-list {
  padding: 12px;
  /*margin: 20px 0;*/
}
.list-item {
  /*display: flex;*/
  cursor: default;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px dashed #f0f0f0;
  font-size: 0.95em;
  position: relative;
  word-wrap: break-word;
  border-radius: 6px;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover {
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
}
.list-item i {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  font-size: 0.95em;
  flex-shrink: 0;
}
.sep { 
  flex: 0 0 auto;
  color: #aaa;
}
.task-text {
  flex: 1;
  word-wrap: break-word;
  word-break: break-word;
  padding: 0px 8px 0 8px;
}
.task-text a {
  color: unset;
  text-decoration: none;
  transition: color 0.2s, text-decoration 0.5s;
}
.task-text a:hover {
  text-decoration: underline;
}
.task-info {
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  padding-left: 8px;
  padding-right: 8px;
}
.parent {
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #999;
}
.parent a {
  color: #999;
  text-decoration: none;
  transition: color 0.2s, text-decoration 0.5s;
}
.parent a:hover {
  color: #5a5a5a;
  text-decoration: underline;
}
.context-path {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-due {
  font-weight: 400;
  font-size: 0.85em;
  /*margin-left: 4px;*/
  flex: 0 0 auto;
}
.time {
  padding-left: 4px;
}
.list-item .pin-btn {
  position: absolute;
  right: 0;
  top: 8px;
  color: #888;
  cursor: pointer;
  font-size: 0.9em;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.list-item:hover .pin-btn {
  opacity: 1;
}
.list-item .pin-btn i {
  transition: color 0.2s ease;
}
.activity-item {
  padding: 0px 0px 8px 0px;
}
.activity-item:last-child {
  padding-bottom: 0px;
}
.activity-date {
  font-size: 11px;
  color: #aaa;
  padding-left: 8px;
}
.activity-text {
  padding-left: 8px;
}
.activity-text i {
  padding-right: 8px;
}

.normal { color: #999; }
.soon { color: #388e3c; }
.today { color: #c09301; }    
.overdue { color: #c53030; }

.icon-task-tomorrow { color: #4caf50; }
.icon-task-today { color: #c29500; }
.icon-task-overdue { color: #c53030; }
.icon-task-backlog { color: #414141; }

.icon-note { color: #805ad5; }
.icon-project { color: #002fff; }
.icon-invoice { color: #388e3c; }
.icon-file { color: #0277bd; }
.icon-chat { color: #38a169; }
.icon-info { color: #717171; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.new-item {
  animation: fadeIn 0.3s ease-out;
}

.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 160px;
  z-index: 1000;
  display: none;
}
.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  color: #333;
  text-decoration: none;
  font-size: 0.9em;
  border-bottom: 1px solid #f0f0f0;
}
.dropdown-menu a:last-child {
  border-bottom: none;
}
.dropdown-menu a:hover {
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
}
.dropdown.open .dropdown-menu {
  display: block;
}

/* Скрытие секций */
.section-hidden {
  display: none !important;
}

.card {
  /*margin-top: 12px;*/
  background: white;
  /*border: 1px solid #d5d5d5;*/
  border-radius: var(--border-radius);
}

.menu-btn {
  width: 40px;
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 1.2em;
  padding: 4px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.item-card:hover .menu-btn {
  opacity: 1;
}
.menu-btn:hover {
  color: var(--accent);
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
}

#active-tasks, #next-payments, #projects {
  margin-bottom: 8px;
}

.date-header {
  /*text-align: center;*/
  /*font-size: 0.85em;*/
  padding: 0px 8px;
  text-transform: uppercase;
  color: #aaa;
}
.date-group {
  margin-bottom: 24px;
}
.date-group:last-child {
  margin-bottom: 0px;
}
/*
.date-header::before, .date-header::after {
  content: "";
  display: inline-block;
  width: 30%;
  height: 1px;
  background: #eee;
  vertical-align: middle;
  margin: 0 10px;
}
*/
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.dash-item {
  /*margin-top: 12px;*/
  /*margin-bottom: 0px;*/
  padding: 12px;
}
.dash-item .task-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-item .task-info {
  display: none;
}
#dash-summary a {
  text-decoration: none;
  color: unset;
}
#dash-urgent .list-item {
  padding-left: 8px;
}
#dash-urgent span {
  padding-left: 8px;
}

.textarea-wrapper {
  position: relative;
}
.item-icon {
  padding: 4px;
  position: absolute;
  left: 8px;
  top: 15px;
  width: 20px;
  height: 20px;
  /*background: red;*/
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;  
}
#item-title {
  text-indent: 36px;
  line-height: 1.4;
  margin-bottom: 8px;
}

#search-header {
  border-bottom: unset;
}
#search-real {
  padding: 12px;
}

#search-real input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;  
}
#search-real input:hover {
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
  border-radius: 6px;
}
#search-real input:focus {
  outline: unset;
  background: #ffffff;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
}  

#search-real select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}
#search-real select:hover {
  background: var(--hover-bg);
  transition: background-color 0.4s ease;
  border-radius: 6px;
}
#search-real select:focus {
  outline: unset;
  background: #ffffff;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
}  
.section-header a {
  color: var(--section-title);
  text-decoration: none;
  border-bottom: 1px dotted white;
  /*line-height: 1.2;
  padding-bottom: 4px;*/
}
.section-header:hover a {
  border-bottom: 1px dotted var(--section-title);
}
.arrow {
  padding-left: 4px;
  opacity: 0.0;
  transition: all 0.3s ease;
}
.card:hover .arrow {
  opacity: 1;
  transform: translateX(3px);
}

#home {
  color: var(--section-title);
  text-decoration: unset;
}
.divider {
  margin: 0px 8px;
  color: #bbb;
}
.main_card {
  background: white;
  border: 1px solid #cbd5e0;
  border-radius: var(--border-radius);
}

.breadcrumbs {
  max-width: 920px;
  margin: 8px auto 0px;
  font-weight: 500;
  border: 1px solid #cbd5e0;
  display: flex;
  align-items: center;
  border-bottom: red;
  border-radius: 6px;
  padding: 4px 12px 4px 16px;
  border-bottom-left-radius: 0px;
  border-bottom-right-radius: 0px;
  background: white;  
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.projects-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}
.action-btn {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex
;
    align-items: center;
    gap: 8px;
}
.action-btn.secondary {
    background: white;
    color: var(--gray-800);
    border: 1px solid var(--gray-300);  
}
.action-btn.secondary:hover {
    background: var(--gray-100);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
@media (min-width: 600px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1000px) {
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.project-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: none;
}
.project-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.project-header {
    display: flex;
    align-items: center;
    gap: 10px;
    /* margin-bottom: 12px; */
}
.project-icon {
    width: 24px;
    height: 24px;
    background: #dbeafe;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--primary);
}
.project-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}
.project-stats {
    display: none;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray-600);
}
.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}
.tasks-dropdown {
    position: relative;
    display: inline-block;
}
.tasks-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    background: white;
    border: 1px solid var(--gray-300);
}
.tasks-title:hover {
    background: var(--gray-100);
}
.tasks-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    display: none;
    min-width: 200px;
    margin-top: 5px;
}
.tasks-dropdown-content.show {
    display: block;
}
.dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dropdown-item:hover {
    background: var(--gray-100);
}

@media (max-width: 768px) {
  .card {
    border: unset;
    border-radius: unset;
    /*border-top: 1px solid #e0e0e0;*/
    /*border-bottom: 1px solid #e0e0e0;*/
    /*margin-top: 8px;*/
    /*padding: 4px;*/
  }
  .dashboard {
    gap: 0px;
  }
  .dash-item {
    /*margin-top: 8px;*/
    margin-bottom: 0px;
  }
  #search-real {
    padding: 4px 12px 8px 12px;
  }
  #search-header {
    padding-left: 0px;
  }
  .date-group {
    margin-bottom: 12px;
  }
  .date-group:last-child {
    margin-bottom: 0px;
  }
  .breadcrumbs {
    margin-top: 0px;
    border-radius: 0px;
    border: unset;
  }
  .main_card {
    border-radius: unset;
    border: none;
    border-top: 1px solid #cbd5e0;
  }
  #home {
    display: none;
  }
  .divider {
    margin: 0px;
  }
}
