/* Основные стили */
:root {
    --primary-gradient: linear-gradient(0.75turn, rgba(0,231,247,1) 0%, rgba(0,194,241,1) 100%);
    --primary-gradient-reverse: linear-gradient(0.25turn, rgba(0,231,247,1) 0%, rgba(0,194,241,1) 100%);
    --primary-color: #00c2f1;
    --primary-dark: #00a0d0;
    --secondary-color: #4caf50;
    --accent-color: #ff9800;
    --danger-color: #f44336;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-light: #e9ecef;
    --gray: #adb5bd;
    --gray-dark: #495057;
    --border-radius: 12px;
    --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    
}

/* Темная тема */
body.dark-theme {
    --light-color: #1a1d21;
    --dark-color: #f8f9fa;
    --gray-light: #2d3238;
    --gray: #6c757d;
    --gray-dark: #adb5bd;
    --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    --box-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.4);
    background-color: #121416;
    color: var(--dark-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fa;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#content {
    display: none;
}

/* Шапка */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: var(--primary-gradient);
    color: white;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 194, 241, 0.2);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 100%;
    padding: 0 14px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 7px;
}

.logo i {
    font-size: 17px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.logo h1 {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    font-size: 13px;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--border-radius);
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-header:hover {
    background: rgba(255, 255, 255, 0.32);
}

.header-time {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

/* ── Навигация в шапке ──────────────────────────────────────────────── */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    padding: 0 6px;
}

.header-dropdown {
    position: relative;
}

.header-dropdown-toggle .hd-arrow {
    font-size: 8px;
    margin-left: 2px;
    opacity: .8;
    transition: transform .2s;
}
.header-dropdown.open .hd-arrow { transform: rotate(180deg); }

.header-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
    z-index: 2100;
    min-width: 210px;
    padding: 4px 0;
    border: 1px solid rgba(0,0,0,.06);
}
body.dark-theme .header-dropdown-menu {
    background: #2d3238;
    border-color: rgba(255,255,255,.1);
}
.header-dropdown.open .header-dropdown-menu { display: block; }

.header-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    text-align: left;
    white-space: nowrap;
    font-family: inherit;
}
body.dark-theme .header-dropdown-menu button { color: #eee; }
.header-dropdown-menu button:hover {
    background: rgba(0,194,241,.09);
    color: #00a0d0;
}
.header-dropdown-menu button i { width: 14px; text-align: center; opacity: .7; }

.search-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-input {
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark-color);
    font-size: 14px;
    width: 140px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    background: white;
}

body.dark-theme .search-input {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

body.dark-theme .search-input:focus {
    background: rgba(255, 255, 255, 0.2);
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Кнопки */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark-color);
    border: 1px solid var(--gray-light);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

body.dark-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-color);
    border-color: var(--gray);
}

body.dark-theme .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(15deg);
}

/* Основной контент */
.main-content {
    margin-top: 48px;
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Боковая панель */
.sidebar {
    width: 22%;
    background: white;
    padding: 24px;
    border-right: 1px solid var(--gray-light);
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.05);
}

body.dark-theme .sidebar {
    background: var(--light-color);
    border-right-color: var(--gray-light);
}

.sidebar-section {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

body.dark-theme .sidebar-section {
    background: #2d3238;
}

.sidebar-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-family: 'Comfortaa', cursive;
    font-size: 18px;
}

.result-card {
    margin-bottom: 16px;
}

.result-card h4 {
    font-size: 14px;
    color: var(--gray-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.result-card textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    resize: none;
    transition: var(--transition);
    color: var(--dark-color);
}

.result-card textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 194, 241, 0.1);
}

body.dark-theme .result-card textarea {
    background: #2d3238;
    border-color: var(--gray);
    color: var(--dark-color);
}

body.dark-theme .result-card h4 {
    color: var(--gray-dark);
}

/* Карточка деталей дела (заменяет textarea для ValueOfSeekingCss) */
.case-details {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--dark-color);
    transition: var(--transition);
}
.case-details-empty {
    margin: 0;
    color: var(--gray);
    font-style: italic;
}
.case-details-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px dashed var(--gray-light);
}
.case-details-row:last-child {
    border-bottom: none;
}
.case-details-label {
    color: var(--gray);
    font-weight: 500;
}
.case-details-value {
    color: var(--dark-color);
    font-weight: 600;
    text-align: right;
}
.case-details-id {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-color);
}
body.dark-theme .case-details {
    background: #2d3238;
    border-color: var(--gray);
    color: var(--dark-color);
}

/* Кастомный select (#selectRole — выбор работника) */
.result-card select,
#selectRole {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    background-color: white;
    color: var(--dark-color);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 10px;
    /* убираем нативную стрелку */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* кастомная стрелка SVG */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2300a0d0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
}

.result-card select:hover,
#selectRole:hover {
    border-color: var(--primary-color);
}

.result-card select:focus,
#selectRole:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 194, 241, 0.15);
}

.result-card select option,
#selectRole option {
    padding: 8px;
    background: white;
    color: var(--dark-color);
    font-weight: 500;
}

body.dark-theme .result-card select,
body.dark-theme #selectRole {
    background-color: #2d3238;
    border-color: var(--gray);
    color: white;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2300c2f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
}

body.dark-theme .result-card select option,
body.dark-theme #selectRole option {
    background: #2d3238;
    color: white;
}

/* ============ Планировщик (форма + кнопки) ============ */
.planner-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.planner-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    background: white;
    color: var(--dark-color);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: var(--transition);
}
.planner-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 194, 241, 0.15);
}
.btn-planner {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 194, 241, 0.25);
    width: 100%;
}
.btn-planner:hover:not(:disabled) {
    background: #00a0d0;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 194, 241, 0.35);
}
.btn-planner:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-planner--ghost {
    background: transparent;
    color: var(--gray-dark);
    border: 1px solid var(--gray-light);
    box-shadow: none;
}
.btn-planner--ghost:hover:not(:disabled) {
    background: var(--gray-light);
    color: var(--dark-color);
    transform: none;
    box-shadow: none;
}
.planner-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.planner-actions .btn-planner {
    flex: 1;
}
body.dark-theme .planner-input {
    background: #2d3238;
    border-color: var(--gray);
    color: white;
}
body.dark-theme .btn-planner--ghost {
    color: white;
    border-color: var(--gray);
}
body.dark-theme .btn-planner--ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.case-form-parent-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}
.case-form-parent-inner {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.case-form-parent-inner .case-form-label {
    text-align: center;
}
.case-form-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}
.case-form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.case-form-required { color: #e53935; }
.case-form-help  { font-size: 11px; color: var(--gray-dark); }
.case-form-error { font-size: 11px; color: #e53935; }
.case-form-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.case-form-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.case-form-grid {
    display: flex;
    flex-direction: column;
}
.case-form-extra {
    margin-bottom: 12px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    padding: 0 12px;
}
.case-form-extra[open] { padding-bottom: 4px; }
.case-form-extra-summary {
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-dark);
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.case-form-extra-summary::-webkit-details-marker { display: none; }
.case-form-extra-summary::before {
    content: '▶ ';
    font-size: 10px;
    transition: transform 0.15s;
}
.case-form-extra[open] .case-form-extra-summary::before { content: '▼ '; }
body.dark-theme .case-form-extra { border-color: var(--gray); }
@media (max-width: 600px) {
    .case-form-parent-inner { width: 100%; }
    .case-form-2col { grid-template-columns: 1fr; }
    .case-form-3col { grid-template-columns: 1fr; }
}

.day-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 11px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--gray-light);
}

body.dark-theme .day-navigation {
    background: #2d3238;
    border-color: var(--gray);
}

.day-nav-btn {
    padding: 6px 8px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.day-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 194, 241, 0.3);
}

.week-nav-btn {
    background: rgba(0, 194, 241, 0.55);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.week-nav-btn:hover {
    background: var(--primary-gradient);
}

.current-day {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 11px;
    text-align: center;
    padding: 3px 8px;
    background: rgba(0, 194, 241, 0.1);
    border-radius: 6px;
}

body.dark-theme .current-day {
    background: rgba(0, 194, 241, 0.2);
}

.day-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-item {
    padding: 12px;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    color: var(--dark-color);
}

.day-item:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.day-item.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 8px rgba(0, 194, 241, 0.3);
}

body.dark-theme .day-item {
    background: #2d3238;
    border-color: var(--gray);
    color: var(--dark-color);
}

body.dark-theme .day-item:hover {
    border-color: var(--primary-color);
}

/* Основной контент */
.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.content-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--dark-color);
    font-family: 'Comfortaa', cursive;
    font-size: 24px;
}

body.dark-theme .content-header h2 {
    color: var(--dark-color);
}

.controls {
    display: flex;
    gap: 12px;
}

/* Таймлайн */
.timeline-container {
    position: relative;
    background: white;
    border-radius: var(--border-radius);
    padding: 6px 17px;
    box-shadow: var(--box-shadow);
    margin-bottom: 8px;
}

.timeline-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--gray-dark);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.timeline-close-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--dark-color);
}

body.dark-theme .timeline-container {
    background: var(--light-color);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 11px;
    border-bottom: 2px solid var(--gray-light);
}

.date-range {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Comfortaa', cursive;
}

.timeline-scroll {
    display: flex;
    gap: 8px;
}

.scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--gray-light);
    background: white;
    color: var(--dark-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
}

body.dark-theme .scroll-btn {
    background: #2d3238;
    border-color: var(--gray);
    color: var(--dark-color);
}

.timeline-wrapper {
    overflow-x: auto;
    padding: 11px;
    background: var(--light-color);
    border-radius: 12px;
    margin-bottom: 14px;
}

body.dark-theme .timeline-wrapper {
    background: #2d3238;
}

.container {
    position: relative;
    min-width: 800px;
    overflow: visible;
}

.date_hours {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-light);
}

body.dark-theme .date_hours {
    background: #2d3238;
    border-color: var(--gray);
}

.day-column {
    flex: 1;
    min-width: 400px;
}

.date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px;
    background: var(--primary-gradient);
    color: white;
    border-bottom: 2px solid white;
}

.date-header .date {
    font-size: 13px;
    font-weight: 700;
    font-family: 'Comfortaa', cursive;
}

.day-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.day-indicator.active {
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.hours {
    display: flex;
    background: white;
}

body.dark-theme .hours {
    background: #2d3238;
}

.hour {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    border-right: 1px solid var(--gray-light);
    border-bottom: 1px solid var(--gray-light);
    color: var(--gray-dark);
    font-size: 10px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.hour:hover {
    background: rgba(0, 194, 241, 0.05);
    color: var(--primary-color);
}

.hour:last-child {
    border-right: none;
}

.hour.current {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.05);
    z-index: 1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hour.selected {
    background: rgba(76, 175, 80, 0.1);
    color: var(--secondary-color);
    font-weight: 700;
}

body.dark-theme .hour {
    border-color: var(--gray);
    color: var(--gray-dark);
}

body.dark-theme .hour:hover {
    background: rgba(0, 194, 241, 0.1);
}

/* События */
.events {
    position: relative;
    height: 64px;
    margin-top: 11px;
    background: linear-gradient(to bottom, rgba(0, 194, 241, 0.03), transparent);
    border-radius: 6px;
    overflow: visible;
}

/* Лимитный бар — полупрозрачная полоса LimDStart→LimDStop под блоками event */
#_lim_bar {
    position: absolute;
    bottom: 0;
    height: 19px;
    background: linear-gradient(to bottom, transparent, rgba(100, 220, 100, 0.45));
    pointer-events: none;
}

body.dark-theme .events {
    background: linear-gradient(to bottom, rgba(0, 194, 241, 0.05), transparent);
}

.event {
    position: absolute;
    bottom: 0;
    height: 56px;
    line-height: 56px;
    text-align: center;
    background: var(--secondary-color);
    color: white;
    cursor: move;
    user-select: none;
    transition: var(--transition);
    border-radius: 8px 8px 0 0;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    min-width: 10px;
}

.event[data-status="done"] {
    background: #37474f;
    opacity: 0.72;
}

.event[data-status="review"] {
    background: #6a1b9a;
}

.event:hover {
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
    z-index: 10;
}

.event.selected {
    height: 66px;
    line-height: 66px;
    z-index: 15;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.event.dragging {
    opacity: 0.8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: none;
    height: 56px;
}

/* Подсказка пользователю: блок «висит» — через 1 с сработает коммит.
   Лёгкий пульс рамки, без анимации левого/ширины (transition остаётся none). */
.event.dragging.hover-pending {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    animation: hoverPendingPulse 1s ease-in-out infinite;
}
@keyframes hoverPendingPulse {
    0%   { outline-color: rgba(0, 194, 241, 0.4); }
    50%  { outline-color: rgba(0, 194, 241, 1.0); }
    100% { outline-color: rgba(0, 194, 241, 0.4); }
}

.event-content {
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.event-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.event:hover .event-tooltip {
    opacity: 1;
    bottom: calc(100% + 8px);
}
.event.tooltip-hidden .event-tooltip {
    opacity: 0 !important;
    bottom: 100% !important;
}

/* Цвета по статусу */
.event[data-status="new"]         { background: linear-gradient(135deg, #64b5f6, #1976d2); }
.event[data-status="in_progress"] { background: linear-gradient(135deg, #ffb74d, #f57c00); }
.event[data-status="review"]      { background: linear-gradient(135deg, #ce93d8, #7b1fa2); }
.event[data-status="done"]        { background: linear-gradient(135deg, #81c784, #388e3c); }

.event[data-id="943"] {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

.event[data-id="944"] {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.timeline-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 11px;
    border-top: 1px solid var(--gray-light);
}

body.dark-theme .timeline-footer {
    border-top-color: var(--gray);
}

.legend {
    display: flex;
    gap: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
}

.legend-color {
    width: 11px;
    height: 11px;
    border-radius: 3px;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(0, 194, 241, 0.1);
    padding: 6px 11px;
    border-radius: 20px;
}

body.dark-theme .time-display {
    background: rgba(0, 194, 241, 0.2);
}

/* Статистика */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--primary-color);
}

body.dark-theme .stat-card {
    background: var(--light-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 4px;
    line-height: 1;
}

.stat-info p {
    color: var(--gray-dark);
    font-size: 14px;
}

body.dark-theme .stat-info p {
    color: var(--gray-dark);
}

/* ============ Кликабельные stat-card ============ */
#CasesStats, #taskStats {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}
#CasesStats:hover, #taskStats:hover {
    border-color: var(--primary-color) !important;
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-3px);
}

/* ============ Панель диаграммы Ганта ============ */
.gantt-panel {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--box-shadow);
    margin-top: 24px;
    border: 1px solid transparent;
    position: relative;
}
body.dark-theme .gantt-panel { background: var(--light-color); }

.gantt-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-light);
}
.gantt-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-family: 'Comfortaa', cursive;
    font-size: 18px;
    margin: 0;
}
body.dark-theme .gantt-panel-header { border-bottom-color: var(--gray-light); }

/* ---- DHTMLX Gantt — переопределение под дизайн сайта ---- */

/* Контейнер — высота задаётся на #gantt_here, DHTMLX сам растягивает gantt_container */
#gantt_here {
    width: 100%;
    height: 460px;
}

.gantt-panel .gantt_container {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 13px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    overflow: hidden;
}

/* Шапка грида и временно́й шкалы */
.gantt-panel .gantt_grid_scale,
.gantt-panel .gantt_task_scale {
    background: linear-gradient(0.75turn, #00e7f7, #00c2f1);
    border-bottom: 2px solid rgba(0,0,0,.07);
}
.gantt-panel .gantt_grid_head_cell {
    color: white;
    font-weight: 600;
    border-right-color: rgba(255,255,255,.25) !important;
}
.gantt-panel .gantt_scale_cell {
    color: white;
    font-weight: 500;
    border-right-color: rgba(255,255,255,.2) !important;
}

/* Разделитель грида и таймлайна */
.gantt-panel .gantt_grid { border-right: 2px solid var(--primary-color); }

/* Строки */
.gantt-panel .gantt_row,
.gantt-panel .gantt_task_row        { border-bottom: 1px solid var(--gray-light); }
.gantt-panel .gantt_row.odd,
.gantt-panel .gantt_task_row.odd    { background: #fafbfc; }
.gantt-panel .gantt_row:hover,
.gantt-panel .gantt_task_row:hover  { background: rgba(0,194,241,.07) !important; }

/* Текст ячеек */
.gantt-panel .gantt_cell {
    color: var(--dark-color);
    border-right-color: var(--gray-light) !important;
}

/* Полосы задач */
.gantt-panel .gantt_task_line {
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,.12);
}
.gantt-panel .gantt_task_line.vik-bar-leaf {
    background: linear-gradient(90deg, #00e7f7, #00c2f1);
}
.gantt-panel .gantt_task_line.vik-bar-parent {
    background: linear-gradient(90deg, #00a8d6, #007fa8);
}
.gantt-panel .gantt_task_content {
    color: white;
    font-size: 11px;
    font-weight: 600;
}

/* Линия «сегодня» */
.gantt-panel .gantt_today_line {
    background: #ff9800;
    opacity: .55;
    width: 2px !important;
}

/* Подсветка текущего дня в шкале */
.gantt-panel .gantt-today-col { background: rgba(0,194,241,.06) !important; }

/* Дерево: иконки раскрытия */
.gantt-panel .gantt_tree_icon.gantt_open,
.gantt-panel .gantt_tree_icon.gantt_close { filter: hue-rotate(160deg) saturate(3); }

/* Тёмная тема */
body.dark-theme .gantt-panel .gantt_container,
body.dark-theme .gantt-panel .gantt_task_bg  { background: #1e2228; border-color: var(--gray-light); }
body.dark-theme .gantt-panel .gantt_row,
body.dark-theme .gantt-panel .gantt_task_row { background: #1e2228; border-color: var(--gray-light); }
body.dark-theme .gantt-panel .gantt_row.odd,
body.dark-theme .gantt-panel .gantt_task_row.odd { background: #2d3238; }
body.dark-theme .gantt-panel .gantt_row:hover,
body.dark-theme .gantt-panel .gantt_task_row:hover { background: rgba(0,194,241,.12) !important; }
body.dark-theme .gantt-panel .gantt_cell,
body.dark-theme .gantt-panel .gantt_tree_content { color: var(--dark-color); }

/* Тултип */
.gantt_tooltip {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 10px 14px;
    color: var(--dark-color);
    max-width: 260px;
    line-height: 1.6;
}
body.dark-theme .gantt_tooltip {
    background: #2d3238;
    border-color: var(--gray);
    color: #f8f9fa;
}

/* ============ Панель статистики задач ============ */
.task-stats-panel {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--box-shadow);
    margin-top: 24px;
    border: 1px solid transparent;
    transition: var(--transition);
    position: relative;
}

body.dark-theme .task-stats-panel {
    background: var(--light-color);
}

.task-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-light);
}

.task-stats-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-family: 'Comfortaa', cursive;
    font-size: 18px;
    margin: 0;
}

body.dark-theme .task-stats-header {
    border-bottom-color: var(--gray-light);
}

.task-stats-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr;
    gap: 16px;
    margin-bottom: 20px;
}

.task-stats-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-stats-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-dark);
}

.task-stats-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    background-color: white;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2300c2f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    -webkit-appearance: none;
    appearance: none;
    color: var(--dark-color);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
}

.task-stats-select:hover { border-color: var(--primary-color); }
.task-stats-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 194, 241, 0.15);
}

body.dark-theme .task-stats-select {
    background-color: #2d3238;
    border-color: var(--gray);
    color: white;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2300c2f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
}

.task-stats-date-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-stats-date-input {
    flex: 1;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    background: white;
    color: var(--dark-color);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    transition: var(--transition);
}

.task-stats-date-input:hover { border-color: var(--primary-color); }
.task-stats-date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 194, 241, 0.15);
}

body.dark-theme .task-stats-date-input {
    background: #2d3238;
    border-color: var(--gray);
    color: white;
    color-scheme: dark;
}

.task-stats-date-sep {
    color: var(--gray);
    font-size: 16px;
    flex-shrink: 0;
    user-select: none;
}

/* ---- Пикер периода ---- */
.pp-wrap {
    position: relative;
}
.pp-display-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pp-display-input {
    flex: 1;
    cursor: pointer;
    background-image: none !important;
}
.pp-open-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.pp-open-btn:hover { border-color: var(--primary-color); background: rgba(0,194,241,.07); }
body.dark-theme .pp-open-btn { background: #2d3238; border-color: var(--gray); }

.pp-popup {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 500;
    width: 460px;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    font-size: 13px;
    color: var(--dark-color);
}
body.dark-theme .pp-popup { background: #2d3238; border-color: var(--gray); }

.pp-title {
    padding: 9px 14px;
    font-weight: 700;
    font-size: 13px;
    background: var(--gray-light);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: 1px solid var(--border, var(--gray-light));
}
body.dark-theme .pp-title { background: #1a1d21; }

.pp-current-text {
    padding: 7px 14px;
    font-size: 12px;
    color: var(--gray-dark);
    background: #fafbfc;
    border-bottom: 1px solid var(--gray-light);
    min-height: 30px;
    display: flex;
    align-items: center;
}
body.dark-theme .pp-current-text { background: #222629; border-color: var(--gray); }

.pp-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-light);
}
.pp-tab {
    flex: 1;
    padding: 7px;
    border: none;
    background: none;
    font-size: 13px;
    cursor: pointer;
    color: var(--gray-dark);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.pp-tab:hover { color: var(--primary-color); }
.pp-tab--active { color: var(--primary-color); font-weight: 600; border-bottom-color: var(--primary-color); }

.pp-body { padding: 12px 14px 6px; }

.pp-work-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    margin-bottom: 10px;
    cursor: pointer;
}
.pp-work-label input { accent-color: var(--primary-color); }

.pp-types { display: flex; flex-direction: column; gap: 5px; }

.pp-type-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}
.pp-radio-lbl {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 118px;
    cursor: pointer;
    font-size: 13px;
}
.pp-radio-lbl input { accent-color: var(--primary-color); }

.pp-select {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 12px;
    color: var(--dark-color);
    background: white;
    cursor: pointer;
}
.pp-select:focus { outline: none; border-color: var(--primary-color); }
body.dark-theme .pp-select { background: #1e2228; border-color: var(--gray); color: white; }

.pp-num-input, .pp-date-input {
    padding: 4px 8px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 12px;
    color: var(--dark-color);
    background: white;
}
.pp-num-input { width: 70px; text-align: center; }
.pp-date-input { flex: 1; }
.pp-num-input:focus, .pp-date-input:focus { outline: none; border-color: var(--primary-color); }
body.dark-theme .pp-num-input,
body.dark-theme .pp-date-input { background: #1e2228; border-color: var(--gray); color: white; color-scheme: dark; }

.pp-check-lbl {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--gray-dark);
}
.pp-check-lbl input { accent-color: var(--primary-color); }

.pp-custom-block {
    padding-left: 126px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}
.pp-custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-dark);
}
.pp-custom-row span { min-width: 18px; }

.pp-footer {
    display: flex;
    gap: 8px;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--gray-light);
    justify-content: flex-end;
}
body.dark-theme .pp-footer { border-color: var(--gray); }

.task-stats-chart-wrap {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-light);
    background: var(--light-color);
}

body.dark-theme .task-stats-chart-wrap {
    border-color: var(--gray-light);
    background: #1e2228;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 7px;
}

/* ---- Кнопка полноэкранного режима ---- */
.expand-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 30px;
    height: 30px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    background: rgba(0, 194, 241, 0.08);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: var(--transition);
    z-index: 10;
    padding: 0;
}
.expand-btn:hover {
    background: rgba(0, 194, 241, 0.22);
    border-color: var(--primary-color);
}

.task-stats-panel:fullscreen,
.gantt-panel:fullscreen {
    border-radius: 0;
    margin: 0;
    padding: 24px;
    overflow: auto;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    background: white;
}
body.dark-theme .task-stats-panel:fullscreen,
body.dark-theme .gantt-panel:fullscreen {
    background: var(--light-color);
}
.gantt-panel:fullscreen #gantt_here {
    height: calc(100vh - 130px);
}

@media (max-width: 768px) {
    .task-stats-controls {
        grid-template-columns: 1fr;
    }
}

/* Подвал */
.footer {
    width: 100%;
    height: 48px;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -4px 12px rgba(0, 194, 241, 0.2);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    padding: 0 14px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    font-size: 11px;
}

.footer-links {
    display: flex;
    gap: 14px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    opacity: 0.9;
}

.footer-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.footer-copyright p {
    margin: 0;
    opacity: 0.8;
    font-size: 9px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .sidebar {
        width: 28%;
    }
    
    .search-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-group {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
}

@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gray-light);
    }
    
    .header-container {
        flex-direction: column;
        padding: 12px;
        height: auto;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .search-section {
        width: 100%;
        margin: 12px 0;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .controls {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .header {
        height: auto;
        padding: 12px 0;
    }
    
    .main-content {
        margin-top: 140px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Прокрутка */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #2d3238;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Стили для уведомлений (toast) */
.toast {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-info {
    background: linear-gradient(135deg, #00c2f1, #00a0d0);
}

.toast-success {
    background: linear-gradient(135deg, #4caf50, #388e3c);
}

.toast-warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.toast-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}
#content {
    display:none;
}

/* ============ Детализация исполнительской дисциплины (#ddPanel) ============ */
.dd-panel {
    margin-top: 24px;
}

/* Строка периода над таблицей */
.dd-period-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.dd-range {
    font-size: 13px;
    color: var(--gray-dark);
    white-space: nowrap;
}

/* Общий показатель — крупное кольцо по центру */
.dd-overall {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--gray-light);
    margin-bottom: 14px;
}

.dd-overall-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-dark);
    letter-spacing: 0.02em;
}

/* Колонка с кольцом в таблице */
.dd-ring-col {
    text-align: center !important;
    padding: 6px 10px !important;
    white-space: nowrap;
}

body.dark-theme .dd-overall {
    border-bottom-color: var(--gray);
}

/* Таблица */
.dd-table-wrap {
    overflow-x: auto;
}

.dd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dd-table th,
.dd-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-light);
    text-align: left;
}

.dd-table th {
    font-weight: 600;
    color: var(--gray-dark);
    background: rgba(0, 194, 241, 0.06);
    white-space: nowrap;
}

.dd-table tr:last-child td { border-bottom: none; }

.dd-table tr:hover td { background: rgba(0, 194, 241, 0.04); }

.dd-num { text-align: right !important; }

.dd-ext-hdr { color: var(--primary-color) !important; }
.dd-ext     { color: var(--primary-color); }

.dd-overdue {
    color: #c62828;
    font-weight: 600;
}

.dd-self-row td {
    font-weight: 600;
    background: rgba(0, 194, 241, 0.08);
}

body.dark-theme .dd-table th {
    background: rgba(0, 194, 241, 0.08);
}
body.dark-theme .dd-rings {
    border-bottom-color: var(--gray);
}
body.dark-theme .dd-table th,
body.dark-theme .dd-table td {
    border-bottom-color: var(--gray);
}

/* ── Таблица дел в статистике ─────────────────────────────────────────────── */
.ts-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ts-thead-row { background: #e0e0e0; }
.ts-th { padding: 6px 8px; text-align: center; color: #333; font-weight: 600; }
.ts-row { border-bottom: 1px solid #ddd; }
.ts-row-even { background: rgba(0,0,0,0.02); }
.ts-cell { padding: 5px 8px; color: #333; }
.ts-cell-dim { color: #666; }
.ts-cell-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-section { background: #e8e8e8; }
.ts-section-cell { padding: 7px 8px; font-weight: 700; color: #1565c0; font-size: 13px; }

body.dark-theme .ts-thead-row { background: #37474f; }
body.dark-theme .ts-th { color: #eceff1; }
body.dark-theme .ts-row { border-bottom-color: #37474f; }
body.dark-theme .ts-row-even { background: rgba(255,255,255,0.03); }
body.dark-theme .ts-cell { color: #eceff1; }
body.dark-theme .ts-cell-dim { color: #b0bec5; }
body.dark-theme .ts-section { background: #263238; }
body.dark-theme .ts-section-cell { color: #00c2f1; }

/* ── Печатная форма ──────────────────────────────────────────────────────── */
@media print {
    body * { visibility: hidden; }
    body.print-dd #ddPanel, body.print-dd #ddPanel * { visibility: visible; }
    body.print-ts #taskStatsPanel, body.print-ts #taskStatsPanel * { visibility: visible; }
    #ddPanel, #taskStatsPanel {
        position: absolute; left: 0; top: 0; width: 100%;
        background: #fff; color: #000;
        box-shadow: none; border-radius: 0; padding: 20px;
    }
    #ddClose, #ddPrintBtn, #ddPpWrap,
    #taskStatsBackBtn, #taskStatsPrintBtn, #taskStatsExpandBtn,
    .pp-wrap, .task-stats-controls { display: none !important; }
    #taskStatsCasesWrap { max-height: none !important; overflow: visible !important; }
    #taskStatsCasesWrap table { width: 100%; border-collapse: collapse; }
    #taskStatsCasesWrap th, #taskStatsCasesWrap td {
        border: 1px solid #999; padding: 5px 8px; color: #000 !important; font-size: 11px;
    }
    #taskStatsCasesWrap th { background: #e0e0e0; }
    #taskStatsCasesWrap tr[style*="263238"] td { color: #000; font-weight: 700; background: #e8e8e8; }
    .task-stats-chart-wrap { page-break-before: auto; }
    .dd-overall { margin: 10px 0; }
    .dd-table { width: 100%; border-collapse: collapse; }
    .dd-table th, .dd-table td {
        border: 1px solid #999; padding: 6px 10px;
        color: #000; font-size: 12px;
    }
    .dd-table th { background: #e0e0e0; }
    .dd-self-row td { font-weight: 700; }
    .dd-overdue { color: #c62828 !important; }
    .dd-ring-col svg circle { stroke-opacity: 1; }
    .dd-ring-col svg text { fill: #000 !important; }
    .dd-overall-label { color: #333; }
    .dd-range { color: #333; font-size: 13px; }
    .task-stats-header h3 { color: #000; font-size: 18px; }
    .task-stats-header { border-bottom: 2px solid #333; padding-bottom: 8px; margin-bottom: 12px; }
}