/* ============================================================
   CSS ПЕРЕМЕННЫЕ
   ============================================================ */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #15256d 0%, #245091 50%, #4495d1 100%);
    --text-primary: #333333;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow: 0 20px 60px rgba(0,0,0,0.3);
    
    --task-bg: #f8f9fa;
    --task-border: #e2e8f0;
    --task-expired-bg: #fff5f5;
    --task-expired-border: #fc8181;
    --task-completed-bg: #f0fff4;
    --task-completed-border: #48bb78;
    --task-awaiting-bg: #fff5f5;
    --task-awaiting-border: #fc8181;
    
    --btn-bg: rgba(255, 255, 255, 0.7);
    --btn-text: #333333;
    --btn-border: rgba(200, 200, 200, 0.3);
    --btn-hover-bg: rgba(255, 255, 255, 0.9);
    
    --tag-bg: rgba(255, 255, 255, 0.7);
    --tag-text: #333333;
    --tag-border: rgba(200, 200, 200, 0.3);
    
    --toast-info: linear-gradient(135deg, #667eea, #764ba2);
    --toast-warning: linear-gradient(135deg, #fc8181, #e53e3e);
    --toast-success: linear-gradient(135deg, #48bb78, #38a169);
    --toast-error: linear-gradient(135deg, #fc8181, #e53e3e);
}

[data-theme="dark"] {
    --bg-primary: #2d3748;
    --bg-secondary: #4a5568;
    --bg-gradient: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    --text-primary: #e2e8f0;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    
    --task-bg: #4a5568;
    --task-border: #4a5568;
    --task-expired-bg: #4a5568;
    --task-expired-border: #fc8181;
    --task-completed-bg: #2d3748;
    --task-completed-border: #48bb78;
    --task-awaiting-bg: #4a5568;
    --task-awaiting-border: #ed8936;
    
    --btn-bg: rgba(45, 55, 72, 0.7);
    --btn-text: #e2e8f0;
    --btn-border: rgba(255, 255, 255, 0.1);
    --btn-hover-bg: rgba(45, 55, 72, 0.9);
    
    --tag-bg: rgba(45, 55, 72, 0.7);
    --tag-text: #e2e8f0;
    --tag-border: rgba(255, 255, 255, 0.1);
    
    --toast-info: linear-gradient(135deg, #667eea, #764ba2);
    --toast-warning: linear-gradient(135deg, #fc8181, #e53e3e);
    --toast-success: linear-gradient(135deg, #48bb78, #38a169);
    --toast-error: linear-gradient(135deg, #fc8181, #e53e3e);
}

[data-theme="glass"] {
    --bg-primary: rgba(255, 255, 255, 0.15);
    --bg-secondary: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.6);
    --border-color: rgba(255, 255, 255, 0.15);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    
    --task-bg: rgba(255, 255, 255, 0.08);
    --task-border: rgba(255, 255, 255, 0.12);
    --task-expired-bg: rgba(252, 129, 129, 0.15);
    --task-expired-border: rgba(252, 129, 129, 0.4);
    --task-completed-bg: rgba(72, 187, 120, 0.15);
    --task-completed-border: rgba(72, 187, 120, 0.4);
    --task-awaiting-bg: rgba(252, 129, 129, 0.15);
    --task-awaiting-border: rgba(252, 129, 129, 0.4);
    
    --btn-bg: rgba(255, 255, 255, 0.15);
    --btn-text: #ffffff;
    --btn-border: rgba(255, 255, 255, 0.2);
    --btn-hover-bg: rgba(255, 255, 255, 0.25);
    
    --tag-bg: rgba(255, 255, 255, 0.12);
    --tag-text: #ffffff;
    --tag-border: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   БАЗОВЫЕ СТИЛИ
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    transition: background 0.5s ease;
    position: relative;
}

[data-theme="glass"] body {
    background: linear-gradient(135deg, 
        rgba(21, 37, 109, 0.6) 0%, 
        rgba(36, 80, 145, 0.6) 50%, 
        rgba(68, 149, 209, 0.6) 100%
    );
}

[data-theme="glass"] .container,
[data-theme="glass"] .settings-panel {
    background: var(--bg-primary);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
}

[data-theme="glass"] .task {
    background: var(--task-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--task-border);
    color: var(--text-primary);
}

[data-theme="glass"] .task.expired {
    background: var(--task-expired-bg);
    border-color: var(--task-expired-border);
}

[data-theme="glass"] .task.completed {
    background: var(--task-completed-bg);
    border-color: var(--task-completed-border);
}

[data-theme="glass"] .task.awaiting {
    background: var(--task-awaiting-bg);
    border-color: var(--task-awaiting-border);
}

[data-theme="glass"] .tag {
    background: var(--tag-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--tag-text);
    border: 1px solid var(--tag-border);
}

[data-theme="glass"] .btn-reset,
[data-theme="glass"] .btn-complete {
    background: var(--btn-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
}

[data-theme="glass"] .btn-reset:hover,
[data-theme="glass"] .btn-complete:hover {
    background: var(--btn-hover-bg);
}

[data-theme="glass"] .profile-toggle {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="glass"] .modal-content {
    background: var(--bg-primary);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="glass"] .modal-field input,
[data-theme="glass"] .modal-field select {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="glass"] .modal-field input:focus,
[data-theme="glass"] .modal-field select:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="glass"] .add-task {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="glass"] .add-task .add-task-row input,
[data-theme="glass"] .add-task .add-task-row select {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="glass"] .stats {
    border-top-color: var(--border-color);
    color: var(--text-muted);
}

[data-theme="glass"] .task-timer {
    color: #ffffff !important;
}

[data-theme="glass"] h1,
[data-theme="glass"] .settings-panel h2 {
    color: var(--text-primary);
}

[data-theme="glass"] .filter-checkbox,
[data-theme="glass"] .theme-toggle {
    color: var(--text-secondary);
}

[data-theme="glass"] .modal-actions .btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

[data-theme="glass"] .modal-actions .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="glass"] .logo-container .logo-text {
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="glass"] .toast {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="glass"] .toast-info {
    background: rgba(102, 126, 234, 0.6);
}

[data-theme="glass"] .toast-warning {
    background: rgba(252, 129, 129, 0.6);
}

[data-theme="glass"] .toast-success {
    background: rgba(72, 187, 120, 0.6);
}

[data-theme="glass"] .toast-error {
    background: rgba(252, 129, 129, 0.6);
}

.profile-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 6px 14px 6px 10px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    user-select: none;
}

.profile-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.02);
}

[data-theme="dark"] .profile-toggle {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .profile-toggle:hover {
    background: rgba(0, 0, 0, 0.4);
}

.profile-toggle .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.profile-toggle .avatar.user {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.profile-toggle .avatar.admin {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
    color: white;
}

.profile-toggle .profile-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.profile-toggle .toggle-icon {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.3s ease;
}

.profile-toggle:hover .toggle-icon {
    transform: rotate(180deg);
}

.logo-container {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.logo-container:hover {
    transform: scale(1.05);
    opacity: 1;
}

.logo-container img {
    height: 50px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.2));
}

.logo-container .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

[data-theme="dark"] .logo-container .logo-text {
    color: #e2e8f0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .logo-container img {
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
}

.container {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 40px 45px 40px 40px;
    max-width: 640px;
    width: 100%;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    transition: background 0.5s ease, color 0.5s ease;
    display: flex;
    flex-direction: column;
    overflow: visible;
    margin-top: 70px;
}

.settings-panel {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 40px;
    max-width: 280px;
    width: 100%;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    transition: background 0.5s ease, color 0.5s ease;
    display: flex;
    flex-direction: column;
    margin-top: 70px;
}

.settings-panel h2 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.5s ease, border-color 0.5s ease;
    flex-shrink: 0;
}

h1 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 28px;
    transition: color 0.5s ease;
    flex-shrink: 0;
}

.filter-group {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.5s ease;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.5s ease;
}

.filter-checkbox input[type="checkbox"],
.theme-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.5s ease;
    padding: 8px 0;
    margin-top: 5px;
}

.add-task {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 16px;
    border: 2px dashed rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

[data-theme="dark"] .add-task {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.add-task.visible {
    display: flex;
}

.add-task .add-task-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.add-task .add-task-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.add-task .add-task-row input,
.add-task .add-task-row select {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: background 0.5s ease, border-color 0.5s ease, color 0.5s ease;
    flex: 1;
    min-width: 120px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.add-task .add-task-row input[type="number"] {
    width: 70px;
    flex: none;
    text-align: center;
}

.add-task .add-task-row input[type="time"] {
    width: 130px;
    flex: none;
}

.add-task .add-task-row .time-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: bold;
    transition: color 0.5s ease;
}

.add-task .add-task-row .task-type-select {
    flex: 1;
    min-width: 150px;
}

.add-task .add-task-row .btn-add-task {
    padding: 10px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    transition: background 0.2s;
    flex: none;
}

.add-task .add-task-row .btn-add-task:hover {
    background: #5a67d8;
}

.add-task .add-task-row .btn-add-task:active {
    transform: scale(0.95);
}

#taskList {
    position: relative;
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
    padding-right: 10px;
    margin-right: -10px;
}

.task {
    background: var(--task-bg);
    border-radius: 12px;
    padding: 15px 18px;
    margin-bottom: 12px;
    transition: all 0.3s ease, background 0.5s ease;
    position: relative;
    border: 2px solid var(--task-border);
    color: var(--text-primary);
}

.task:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.task.expired {
    border-color: var(--task-expired-border);
    background: var(--task-expired-bg);
}

.task.awaiting {
    border-color: var(--task-awaiting-border);
    background: var(--task-awaiting-bg);
}

.task.completed {
    border-color: var(--task-completed-border);
    background: var(--task-completed-bg);
    opacity: 0.7;
}

.task.inactive {
    border-style: dashed !important;
    border-color: #a0aec0 !important;
    opacity: 0.7;
}

[data-theme="dark"] .task.inactive {
    border-color: #4a5568 !important;
}

.task.completed.inactive {
    border-color: var(--task-completed-border) !important;
    border-style: dashed !important;
    opacity: 0.7;
}

.task.scheduled-hidden {
    display: none !important;
}

.task.scheduled-waiting {
    border-color: #ed8936;
    background: #fffbeb;
}

[data-theme="dark"] .task.scheduled-waiting {
    background: #4a5568;
    border-color: #ed8936;
}

.task-progress-bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    z-index: 0;
    transition: background 0.5s ease;
    overflow: hidden;
}

[data-theme="dark"] .task-progress-bg {
    background: rgba(255, 255, 255, 0.05);
}

.task-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    border-radius: 12px;
    z-index: 1;
    transition: width 0.3s ease, background 0.3s ease;
}

.task-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.task-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.task-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 16px;
    transition: color 0.5s ease;
    word-break: break-word;
}

.task-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.task-timer {
    font-size: 20px;
    font-weight: bold;
    color: #000000 !important;
    font-variant-numeric: tabular-nums;
    min-width: 85px;
    display: inline-block;
}

[data-theme="dark"] .task-timer {
    color: #ffffff !important;
}

.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    color: var(--tag-text);
    background: var(--tag-bg);
    backdrop-filter: blur(4px);
    border: 1px solid var(--tag-border);
    white-space: nowrap;
    text-shadow: none;
}

.tag-status.expired { color: #e53e3e; }
.tag-status.active { color: #38a169; }
.tag-status.completed { color: #38a169; }
.tag-status.waiting { color: #ed8936; }
.tag-status.hidden { color: #a0aec0; }
.tag-status.awaiting { color: #e53e3e; }
.tag-type.onetime { color: #2b6cb0; }
.tag-schedule { color: var(--text-muted); }
.tag-default.default { color: #667eea; }

.btn-reset,
.btn-complete {
    background: var(--btn-bg);
    backdrop-filter: blur(4px);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    white-space: nowrap;
}

.btn-reset:hover,
.btn-complete:hover {
    background: var(--btn-hover-bg);
    transform: scale(1.05);
    border-color: rgba(200, 200, 200, 0.5);
}

.btn-reset:active,
.btn-complete:active {
    transform: scale(0.9);
}

.btn-reset.expired-btn {
    color: #e53e3e;
}

.btn-complete.done {
    background: rgba(200, 200, 200, 0.3);
    color: #a0aec0;
    border-color: rgba(200, 200, 200, 0.1);
    cursor: default;
}

.btn-complete.done:hover {
    transform: none;
    background: rgba(200, 200, 200, 0.3);
}

.btn-delete {
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #f56565;
    transform: scale(1.05);
}

.btn-delete:active {
    transform: scale(0.9);
}

.task-edit-btn {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    white-space: nowrap;
}

.task-edit-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.task-edit-btn:active {
    transform: scale(0.9);
}

.stats {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 14px;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    transition: border-color 0.5s ease, color 0.5s ease;
    flex-shrink: 0;
}

.stats button {
    background: none;
    border: none;
    color: #fc8181;
    cursor: pointer;
    font-size: 14px;
}

.stats button:hover {
    text-decoration: underline;
}

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    transition: color 0.5s ease;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 18px;
    transition: color 0.5s ease;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes resetFlash {
    0% { background-color: var(--task-bg); }
    30% { background-color: #c6f6d5; }
    100% { background-color: var(--task-bg); }
}

.task-reset {
    animation: resetFlash 0.6s ease !important;
}

@keyframes completeFlash {
    0% { background-color: var(--task-bg); }
    30% { background-color: #c6f6d5; }
    100% { background-color: var(--task-bg); }
}

.task-complete {
    animation: completeFlash 0.6s ease !important;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 35px 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    color: var(--text-primary);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 22px;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 8px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-field {
    margin-bottom: 16px;
}

.modal-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.modal-field input,
.modal-field select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-field input:focus,
.modal-field select:focus {
    outline: none;
    border-color: #667eea;
}

.modal-field .field-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-field .field-row input {
    flex: 1;
}

.modal-field .field-row .time-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-actions .btn-save {
    background: #667eea;
    color: white;
}

.modal-actions .btn-save:hover {
    background: #5a67d8;
    transform: scale(1.02);
}

.modal-actions .btn-cancel {
    background: var(--border-color);
    color: var(--text-secondary);
}

.modal-actions .btn-cancel:hover {
    background: #cbd5e0;
}

.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 450px;
    width: 100%;
    pointer-events: none;
}

.toast {
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.toast:hover {
    transform: scale(1.02);
}

.toast-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    color: white;
}

.toast-info {
    background: var(--toast-info);
}

.toast-warning {
    background: var(--toast-warning);
}

.toast-success {
    background: var(--toast-success);
}

.toast-error {
    background: var(--toast-error);
}

.toast-hidden {
    animation: toastSlideOut 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
    }
}

@media (max-width: 900px) {
    body {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .container {
        max-width: 100%;
        padding: 30px;
        margin-top: 70px;
    }
    
    #taskList {
        padding-right: 0;
        margin-right: 0;
    }
    
    .settings-panel {
        max-width: 100%;
        margin-top: 0;
    }
    
    .logo-container {
        top: 10px;
        left: 10px;
        gap: 8px;
    }
    
    .logo-container img {
        height: 35px;
    }
    
    .logo-container .logo-text {
        font-size: 14px;
    }
    
    .profile-toggle {
        top: 10px;
        right: 10px;
        padding: 4px 10px 4px 8px;
    }
    
    .profile-toggle .avatar {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .profile-toggle .profile-name {
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .add-task .add-task-row {
        flex-direction: column;
    }
    .add-task .add-task-row input,
    .add-task .add-task-row select {
        width: 100%;
        min-width: auto;
    }
    .add-task .add-task-row input[type="number"],
    .add-task .add-task-row input[type="time"] {
        width: 100%;
        flex: auto;
    }
    .add-task .add-task-row .btn-add-task {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo-container img {
        height: 28px;
    }
    
    .logo-container .logo-text {
        font-size: 11px;
    }
    
    .container {
        margin-top: 55px;
        padding: 20px;
    }
    
    .task-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .task-timer {
        font-size: 17px;
        min-width: 70px;
    }
    
    .profile-toggle .profile-name {
        display: none;
    }
    
    .modal-content {
        padding: 25px 20px;
    }
    
    .modal-field .field-row {
        flex-wrap: wrap;
    }
}

/* ============================================================
   ПАНЕЛЬ ЛОГОВ
   ============================================================ */

.logs-panel {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 40px;
    max-width: 380px;
    width: 100%;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    transition: background 0.5s ease, color 0.5s ease;
    display: flex;
    flex-direction: column;
    margin-top: 70px;
    max-height: calc(100vh - 100px);
}

.logs-panel h2 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.clear-logs-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    color: var(--text-muted);
}

.clear-logs-btn:hover {
    background: rgba(252, 129, 129, 0.15);
    color: #fc8181;
}

.logs-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-right: -8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logs-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-size: 14px;
}

/* Элемент лога в стиле задачи */
.log-entry {
    background: var(--task-bg);
    border-radius: 12px;
    padding: 12px 15px;
    border: 2px solid var(--task-border);
    transition: all 0.3s ease, background 0.5s ease;
    position: relative;
    overflow: hidden;
}

.log-entry:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.log-entry.completed {
    border-color: var(--task-completed-border);
    background: var(--task-completed-bg);
    opacity: 0.8;
}

.log-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.log-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.log-task-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 14px;
    word-break: break-word;
    line-height: 1.3;
}

.log-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.log-date {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Стили для разных типов действий */
.log-action {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(200, 200, 200, 0.3);
    white-space: nowrap;
}

.log-complete { color: #38a169; }
.log-reset    { color: #3182ce; }
.log-create   { color: #667eea; }
.log-delete   { color: #e53e3e; }
.log-update   { color: #ed8936; }
.log-clear    { color: #805ad5; }

[data-theme="dark"] .log-action {
    background: rgba(45, 55, 72, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="glass"] .logs-panel {
    background: var(--bg-primary);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
}

[data-theme="glass"] .log-entry {
    background: var(--task-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--task-border);
}

[data-theme="glass"] .log-action {
    background: var(--tag-bg);
    color: var(--tag-text);
    border: 1px solid var(--tag-border);
}

/* Адаптивность для панели логов */
@media (max-width: 1200px) {
    .logs-panel {
        max-width: 100%;
        max-height: 400px;
    }
}

@media (max-width: 900px) {
    .logs-panel {
        margin-top: 0;
        max-height: 500px;
    }
}
