/* CSS Variables for better maintenance and performance */


:root {
  --mobile-yellow-color: #FEB335; /*#FF9800;*/

  --primary-color: #007bff; /*#1976d2;*/
  --primary-hover: #1565c0;
  --error-color: #e53935;
  --error-hover: #f44336;
  --success-color: #388e3c;

  --light-bg: #F2F2F2;
  --light-text: #222;
  --light-border: #eee;
  --light-input-border: #ddd;
  --light-input-focus: #bbb;

  --dark-bg: #181c22;
  --dark-surface: #23272f;
  --dark-surface-light: #2a2f37;
  --dark-surface-lighter: #313543;
  --dark-text: #f1f1f1;
  --dark-text-secondary: #e0e0e0;
  --dark-text-muted: #aaa;
  --dark-border: #000;
  --dark-border-light: #555;

  /* Calendar colors */
  --calendar-bg: #ffffff;
  --calendar-surface: #fafafa;
  --calendar-text: #222;
  --calendar-text-muted: #999;
  --calendar-text-disabled: #ccc;
  --calendar-text-secondary: #666;
  --calendar-border: #f0f0f0;
  --calendar-border-light: #e0e0e0;
  --calendar-hover: #f0f7ff;
  --calendar-today-bg: #e3f2fd;
  --calendar-selected-bg: var(--primary-color);
  --calendar-selected-hover: var(--primary-hover);

  /* Calendar dark theme colors */
  --calendar-dark-bg: var(--dark-surface);
  --calendar-dark-surface: var(--dark-surface-light);
  --calendar-dark-text: var(--dark-text);
  --calendar-dark-text-muted: var(--dark-text-muted);
  --calendar-dark-text-disabled: #666;
  --calendar-dark-text-secondary: var(--dark-text-secondary);
  --calendar-dark-border: var(--dark-border);
  --calendar-dark-border-light: var(--dark-border-light);
  --calendar-dark-hover: var(--dark-surface-lighter);
  --calendar-dark-today-bg: rgba(25, 118, 210, 0.2);
  --calendar-dark-selected-bg: var(--primary-color);
}

/* Стили для отображения задач по колонкам (десктоп) и разделам (мобильные) */
.tasks-columns-container {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 16px;
}

.tasks-status-column {
  min-width: 280px;
  max-width: 300px;
  flex-shrink: 0;
}

.tasks-status-column-header {
  padding: 0 0 14px 20px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tasks-status-column-content {
  border: 1px solid #e0e0e0;
  border-radius: 0 0 8px 8px;
  background: #fafafa;
  min-height: 120px;
  padding: 8px;
}

.tasks-sections-container {
  display: flex;
  flex-direction: column;
}

.tasks-status-section {
  width: 100vw;
}

.tasks-status-section-header {
  padding: 8px 24px 8px;
  font-weight: bold;
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.tasks-status-section-content {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
}

/* Обновленные стили карточек задач для новых макетов */
.task-card-column {
  background: #ffffff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card-section {
  background: #ffffff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.touch-device .task-card-column:hover,
body.touch-device .task-card-section:hover {
	transform: none;
	box-shadow: none;
}

.task-card-column:hover,
.task-card-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Стили для карточек задач в панели planTasksPanel */
.plan-task-card {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/*
.plan-task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
*/

/* Темная тема для карточек задач */
/*body.dark-theme #deleteReportModal,*/
body.dark-theme .task-card-column,
body.dark-theme .task-card-section {
  background: var(--dark-surface);
  color: var(--dark-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.touch-device .report-card {
	background: var(--dark-surface);
	color: var(--dark-text-muted);
	/*gap:unset !important;*/
}
body.touch-device .report-name{
  white-space: inherit !important;
}

body.dark-theme .task-card-column:hover,
body.dark-theme .task-card-section:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

/* Темная тема для карточек задач в панели planTasksPanel */
body.dark-theme .plan-task-card {
  background: var(--dark-surface);
  color: var(--dark-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
body.touch-device .plan-task-card {
	box-shadow: none !important;
}

body.dark-theme .plan-task-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

/* Скрываем лишние элементы в зависимости от типа устройства */
.desktop-device .tasks-sections-container {
  display: none;
}

.touch-device .tasks-columns-container {
  display: none;
}

/* Скрываем элементы только для десктопа на мобильных устройствах */
.touch-device .desktop-only {
  display: none !important;
}

/* Стили для календарных задач */
/*
.calendar-tasks-column {
  border: 2px solid #e3f2fd;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
  position: relative;
}
*/

/*
.calendar-tasks-column::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1976d2, #2196f3);
  border-radius: 8px 8px 0 0;
}
*/
/*
.calendar-tasks-column .tasks-status-column-header {
  background: rgba(25, 118, 210, 0.05);
  border-bottom: 1px solid rgba(25, 118, 210, 0.1);
  padding: 12px 16px;
  border-radius: 6px 6px 0 0;
}
*/

.calendar-tasks-column .tasks-status-column-header span:first-of-type {
  color: #1976d2;
  font-weight: 600;
}

/*
.calendar-tasks-section {
  border: 2px solid #e3f2fd;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
  margin-bottom: 16px;
  position: relative;
}
*/

/*
.calendar-tasks-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1976d2, #2196f3);
  border-radius: 8px 8px 0 0;
}
*/

.calendar-tasks-section .tasks-status-section-header {
  background: rgba(25, 118, 210, 0.05);
  border-bottom: 1px solid rgba(25, 118, 210, 0.1);
  padding: 12px 16px;
  border-radius: 6px 6px 0 0;
}

.calendar-tasks-section .tasks-status-section-header span {
  color: #1976d2;
}


/* Темная тема для календарных задач */
/*
body.dark-theme .calendar-tasks-column,
body.dark-theme .calendar-tasks-section {
  background: linear-gradient(135deg, var(--dark-surface-light) 0%, rgba(25, 118, 210, 0.1) 100%);
  border-color: rgba(25, 118, 210, 0.3);
}
*/

body.dark-theme .calendar-tasks-column .tasks-status-column-header,
body.dark-theme .calendar-tasks-section .tasks-status-section-header {
  color: var(--dark-text);
}

body.dark-theme .calendar-tasks-column .tasks-status-column-header span:first-of-type,
body.dark-theme .calendar-tasks-section .tasks-status-section-header span {
  color: #64b5f6;
}

/* Resume CSS variables */
:root {
  --calendar-dark-selected-hover: var(--primary-hover);

  --font-family: 'Inter', 'Lato', sans-serif;
  --font-size: 13px;
  --border-radius: 6px;
  --border-radius-large: 12px;
  --transition: 0.3s ease;
  --transition-fast: 0.15s ease;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-large: 0 4px 16px rgba(0,0,0,0.1);

  --z-toast: 99999;
  --z-overlay: 1000;
  --z-header: 300;
  --z-menu: 200;
  --z-menu-overlay: 150;
}

/* Font Loading Optimization */
@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -moz-user-select: none;
  user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  font-family: var(--font-family);
  font-size: var(--font-size);
  font-weight: 400;
  letter-spacing: 0.01em;
  background: var(--light-bg);
  color: var(--light-text);
  touch-action: none;
}
/*
body{
	padding-bottom: env(safe-area-inset-bottom);
}
*/

/* Form Elements Base */
input,
button,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

button {
  padding: 8px 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--light-input-border);
  border-radius: var(--border-radius);
  transition: none;
}





/* Layout Components */
.container {
  margin: 0 auto;
  margin-left: 60px;
  padding: 0 16px !important; /* Убираем верхние отступы */
  transition: margin-left var(--transition);
  height: calc(100vh - 56px) !important; /* Полная высота окна минус только header */
  box-sizing: border-box;
}

body.login-page .container {
  margin-left: auto;
}

body.menu-open .container {
  margin-left: 220px;
}

/* Мобильная версия контейнера */
body.touch-device .container {
  padding: 0 0 !important; /* Убираем верхние отступы */
  margin-left: 0; /* Убираем отступ - меню будет overlay */
  height: calc(100vh - 55px) !important; /* Полная высота окна минус только header */
}

/* В мобильной версии контент не смещается при открытии меню */
body.touch-device.menu-open .container {
  margin-left: 0 !important; /* Контент остается на месте */
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--dark-surface);
  color: var(--dark-text);
  border-bottom: 1px solid var(--dark-bg);
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

#headerTitle {
  font-weight: bold;
  flex: 1;
  text-align: center;
  color: var(--dark-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mainFieldItem{
	flex: 1;
	word-break: break-all;
}
body.touch-device.dark-theme .mainFieldItem div{
	/*color: var(--dark-text) !important;*/
	background-color: transparent !important;
}

.mainVieldBts{
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 24px;
	word-break:normal;
}

.mainFieldEditBt,
.mainFieldDelBtTxt,
.mainFieldDelBtPhoto{
	display: flex;
	gap: 4px;
	height: 24px;
}
.mainFieldEditBt,
.mainFieldDelBtTxt{
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 10;
}
.mainFieldDelBtTxt{
	right: 13px;
}
body.touch-device .mainFieldEditBt,
body.touch-device .mainFieldDelBtTxt{
	margin-top: -100px;
}


.mainFieldPlanImg{
	width: 120px;
	height: 80px;
	background-size: cover;
	background-position: center;
	border-radius: 8px;
	border: 2px solid #fff;
	position: relative;
	cursor: pointer;
	background-color: #f5f5f5;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 8px;
}
.mainFieldPlanMarker{
	position: absolute;
	width: 16px;
	height: 20px;
}

.description-content,
.comment-content{
	white-space: pre-wrap;
	word-break: break-word;
	/*font-size: 14px;*/
	/*line-height: 1.4;*/
	color: var(--light-text) !important;
	margin-bottom: 4px;
	max-width: calc(100% - 70px);
}
body.touch-device.dark-theme .description-content,
body.touch-device.dark-theme .comment-content{
	color: var(--dark-text) !important;
	max-width: 100%;
}

.chatMsgEditBts{
	display: flex;
	gap: 6px;
	margin-top: 6px;
	justify-content: flex-end;
	height: 24px;
}

.chatModal{
	background: var(--dark-surface);
	border-radius: 12px;
	width: 90vw;
	max-width: 700px;
	height: 90vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
body.touch-device .chatModal{
	border-radius: 0;
	width: 100vw;
	max-width: none;
	height: 100vh;
	transform: translateX(100%);
	transition: transform 0.3s ease-in-out;
}

/* Анимация появления чата справа на мобильных устройствах */
body.touch-device .chatModal.slide-in-right {
	transform: translateX(0);
}

/* Анимация исчезновения чата вправо на мобильных устройствах */
body.touch-device .chatModal.slide-out-right {
	transform: translateX(100%);
}

.chatMessageDiv{
	display: flex;
	margin-bottom: 12px;
	justify-content: flex-start;
}
.cMDRight{
	justify-content: flex-end;
}
.chatMessageDiv > div{
	max-width: 85%;
	background: #182533;
	border-radius: 18px 18px 18px 4px;
	padding: 8px 12px;
	position: relative;
	color: #e0e0e0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.cMDRight > div{
	background: #2B5278;
	border-radius: 18px 18px 4px 18px;
}

.chatSendBt{
	padding: 20px;
    background: var(--primary-color) !important;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    gap: 8px;
}
#messagesContainer{
	flex: 1;
	padding: 16px 20px;
	overflow-y: auto;
	background: var(--dark-bg);
	display: flex;
	flex-direction: column;
	word-break: break-word;
}
#chatCloseButton{
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #ccc;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#chatEmojiBt{
  padding: 12px;
  background: none;
  cursor: pointer;
  position: relative;
  font-size: 20px;
}


.main-field-move-up-off,
.main-field-move-up,
.main-field-move-down-off,
.main-field-move-down{
	width: 28px;
	height: 28px;
	border: none;
	background-color: #ddd;
	color: #212529;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: bold;
}
.main-field-move-down-off,
.main-field-move-up-off{
	background-color: transparent;
	color: transparent !important;
	cursor: default;
}

body.touch-device .moveBts,
.moveBts{
	display:flex;
	gap: 1px;
	flex-direction: column;
	justify-content:center;
}
body.touch-device .moveBts{
	flex-direction: row;
	justify-content:end;
	padding-right: 6px;
}

.mainFieldDoc{
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 7px;
	background: #fff;
	border-radius: 6px;
	border-left: 4px solid #6c757d;
}


.edit-content-btn{
	width: 32px;
	height: 24px;
	background: #28a745 !important;
	color: white !important;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.chat-edit-content-btn,
.ecb2{
	background: var(--primary-color) !important;
}

.chat-edit-content-btn:hover,
.edit-content-btn:hover{
	opacity: 1;
}


.download-file-btn-doc,
.download-file-btn{
	background: none !important;
	border: none;
	cursor: pointer;
	padding: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
}


.chat-delete-content-btn,
.delete-content-btn{
	background: none !important;
	border: none;
	cursor: pointer;
	padding: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.download-file-btn-doc,
.download-file-btn,
.delete-content-btn{
	transform: translateY(-5px);
	margin-top: 4px;
}

.chat-edit-content-btn{
	width: 28px;
	height: 20px;
	color: white !important;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3px;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

/*
.chat-delete-content-btn{
	background: none !important;
	border: none;
	cursor: pointer;
	padding: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
}
*/


#mobileAddTagBtn{
	position:absolute;
	right:0;
}

.header-btn {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  margin: auto 0;
  background: transparent;
  color: var(--dark-text);
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header-btn.square {
  width: 50px;
  height: 40px;
  padding: 2px;
}

#headerHamburger {
  width: 50px;
  height: 40px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: left;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.header-btn svg {
  stroke: var(--dark-text);
}

#deletePlansBtn svg path {
  stroke: var(--error-color);
}

#addPlanBtn,
#addObjectBtn,
#addFolderBtn {
  color: #fff;
}

/* Side Menu */
#sideMenu {
  position: fixed;
  left: 0;
  top: 56px;
  bottom: 0;
  width: 60px;
  background: var(--dark-surface);
  box-shadow: 2px 0 12px rgba(0,0,0,0.2);
  z-index: var(--z-menu);
  transition: width var(--transition);
  display: hidden;
  flex-direction: column;
  padding-top: 48px;
}

#sideMenu.open {
  width: 220px;
}

#sideMenu.closed {
  width: 60px;
}


/* Мобильная версия меню - overlay поверх контента с анимацией */
body.touch-device #sideMenu {
  top: 55px;
  width: 220px; /* Полная ширина меню */
  transform: translateX(-220px); /* Полностью скрываем меню */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: calc(var(--z-menu) + 10);
}

body.touch-device #sideMenu.open {
  transform: translateX(0); /* Полностью показываем меню */
  box-shadow: 4px 0 20px rgba(0,0,0,0.4);
}

body.touch-device #sideMenu.closed {
  transform: translateX(-220px); /* Полностью скрываем меню */
}

#sideMenu.closed .menu-text,
#sideMenu.closed .theme-toggle-container,
#sideMenu.closed #sideMenuLogout,
#sideMenu.closed .objects-dropdown-arrow {
  display: none;
}

/* Кнопки управления offline данными */
#sideMenuRecForOffline{
	margin-top:16px !important;
}
/*#sideMenu.closed #sideMenuRecForOffline,*/
#sideMenu.closed #sideMenuDelOfflineData {
  display: none;
}

/* Размер offline кеша */
#offlineCacheSize {
  font-weight: normal;
  opacity: 0.8;
}

/* Отключенная кнопка удаления offline данных */
#sideMenuRecForOffline.disabled,
#sideMenuDelOfflineData.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

#sideMenuRecForOffline.disabled:hover,
#sideMenuDelOfflineData.disabled:hover {
  background: none !important;
}

#sideMenuLogout{
	margin-top: auto !important;
	margin-bottom: 16px !important;
}

/* В мобильной версии не скрываем текст, так как меню уезжает влево полностью */
body.touch-device #sideMenu.closed .menu-text {
  display: block;
}

#sideMenu.closed button {
  justify-content: center;
  padding: 12px;
}

#sideMenu button {
  margin: 0 0 8px 0;
  width: 100%;
  background: none;
  text-align: left;
  padding: 12px 24px;
  color: var(--dark-text);
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color var(--transition-fast);
}

#sideMenu button:hover {
  background: var(--dark-surface-lighter);
}

.menu-icon {
  flex-shrink: 0;
  color: var(--dark-text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  font-size: 18px;
  line-height: 1;
  opacity: 0.95;
}

.menu-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


#noReportsMessage {
	display:none;
	text-align:center;
	padding:80px 20px;
	color:#999;
}

#reportsView {
	display:none;
	width:100%;
	height:calc(100vh - 56px);
	padding:20px;
	overflow-y:auto;
	margin-top: 56px !important;
}

/* Карточки отчетов */
.report-card {
  background: #ffffff;

  border: 1px solid rgb(238, 238, 238);
  border-radius: 12px;
  box-shadow: rgba(0, 0, 0, 0.067) 0px 2px 8px;

  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: background 0.2s, box-shadow 0.2s;
  min-height: 70px;
}

/*
.report-card:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
*/

.report-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  border-radius: 8px;
  color: white;
}

.report-info {
  flex: 1;
  min-width: 0;
}

.report-name {
  font-size: 14px;
  font-weight: 500;
  /*color: #333;*/
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-meta {
  font-size: 12px;
  /*color: #666;*/
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.report-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.report-status.processing {
  background: #ff9800;
  color: white;
}

.report-status.completed {
  background: #4caf50;
  color: white;
}

.report-status.error {
  background: #f44336;
  color: white;
}

.report-new-badge {
  background: #f44336;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.report-actions {
  display: flex;
  gap: 8px;
}

.report-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.report-btn.download {
  background: var(--primary-color);
  color: white;
}

.report-btn.download:hover {
  background: #1565c0;
}

.report-btn.delete {
  background: transparent;
  color: #f44336;
  border: 1px solid #f44336;
}

.report-btn.delete:hover {
  background: #f44336;
  color: white;
}

.report-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* App Version Display */
#appVersion {
	margin-bottom: calc(16px + env(safe-area-inset-bottom));
	text-align: center;
	margin-right: 30px;
	font-size: 14px;
}

#sideMenu.closed #appVersion {
  display: none;
}

/* Light theme version styles */
body:not(.dark-theme) #appVersion {
  color: var(--dark-text-muted) !important;
}

/* Dark theme version styles */
body.dark-theme #appVersion {
  color: var(--dark-text-muted) !important;
}

/* Menu Overlay */
#menuOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.25);
  z-index: var(--z-menu-overlay);
}

#menuOverlay.open {
  display: block;
}

/* Overlay для мобильной версии с плавной анимацией */
body.touch-device #menuOverlay {
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  top: 55px; /* Начинается под header */
  height: calc(100vh - 55px); /* До конца экрана */
  background: rgba(0,0,0,0.5);
  z-index: calc(var(--z-menu) + 5); /* Между контентом и меню */
}

body.touch-device #menuOverlay.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Theme Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 0 15c-.13 0-.261 0-.393 0A8.501 8.501 0 1 1 12 3z' fill='%23666'/%3E%3C/svg%3E");
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: 120% 80%;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  margin-top: auto;
  margin-bottom: 20px;
}

/* Plan View */
#planView {
  position: fixed;
  left: 0;
  top: 56px;
  width: 100vw;
  height: 100dvh;
  background: #f8f8f8;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  z-index: 10;
}

#planContainer {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--light-bg);
  z-index: 1;
  flex:1;
}

#planViewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#planImage {
  position: absolute;
  top: 0;
  left: 0;
  object-fit: contain;
  max-width: 100%;
  display: block;
  margin: 16px 0;
}

#marksLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10; /* Иконки задач должны быть поверх окошка "Задачи плана" */
}

/* Plan Undo/Redo Controls */
#planUndoRedoControls {
  user-select: none;
}

#planUndoBtn,
#planRedoBtn {
  transition: all 0.3s ease;
}

#planUndoBtn:not(:disabled),
#planRedoBtn:not(:disabled) {
  opacity: 1 !important;
  cursor: pointer;
}

#planUndoBtn:not(:disabled) svg,
#planRedoBtn:not(:disabled) svg {
  stroke: #1976d2 !important;
}

#planUndoBtn:not(:disabled):hover,
#planRedoBtn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 1;
}

#planUndoBtn:not(:disabled):active,
#planRedoBtn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#planUndoBtn:disabled,
#planRedoBtn:disabled {
  cursor: default;
  opacity: 0.3;
}

/* Анимация для перемещения маркеров при Undo/Redo */
.plan-marker-animating {
  transition: left 0.6s cubic-bezier(0.25, 0.8, 0.25, 1),
              top 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  z-index: 1000 !important;
  /* Убираем принудительный transform: scale(1.0) чтобы не сбрасывать правильный масштаб */
}

/* Анимация пульсации для выделения маркера - теперь использует CSS-переменную для базового масштаба */
@keyframes undoRedoPulse {
  0% {
    transform: scale(var(--inverse-scale, 1.0));
  }
  50% {
    transform: scale(calc(var(--inverse-scale, 1.0) * 2.2));
  }
  100% {
    transform: scale(var(--inverse-scale, 1.0));
  }
}

.plan-marker-pulse {
  animation: undoRedoPulse 0.4s ease-in-out;
}

/* Убираем transition во время обычного перетаскивания */
.plan-marker-dragging {
  transition: none !important;
}

/* Dark theme для кнопок Undo/Redo */
body.dark-theme #planUndoBtn,
body.dark-theme #planRedoBtn {
  background: var(--dark-surface-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark-theme #planUndoBtn:not(:disabled) svg,
body.dark-theme #planRedoBtn:not(:disabled) svg {
  stroke: var(--primary-color) !important;
}

body.dark-theme #planUndoBtn:disabled svg,
body.dark-theme #planRedoBtn:disabled svg {
  stroke: var(--dark-text-muted) !important;
}

/* Анимация для темной темы */
/*
body.dark-theme .plan-marker-animating {
  filter: drop-shadow(0 4px 8px rgba(25, 118, 210, 0.6));
}
*/

/* Скрытие кнопок Undo/Redo на мобильных устройствах (при необходимости) */
/*
@media (max-width: 768px) {
  #planUndoRedoControls {
    top: 10px;
    right: 10px;
    gap: 6px;
  }

  #planUndoBtn,
  #planRedoBtn {
    width: 36px;
    height: 36px;
  }

  #planUndoBtn svg,
  #planRedoBtn svg {
    width: 18px;
    height: 18px;
  }
}
*/

/* Grids */
/*
#plansGrid {
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 55px);
  overflow-y: auto;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
*/
#plansGrid {
	-webkit-overflow-scrolling: touch;
	max-height: calc(100vh - 55px);
	width: 100%;
	max-width: 100vw;
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 0 16px 80px;
	box-sizing: border-box;

	min-height: 200px;
	position: relative;
  }

  /* Мобильная версия планов - теперь использует карточки как в десктопе */
  body.touch-device #plansGrid {
	/* Убрали gap: 0, теперь используется стандартный gap для карточек */
	padding: 0 16px calc(16px + env(safe-area-inset-bottom)) !important;
  }



/* #objectsGrid теперь имеет отдельные стили ниже */

/* Старые стили убраны - objectsGrid теперь использует flex-layout */


/*
#photoGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  max-height: calc(100vh - 56px - 16px);
}
*/


/* Секция объектов занимает всю доступную высоту */
/*
#newTaskForm{
	height: calc(100vh - 55px - env(safe-area-inset-bottom)) !important;
}
*/

#taskActions{
	margin-bottom: calc(16px + env(safe-area-inset-bottom)*2);
}
#photoControlsPanel,
#chatFooter{
	margin-bottom: calc(env(safe-area-inset-bottom)*2);
}


/*-5px: because of .mobile-dropdown-list{margin: 5px 0 0 0;}*/
.mobile-dropdown-panel {
	height: calc(100vh - env(safe-area-inset-bottom)) !important;
}


/* iOS PWA scroll Fix*/
/*
html.plt-ios.plt-pwa {
  height: 99.9vh !important;
}
*/
/*iOS fix body scrolling*/
body {
	position: fixed;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	touch-action: none; /* Prevents default touch actions */
}

#tasksList,
#planTasksPanel,
#plansGrid,
/*#mobileHistoryContent,*/
#sectionObjects {
	height: calc(100vh - 55px - env(safe-area-inset-bottom)) !important;
}

#sectionObjects {
  margin-top: 35px !important; /* Отступ от header для десктопа */
  display: flex;
  flex-direction: column;
}

/* Мобильная версия секции объектов */
body.touch-device #sectionObjects {
  margin-top: 55px !important; /* Меньший отступ для мобильной */
}

/* Секция планов занимает всю доступную высоту */
#sectionPlans {
  height: 100% !important;
  margin-top: 35px !important;
  display: flex;
  flex-direction: column;
}

/* Мобильная версия секции планов */
body.touch-device #sectionPlans {
  margin-top: 55px !important;
}

#objectsListSection {
  flex: 1 !important; /* Занимаем всю оставшуюся высоту - это правильный способ */
  overflow: hidden;
  margin-top: 80px !important; /* Смещаем всю прокручиваемую область под панель поиска */
}

body.touch-device #logo{
	display:none;
}
#logo{
	width:140px;
	margin-right:24px;
}

/* Мобильная версия - больший отступ от панели поиска */
body.touch-device #objectsListSection {
  margin-top: 0 !important; /* Больший отступ для мобильной панели поиска */
}

#plansListSection {
  flex: 1 !important;
  overflow: hidden;
  margin-top: 24px !important;
}

body.touch-device #plansListSection {
  margin-top: 0 !important;
}

#objectsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-auto-rows: minmax(120px, 140px); /* ВАЖНО: фиксируем высоту строк */
  gap: 8px !important; /* ВАЖНО: добавляем отступы между карточками */
  height: 100% !important; /* Занимаем всю высоту родителя */
  overflow-y: auto;
  padding: 0 16px; /* Отступы внутри grid */
  box-sizing: border-box;
}

/* Мобильные карточки проектов */
body.touch-device #objectsGrid {
  grid-template-columns: 1fr; /* Одна колонка для мобильных */
  grid-auto-rows: 60px; /* Фиксированная высота строк для мобильных */
  gap: 0 !important; /* Меньший отступ между карточки */
  padding: 0 0 !important; /* Меньшие внутренние отступы */
}






/* Стили скроллбара для мобильной версии - скрыт по умолчанию */
/*todo:to one class*/
body.touch-device #sectionSettings,
body.touch-device .task-content,
body.touch-device #tasksList,
body.touch-device #planTasksList,
body.touch-device #objectsGrid,
body.touch-device #plansGrid {
  scrollbar-width: thin;
  transition: scrollbar-color 0.3s ease;
}
/*body.touch-device #sectionSettings,*/
/*body.touch-device .task-content,*/
/*body.touch-device #planTasksList,*/
body.touch-device #objectsGrid,
body.touch-device #plansGrid {
	scrollbar-color: transparent transparent;
}
body.touch-device #sectionSettings::-webkit-scrollbar,
body.touch-device .task-content::-webkit-scrollbar,
body.touch-device #tasksList::-webkit-scrollbar,
body.touch-device #planTasksList::-webkit-scrollbar,
body.touch-device #objectsGrid::-webkit-scrollbar,
body.touch-device #plansGrid::-webkit-scrollbar {
  width: 4px;
}
body.touch-device #sectionSettings::-webkit-scrollbar-track,
body.touch-device .task-content::-webkit-scrollbar-track,
body.touch-device #tasksList::-webkit-scrollbar-track,
body.touch-device #planTasksList::-webkit-scrollbar-track,
body.touch-device #objectsGrid::-webkit-scrollbar-track,
body.touch-device #plansGrid::-webkit-scrollbar-track {
  background: transparent;
}
body.touch-device #sectionSettings::-webkit-scrollbar-thumb,
body.touch-device .task-content::-webkit-scrollbar-thumb,
body.touch-device #tasksList::-webkit-scrollbar-thumb,
body.touch-device #planTasksList::-webkit-scrollbar-thumb,
body.touch-device #objectsGrid::-webkit-scrollbar-thumb,
body.touch-device #plansGrid::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}
/* Показываем скроллбар при скроллинге */
body.touch-device #sectionSettings.scrolling,
body.touch-device .task-content.scrolling,
body.touch-device #tasksList.scrolling,
body.touch-device #planTasksList.scrolling,
body.touch-device #objectsGrid.scrolling,
body.touch-device #plansGrid.scrolling {
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
body.touch-device #sectionSettings.scrolling::-webkit-scrollbar-thumb,
body.touch-device .task-content.scrolling::-webkit-scrollbar-thumb,
body.touch-device #tasksList.scrolling::-webkit-scrollbar-thumb,
body.touch-device #planTasksList.scrolling::-webkit-scrollbar-thumb,
body.touch-device #objectsGrid.scrolling::-webkit-scrollbar-thumb,
body.touch-device #plansGrid.scrolling::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
}





/* Стили для мобильных карточек проектов */
body.touch-device #objectsGrid > div {
  min-height: 60px !important; /* Меньшая высота для мобильных */
  max-height: 60px !important;
  aspect-ratio: auto !important; /* Убираем фиксированное соотношение сторон */
}

/* Стили для мобильных папок - такие же как у проектов */
body.touch-device .folder-header {
  min-height: 60px !important;
  max-height: 60px !important;
  aspect-ratio: auto !important;
}

/* Темная тема для мобильных карточек проектов */
body.touch-device #objectsGrid > div {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-bg);
  border-width: 1px 1px 0 0;
  border-style: solid;
}

/* Темная тема для мобильных карточек планов - теперь используют карточный вид как в десктопе */
body.touch-device .plan-card {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
  /*
  border-color: var(--dark-bg);
  border-width: 1px 1px 0 0;
  border-style: solid;
  */
  box-shadow: none;
}
body.touch-device .plan-card:hover {
	box-shadow: none !important;
}

/* Стили для мобильных карточек планов - теперь используют карточный вид как в десктопе
   Убрали фиксированную высоту, чтобы карточки отображались вертикально */
/* body.touch-device .plan-card {
  min-height: 60px !important;
  max-height: 60px !important;
  aspect-ratio: auto !important;
} */




/* Темная тема для мобильных папок - такие же как у проектов */
body.touch-device .tasks-status-section-header,
body.touch-device .folder-header {
  background: var(--dark-bg) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-bg);
  border-width: 1px 1px 0 0;
  border-style: solid;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 12px 16px !important;
  gap:12px;
}
body.touch-device .tasks-status-section-header{
	padding: 4px 16px 12px !important;
}

/* Hover эффект для мобильных карточек в темной теме */
/*
body.touch-device #objectsGrid > div:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
*/

/* Название проекта в темной теме на мобильных */
body.touch-device #objectsGrid > div > div {
  color: var(--dark-text) !important;
}

/* Название плана в темной теме на мобильных - теперь используем стандартное центрирование как в десктопе */
body.touch-device .plan-card .plan-title {
  color: var(--dark-text) !important;
}

/* Название папки и счетчик в темной теме на мобильных */
body.touch-device .folder-header .folder-title,
body.touch-device .folder-header .folder-count {
  color: var(--dark-text) !important;
}

/* SVG иконки в мобильных карточках в темной теме - корона остается золотой */

body.touch-device #objectsGrid svg path[fill="#FFB300"] {
  fill: #FFB300 !important; /* Корона остается золотой */
}

/* Значок "Архивирован" в темной теме мобильной версии */
body.touch-device #objectsGrid span[style*="background: var(--mobile-yellow-color)"] {
  background: var(--mobile-yellow-color) !important;
  color: #fff !important;
}

/* Панель поиска и фильтров проектов */
#projectSearchAndFilter {
  display: none; /* По умолчанию скрыта, показывается только в разделе проектов */
  transition: left 0.3s ease;
  right: 0;
}

/* Скрытие панели поиска на мобильных устройствах */
body.touch-device #projectSearchAndFilter {
  display: none !important;
}

/* Мобильный поиск в хедере - по умолчанию скрыт */
#mobileProjectSearch {
  display: none;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 60%;
}

/* Показываем мобильный поиск только на touch устройствах */
body.touch-device #mobileProjectSearch {
  display: flex; /* !important;*/
}

.mobile-search-inner {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

/* Скрываем заголовок когда показывается мобильный поиск */
body.touch-device #mobileProjectSearch:not(.hidden) ~ #headerTitle {
  display: none !important;
}

/* Скрываем текст "Создать проект" на мобильных */
body.touch-device .add-object-text {
  display: none;
}

/* Скрываем текст "План" на мобильных */
body.touch-device .add-plan-text {
  display: none;
}

/* Компактная кнопка "+" на мобильных */
body.touch-device #addObjectBtn,
body.touch-device #addPlanBtn {
  padding: 0 12px !important;
  min-width: 50px;
}

/* Стили для мобильного поля поиска */
#mobileProjectSearchInput {
  background: #fff;
  color: #333;
  border: 1.5px solid #ddd;
  transition: border-color 0.2s ease;
}

#mobileProjectSearchInput:focus {
  outline: none;
}

#mobileProjectSearchClear:hover {
  stroke: #333;
  transform: scale(1.1);
}

/* Темная тема для мобильного поиска */
body.dark-theme #mobileProjectSearchInput {
  background: var(--dark-surface-light) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

body.dark-theme #mobileProjectSearchInput::placeholder {
  color: var(--dark-text-muted) !important;
}

body.dark-theme #mobileProjectSearchClear {
  stroke: var(--dark-text-muted) !important;
}

body.dark-theme #mobileProjectSearchClear:hover {
  stroke: var(--dark-text) !important;
}

/* Панель поиска всегда смещается как карточки проектов */
body:not(.menu-open) #projectSearchAndFilter {
  left: 60px; /* Ширина закрытого меню */
}

body.menu-open #projectSearchAndFilter {
  left: 220px; /* Ширина открытого меню */
}

/* Стили для поля поиска проектов */
#projectSearchInput {
  transition: none;
}

#projectTaskSearchInput {
  transition: none;
}



/* Стили для кнопки очистки поиска */
#projectSearchClear, #projectTaskSearchClear {
  transition: all 0.2s ease;
}

#projectSearchClear:hover {
  stroke: #333;
  transform: scale(1.1);
}

/* Стили для иконок поиска в десктопной версии со светлой темой поля */
body.dark-theme:not(.touch-device) #projectSearchAndFilter svg[stroke="#999"] {
  stroke: #999;
}

/* Стили для кнопок фильтра и сортировки */
#projectFilterBtn,
#projectSortBtn {
  border-radius: 50% !important;
  transition: all 0.2s;
}

#projectFilterBtn:hover,
#projectSortBtn:hover {
  transform: scale(1.05);
}

/* Классы для иконки фильтра */
.filter-icon {
  transition: transform 0.2s ease;
}

/* Состояние: фильтр не применен - синяя залитая иконка, больше */
.filter-icon.inactive {
  fill: #2196F3 !important;
  stroke: none !important;
  stroke-width: 0 !important;
  transform: scale(1.2) !important;
}

/* Состояние: фильтр применен - белая контурная иконка */
.filter-icon.active {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  /*transform: scale(1.29) !important;*/
}

#objectsGrid > div {
  min-height: 120px;
  max-height: 140px; /* ВАЖНО: возвращаем ограничение высоты */
  overflow: hidden; /* Обрезаем лишнее содержимое */
  /* Убираем aspect-ratio чтобы использовать фиксированные размеры */
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes scale-pulse {
  0% { transform: scale(1); }
  15% { transform: scale(1.32); }
  30% { transform: scale(1); }
  50% { transform: scale(1.22); }
  65% { transform: scale(1); }
  100% { transform: scale(1); }
}

.scale-pulse {
  animation: scale-pulse 0.9s cubic-bezier(0.4, 1.4, 0.6, 1) 1;
  z-index: 10;
}

/* Toast Notifications */
#toast {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  padding: 10px 26px;
  border-radius: 999px;
  font-size: var(--font-size);
  z-index: var(--z-toast);
  pointer-events: none;
  font-weight: 500;
  text-align: center;
  background: var(--mobile-yellow-color) !important; /*#FFA500*/
  color: var(--dark-surface) !important;
  transition: opacity var(--transition);
}

/* Toast на мобильных устройствах - поднимаем на высоту футера */
body.touch-device #toast {
  width: 80vw;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-overlay);
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.5);
}

/* Modals */
#addObjectSection,
#addFolderSection,
#addPlanSection {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-overlay);
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.5);
}

#addPlanSection {
  display: none;
  min-height: 0;
  overflow-y: auto;
}

#addPlanSection.show {
  display: flex;
}

.modal-form {
  background: #fff;
  border-radius: var(--border-radius-large);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 400px;
  width: 90vw;
  box-sizing: border-box;
}

.modal-form h2 {
  text-align: center;
  margin: 0;
  color: #333;
  font-size: var(--font-size);
}

.modal-form label {
  width: 100%;
  margin: 0;
  padding: 0;
}

.modal-form textarea {
  width: 100%;
  padding: 12px;
  font-size: var(--font-size);
  border-radius: 8px;
  border: 1.5px solid var(--light-input-border);
  margin: 0;
  box-sizing: border-box;
  height: 60px;
  min-height: 60px;
  font-family: inherit;
  resize: none;
}

/* Dropdown Components */
.custom-status-dropdown {
  position: relative;
  width: 100%;
  max-width: 100%;
  outline: none;
  user-select: none;
}

/* Точное распределение ширины элементов в форме настроек пользователей */
.settings-user-dropdown-container {
  flex: 0 0 30%;
  min-width: 120px;
  max-width: 30%;
}

.settings-position-container {
  flex: 1 1 auto;
}

.settings-role-dropdown-container {
  flex: 0 0 30%;
  max-width: 30%;
}

/* Ограничение ширины для dropdown элементов */
#settingsUserLoginDropdown,
#settingsUserRoleDropdown {
  width: 100%;
  max-width: 100%;
}

/* Названия планов - максимум 2 строки с переносом длинных слов */
.plan-title {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.3;
  max-height: 2.6em; /* 2 строки * 1.3 line-height */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  hyphens: auto;

margin-top:10px;
font-weight:bold;
font-size:13px;
text-align:center;

}

.dropdown-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: var(--border-radius);
  padding: 5px 10px;
  cursor: pointer;
  min-height: 32px;
  transition: none;
  word-break: break-all;
}



.dropdown-arrow {
  margin-left: auto;
  color: #888;
  pointer-events: none;
}

.dropdown-list {
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-large);
  z-index: 10001;
  margin-top: 2px;
  display: none;
  max-height: 200px;
  overflow-y: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  background: #fff;
  border: none;
  transition: all var(--transition-fast);
  word-break: break-word;
}

#settingsObjectName{
	width:100%;
	height:60px;
	resize:none;
	font-family:inherit;
	font-size:13px;
	padding:12px;
	border:1.5px solid #ddd;
	border-radius:8px;
	box-sizing:border-box;
	min-height:60px;
}

#settingsObjectName.touch-device{
	border:none;
}

.separatorLine{
	height: 1px;
	background: #e0e0e0;
	margin: 4px 8px;
}
.separatorLine.touch-device{
	background: #333;
}

/* Специальные стили для статусных dropdown элементов */
/*
.custom-status-dropdown .dropdown-item {
	background: var(--light-bg);
}
*/
#addTaskToMarkBtn{
	background: var(--primary-color);
}
#fullSizePlanViewer{
	position: absolute;
	left: 5px;
	top: 5px;
	right: 5px;
	bottom: 120px;
	background: var(--light-bg);
	z-index: 1000;
	border-radius: 8px;
	cursor: move;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dropdown-item:hover,
.dropdown-item:active {
  filter: brightness(0.9);
}

/* Custom File Input */
.custom-file-input {
  position: relative;
  display: inline-block;
  width: 100%;
}

.custom-file-input input[type='file'] {
  opacity: 0;
  width: 100%;
  height: 44px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  cursor: pointer;
}

.custom-file-label {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: none;
  padding: 10px 16px;
  color: #222;
  cursor: pointer;
  min-height: 44px;
  width: 100%;
}

.custom-file-name {
  color: #888;
  margin-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Checkbox Components */
.plan-checkbox {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  padding: 0;
  margin: 0;
}

.plan-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #a9a9a9;
  background: #fff;
  outline: none;
  transition: background var(--transition-fast);
  cursor: pointer;
  display: block;
  position: relative;
  padding: 0;
  margin: 0;
}

.plan-checkbox input[type="checkbox"]:checked {
  background: var(--error-color);
  border-color: var(--error-color);
}

.plan-checkbox input[type="checkbox"]::after {
  content: '';
  display: block;
  width: 8px;
  height: 4px;
  border: none;
  border-left: 2.5px solid transparent;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  position: absolute;
  top: 8px;
  left: 7px;
  transform: rotate(-45deg);
  transition: none;
}

.plan-checkbox input[type="checkbox"]:checked::after {
  border-left-color: #fff;
  border-bottom-color: #fff;
}

/* Drop Indicator for Drag & Drop */
.drop-indicator {
  background: linear-gradient(90deg, #4ca7f0, #6597c9) !important;
  /*border: 2px solid #1976d2;*/
  border-radius: 10px;
  height: 24px !important;
  margin: 8px !important;
  grid-column: 1 / -1;
  pointer-events: none;
  opacity: 0.8;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
  animation: drop-indicator-pulse 1.5s ease-in-out infinite;
}

/* Drag Count Indicator */
.drag-count-indicator {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Task Number Badge */
.task-number-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary-color);
  color: white;
  border-radius: 50pt;
  width: 24px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  z-index: 1000;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@keyframes drop-indicator-pulse {
  0% { opacity: 0.8; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.5); }
  100% { opacity: 0.8; transform: scaleY(1); }
}

/* Display Utilities - High specificity to override other styles */
.hidden { display: none !important; }
.show-flex { display: flex !important; }
.show-block { display: block !important; }

/* Role-based visibility */
.role-hidden { display: none !important; }
.show-inline { display: inline !important; }
.show-inline-block { display: inline-block !important; }

/* Modal visibility */
.modal-overlay:not(.hidden) {
  display: flex !important;
}

/* Login page initial state */
#loginPage:not(.hidden) {
  display: flex !important;
}

/* Overflow Utilities */
.overflow-hidden { overflow: hidden !important; }
.overflow-visible { overflow: visible !important; }
.overflow-auto { overflow: auto !important; }

/* Settings Container Scrolling */

#settingsContainer::-webkit-scrollbar {
  width: 8px;
}

#settingsContainer::-webkit-scrollbar-track {
  background: transparent;
}

#settingsContainer::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

#settingsContainer::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/*
@media (max-width: 768px) {
  #settingsContainer {
    padding: 66px 12px 12px;
  }
}
*/

/* Form Utilities */
.form-fullwidth {
  width: 100%;
  display: block;
  margin: 0;
}

.form-fullwidth button,
#uploadForm button.form-fullwidth,
#uploadForm button[type='submit'].form-fullwidth {
  width: 100%;
  max-width: 340px;
  text-align: center;
  display: block;
  margin: 0;
}

#uploadForm {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Темная тема для uploadForm в мобильной версии */
body.touch-device #uploadForm {
  background: var(--dark-surface) !important;
  border: 1px solid var(--dark-border) !important;
}

body.touch-device #uploadForm h2 {
  color: var(--dark-text) !important;
}

/* Стили для кнопки "Отмена" в темной теме на мобильных */
body.touch-device.dark-theme #deleteTaskModal #cancelDeleteTask,
body.touch-device.dark-theme #uploadForm #cancelPlanBtn {
  background: var(--dark-bg) !important;
  color: var(--dark-text) !important;
  border: 1px solid var(--dark-border) !important;
}

body.touch-device #uploadForm #cancelPlanBtn:hover {
  background: var(--dark-surface-light) !important;
}

/* Стили для кнопки "Создать" остаются синими для видимости */
body.touch-device #uploadForm button[type="submit"] {
  background: var(--primary-color) !important;
}

/* Стили для dropdown папок в темной теме на мобильных */
body.touch-device #uploadForm .custom-status-dropdown {
  background: var(--dark-bg) !important;
  color: var(--dark-text) !important;
  border: 1px solid var(--dark-border) !important;
}

/*
body.touch-device #uploadForm .custom-status-dropdown:focus {
  border-color: var(--primary-color) !important;
}
*/

/* Стили для file input в темной теме на мобильных */
body.touch-device #uploadForm .custom-file-input .custom-file-label {
  background: var(--dark-bg) !important;
  border: 1px solid var(--dark-border) !important;
}

body.touch-device #uploadForm .custom-file-input .custom-file-label span:first-child {
  color: var(--dark-text) !important;
}

body.touch-device #uploadForm .custom-file-input .custom-file-name {
  color: #999 !important;
}

/* Стили для dropdown-list в темной теме на мобильных */
body.touch-device.dark-theme #uploadForm .dropdown-list {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
  border: 1px solid var(--dark-border) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
}

body.touch-device.dark-theme #uploadForm .dropdown-item {
  background: transparent !important;
  color: var(--dark-text) !important;
}

/*
body.touch-device #uploadForm .dropdown-item:hover {
  background: var(--dark-surface-light) !important;
}
*/

body.touch-device.dark-theme #uploadForm .dropdown-selected {
  background: var(--dark-bg) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

/* Objects Dropdown */
.objects-dropdown-container {
  position: relative;
  width: 100%;
  background: none;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
}

.objects-dropdown-btn {
  width: 100%;
  padding: 18px 16px;
  background: none;
  border: none;
  color: var(--dark-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  outline: none;
  border-radius: 0;
  position: relative;
  transition: background-color 0.2s;
}

.objects-dropdown-btn:hover {
  background: #404244;
}

.objects-dropdown-text {
  flex: 1;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
  color: var(--dark-text);
}

.objects-dropdown-arrow {
  color: var(--dark-text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
}

.objects-dropdown-btn.active .objects-dropdown-arrow {
  transform: rotate(180deg);
}

.objects-dropdown {
  background: var(--dark-surface-light);
  border-left: 3px solid var(--primary-color);
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
}

.objects-dropdown.show {
  max-height: 350px;
  overflow-y: auto;
}

.objects-dropdown-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--dark-text-secondary);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background-color var(--transition-fast);
  margin: 0;
}

.objects-dropdown-item:hover {
  background: var(--primary-hover);
}

/*
.objects-dropdown-separator {
  height: 1px;
  background: var(--dark-border-light);
  margin: 4px 20px;
}
*/

/* Menu separator in side menu */
.menu-separator {
  height: 1px;
  background: var(--dark-border-light);
  margin: 12px 24px;
}

#sideMenu.closed .menu-separator {
  margin: 12px 12px;
}

.objects-dropdown-counter.touch-device,
.objects-dropdown-counter {
  /*background: var(--primary-color);
  color: #fff;*/
  background: var(--mobile-yellow-color);
  color: #000;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: bold;
  font-family: 'Lato', sans-serif;
}

.objects-dropdown-counter.touch-device{
  /*background: var(--mobile-yellow-color);
  color: #000;*/
  border-radius: 8px;
  width: 34px;
}


.objects-dropdown-counter.zero {
  background: #666;
}

.objects-dropdown-counter.error {
  background: var(--error-color);
}

.objects-dropdown-item-text {
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}

/* Login Page */
#loginPage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f5f5f5;
}

/* Initial states for app elements */
.container {
  display: none; /* Hidden by default until logged in */
}

body.login-page .container {
  display: none;
}

/* Show container when not on login page */
body:not(.login-page) .container {
  display: block;
}

.header-right,
.header-left{
	display:flex;
	align-items:center;
}

#loginForm {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#loginForm h2,
#registerForm h2 {
  text-align: center;
  margin: 0 0 24px 0;
  color: #333;
  font-size: 18px;
  font-weight: 500;
}

#loginForm input,
#registerForm input {
  width: 100%;
  padding: 16px 14px;
  border-radius: var(--border-radius-large);
  background: #fff;
  color: #222;
  border: none;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

#loginForm input::placeholder,
#registerForm input::placeholder {
  color: #888;
}

/* Primary button styles for consistent theming across the app */
.btn-primary,
#loginForm button,
#registerForm button {
  width: 100%;
  padding: 16px 0;
  border-radius: var(--border-radius);
  font-weight: 500;
  background: var(--primary-color);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s ease;
}

.btn-primary:hover,
#loginForm button:hover,
#registerForm button:hover {
  background: var(--primary-hover);
}

#loginError {
  margin-top: 8px;
  padding: 12px;
  border-radius: 8px;
  display: none;
  text-align: center;
  background: #ffebee;
  color: #c62828;
}

/* Dark Theme */
html.dark-theme {
  background: var(--dark-bg);
}

body.dark-theme {
  background: var(--dark-bg);
  color: var(--dark-text);
}

body.dark-theme #toast {
  background: var(--dark-surface-light);
  color: var(--dark-text-secondary);
}

body.dark-theme .slider {
  background: var(--dark-border);
}

body.dark-theme .slider:before {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 0 15c-.13 0-.261 0-.393 0A8.501 8.501 0 1 1 12 3z' fill='%23aaa'/%3E%3C/svg%3E");
}

/* Стили для заголовков дней в фотогалерее */
.photo-day-header {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-top: 30px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
  grid-column: 1 / -1;
}

/* Dark theme for grids */
body.dark-theme #plansGrid > div,
body.dark-theme #objectsGrid > div {
  /*background: var(--dark-surface);*/
  color: var(--dark-text);
}

body.touch-device .folder-menu-button,
body.touch-device .plan-menu-button{
	background: none;
	color: inherit;
}

/* Dark theme для folder-header - только для десктопа */
body.dark-theme:not(.touch-device) .folder-header {
  background: var(--dark-surface) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}

body.dark-theme:not(.touch-device) .folder-header:hover {
  background: var(--dark-surface-light) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
}

body.dark-theme:not(.touch-device) .folder-title,
body.dark-theme:not(.touch-device) .folder-count {
  color: var(--dark-text) !important;
}

/* Dark theme для plan-card - только для десктопа */
body.dark-theme:not(.touch-device) .plan-card {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}

body.dark-theme:not(.touch-device) .plan-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
}

body.dark-theme:not(.touch-device) .plan-title {
  color: var(--dark-text) !important;
}

body.dark-theme:not(.touch-device) .plan-card svg {
  stroke: var(--dark-text);
}

/* Dark theme для заголовков дней */
body.dark-theme .photo-day-header {
  color: var(--dark-text);
  border-bottom-color: #555;
}

body.dark-theme #objectsGrid > div > div > div {
  color: var(--dark-text);
}

body.dark-theme #objectsGrid .users-icon,
body.dark-theme #objectsGrid .users-count {
  color: var(--dark-text);
}

body.dark-theme #objectsGrid svg,
body.dark-theme #objectsGrid svg * {
  stroke: var(--dark-text);
}

body.dark-theme #objectsGrid svg[viewBox="-2 -4 24 24"],
body.dark-theme #objectsGrid svg[viewBox="-2 -4 24 24"] * {
  stroke: none;
}

/* Dark theme for inputs and forms - для обеих версий */
body.dark-theme input,
body.dark-theme button,
body.dark-theme select,
body.dark-theme textarea {
  background: var(--dark-surface);
  color: var(--dark-text);
  border-color: var(--dark-border);
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
  color: var(--dark-text-muted);
}

/* Светлая тема для input полей (когда темная тема НЕ активна) */
body:not(.dark-theme) input,
body:not(.dark-theme) textarea {
  background: #fff;
  color: #333;
  border-color: var(--light-input-border);
}

body:not(.dark-theme) input::placeholder,
body:not(.dark-theme) textarea::placeholder {
  color: #999;
}

#photoAnnotationEditor{
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: #000;
	z-index: 10000;
	display: flex;
	flex-direction: column;
	align-items: center;
}
#photoControlsPanel,
#photoAnnotationEditorToolbar{
	position: absolute;
	width: 100%;
	max-width: 500px;
	justify-content: space-evenly;
}
#photoAnnotationEditorToolbar {
	/* top: 20px; */
	height: 80px;
	/*left: 50%;*/
	/*transform: translateX(-50%);*/
	display: none;
	/* gap: 4px; */
	align-items: center;
	/* padding: 12px 16px; */
	z-index: 10002;
}
#photoControlsPanel{
	bottom: 20px;
	display: flex;
	z-index: 10002;
}
.photoControlsBt{
	background: #f5f5f5;
	color: #333;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}
.photoControlsBt:disabled{
	opacity: 0.6;
	cursor: not-allowed !important;
}
.photoColorBt{
	width: 35px;
	height: 35px;
	/*border: 4px solid transparent;*/
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform: scale(1);
	position: relative;
	overflow: hidden;
}
.photoToolBt{
	width: 45px;
	height: 45px;
	border-radius: 50%;
	background: rgb(20, 69, 119);
	color: white;
	cursor: pointer;
	display: flex;
	align-items: center;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform: scale(1);
	position: relative;
	overflow: hidden;
}

/* Dark theme for dropdowns */
body.dark-theme .custom-status-dropdown .dropdown-selected {
  background: var(--dark-surface);
  color: var(--dark-text);
}

body.dark-theme .custom-status-dropdown .dropdown-arrow {
  color: var(--dark-text-muted);
}

body.dark-theme .custom-status-dropdown .dropdown-list {
  background: var(--dark-bg);
  color: var(--dark-text);
  border: 1.5px solid var(--dark-border-light);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

body.dark-theme .custom-status-dropdown .dropdown-item {
  background: var(--dark-bg);
  color: var(--dark-text);
}

body.dark-theme .custom-status-dropdown .dropdown-item:hover {
  filter: brightness(1.2);
}

/* Dark theme for login and registration */
body.dark-theme #loginPage,
body.dark-theme #registerPage {
  background: var(--dark-bg);
}

body.dark-theme #loginForm h2,
body.dark-theme #registerForm h2 {
  color: var(--dark-text);
}

body.dark-theme #loginForm input,
body.dark-theme #registerForm input {
  background: var(--dark-surface);
  color: var(--dark-text);
  border: 1px solid var(--dark-border);
}

body.dark-theme #loginForm input::placeholder,
body.dark-theme #registerForm input::placeholder {
  color: var(--dark-text-muted);
}



body.dark-theme .btn-primary,
body.dark-theme #loginForm button,
body.dark-theme #registerForm button {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .btn-primary:hover,
body.dark-theme #loginForm button:hover,
body.dark-theme #registerForm button:hover {
  background: var(--primary-hover);
}

body.dark-theme #loginError {
  background: #3e1723;
  color: #ffcdd2;
  border: 1px solid #c62828;
}

/* Dark theme for modals */
body.dark-theme #addObjectSection,
body.dark-theme #addFolderSection,
body.dark-theme #addPlanSection {
  background: rgba(0,0,0,0.7);
}

body.dark-theme .modal-form {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
}

body.dark-theme #addObjectSection h2,
body.dark-theme #addFolderSection h2,
body.dark-theme #addPlanSection h2 {
  color: var(--dark-text);
}

body.dark-theme #addObjectSection input,
body.dark-theme #addObjectSection textarea,
body.dark-theme #addFolderSection input,
body.dark-theme #addPlanSection input {
  background: var(--dark-surface-light);
  color: var(--dark-text);
  border: none;
}

body.dark-theme #cancelObjectBtn,
body.dark-theme #cancelFolderBtn,
body.dark-theme #cancelPlanBtn {
  background: var(--dark-surface-light);
  color: var(--dark-text-secondary);
}

body.dark-theme #cancelObjectBtn:hover,
body.dark-theme #cancelFolderBtn:hover,
body.dark-theme #cancelPlanBtn:hover {
  background: var(--dark-surface-lighter);
}

body.dark-theme .custom-file-label {
  background: var(--dark-surface);
  color: var(--dark-text);
}

body.dark-theme .custom-file-name {
  color: var(--dark-text-muted);
}

/* Dark theme for checkboxes */
body.dark-theme .plan-checkbox input[type="checkbox"] {
  background: var(--dark-surface-light);
  border: 1px solid var(--dark-border);
}



body.dark-theme .plan-checkbox input[type="checkbox"]:checked {
  background: var(--error-color);
  border-color: var(--error-color);
}

/* Dark theme for drop indicator */
/*body.dark-theme .drop-indicator {
  background: linear-gradient(90deg, #64b5f6, var(--primary-color)) !important;
  border: 2px solid var(--primary-color);
  box-shadow: 0 2px 8px rgba(100, 181, 246, 0.4);
}*/

/* Universal scrollbar styles for light theme (default) */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: #f5f5f5;
}

*::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #999;
}

*::-webkit-scrollbar-track {
  background: #f5f5f5;
}

#objectMenu,
#folderMenu,
#taskMenu,
#planMenu {
	position: fixed;
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 8px 0;
    z-index: 10000;
    display: none;
    min-width: 140px;
}


.plan-menu-item{
	padding: 8px 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	transition: background-color 0.2s;
	color: #333;
}

.plan-menu-item:hover {
	background-color: #f5f5f5;
}

.folder-menu-item{
	padding: 8px 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	transition: background-color 0.2s;
	color: #333;
}

.folder-menu-item:hover {
	background-color: #f5f5f5;
}

/* Dark theme styles for plan menu */
body.dark-theme #planMenu, body.dark-theme #folderMenu,body.dark-theme #taskMenu {
    background: var(--dark-surface-light);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

body.dark-theme .plan-menu-item, body.dark-theme .folder-menu-item {
    color: var(--dark-text);
}

body.dark-theme .plan-menu-item:hover, body.dark-theme .folder-menu-item:hover {
    background-color: var(--dark-surface-light);
}


.folder-menu-button{
	width: 24px;
	height: 24px;
	border-radius: 50%;
	/*background: transparent;*/
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: bold;
	color: #666;
	transition: all 0.2s;
	margin-left: auto;
}

/*
.folder-menu-button.touch-device{
	margin-left: auto;
}
*/

/* Мобильная версия теперь использует те же кнопки меню, что и десктопная */
/* .folder-menu-button.touch-device,
.plan-menu-button.touch-device{
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: bold;
	color: #666;
	cursor: pointer;
	flex-shrink: 0;
	position: initial;
	background: none;
} */

.folder-menu-button.touch-device {
	margin-left: auto;
}

.plan-menu-button{
	position: absolute;
	top: 8px;
	left: 8px;
	width: 24px;
	height: 24px;
	border-radius: 0;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: bold;
	color: #666;
	transition: all 0.2s;
	z-index: 10;
}

.dropdownInput{
	flex: 1;
	padding: 4px 8px;
	border: none;
	border-radius: 4px;
	font-size: 13px;
	/*background: #f9f9f9;*/
	color: #333;
	font-weight: bold;
}

.dropdownInputBadge{
	width: 20px;
	height: 20px;
	border-radius: 4px;
	border: 1px solid #000;
	cursor: pointer;
	flex-shrink: 0;
}

.dropdownInputDelBt{
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.dropdownInputDrag{
	font-size: 16px;
	color: #666;
	cursor: grab;
	line-height: 1;
	user-select: none;
	transition: color 0.2s;
	opacity: 1;
	padding: 4px;
	border-radius: 4px;
	flex-shrink: 0;
}

/* Мобильная версия теперь использует стандартный tasks-counter, а не tasks-counter-mobile */
/* .tasks-counter-mobile{
	width: 34px;
	height: 24px;
	border-radius: 8px;
	background: #2196F3;
	color: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: bold;
	font-family: 'Lato', sans-serif;
	flex-shrink: 0;
} */

.folder-plans-counter-mobile{
	width: 34px;
	height: 24px;
	border-radius: 8px;
	background: var(--mobile-yellow-color);
	color: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: bold;
	font-family: 'Lato', sans-serif;
	flex-shrink: 0;
	margin-left: auto;
}

.tasks-counter {
	position: absolute;
	top: 76px;
	right: 10px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #2196F3;
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: bold;
	font-family: 'Lato', sans-serif;
}

/* Если в карточке плана нет чекбокса (не админ), перемещаем счетчик задач в правый верхний угол */
.plan-card.no-admin-controls .tasks-counter {
	top: 8px;
	right: 8px;
}

/* Для лучшей совместимости также поддерживаем :has() селектор */
.plan-card:not(:has(.plan-checkbox)) .tasks-counter {
	top: 8px;
	right: 8px;
}

body.touch-device .tasks-counter{
    width: 40px;
    height: 40px;
	font-size: 15px;
}

.folder-header{
	display:flex;
	align-items:center;
	margin:0 16px 12px 0;
	padding:8px 12px;
	background:white;
	border-radius:8px;
	box-shadow:0 2px 8px #0001;
	cursor:grab;
	transition:background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.folder-title{
	font-weight:bold;
	font-size:14px;
	font-family:Lato, sans-serif;
	color:#333;
}

/* Только на мобильных устройствах название папки занимает всё доступное пространство */
body.touch-device .folder-header .folder-title {
	flex: 1;
	word-break: break-word;
}
.folder-count{
	font-size:13px;
	font-family:Lato, sans-serif;
	color:#666;
	margin-left:4px;
}

.planThumb{
	width:100%;
	max-width:140px;
	height:140px;
	object-fit:contain;
	border-radius:8px;
}

.plan-card{
    background: rgb(255, 255, 255);
    position: relative;
    border: 1.5px solid rgb(238, 238, 238);
    border-radius: 12px;
    box-shadow: rgba(0, 0, 0, 0.067) 0px 2px 8px;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px 10px;
    cursor: grab;
    max-width: 200px;
}
/* Мобильная версия использует карточки, но в вертикальном списке на всю ширину */
.plan-card.touch-device{
	max-width: none !important;
	width: 100%;
	cursor: pointer !important; /* Убираем grab, чтобы не мешать прокрутке */
}
/* Мобильная версия теперь использует стандартный .plan-title, а не .plan-title.touch-device */
/* .plan-title.touch-device{
	font-weight: bold;
    font-size: 14px;
    font-family: Lato, sans-serif;
    line-height: 1.4;
    color: var(--dark-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 0%;
    min-width: 0px;
} */

.plan-rotate-button{
	position: absolute;
	top: 40px;
	right: 6px;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: bold;
	color: #666;
	transition: all 0.2s;
	z-index: 10;
}

/* Scrollbar styles for dark theme */
body.dark-theme *::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: var(--dark-surface);
}

body.dark-theme *::-webkit-scrollbar-thumb {
  background: var(--dark-border);
  border-radius: 3px;
}

body.dark-theme *::-webkit-scrollbar-thumb:hover {
  background: var(--dark-border-light);
}

body.dark-theme *::-webkit-scrollbar-track {
  background: var(--dark-surface);
}



/* Light theme for calendar (explicit overrides) */
.calendar-modal {
  background: var(--calendar-bg) !important;
  color: var(--calendar-text) !important;
}

.calendar-modal button {
  background: var(--calendar-surface) !important;
  color: var(--calendar-text-secondary) !important;
  border-color: var(--calendar-border-light) !important;
}

.calendar-btn-primary {
  background: var(--calendar-selected-bg) !important;
  color: white !important;
}

.calendar-btn-secondary {
  background: var(--calendar-surface) !important;
  color: var(--calendar-text-secondary) !important;
}

.calendar-btn-outline {
  background: transparent !important;
  color: var(--primary-color) !important;
  border: none !important;
}

.calendar-preset-btn {
  background: var(--calendar-bg) !important;
  color: var(--calendar-text-secondary) !important;
  border: 1px solid var(--calendar-border-light) !important;
}

.calendar-nav-btn {
  background: transparent !important;
  color: white !important;
  border: none !important;
}

.calendar-presets {
  background: var(--calendar-surface) !important;
  border-bottom: 1px solid var(--calendar-border) !important;
}

.calendar-actions {
  background: var(--calendar-surface) !important;
  border-top: 1px solid var(--calendar-border) !important;
}

.calendar-weekday {
  color: var(--calendar-text-muted) !important;
}

.calendar-day {
  color: var(--calendar-text) !important;
}

.calendar-day:not(.calendar-day-disabled):hover {
  background: var(--calendar-hover) !important;
  color: var(--primary-color) !important;
}

.calendar-day.calendar-day-today {
  background: var(--calendar-today-bg) !important;
  color: var(--primary-color) !important;
}

.calendar-day.calendar-day-selected {
  background: var(--calendar-selected-bg) !important;
  color: white !important;
}

.calendar-day.calendar-day-other-month,
.calendar-day.calendar-day-disabled {
  color: var(--calendar-text-disabled) !important;
}

/* Dark theme for calendar */
body.dark-theme .calendar-modal {
  background: var(--calendar-dark-bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark-theme .calendar-navigation {
  background: var(--primary-color);
}

body.dark-theme .calendar-month-year {
  color: white;
}

body.dark-theme .calendar-nav-btn {
  color: white;
}

body.dark-theme .calendar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

body.dark-theme .calendar-presets {
  background: var(--calendar-dark-surface);
  border-bottom: 1px solid var(--calendar-dark-border);
}

body.dark-theme .calendar-preset-btn {
  background: var(--calendar-dark-bg);
  color: var(--calendar-dark-text-secondary);
  border: 1px solid var(--calendar-dark-border-light);
}

body.dark-theme .calendar-preset-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--calendar-dark-hover);
}

body.dark-theme .calendar-preset-btn.active {
  background: var(--calendar-dark-selected-bg);
  border-color: var(--calendar-dark-selected-bg);
  color: white;
}

body.dark-theme .calendar-weekday {
  color: var(--calendar-dark-text-muted);
}

body.dark-theme .calendar-day {
  color: var(--calendar-dark-text);
}

body.dark-theme .calendar-day:not(.calendar-day-disabled):hover {
  background: var(--calendar-dark-hover);
  color: var(--primary-color);
}

body.dark-theme .calendar-day.calendar-day-today {
  background: var(--calendar-dark-today-bg);
  color: var(--primary-color);
}

body.dark-theme .calendar-day.calendar-day-selected {
  background: var(--calendar-dark-selected-bg);
  color: white;
}

body.dark-theme .calendar-day.calendar-day-selected:hover {
  background: var(--calendar-dark-selected-hover);
}

body.dark-theme .calendar-day.calendar-day-other-month {
  color: var(--calendar-dark-text-disabled);
}

body.dark-theme .calendar-day.calendar-day-disabled {
  color: var(--calendar-dark-text-disabled);
}

body.dark-theme .calendar-day.calendar-day-other-month:hover,
body.dark-theme .calendar-day.calendar-day-disabled:hover {
  background: none;
  color: var(--calendar-dark-text-disabled);
}

body.dark-theme .calendar-actions {
  background: var(--calendar-dark-surface);
  border-top: 1px solid var(--calendar-dark-border);
}

body.dark-theme .calendar-btn-primary {
  background: var(--calendar-dark-selected-bg);
  color: white;
}



body.dark-theme .calendar-btn-secondary {
  background: var(--calendar-dark-surface);
  color: var(--calendar-dark-text-secondary);
}



body.dark-theme .calendar-btn-outline {
  background: none;
  color: var(--primary-color);
  border: none;
}



/* Override general dark theme button styles for calendar */
body.dark-theme .calendar-modal button {
  background: var(--calendar-dark-surface) !important;
  color: var(--calendar-dark-text) !important;
  border-color: var(--calendar-dark-border) !important;
}

body.dark-theme .calendar-btn-primary {
  background: var(--calendar-dark-selected-bg) !important;
  color: white !important;
}

body.dark-theme .calendar-btn-secondary {
  background: var(--calendar-dark-surface) !important;
  color: var(--calendar-dark-text-secondary) !important;
}

body.dark-theme .calendar-btn-outline {
  background: transparent !important;
  color: var(--primary-color) !important;
  border: none !important;
}

body.dark-theme .calendar-preset-btn {
  background: var(--calendar-dark-bg) !important;
  color: var(--calendar-dark-text-secondary) !important;
  border: 1px solid var(--calendar-dark-border-light) !important;
}

body.dark-theme .calendar-nav-btn {
  background: transparent !important;
  color: white !important;
  border: none !important;
}

/* Override general dark theme styles for other calendar elements */
body.dark-theme .calendar-modal {
  background: var(--calendar-dark-bg) !important;
  color: var(--calendar-dark-text) !important;
}

body.dark-theme .calendar-presets {
  background: var(--calendar-dark-surface) !important;
  border-bottom: 1px solid var(--calendar-dark-border) !important;
}

body.dark-theme .calendar-actions {
  background: var(--calendar-dark-surface) !important;
  border-top: 1px solid var(--calendar-dark-border) !important;
}

body.dark-theme .calendar-weekday {
  color: var(--calendar-dark-text-muted) !important;
}

body.dark-theme .calendar-day {
  color: var(--calendar-dark-text) !important;
}

body.dark-theme .calendar-day:not(.calendar-day-disabled):hover {
  background: var(--calendar-dark-hover) !important;
  color: var(--primary-color) !important;
}

body.dark-theme .calendar-day.calendar-day-today {
  background: var(--calendar-dark-today-bg) !important;
  color: var(--primary-color) !important;
}

body.dark-theme .calendar-day.calendar-day-selected {
  background: var(--calendar-dark-selected-bg) !important;
  color: white !important;
}

body.dark-theme .calendar-day.calendar-day-other-month,
body.dark-theme .calendar-day.calendar-day-disabled {
  color: var(--calendar-dark-text-disabled) !important;
}

/* Отступы сверху для разделов Фото и Задачи */
#sectionTasks {
  padding-top: 56px;
}

#tasksCount{
	font-size:12px;
	color:#666 !important;
	padding-top: 8px;
}
body.touch-device #tasksCount{
	width: 60vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
	font-weight: normal;
}



/* Фиксация высоты для раздела задач в мобильной версии */
body.touch-device #sectionTasks {
  height: calc(100vh - 4px); /* Высота экрана минус высота header */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body.touch-device #tasksListView {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.touch-device #tasksList {
  flex: 1;
  max-height: none;
  height: auto;
  overflow-y: auto !important;
  padding: 10px 0 100px; /* Увеличиваем нижний отступ для лучшей прокрутки */
}

/* Responsive Design */
/*
@media (max-width: 700px) {
  .container {
    max-width: 100vw;
    padding: 0 8px !important;
    margin-left: 60px;
    height: calc(100vh - 56px) !important;
  }

  #sideMenu {
    width: 70vw;
  }
}
*/
/*
@media (max-width: 500px) {
  #addPlanSection form {
    border-radius: 8px;
    max-width: 99vw;
    margin: 16px auto;
  }

  .menu-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    font-size: 13px;
  }
}

@media (max-width: 600px), (max-height: 500px) {
  #addPlanSection form {
    border-radius: 8px;
    gap: 8px;
  }
}
*/

@media (pointer: coarse) {
  #addPlanSection {
    align-items: flex-start;
  }

  #addPlanSection form {
    margin-top: 66px;
  }
}


/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --light-border: #000;
    --dark-border: #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  #sideMenu,
  header,
  .header-btn,
  button:not(.print-button) {
    display: none;
  }

  .container {
    margin-left: 0;
    padding: 0;
  }

  * {
    color: #000 !important;
    background: #fff !important;
  }
}

/* ======================
   PWA SPECIFIC STYLES
====================== */

/* PWA Install Button */
#pwa-install-button {
  /* Styles are applied inline via JavaScript for better control */
  font-family: var(--font-family) !important;
}

/* PWA Standalone mode styles */
body.pwa-standalone {
  /* Additional padding for standalone mode if needed */
  -webkit-user-select: none;
  user-select: none;
}

/* PWA offline indicator */
/*.pwa-offline-indicator*/
#offlineIndicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--mobile-yellow-color);
  color: #000;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  z-index: 10002;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  border-radius: 0 0 12px 12px;
}

#offlineIndicator.show {
  transform: translateY(0);
}
#offlineIndicator.minimize {
	transform: translateY(-23px);
}

/* PWA update button */
.pwa-update-button {
  animation: pulse-update 2s infinite;
}

@keyframes pulse-update {
  0% {
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
  }
  50% {
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6);
    transform: translateY(-1px);
  }
  100% {
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
  }
}

/* PWA splash screen (iOS) */
@media (display-mode: standalone) {
  body {
    background: var(--dark-surface);
  }

  /* Hide browser-specific elements in standalone mode */
  .browser-only {
    display: none !important;
  }

  /* Adjust header for standalone mode */

  html {
    padding-top: env(safe-area-inset-top);
	padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }


  /* Adjust container for safe areas */
  /*
  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: env(safe-area-inset-bottom);
  }
	*/


}

/* PWA loading state */
.pwa-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--dark-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 10003;
}

.pwa-loading-logo {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 20px;
  animation: pwa-logo-pulse 1.5s ease-in-out infinite;
}

@keyframes pwa-logo-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.pwa-loading-text {
  color: var(--dark-text);
  font-size: 16px;
  margin-bottom: 10px;
}

.pwa-loading-subtext {
  color: var(--dark-text-muted);
  font-size: 14px;
}

/* PWA status indicator */
.pwa-status {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.pwa-status.show {
  opacity: 1;
  transform: translateY(0);
}

.pwa-status.online {
  background: rgba(76, 175, 80, 0.9);
}

.pwa-status.offline {
  background: rgba(255, 152, 0, 0.9);
}

.pwa-status.updating {
  background: rgba(33, 150, 243, 0.9);
}

/* PWA toast improvements */
.pwa-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  max-width: 300px;
  text-align: center;
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  transition: all 0.3s ease;
}

.pwa-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pwa-toast.success {
  background: rgba(76, 175, 80, 0.9);
}

.pwa-toast.error {
  background: rgba(244, 67, 54, 0.9);
}

.pwa-toast.info {
  background: rgba(33, 150, 243, 0.9);
}

/* Dark theme adjustments for PWA */
body.dark-theme .pwa-loading {
  background: var(--dark-bg);
}

body.dark-theme .pwa-loading-logo {
  background: var(--primary-color);
  box-shadow: 0 8px 32px rgba(25, 118, 210, 0.3);
}

/* PWA shortcuts menu (future) */
.pwa-shortcuts {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.pwa-shortcuts.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pwa-shortcut-btn {
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
  transition: all 0.2s ease;
}

.pwa-shortcut-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(25, 118, 210, 0.5);
}

/* PWA performance optimization */
@media (prefers-reduced-motion: reduce) {
  .pwa-loading-logo,
  .pwa-update-button,
  #pwa-install-button,
  .pwa-toast,
  .pwa-status {
    animation: none !important;
    transition: none !important;
  }
}

/* PWA network status */
/*
@media (max-width: 768px) {
  #pwa-install-button {
    bottom: 80px !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    text-align: center !important;
  }

  .pwa-toast {
    bottom: 100px;
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
  }

  .pwa-toast.show {
    transform: none;
  }
}
*/

/* ======================
   КАСТОМНЫЙ КАЛЕНДАРЬ
====================== */

/* Overlay */
.calendar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10010; /* Выше модального окна настройки отчета (10002) */
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Модальное окно календаря */
.calendar-modal {
  background: var(--calendar-bg);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 380px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  animation: slideInUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Навигация по месяцам */
.calendar-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--primary-color);
  border-bottom: 1px solid var(--calendar-border-light);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.calendar-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: scale(1.1);
}

.calendar-month-year {
  font-weight: 600;
  font-size: 15px;
  color: white;
  min-width: 120px;
  text-align: center;
}

/* Быстрые пресеты */
.calendar-presets {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  background: var(--calendar-surface);
  border-bottom: 1px solid var(--calendar-border);
  flex-wrap: wrap;
}

.calendar-preset-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--calendar-border-light);
  border-radius: 16px;
  background: var(--calendar-bg);
  color: var(--calendar-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.calendar-preset-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--calendar-hover);
  transform: translateY(-1px);
}

.calendar-preset-btn.active {
  background: var(--calendar-selected-bg);
  border-color: var(--calendar-selected-bg);
  color: white;
}

/* Сетка календаря */
.calendar-grid {
  padding: 16px 24px;
}

/* Заголовки дней недели */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--calendar-text-muted);
  padding: 8px 4px;
}

/* Дни месяца */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  font-weight: 500;
  color: var(--calendar-text);
  min-height: 40px;
}

.calendar-day:not(.calendar-day-disabled):hover {
  background: var(--calendar-hover);
  color: var(--primary-color);
  transform: scale(1.05);
}

.calendar-day:not(.calendar-day-disabled):active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

.calendar-day.calendar-day-today {
  background: var(--calendar-today-bg);
  color: var(--primary-color);
  font-weight: 600;
}

.calendar-day.calendar-day-selected {
  background: var(--calendar-selected-bg);
  color: white;
  font-weight: 600;
}

.calendar-day.calendar-day-selected:hover {
  background: var(--calendar-selected-hover);
  transform: scale(1.05);
}

.calendar-day.calendar-day-other-month {
  color: var(--calendar-text-disabled);
  cursor: default;
}

.calendar-day.calendar-day-disabled {
  color: var(--calendar-text-disabled);
  cursor: not-allowed;
}

.calendar-day.calendar-day-other-month:hover,
.calendar-day.calendar-day-disabled:hover {
  background: none;
  color: var(--calendar-text-disabled);
  transform: none;
}

/* Кнопки действий */
.calendar-actions {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--calendar-border);
  background: var(--calendar-surface);
}

.calendar-btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  flex: 1;
}

.calendar-btn-primary {
  background: var(--calendar-selected-bg);
  color: white;
}



.calendar-btn-secondary {
  background: var(--calendar-surface);
  color: var(--calendar-text-secondary);
}



.calendar-btn-outline {
  background: none;
  color: var(--primary-color);
  border: none;
}

/* Анимация для смены месяца */
.calendar-days.changing {
  opacity: 0.5;
  transform: scale(0.98);
  transition: all 0.2s ease;
}

/* Стили календаря на основе типа устройства */
/* Touch устройства (мобильные/планшеты) - всегда полноэкранный режим */
body.touch-device .calendar-modal {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
  animation: slideInUp 0.3s ease-out;
  display: flex;
  flex-direction: column;
  position: relative;
}



body.touch-device .calendar-navigation,
body.touch-device .calendar-presets,
body.touch-device .calendar-grid,
body.touch-device .calendar-actions {
  padding-left: 16px;
  padding-right: 16px;
}

body.touch-device .calendar-navigation {
  padding: 20px 16px;
  background: var(--primary-color);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

body.touch-device .calendar-month-year {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

body.touch-device .calendar-nav-btn {
  width: 44px;
  height: 44px;
  padding: 10px;
  color: white;
}

body.touch-device .calendar-nav-btn:hover {
  background: none;
  color: white;
  transform: none;
}

body.touch-device .calendar-nav-btn:active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(0.9);
}

body.touch-device .calendar-presets {
  padding: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

body.touch-device .calendar-preset-btn {
  flex: 1;
  min-width: calc(50% - 4px);
  padding: 10px 8px;
  font-size: 12px;
  border-radius: 8px;
  min-height: 40px;
}

body.touch-device .calendar-grid {
  padding: 12px 16px;
  flex: 1;
  min-height: 0;
}

body.touch-device .calendar-weekdays {
  gap: 2px;
  margin-bottom: 12px;
}

body.touch-device .calendar-weekday {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 4px;
  color: var(--calendar-text-muted);
}

body.touch-device .calendar-days {
  gap: 2px;
  max-height: 250px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.touch-device .calendar-day {
  font-size: 14px;
  font-weight: 500;
  min-height: 36px;
  height: 36px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

body.touch-device .calendar-day:hover {
  background: none;
  color: inherit;
  transform: none;
}

body.touch-device .calendar-day:not(.calendar-day-disabled):active {
  background: #f0f7ff;
  color: #1976d2;
  transform: scale(0.95);
}

body.touch-device .calendar-day.calendar-day-selected {
  background: var(--calendar-selected-bg);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

body.touch-device .calendar-day.calendar-day-today {
  background: var(--calendar-today-bg);
  color: var(--primary-color);
  font-weight: 600;
  border: 2px solid var(--primary-color);
}

body.touch-device .calendar-actions {
  padding: 12px;
  background: var(--dark-surface);
  border: none;
  flex-direction: row;
  gap: 8px;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

body.touch-device .calendar-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: normal;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

/* Второстепенные кнопки календаря (Отмена, Очистить) */
body.touch-device #calendarCancel,
body.touch-device #calendarClear {
  background: #f5f5f5 !important;
  color: #666 !important;
}

/* Главная кнопка календаря (Выбрать) */
body.touch-device #calendarConfirm {
  background: var(--primary-color) !important;
  color: #fff !important;
}

/* Принудительное применение единого стиля футера календаря в мобильной версии */
body.dark-theme.touch-device .calendar-actions {
  background: var(--dark-surface) !important;
  border: none !important;
}

/* Стили полей ввода дат для touch устройств */
body.touch-device .custom-date-input {
  padding: 14px 42px 14px 16px;
  font-size: 16px; /* Предотвращает зум на iOS */
  min-height: 48px;
  border-radius: 8px;
}

body.touch-device .custom-date-icon {
  right: 16px;
  width: 22px;
  height: 22px;
}

body.touch-device .custom-date-icon svg {
  width: 20px;
  height: 20px;
}

/* Стили для попапа "Фильтр проектов" на touch устройствах */
body.touch-device #projectFilterModal > div {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  animation: slideInUp 0.3s ease-out;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  overflow: hidden !important;
  position: relative;
}

/* Хеадер для полноэкранных попапов */
body.touch-device #projectFilterModal .popup-header {
  background: var(--dark-surface);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

/* Кнопка "Назад" в хеадере - стиль как у backBtn */
body.touch-device #projectFilterModal .popup-back-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 40px;
  padding: 2px;
  background: transparent;
  border: none;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Заголовок в хеадере */
body.touch-device #projectFilterModal .popup-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  text-align: center;
  color: var(--dark-text);
}

/* SVG в кнопке "Назад" */
body.touch-device #projectFilterModal .popup-back-btn svg {
  width: 26px;
  height: 26px;
  stroke: #1976d2;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Контент попапа (прокручиваемая область) */
body.touch-device #projectFilterModal .popup-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 0 12px; /* Убираем padding-bottom, заменяем на margin */
  margin-bottom: 70px; /* Отступ для футера с кнопками */
}

/* Темная тема для хеадера и кнопок - теперь все попапы используют var(--dark-surface) */



/* Стили для контента внутри popup-content */
body.touch-device #projectFilterModal .popup-content > * {
  margin: 12px 0 !important;
}

/* Последний элемент в контенте */
body.touch-device #projectFilterModal .popup-content > *:last-child {
  margin-bottom: 16px !important; /* Дополнительный отступ для последнего элемента */
}


/* Темная тема для заголовков секций */
body.dark-theme.touch-device #projectFilterModal .popup-content label:first-child {
  color: var(--dark-text) !important;
}

/* Кнопки */
body.touch-device #projectFilterModal button {
  min-height: 36px !important;
  font-size: 14px !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  margin: 0 !important;
  flex: 1 !important;
  box-sizing: border-box !important;
  border: none !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
}

/* Цвета проектов - квадратики */
body.touch-device #projectFilterColors > * {
  width: 24px !important;
  height: 24px !important;
  border-radius: 4px !important;
  border: 1px solid #ddd !important;
  flex-shrink: 0 !important;
  margin: 2px !important;
  display: inline-block !important;
  position: relative !important;
}

/* Чекбоксы с текстом в popup-content */
body.touch-device #projectFilterModal .popup-content label[style*="display:flex"] {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 4px 0 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  width: 100% !important;
}

/* Текст рядом с чекбоксами */
body.touch-device #projectFilterModal .popup-content input[type="checkbox"] + * {
  flex: 1 !important;
  white-space: normal !important;
  word-wrap: break-word !important;
}

/* Архивированные проекты чекбокс */
body.touch-device #projectFilterModal .popup-content div[data-role="admin"] {
  margin: 8px 0 !important;
  padding: 4px 0 !important;
}

/* Пользователи в списке */
body.touch-device #projectFilterUsers label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 0 !important;
  margin: 0 !important;
  font-size: 14px !important;
}


/* Темная тема для пользователей в списке */
body.dark-theme.touch-device #projectFilterUsers label {
  border-bottom-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}

/* Стили для полей дат */
body.touch-device #projectFilterModal .popup-content input[type="date"] {
  font-size: 14px !important;
  min-height: 36px !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  border: 1px solid #ddd !important;
  box-sizing: border-box !important;
  width: 100% !important;
  margin: 4px 0 !important;
}

/* Стили для чекбоксов */
body.touch-device #projectFilterModal .popup-content input[type="checkbox"] {
  width: 20px !important;
  height: 20px !important;
  margin: 2px 0 0 0 !important;
  flex-shrink: 0 !important;
  align-self: flex-start !important;
}

/* Стили для пользователей и цветов */
body.touch-device #projectFilterUsers {
  max-height: 200px !important;
  overflow-y: auto !important;
  padding: 8px !important;
  margin: 8px 0 !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px !important;
}

body.touch-device #projectFilterColors {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 8px 0 !important;
  justify-content: flex-start !important;
}

/* Темная тема для полей и контейнеров */
body.dark-theme.touch-device #projectFilterModal .popup-content input[type="date"] {
  background: var(--dark-surface-light) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

body.dark-theme.touch-device #projectFilterUsers {
  background: var(--dark-surface-light) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}

/* Кнопки в нижней части - фиксированные горизонтальные */
body.touch-device #projectFilterModal > div > div:last-child {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  padding: 12px !important;
  margin: 0 !important;
  background: var(--dark-surface) !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
  z-index: 1000 !important;
  flex-shrink: 0 !important;
}

/* Полноэкранный режим для мобильных */
.calendar-overlay.mobile-fullscreen {
  animation: none;
}

.calendar-overlay.mobile-fullscreen .calendar-modal {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  margin: 0;
  animation: slideInUp 0.3s ease-out;
}

/* Темная тема для календаря */
@media (prefers-color-scheme: dark) {
  .calendar-modal {
    background: #2d2d2d;
    color: #e0e0e0;
  }

  .calendar-navigation {
    background: #1976d2;
    border-color: #4d4d4d;
  }

  .calendar-presets,
  .calendar-actions {
    background: #3d3d3d;
    border-color: #4d4d4d;
  }

  /* Переопределение для мобильных устройств в темной теме */
  body.touch-device .calendar-actions {
    background: var(--dark-surface) !important;
    border: none !important;
  }

  .calendar-preset-btn {
    background: #4d4d4d;
    border-color: #5d5d5d;
    color: #e0e0e0;
  }

  .calendar-day.calendar-day-today {
    background: #1e3a8a;
    color: #bfdbfe;
  }

  .calendar-day:not(.calendar-day-disabled):hover {
    background: #1e40af;
    color: #bfdbfe;
  }
}

/* Темная тема для попапа фильтров проектов */
body.dark-theme.touch-device #projectFilterModal > div {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
}

body.dark-theme.touch-device #projectFilterModal h2 {
  color: var(--dark-text) !important;
  border-bottom-color: var(--dark-border) !important;
}

body.dark-theme.touch-device #projectFilterModal label {
  color: var(--dark-text) !important;
}

body.dark-theme.touch-device #projectFilterModal input[type="date"] {
  background: var(--dark-surface-light) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

body.dark-theme.touch-device #projectFilterModal button {
  background: var(--dark-surface-light) !important;
  color: var(--dark-text) !important;
  border: 1px solid var(--dark-border) !important;
}

body.dark-theme.touch-device #projectFilterModal .btn-primary {
  background: var(--primary-color) !important;
  color: white !important;
}

body.dark-theme.touch-device #projectFilterUsers {
  background: var(--dark-surface-light) !important;
  border-color: var(--dark-border) !important;
}

body.dark-theme.touch-device #projectFilterUsers label {
  border-bottom-color: var(--dark-border) !important;
}

body.dark-theme.touch-device #projectFilterModal > div > div:last-child {
  border-top-color: var(--dark-border) !important;
}

/* Стили для кастомного поля даты */
.custom-date-field {
  position: relative;
  display: inline-block;
  width: 100%;
}

.custom-date-input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  font-size: 13px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
  color: #333;
  user-select: none;
}





.custom-date-input.has-value {
  color: #333;
}

.custom-date-input.placeholder {
  color: #999;
  font-style: italic;
}

.custom-date-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #666;
}

.custom-date-field:hover .custom-date-icon {
  color: #1976d2;
}

/* Стили для раздела "Настройки проекта" на touch устройствах */
body.touch-device #sectionSettings {
  padding-bottom: 100px !important; /* Отступ для фиксированных кнопок */
}

/* Убираем border у всех полей ввода и dropdown в настройках проекта для мобильной версии */
body.touch-device * {
  border: none !important;
}

/* Исправление цвета заголовков полей в настройках проекта для темной темы мобильной версии */
body.touch-device.dark-theme #sectionSettings .settings-group span[style*="color:#333"] {
  color: var(--dark-text) !important;
}


/* Темная тема для settingsUsersList в мобильной версии */
body.touch-device #settingsUsersList {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
}

/* Элементы внутри списка пользователей в темной теме */
body.touch-device #settingsUsersList > div {
  background: var(--dark-bg) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

/* Текст и элементы внутри элементов списка пользователей */
body.touch-device #settingsUsersList span,
body.touch-device #settingsUsersList button {
  color: var(--dark-text) !important;
}

/* Кнопки удаления в списке пользователей */
body.touch-device #settingsUsersList button[style*="background:#f44336"] {
  background: var(--error-color) !important;
  color: white !important;
}

/* Темная тема для dropdown с классом user-role-dropdown в мобильной версии */
body.touch-device .custom-status-dropdown.user-role-dropdown {
  background: var(--dark-bg) !important;
  color: var(--dark-text) !important;
  border: none !important;
}

body.touch-device .custom-status-dropdown.user-role-dropdown .dropdown-selected {
  background: var(--dark-bg) !important;
  color: var(--dark-text) !important;
  border: none !important;
}

body.touch-device .custom-status-dropdown.user-role-dropdown .dropdown-list {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
}

body.touch-device .custom-status-dropdown.user-role-dropdown .dropdown-item {
  background: transparent !important;
  color: var(--dark-text) !important;
  border: none !important;
}

body.touch-device .custom-status-dropdown.user-role-dropdown .dropdown-item:hover {
  background: var(--dark-surface-light) !important;
}

body.touch-device #addTagBtn,
body.touch-device #gotoPlanBtn{
	display: none !important;
}

.backBt{
	position: absolute;
	left: 12px;
	width: 80px !important;
	height: 40px !important;
	padding: 2px !important;
	background: transparent;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

#mobileTextEditArea{
	width: 100%;
	height: 200px;
	padding: 16px;
	border: 1px solid #e5e5ea;
	border-radius: 8px;
	font-size: 16px;
	line-height: 1.4;
	resize: none;
	margin: 20px 0;
	box-sizing: border-box;
}

/* Контейнер с кнопками настроек - фиксированный внизу */
body.touch-device #sectionSettings > div > form > div:last-child {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  padding: 12px !important;
  background: var(--dark-surface) !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 12px !important;
  z-index: 400 !important;
  justify-content: flex-end !important;
  align-items: flex-start;
  /*margin: 0 !important;*/
  height: calc(56px + env(safe-area-inset-bottom));
}

/* iOS-стиль мобильных dropdown'ов */
.mobile-ios-dropdown {
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-ios-dropdown .param-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  word-break: break-word;
}

.mobile-ios-dropdown .param-name {
  font-size: 11px;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-ios-dropdown .param-value {
  font-size: 15px;
  color: #000;
  line-height: 1.2;
}

.mobile-ios-dropdown .arrow {
  font-size: 16px;
  color: #c7c7cc;
  margin: 0 14px;
}

/* Выезжающая панель для выбора значений */
.mobile-dropdown-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: #f2f2f7;
  z-index: 10002;
  transition: right 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

.mobile-dropdown-panel.show {
  right: 0;
}

.mobile-dropdown-header {
  background: #fff;
  border-bottom: 1px solid #e5e5ea;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  background: var(--dark-surface);
}

.mobile-dropdown-back-btn {
  background: none;
  border: none;
  color: #007AFF;
  font-size: 17px;
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-dropdown-title {
  font-size: 17px;
  font-weight: 600;
  color: #000;
  text-align: center;
  flex: 1;
  margin: 0 16px;
}

.mobile-dropdown-add-btn {
  background: none;
  border: none;
  color: #007AFF;
  font-size: 17px;
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  font-weight: 500;
}

.mobile-dropdown-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f2f2f7;
}

.mobile-dropdown-list {
  background: #fff;
  margin: 5px 0 0 0;
  border-top: 1px solid #e5e5ea;
  border-bottom: 1px solid #e5e5ea;
}

.mobile-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5ea;
  background: #fff;
  cursor: pointer;
  min-height: 44px;
}

.mobile-dropdown-item:last-child {
  border-bottom: none;
}

.mobile-dropdown-item.selected {
  background: #f0f0f5;
}

.mobile-dropdown-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  word-break: break-word;
}

.mobile-dropdown-item-title {
  font-size: 17px;
  color: #000;
  line-height: 1.2;
}

.mobileDropdownItemsHeader{
	color: #666 !important;
	margin-left: 12px;
}

.mobile-dropdown-item-subtitle {
  font-size: 14px;
  color: #666;
  line-height: 1.2;
}

.mobile-dropdown-checkmark {
  color: #007AFF;
  font-size: 18px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  margin-left:14px;
}

.mobile-dropdown-item.selected .mobile-dropdown-checkmark {
  opacity: 1;
}

/* Темная тема для мобильных dropdown'ов */
body.touch-device .mobile-ios-dropdown {
  background: var(--dark-bg);
}

body.touch-device .mobile-ios-dropdown .param-name {
  color: #999;
}

body.touch-device .mobile-ios-dropdown .param-value {
  color: var(--dark-text);
}

body.touch-device .mobile-dropdown-panel {
  background: var(--dark-bg);
}

/* Стили для мобильного редактирования текста */
.mobile-text-edit-container {
  padding: 20px;
}

body.touch-device .mobile-text-edit-container textarea {
  color: var(--dark-text);
  border-color: var(--dark-border-light);
}


body.touch-device .mobile-dropdown-header {
  background: var(--dark-surface);
  border-bottom: 1px solid var(--dark-border);
}

body.touch-device .mobile-dropdown-title {
  color: var(--dark-text);
}

body.touch-device .mobile-dropdown-content {
  background: var(--dark-bg);
}

body.touch-device .mobile-dropdown-list {
  background: var(--dark-bg);
  border-top: 1px solid var(--dark-border);
  border-bottom: 1px solid var(--dark-border);
}

body.touch-device .mobile-dropdown-item {
  background: var(--dark-bg);
  border-bottom: 1px solid var(--dark-border);
}

body.touch-device .mobile-dropdown-item.selected {
  background: var(--dark-surface);
}

body.touch-device .mobile-dropdown-item-title {
  color: var(--dark-text);
}

body.touch-device .mobile-dropdown-item-subtitle {
  color: var(--dark-text-muted);
}

/* Стили для папок в мобильных dropdown'ах */
.mobile-dropdown-folder {
  background: #f8f9fa !important;
  opacity: 0.7 !important;
  cursor: default !important;
}

body.touch-device .mobile-dropdown-folder {
  background: var(--dark-bg) !important;
  opacity: 0.8 !important;
}

/* Унифицированные стили кнопок для футеров мобильных попапов */

/* Размеры и базовые стили для всех кнопок в футерах мобильных попапов */
body.touch-device #projectFilterModal button,
body.touch-device #settingsCancelBtn,
body.touch-device #settingsSaveBtn {
  flex: 1 !important;
  padding: 10px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
  border: none !important;
  cursor: pointer !important;
  font-weight: normal !important;
}

/* Второстепенные кнопки (серые) - как clearProjectFilters */
body.touch-device #projectFilterModal #clearProjectFilters,
body.touch-device #projectFilterModal #cancelProjectFilters,
body.touch-device #settingsCancelBtn {
  background: #f5f5f5 !important;
  color: #666 !important;
}

/* Главные кнопки (синие) - как applyProjectFilters */
body.touch-device #projectFilterModal #applyProjectFilters,
body.touch-device #settingsSaveBtn {
  background: var(--primary-color) !important;
  color: #fff !important;
}

/* Темная тема для кнопок настроек - теперь футер всегда использует var(--dark-surface) */

/* Action buttons hover effects */
#addPhotoBtn:hover {
  background: #e6680b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(253, 126, 20, 0.3);
}

#addDocumentBtn:hover {
  background: #5a6268 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

#addCommentBtn:hover {
  background: #0056b3 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#exportRemarkBtn:hover {
  background: #5a32a3 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

/* Task Navigation Footer Styles */
.task-navigation-footer {
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);

  align-items: start !important;
  height: calc(56px + env(safe-area-inset-bottom));

}

.task-navigation-footer button:not(:disabled) {
  opacity: 1 !important;
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
}

.task-navigation-footer button:not(:disabled):hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(25, 118, 210, 0.3);
}

.task-navigation-footer button:disabled {
  cursor: default !important;
  opacity: 0.4 !important;
}

.task-counter {
  user-select: none;
  font-family: monospace;
  font-weight: 500;
  margin-top:12px;
}

/* Dark theme для task navigation footer */
body.dark-theme .task-navigation-footer {
  background: var(--dark-surface) !important;
  border-color: var(--dark-border) !important;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .task-navigation-footer button {
  background: var(--dark-surface-light) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

body.dark-theme .task-navigation-footer button:not(:disabled) {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
}

body.dark-theme .task-counter {
  color: var(--dark-text-muted) !important;
}

/* ======================
   ПРАВАЯ ПАНЕЛЬ ЗАДАЧ ПЛАНА
====================== */

/* Основные стили для панели задач */
/*
#planTasksPanel {
  transition: width 0.3s ease;
}
*/

#planTasksPanelHeader {
  user-select: none;
}

#planTasksList {
  flex:1;
  overflow-y:auto;
  padding:8px;
  min-height:0;
  max-height:calc(100vh - 56px - 60px - 150px);
}

/*body.touch-device #tasksList,*/
.task-main-field-column #taskMainField,
#settingsContainer
/*#planTasksList,*/
/*.task-content*/{
	scrollbar-width: thin;
	scrollbar-color: #ccc transparent;
}


/*.task-content::-webkit-scrollbar*/
/*#planTasksList::-webkit-scrollbar*//* {
  width: 6px;
}*/

/*.task-content::-webkit-scrollbar-track*/
/*#planTasksList::-webkit-scrollbar-track*//* {
  background: transparent;
}*/

/*.task-content::-webkit-scrollbar-thumb*/
/*#planTasksList::-webkit-scrollbar-thumb*//* {
  background: #ddd;
  border-radius: 3px;
}*/

/*.task-content::-webkit-scrollbar-thumb:hover*/
/*#planTasksList::-webkit-scrollbar-thumb:hover*//* {
  background: #bbb;
}*/


/* Темная тема для панели задач */
body.dark-theme #planTasksPanel {
  background: var(--dark-surface) !important;
  border-left-color: var(--dark-border) !important;
}

body.dark-theme #tasksHeader,
body.dark-theme #planTasksPanelHeader {
  background: var(--dark-surface-light) !important;
  border-bottom-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}

/*другая верстка хеадера раздела Задачи для мобильных*/
body.touch-device #tasksHeader > div:first-child{
	display: flex;
	flex-wrap: wrap; /* Разрешаем перенос элементов на новую строку */
	justify-content: space-between; /* Распределяет div1 и div3 по краям */
	align-items: center; /* Выравнивание по вертикали для первой строки */
}
/*Задачи проекта (n задач)*/
body.touch-device #tasksHeader1{
	flex: 0 0 auto; /* div1: не растягивается */
	order: 1;
}
/*Фильтр задач*/
#tasksHeader2{
	width:50%; /*desktop*/
}
body.touch-device #tasksHeader2{
	flex: 1 1 100%; /* div2: занимает всю ширину */
	order: 3;
	width:initial;
}
/*Кнопка Изменить*/
body.touch-device #tasksHeader3{
	flex: 0 0 auto; /* div3: не растягивается */
	order: 2;
}



body.dark-theme.touch-device #tasksHeader > div:first-child > div,
body.dark-theme #planTasksPanelHeader > div:first-child {
  color: var(--dark-text) !important;
}


body.dark-theme #tasksCount,
body.dark-theme #planTasksCount {
  color: var(--dark-text-muted) !important;
}

/* Стили для поля фильтрации задач */
#tasksFilter,
#planTasksFilter,
#plansTasksFilter {
  transition: all 0.2s ease;
  width:100%;
  padding:8px 25px 8px 32px;
  border:1px solid #e0e0e0;
  border-radius:16px;
  font-size:13px;
  background:#fff;
  color:#333;
  transition:border-color 0.2s ease;
  box-sizing:border-box;
  outline:none;
}

#tasksFilter:focus,
#planTasksFilter:focus,
#plansTasksFilter:focus {
  outline: none;
}

#tasksFilter:hover,
#planTasksFilter:hover,
#plansTasksFilter:hover {
  border-color: #ccc;
}

/* Стили для кнопки очистки фильтра задач */
#tasksFilterClear,
#planTasksFilterClear,
#plansTasksFilterClear {
  transition: all 0.2s ease;
  position:absolute;
  right:9px;
  z-index:1;
  cursor:pointer;
  display:none;
}

/* Стили для кнопки "Отчеты" в разделе задач */
#tasksReportsBtn {
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

#tasksReportsBtn:hover {
  background: #5a32a3 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

#tasksReportsBtn:active {
  transform: translateY(0);
}

/* Стили для модальных окон отчетов */
body.dark-theme #tasksReportsListModal > div,
body.dark-theme #tasksReportConfigModal > div {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
}

body.dark-theme #tasksReportsListModal h2,
body.dark-theme #tasksReportsListModal h3,
body.dark-theme #tasksReportConfigModal h2,
body.dark-theme #tasksReportConfigModal h3 {
  color: var(--dark-text) !important;
}

body.dark-theme #tasksReportName,
body.dark-theme #tasksReportDescription,
body.dark-theme #reportFilterAuthorized,
body.dark-theme #reportFilterResponsible,
body.dark-theme #reportFilterPlansSearch,
body.dark-theme #reportFilterPlansList,
body.dark-theme #reportDateFilterCreatedFrom,
body.dark-theme #reportDateFilterCreatedTo,
body.dark-theme #reportDateFilterStatusFrom,
body.dark-theme #reportDateFilterStatusTo,
body.dark-theme #reportDateFilterActivityFrom,
body.dark-theme #reportDateFilterActivityTo {
  background: var(--dark-surface-light) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

/* Стили для кнопки очистки поиска планов в отчетах */
#reportFilterPlansSearchClear {
  transition: all 0.2s ease;
}

#reportFilterPlansSearchClear:hover {
  stroke: #333;
  opacity: 0.8;
}

body.dark-theme #reportFilterPlansSearchClear {
  stroke: var(--dark-text-secondary);
}

body.dark-theme #reportFilterPlansSearchClear:hover {
  stroke: var(--dark-text);
  opacity: 0.8;
}

body.dark-theme #tasksReportConfigModal label {
  color: var(--dark-text) !important;
}

/* Стили для списка отчетов */
.tasks-report-item {
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin:0 8px 8px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tasks-report-item:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.tasks-report-item-info {
  flex: 1;
}

.tasks-report-item-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 4px;
}

.tasks-report-item-desc {
  font-size: 12px;
  color: #666;
}

.tasks-report-item-actions {
  display: none;
  gap: 8px;
}

.tasks-report-item:hover .tasks-report-item-actions {
  display: flex;
}

.tasks-report-action-btn {
  padding: 6px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tasks-report-action-btn:hover {
  transform: scale(1.1);
}

.tasks-report-copy-btn {
  background: #007bff;
  color: white;
}

.tasks-report-delete-btn {
  background: #e53935;
  color: white;
}

body.dark-theme .tasks-report-item {
  background: var(--dark-surface-light);
  border-color: var(--dark-border);
}

body.dark-theme .tasks-report-item:hover {
  background: var(--dark-surface);
  border-color: #555;
}

body.dark-theme .tasks-report-item-name {
  color: var(--dark-text);
}

body.dark-theme .tasks-report-item-desc {
  color: var(--dark-text-muted);
}

/* Стили для чекбоксов фильтров */
.report-filter-checkbox {
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-filter-checkbox input[type="checkbox"] {
  margin: 0;
}

.report-filter-checkbox:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.report-filter-checkbox.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

body.dark-theme .report-filter-checkbox {
  background: var(--dark-surface-light);
  border-color: var(--dark-border);
  color: var(--dark-text);
}

body.dark-theme .report-filter-checkbox:hover {
  background: var(--dark-surface);
  border-color: #555;
}

body.dark-theme .report-filter-checkbox.active {
  background: #1976d2;
  border-color: #1976d2;
  color: white;
}

#tasksFilterClear:hover,
#planTasksFilterClear:hover,
#plansTasksFilterClear:hover {
  stroke: #333;
  transform: scale(1.1);
}

/* Темная тема для поля фильтрации */
body.dark-theme #tasksFilter,
body.dark-theme #planTasksFilter,
body.dark-theme #plansTasksFilter {
  background: var(--dark-surface-light) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}
body.dark-theme #tasksFilter::placeholder,
body.dark-theme #planTasksFilter::placeholder,
body.dark-theme #plansTasksFilter::placeholder {
  color: var(--dark-text-muted) !important;
}

/*
body.dark-theme #planTasksFilter:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.3);
}
*/

body.dark-theme #tasksFilter:hover,
body.dark-theme #planTasksFilter:hover,
body.dark-theme #plansTasksFilter:hover {
  border-color: var(--dark-border-light) !important;
}

/* Темная тема для кнопки очистки фильтра задач */
body.dark-theme #tasksFilterClear,
body.dark-theme #planTasksFilterClear,
body.dark-theme #plansTasksFilterClear {
  stroke: var(--dark-text-muted) !important;
}

body.dark-theme #tasksFilterClear:hover,
body.dark-theme #planTasksFilterClear:hover,
body.dark-theme #plansTasksFilterClear:hover {
  stroke: var(--dark-text) !important;
}

/* Скрываем фильтр задач в разделе планов на мобильных устройствах */
body.touch-device #plansFilterSection {
  display: none !important;
}
#plansFilterSection {
	padding:16px;
}



/* Стили для поля фильтрации задач в основном разделе */
/*
#tasksFilter {
  transition: all 0.2s ease;
}

#tasksFilter:focus {
  outline: none;
}

#tasksFilter:hover {
  border-color: #ccc;
}

body.dark-theme #tasksFilter {
  background: var(--dark-surface-light) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text) !important;
}

body.dark-theme #tasksFilter::placeholder {
  color: var(--dark-text-muted) !important;
}

body.dark-theme #tasksFilter:hover {
  border-color: var(--dark-border-light) !important;
}
*/



/*body.dark-theme .task-content::-webkit-scrollbar-thumb,*/
/*body.dark-theme.touch-device #tasksList::-webkit-scrollbar-thumb*/
/*body.dark-theme #planTasksList::-webkit-scrollbar-thumb*//* {
  background: var(--dark-border);
}*/


/*body.dark-theme .task-content::-webkit-scrollbar-thumb:hover,*/
/*body.dark-theme.touch-device #tasksList::-webkit-scrollbar-thumb:hover*/
/*body.dark-theme #planTasksList::-webkit-scrollbar-thumb:hover*//* {
  background: var(--dark-border-light);
}*/


/* Стили для кнопки "Изменить" в заголовке панели (красный цвет как у чекбоксов) */
#planTasksEditBtn, #tasksEditBtn {
  transition: all 0.3s ease;
  background: var(--error-color) !important;
  color: #fff !important;
}

#planTasksEditBtn:not(:disabled):hover, #tasksEditBtn:not(:disabled):hover {
  background: var(--error-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(229, 57, 53, 0.3);
}

#planTasksEditBtn:disabled, #tasksEditBtn:disabled {
  cursor: default !important;
  background: var(--error-color) !important;
}

/* Темная тема для кнопки "Изменить" */
body.dark-theme #planTasksEditBtn, body.dark-theme #tasksEditBtn {
  background: var(--error-color) !important;
  color: #fff !important;
}

body.dark-theme #planTasksEditBtn:not(:disabled):hover, body.dark-theme #tasksEditBtn:not(:disabled):hover {
  background: var(--error-hover) !important;
}

/* Контейнер чекбокса для задач (как у планов) */
.plan-task-checkbox-container {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  padding: 0;
  margin: 0;
}

/* Кнопка "Открыть" для задач в режиме План */
.plan-task-open-btn {
  transition: all 0.2s ease;
}

.plan-task-open-btn:hover {
  background: #1565c0 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(25, 118, 210, 0.4) !important;
}

.plan-task-open-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(25, 118, 210, 0.3) !important;
}

.task-checkbox-container {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

/* Стили чекбоксов для задач в панели (точно как у планов) */
.plan-task-checkbox, .task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #a9a9a9;
  background: #fff;
  outline: none;
  transition: background var(--transition-fast);
  cursor: pointer;
  display: block;
  position: relative;
  padding: 0;
  margin: 0;
}

.plan-task-checkbox:checked, .task-checkbox:checked {
  background: var(--error-color);
  border-color: var(--error-color);
}

.plan-task-checkbox::after, .task-checkbox::after {
  content: '';
  display: block;
  width: 8px;
  height: 4px;
  border: none;
  border-left: 2.5px solid transparent;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  position: absolute;
  top: 8px;
  left: 7px;
  transform: rotate(-45deg);
  transition: none;
}

.plan-task-checkbox:checked::after, .task-checkbox:checked::after {
  border-left-color: #fff;
  border-bottom-color: #fff;
}

/* Темная тема для чекбоксов задач */
body.dark-theme .plan-task-checkbox, body.dark-theme .task-checkbox {
  background: var(--dark-surface-light);
  border: 1px solid var(--dark-border);
}

body.dark-theme .plan-task-checkbox:checked, body.dark-theme .task-checkbox:checked {
  background: var(--error-color);
  border-color: var(--error-color);
}

/* Темная тема для кнопки "Открыть" */
body.dark-theme .plan-task-open-btn {
  background: var(--primary-color) !important;
  color: white !important;
  box-shadow: 0 2px 4px rgba(25, 118, 210, 0.4) !important;
}

body.dark-theme .plan-task-open-btn:hover {
  background: var(--primary-hover) !important;
  box-shadow: 0 4px 8px rgba(25, 118, 210, 0.5) !important;
}

body.dark-theme .plan-task-open-btn:active {
  box-shadow: 0 2px 4px rgba(25, 118, 210, 0.4) !important;
}

/* Индикатор перемещения для задач без координат (слева от маркера) */
.plan-task-move-indicator {
  position: absolute;
  left: -5px;
  top: 93%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}


.plan-task-move-indicator svg {
  width: 22px;
  height: 22px;
}


/* Анимация выделения задачи на плане */
.task-highlight {
  animation: taskHighlight 0.3s ease-in-out 0s 2;
  z-index: 1000 !important;
}

@keyframes taskHighlight {
  0% {
    transform: scale(var(--inverse-scale, 1.0));
  }
  50% {
    transform: scale(calc(var(--inverse-scale, 1.0) * 1.5));
  }
  100% {
    transform: scale(var(--inverse-scale, 1.0));
  }
}

/* Адаптивность панели для мобильных устройств */
/*
@media (max-width: 768px) {
  #planTasksPanel {
    width: 100vw;
    position: absolute;
    top: 0;
    right: -100vw;
    z-index: 100;
    transition: right 0.3s ease;
    height: 100%;
  }

  #planTasksPanel.mobile-visible {
    right: 0;
  }

  body.touch-device #planTasksPanel {
    width: 100vw;
    border-left: none;
    border-top: 1px solid #e0e0e0;
    height: 100%;
  }

  body.dark-theme.touch-device #planTasksPanel {
    background: var(--dark-surface) !important;
    border-top-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
  }
*/

body.touch-device .report-icon,
body.touch-device #tasksReportsBtn{
	display: none !important;
}

  /* Мобильный полноэкранный режим для панели задач */
  body.touch-device #planTasksPanel.mobile-fullscreen {
    /*position: fixed;*/
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    border: none;
    background: #fff;
  }

  body.dark-theme.touch-device #planTasksPanel.mobile-fullscreen {
    background: var(--dark-bg) !important;
  }

  /* Скрытый режим для мобильных устройств */
  body.touch-device #planTasksPanel.mobile-hidden {
    display: none !important;
  }

  /* Стили для кнопки закрытия в полноэкранном режиме */
  #mobilePlanTasksCloseBtn svg {
    transition: stroke 0.2s ease;
  }

  #mobilePlanTasksCloseBtn:hover svg {
    stroke: #333 !important;
  }

  body.dark-theme #mobilePlanTasksCloseBtn svg {
    stroke: #ccc !important;
  }

  body.dark-theme #mobilePlanTasksCloseBtn:hover svg {
    stroke: #fff !important;
  }

  /* Анимация для иконки песочных часов */
  .loading-hourglass {
    animation: rotate-hourglass 2s linear infinite;
  }

  @keyframes rotate-hourglass {
    0% {
      transform: rotate(0deg);
    }
    50% {
      transform: rotate(180deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }



/* Стили для панели навигации планов */
#planNavigationPanel {
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
}

#planNavigationInfo {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

#planNavigationPanel button {
  transition: all 0.2s ease;
}

#planNavigationPanel button:hover:not(:disabled) {
  background-color: #1565c0 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#planNavigationPanel button:disabled {
  background-color: #bbb !important;
  opacity: 0.6;
  cursor:default !important;
}

#planNavigationPanel button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Темная тема для панели навигации планов */
body.dark-theme #planNavigationPanel {
  border-top-color: var(--dark-border) !important;
  background: var(--dark-surface-light) !important;
}

/* Мобильная версия панели планов */
body.touch-device #planTasksPanel #planNavigationPanel {
  display: none !important;
}

body.touch-device #planTasksList {
  max-height: calc(100vh - 20px - 150px) !important;
}

/* Темная тема для мобильной версии панели навигации планов */
body.dark-theme.touch-device #planNavigationPanel {
  border-top-color: var(--dark-border) !important;
  background: var(--dark-surface-light) !important;
}

body.dark-theme #planNavigationPanel button:disabled {
  background-color: var(--dark-border) !important;
}

body.dark-theme #planNavigationInfo {
  color: var(--dark-text-secondary) !important;
}

/* Темная тема для мобильной версии информации о навигации */
body.dark-theme.touch-device #planNavigationInfo {
  color: var(--dark-text-secondary) !important;
}


.formButtons{
	padding: 8px 16px;
	background: #f5f5f5;
	color: white;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
}



/* ======================
   ТЕМНАЯ ТЕМА ДЛЯ МОДАЛЬНЫХ ОКОН В МОБИЛЬНОЙ ВЕРСИИ
====================== */

/* Темная тема для модальных окон редактирования и удаления */
body.dark-theme.touch-device #editFolderModal > div,
body.dark-theme.touch-device #deleteFolderModal > div,
body.dark-theme.touch-device #deletePlanModal > div,
body.dark-theme.touch-device #editPlanModal .edit-plan-content {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
}

/* Заголовки модальных окон */
body.dark-theme.touch-device #editFolderModal h2,
body.dark-theme.touch-device #deleteFolderModal h2,
body.dark-theme.touch-device #deletePlanModal h2,
body.dark-theme.touch-device #editPlanModal h2 {
  color: var(--dark-text) !important;
}

/* Поля ввода в модальных окнах */
body.dark-theme.touch-device #editFolderModal input,
body.dark-theme.touch-device #editPlanModal input,
body.dark-theme.touch-device #editPlanModal textarea {
  background: var(--dark-surface-light) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

/* Кнопки в модальных окнах */
body.dark-theme.touch-device #deletePlanModal button,
body.dark-theme.touch-device #editPlanModal button,
body.dark-theme.touch-device #editFolderModal button,
body.dark-theme.touch-device #deleteFolderModal button{
  background: var(--dark-surface-light);
  color: var(--dark-text);
  border: 1px solid var(--dark-border);
}

/* Основные кнопки (сохранить, удалить) */
body.dark-theme.touch-device #editFolderModal .btn-primary,
body.dark-theme.touch-device #deleteFolderModal .btn-primary,
body.dark-theme.touch-device #deletePlanModal .btn-primary,
body.dark-theme.touch-device #editPlanModal .btn-primary {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
}

/* Кнопки удаления */
body.dark-theme.touch-device #deleteFolderModal button[onclick*="deleteFolder"],
body.dark-theme.touch-device #deletePlanModal button[onclick*="deletePlan"],
body.dark-theme.touch-device #editPlanModal button[onclick*="delete"] {
  background: var(--error-color) !important;
  color: white !important;
  border-color: var(--error-color) !important;
}

/* Текст в модальных окнах удаления */
body.dark-theme.touch-device #deleteFolderModal p,
body.dark-theme.touch-device #deletePlanModal p {
  color: var(--dark-text) !important;
}

/* Дополнительные стили для editPlanModal */
body.dark-theme.touch-device #editPlanModal .plan-thumbnail-wrapper {
  border-color: var(--dark-border) !important;
}

body.dark-theme.touch-device #editPlanModal .navigation-buttons {
  border-color: var(--dark-border) !important;
}

body.dark-theme.touch-device #editPlanModal .navigation-buttons button:disabled {
  background: var(--dark-border) !important;
  color: var(--dark-text-muted) !important;
}

/* Лейблы в модальных окнах */
body.dark-theme.touch-device #editFolderModal label,
body.dark-theme.touch-device #editPlanModal label {
  color: var(--dark-text) !important;
}


.task-marker-fixed-size{
	position:absolute;
	width:34px;
	height:43px;
	display:flex;
	align-items:center;
	justify-content:center;
	cursor:pointer;
	pointer-events:auto;
	transform-style: preserve-3d;
	will-change: transform;
}


/* Стиль для кнопок Undo/Redo */
.undo-redo-btn {
  margin: 4px;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: all 0.3s ease;
}

/* Стили для кнопок Undo/Redo в разделе задач */
#tasksUndoBtn,
#tasksRedoBtn {
  transition: all 0.3s ease;
}

#tasksUndoBtn:not(:disabled),
#tasksRedoBtn:not(:disabled) {
  opacity: 1 !important;
  cursor: pointer;
}

#tasksUndoBtn:not(:disabled) svg,
#tasksRedoBtn:not(:disabled) svg {
  stroke: #1976d2 !important;
}

#tasksUndoBtn:not(:disabled):hover,
#tasksRedoBtn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 1;
}

#tasksUndoBtn:not(:disabled):active,
#tasksRedoBtn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#tasksUndoBtn:disabled,
#tasksRedoBtn:disabled {
  cursor: default;
  opacity: 0.3;
}

/* Dark theme для кнопок Undo/Redo задач */
body.dark-theme #tasksUndoBtn,
body.dark-theme #tasksRedoBtn {
  background: var(--dark-surface-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark-theme #tasksUndoBtn:not(:disabled) svg,
body.dark-theme #tasksRedoBtn:not(:disabled) svg {
  stroke: var(--primary-color) !important;
}

body.dark-theme #tasksUndoBtn:disabled svg,
body.dark-theme #tasksRedoBtn:disabled svg {
  stroke: var(--dark-text-muted) !important;
}

body.touch-device #tasksUndoBtn,
body.touch-device #tasksRedoBtn {
	display: none;
}

/* Стили для кнопок Undo/Redo в мобильном разделе Задачи */
#settingsUndoBtn,
#settingsRedoBtn {
  width:40px;
  height:40px;
  padding:0;
  margin:0;
  box-shadow: none !important;
}

#settingsUndoBtn:not(:disabled),
#settingsRedoBtn:not(:disabled) {
  opacity: 1 !important;
}

#settingsUndoBtn:not(:disabled) svg,
#settingsRedoBtn:not(:disabled) svg {
  stroke: #1976d2 !important;
}

#settingsUndoBtn:disabled,
#settingsRedoBtn:disabled {
  opacity: 0.3;
}

/* Dark theme для кнопок Undo/Redo настроек */
/*
body.dark-theme #settingsUndoBtn,
body.dark-theme #settingsRedoBtn {
  background: var(--dark-surface-light);
}
*/

body.dark-theme #settingsUndoBtn:not(:disabled) svg,
body.dark-theme #settingsRedoBtn:not(:disabled) svg {
  stroke: var(--primary-color) !important;
}

body.dark-theme #settingsUndoBtn:disabled svg,
body.dark-theme #settingsRedoBtn:disabled svg {
  stroke: var(--dark-text-muted) !important;
}


/* ======================
   СТИЛИ ДЛЯ ДВУХКОЛОНОЧНОЙ СТРУКТУРЫ ПАНЕЛЕЙ ЗАДАЧ (ТОЛЬКО ДЕСКТОП)
====================== */

/* Контейнер для двухколоночной структуры */
.task-form-columns {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
}

/* Левая колонка - Основное поле (80% ширины) */
.task-main-field-column {
  width: 80%;
  flex: 0 0 80%;
}

/* Правая колонка - Остальные поля (20% ширины) */
.task-form-fields-column {
  width: 20%;
  flex: 0 0 20%;
}

/* Стили для основного поля в двухколоночной структуре */
.task-main-field-column #taskMainField {
  min-height: 400px;
  max-height: 600px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  transition: border-color 0.2s ease;
}

/*
.task-main-field-column #taskMainField:focus-within {
  border-color: var(--primary-color);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1), 0 0 0 2px rgba(25, 118, 210, 0.1);
}
*/

/* Адаптация полей в правой колонке для узкого пространства */
.task-form-fields-column .form-group {
  margin-bottom: 16px;
}

.task-form-fields-column textarea {
  min-height: 60px;
  font-size: 12px;
}

.task-form-fields-column .dropdown-selected {
  font-size: 12px;
  min-height: 30px;
  padding: 4px 8px;
  word-break: break-all;
}

.task-form-fields-column label {
  font-size: 12px;
  margin-bottom: 6px;
}

/* Темная тема для новой структуры */
body.dark-theme .task-main-field-column #taskMainField {
  background: var(--dark-surface-light);
  border-color: var(--dark-border);
  color: var(--dark-text);
}

/*
body.dark-theme .task-main-field-column #taskMainField:focus-within {
  border-color: var(--primary-color);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3), 0 0 0 2px rgba(25, 118, 210, 0.2);
}
*/

body.dark-theme .task-form-fields-column textarea,
body.dark-theme .task-form-fields-column .dropdown-selected {
  background: var(--dark-surface-light);
  color: var(--dark-text);
  border-color: var(--dark-border);
}

body.dark-theme .task-form-fields-column label {
  color: var(--dark-text);
}



.task-main-field-column #taskMainField::-webkit-scrollbar {
  width: 8px;
}

.task-main-field-column #taskMainField::-webkit-scrollbar-track {
  background: transparent;
}

.task-main-field-column #taskMainField::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

.task-main-field-column #taskMainField::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* Темная тема для скроллбара */
body.dark-theme .task-main-field-column #taskMainField {
  scrollbar-color: var(--dark-border) transparent;
}

body.dark-theme .task-main-field-column #taskMainField::-webkit-scrollbar-thumb {
  background: var(--dark-border);
}

body.dark-theme .task-main-field-column #taskMainField::-webkit-scrollbar-thumb:hover {
  background: var(--dark-border-light);
}

/* ======================
   ИНДИКАТОР ЗАГРУЗКИ ПЛАНА
====================== */

/* Индикатор загрузки плана */
#planLoadingIndicator {
  color: #888 !important;
}

body.dark-theme #planLoadingIndicator {
  color: #888 !important;
}

/* ======================
   СТИЛИ ДЛЯ КНОПКИ ИСТОРИЯ ДЕЙСТВИЙ
====================== */

/* Кнопка История действий */
#taskActionHistoryBtn {
  background: #ffc107 !important;
  color: #212529 !important;
  font-weight: 500;
  margin-left: auto; /* Выравнивание по правому краю */
  transition: all 0.2s ease;
  justify-content: space-around;
}

#taskActionHistoryBtn:hover {
  background: #e0a800 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

#taskActionHistoryBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(255, 193, 7, 0.2);
}

/* Треугольник в кнопке истории действий */
#taskActionHistoryArrow {
  transition: transform 0.2s ease;
  font-size: 12px;
  margin-left: 4px;
  color: #212529;
}

/* Контейнер истории действий */
#taskActionHistorySection {
  animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Темная тема для кнопки истории действий */
body.dark-theme #taskActionHistoryBtn {
  background: #ffc107 !important;
  color: #212529 !important;
}

body.dark-theme #taskActionHistoryBtn:hover {
  background: #e0a800 !important;
  color: #212529 !important;
}

body.dark-theme #taskActionHistoryArrow {
  color: #212529 !important;
}

#taskActionHistory{
	height: 500px;
	overflow-y: auto;
	padding: 12px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #f8f8f8;
	color: inherit;
	font-size: 12px;
	-webkit-overflow-scrolling: touch;
	margin-top: 16px;
	word-break: break-word;
}
#taskActionHistory > div{
	margin-bottom: 8px;
	padding: 8px;
	background: #ffffff;
	border-radius: 6px;
	border-left: 3px solid #007bff;
}
#taskActionHistory > div > div{
	color: #333;
	font-size: 13px;
	line-height: 1.4;
	margin-bottom: 4px;
}
body.dark-theme #taskActionHistory > div > div{
	color: inherit;
}
body.dark-theme #taskActionHistory > div {
	background: none;
}
/* Контейнер истории действий в темной теме */
body.dark-theme #taskActionHistory {
  background: var(--dark-surface-light);
  border-color: var(--dark-border);
  color: var(--dark-text);
}
body.touch-device #taskActionHistory {
	background: none !important;
	border: none !important;
	border-radius:0 !important;
	padding:0 !important;
}

/* Стили для мобильной панели истории действий */
#mobileHistoryPanel .mobile-dropdown-content {
  padding: 0;
}

#mobileHistoryContent {
  background: var(--dark-bg) !important;
}

#mobileHistoryContent > div {
  margin-bottom: 8px;
  padding: 12px;
  background: var(--dark-surface) !important;
  border-radius: 8px;
  border-left: 3px solid #007bff;
  margin: 8px 12px;
}

#mobileHistoryContent > div > div {
  color: var(--dark-text) !important;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: break-word;
}



/* Адаптивность для мобильных устройств */
/*
@media (max-width: 768px) {
  #taskActionHistoryBtn {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  #taskActionHistorySection {
    margin-top: 12px;
  }

  #taskActionHistory {
    height: 300px;
  }
}
*/

/* Очень маленькие устройства в landscape (телефоны) */
/*
@media (orientation: landscape) and (max-height: 500px) {

  #mainHeader {
    min-height: 40px;
    padding: 6px 10px;
  }

  .header-btn {
    padding: 6px 12px;
    font-size: 12px;
  }


  #projectSearchAndFilter {
    top: 40px;
    padding: 6px 10px;
  }


  input, textarea, button {
    padding: 8px 10px;
    font-size: 12px;
  }


  #planTasksPanel {
    width: 240px;
  }


  #tasksList {
    grid-template-columns: 1fr;
  }
}
*/

/* Планшеты в landscape */
@media (orientation: landscape) and (min-width: 768px) and (max-width: 1024px) {
  /* Сетка проектов - 3-4 колонки */
  #objectsGrid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  /* Список задач - 2-3 колонки */
  #tasksList {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  /* Панель задач шире на планшетах */
  /*
  #planTasksPanel {
    width: 320px;
  }
 */
}

#planTasksPanel{
	width:300px;
	background:#fff;
	border-left:1px solid #e0e0e0;
	display:flex;
	flex-direction:column;
	overflow:hidden;
	position:relative;
	height:100%;
}

/* Поворот устройства - плавные переходы */
/*
* {
  transition: width 0.3s ease, height 0.3s ease, padding 0.3s ease;
}
*/

/* Исключения для элементов, которые не должны анимироваться */
input, textarea, select, button, img, svg, canvas {
  transition: none;
}

/*В разделе Задачи: "+" Создать задачу*/
body.touch-device #addTaskBtn span:first-child{
	margin-right:0 !important;
}
/*В разделе Задачи: "Создать задачу"*/
body.touch-device #addTaskBtn span:nth-child(2){
	display:none;
}

.task-menu-button{
	position: relative;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 4px;
	transition: background-color 0.2s;
}
.task-menu-button span{
	font-size: 16px;
	color: #666;
	line-height: 1;
	font-weight: bold;
}

.task-meta-info{
	font-size: 12px;
	color: #666666;
	font-weight: 400;
	margin-bottom: 4px;
	word-break: break-all;
}
body.touch-device .task-meta-info{
	color: var(--dark-text-muted);
}
.task-title{
	font-size: 15px;
	font-weight: 500;
	color: #333333;
	line-height: 1.3;
	word-break: break-word;
}
body.touch-device .task-title{
	color: var(--dark-text-muted);
}

/* ======================
   МОБИЛЬНАЯ СЕТКА КНОПОК В TASKMODAL
====================== */

body.touch-device .form-group label{
	display: none !important;
}


/* Контейнер с кнопками действий в taskModal для мобильных устройств */
body.touch-device #taskModal .form-group div[style*="display: flex"][style*="gap: 12px"][style*="flex-wrap: wrap"] {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-gap: 12px !important;
  gap: 12px !important;
}

/* Первые 4 кнопки в сетке 2x2 */
body.touch-device #taskModal #addPhotoBtn,
body.touch-device #taskModal #addDocumentBtn,
body.touch-device #taskModal #addCommentBtn,
body.touch-device #taskModal #exportRemarkBtn {
  grid-column: span 1 !important;
  width: 100% !important;
  margin: 0 !important;
  justify-self: stretch !important;
}

/* Кнопка истории действий на всю ширину ниже сетки */
body.touch-device #taskModal #taskActionHistoryBtn {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  margin: 0 !important;
  margin-top: 4px !important;
  justify-self: stretch !important;
}



.main-field-items{
	display: flex;
	gap: 12px;
	margin-bottom: 16px;
	padding: 12px;
	background: #f8f9fa;
	/*border-radius: 8px;*/
	/*transition: background-color 0.5s ease;*/
}
.main-field-items div:first-child{
	min-width: 100px;
	font-size: 12px;
	color: #666;
	line-height: 1.3;
}

/* Карточки событий в taskMainFieldContent в темной теме для мобильных устройств */
/*body.touch-device.dark-theme #taskModal #taskMainFieldContent [id^="main-field-item-"] {*/
body.touch-device.dark-theme .main-field-items{
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
}
body.touch-device .main-field-items{
	flex-direction: column;
	border-radius:8px;
}


/* Улучшенный вид карточек при наведении в темной теме на мобильных */
/*
body.touch-device.dark-theme #taskModal #taskMainFieldContent [id^="main-field-item-"]:hover {
  background: var(--dark-surface-light) !important;
  border-color: var(--primary-color) !important;
}
*/

/* Темная тема для попапа planTasksBulkMenu в мобильной версии */
/*
body.touch-device.dark-theme #planTasksBulkMenu >div {
  background: rgba(0, 0, 0, 0.8) !important;
}
*/
/*
body.touch-device.dark-theme #deleteTaskModal .modal-form,
body.touch-device.dark-theme #planTasksBulkMenu .modal-form {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
  border: 1px solid var(--dark-border, #444) !important;
}
*/
body.dark-theme .lbl,
body.dark-theme .modal-form label,
body.dark-theme .modal-form h2 {
  color: var(--dark-text) !important;
}

/*
body.touch-device.dark-theme #planTasksBulkMenu .modal-form input,
body.touch-device.dark-theme #planTasksBulkMenu .modal-form select,
body.touch-device.dark-theme #planTasksBulkMenu .modal-form textarea {
  background: var(--dark-input-bg, #333) !important;
  color: var(--dark-text) !important;
  border: 1px solid var(--dark-border, #444) !important;
}
*/

/*кнопка Закрыть в planTasksBulkMenu*/
body.touch-device.dark-theme #planTasksBulkMenu .modal-form button:nth-of-type(2) {
  background: var(--primary-color) !important;
  color: white !important;
}
/*
body.touch-device.dark-theme #planTasksBulkMenu .modal-form button.secondary {
  background: var(--dark-surface-light, #444) !important;
  color: var(--dark-text) !important;
}
*/
