/*
Theme Name: Задачи выполнены
Theme URI: https://taskscompleted.local
Description: Система управления задачами и напоминаниями для сотрудников
Version: 1.0.0
Author: TasksCompleted Team
Author URI: https://taskscompleted.local
Text Domain: taskscompleted
*/

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Manager Panel Layout */
.manager-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.manager-header .logo {
    height: 40px;
    cursor: pointer;
}

.manager-header .btn-logout {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.manager-header .btn-logout:hover {
    background: #c82333;
}

.manager-main {
    display: flex;
    min-height: calc(100vh - 120px);
}

.manager-sidebar {
    width: 20%;
    background: #2c3e50;
    color: #fff;
    padding: 2rem 0;
}

.manager-sidebar nav ul {
    list-style: none;
}

.manager-sidebar nav ul li {
    margin: 0;
}

.manager-sidebar nav ul li a {
    display: block;
    padding: 1rem 2rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: background 0.2s;
    border-left: 4px solid transparent;
}

.manager-sidebar nav ul li a:hover,
.manager-sidebar nav ul li a.active {
    background: #34495e;
    border-left-color: #3498db;
}

.manager-content {
    width: 80%;
    padding: 2rem;
}

.manager-footer {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 1.5rem 2rem;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    color: #2c3e50;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 12px;
}

/* Tables */
.data-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    font-weight: 600;
    color: #2c3e50;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Mobile calendar navigation fixes */
@media (max-width: 768px) {
    .calendar-navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .calendar-navigation button {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .calendar-navigation h2 {
        font-size: 1.2rem;
        margin: 0.5rem 0;
    }
    
    /* Mobile date cards */
    .date-card {
        min-width: 280px;
        margin: 0 auto;
    }
    
    .date-card .btn-sm {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Grid adjustments for mobile */
    .date-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
}

/* Mobile modal content fixes */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        max-height: 85vh;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-body .form-group {
        margin-bottom: 1rem;
    }
    
    .modal-body input,
    .modal-body select,
    .modal-body textarea {
        width: 100%;
        box-sizing: border-box;
    }
    
    .modal-body .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Schedule modal specific fixes */
    #shifts-container .shift-item {
        margin-bottom: 1rem;
        padding: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        background: #f8f9fa;
    }
    
    #shifts-container .form-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #shifts-container .form-group label {
        font-weight: 600;
        color: #2c3e50;
        font-size: 14px;
    }
    
    #shifts-container .form-group input,
    #shifts-container .form-group select {
        padding: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    #shifts-container .btn-danger {
        background: #e74c3c;
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.login-heading-wrap {
    display: flex;
    justify-content: center;
    margin: 0 0 1.75rem;
}

.login-heading {
    margin: 0;
    max-width: 20rem;
    text-align: center;
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: clamp(0.98rem, 2.6vw, 1.14rem);
    font-weight: 600;
    line-height: 1.42;
    letter-spacing: -0.035em;
    color: #1e293b;
    text-wrap: balance;
}

.login-heading::before {
    content: '';
    display: block;
    width: 2.75rem;
    height: 3px;
    margin: 0 auto 0.95rem;
    border-radius: 2px;
    background: linear-gradient(90deg, #667eea, #8b5cf6, #764ba2);
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.35);
}

.login-box .form-group {
    margin-bottom: 1.5rem;
}

.login-box .btn {
    width: 100%;
    padding: 1rem;
    font-size: 16px;
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 2rem;
    min-height: 100vh;
    background: #f8f9fa;
}

/* Fix header position during horizontal scroll */
.kanban-header {
    background: #2c3e50;
    color: #fff;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .kanban-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Kanban page specific styles */
body.kanban-page {
    margin: 0;
    padding: 0;
}

/* Mobile optimization for schedule modal */
@media (max-width: 768px) {
    .shift-fields {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .shift-field {
        min-width: 100% !important;
        flex: none !important;
    }
    
    .shift-field button {
        width: 100% !important;
        margin-top: 0.5rem;
    }
    
    #scheduleModal .modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 1rem !important;
        max-height: 90vh !important;
    }
    
    #scheduleModal .modal-body {
        padding: 1rem !important;
        max-height: 60vh !important;
        overflow-y: auto !important;
    }
    
    /* Mobile header layout */
    #scheduleModal .modal-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    #scheduleModal .modal-header h2 {
        font-size: 14px !important;
    }
    
    #scheduleModal .modal-header .btn {
        font-size: 11px !important;
        padding: 0.3rem 0.6rem !important;
        align-self: flex-start !important;
    }
}


.kanban-column {
    min-width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1.5rem;
}

.kanban-column-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.kanban-column-header h2 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.kanban-column-header .staff-list {
    font-size: 14px;
    color: #666;
    margin: 0.5rem 0;
}

.task-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.task-card.active {
    border-left: 4px solid #27ae60;
}

.task-card.waiting {
    background: #fff9e6;
    border-left: 4px solid #f39c12;
}

.task-card.later {
    background: #fff;
    border-left: 4px solid #95a5a6;
}

.task-card.overdue {
    border-left: 4px solid #e74c3c;
}

.task-card-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.task-card-badge.in-progress {
    background: #d4edda;
    color: #155724;
}

.task-card-badge.overdue {
    background: #f8d7da;
    color: #721c24;
}

.task-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.task-card-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 0.75rem;
}

.task-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none !important;
}

/* Filters bar (Analytics page) */
#filters-bar {
    backdrop-filter: saturate(150%) blur(2px);
}

#filters-bar form label {
    display: block;
    font-size: 12px;
    color: #6b7280; /* gray-500 */
    margin-bottom: 6px;
}

#filters-bar input[type="date"],
#filters-bar select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #ffffff;
    border: 1px solid #e5e7eb; /* gray-200 */
    border-radius: 8px;
    padding: 10px 12px;
    height: 40px;
    font-size: 14px;
    color: #111827; /* gray-900 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

#filters-bar input[type="date"]:focus,
#filters-bar select:focus {
    outline: none;
    border-color: #3b82f6; /* blue-500 */
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* Nice calendar icon for date inputs */
#filters-bar input[type="date"]::-webkit-calendar-picker-indicator {
    background: url('data:image/svg+xml;utf8,<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path stroke="%236b7280" stroke-width="1.5" d="M7 3v4M17 3v4M4 9h16M5 5h14a2 2 0 012 2v11a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2z"/></svg>') no-repeat center;
    width: 22px;
    height: 22px;
    opacity: .8;
    cursor: pointer;
}

#filters-bar input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
#filters-bar input[type="date"]::-webkit-datetime-edit { padding: 0 2px; }
#filters-bar input[type="date"]::-webkit-datetime-edit-text { color: #374151; }
#filters-bar input[type="date"]::-webkit-datetime-edit-month-field,
#filters-bar input[type="date"]::-webkit-datetime-edit-day-field,
#filters-bar input[type="date"]::-webkit-datetime-edit-year-field { color: #111827; }

/* Hover & disabled states */
#filters-bar input[type="date"]:hover,
#filters-bar select:hover {
    border-color: #d1d5db; /* gray-300 */
}

#filters-bar .btn-primary {
    height: 40px;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: #2c3e50;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: background 0.3s;
}

.mobile-menu-toggle:hover {
    background: #34495e;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar-overlay {
        display: block;
        pointer-events: none;
    }
    
    .sidebar-overlay.active {
        pointer-events: auto;
    }
    
    .manager-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        max-width: 80vw;
        height: 100vh;
        z-index: 1000;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        padding-top: 4rem; /* Space for close button */
    }
    
    .manager-sidebar.active {
        left: 0;
    }
    
    .manager-sidebar nav {
        padding-top: 0;
    }
    
    .manager-content {
        width: 100%;
        padding: 1rem;
        padding-top: 4rem; /* Space for menu button */
    }
    
    .manager-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .manager-header .user-info {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .data-table {
        overflow-x: auto;
    }
    
    .data-table table {
        min-width: 600px;
    }
    
    /* Modal adjustments for mobile */
    .modal-content {
        width: 95%;
        max-width: 500px;
        margin: 2rem auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Admin Schedule Calendar Mobile Adjustments */
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    /* Schedule navigation mobile - same as kanban */
    div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center !important;
        margin-bottom: 1rem !important;
    }
    
    div[style*="display: flex"][style*="justify-content: space-between"] button {
        width: 100% !important;
        max-width: 200px !important;
        margin: 0 auto !important;
        font-size: 0.9rem !important;
    }
    
    div[style*="display: flex"][style*="justify-content: space-between"] h2 {
        font-size: 1.2rem !important;
        margin: 0.5rem 0 !important;
        order: 2 !important;
    }
    
    div[style*="display: flex"][style*="justify-content: space-between"] button:first-child {
        order: 1 !important;
    }
    
    div[style*="display: flex"][style*="justify-content: space-between"] button:last-child {
        order: 3 !important;
    }
    
    /* Kanban calendar mobile adjustments */
    .calendar-navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .calendar-navigation button {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .calendar-navigation h2 {
        font-size: 1.2rem;
        margin: 0.5rem 0;
    }
    
    .calendar-weekdays {
        display: none !important;
    }
    
    .calendar-days-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    }
    
    /* Mobile date cards - applies to both kanban and schedule */
    .date-card {
        min-width: 280px;
        margin: 0 auto;
    }
    
    /* Mobile modal adjustments for schedule */
    .shift-fields {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .shift-field {
        flex: none !important;
        min-width: unset !important;
        width: 100% !important;
    }
    
    .shift-field select,
    .shift-field input[type="time"],
    .shift-field input[type="text"] {
        font-size: 16px !important;
        padding: 0.75rem !important;
    }
    
    .shift-field button {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .manager-sidebar {
        width: 200px;
    }
    
    .manager-content {
        width: calc(100% - 200px);
        padding: 1.5rem;
    }
    
    .manager-sidebar nav ul li a {
        padding: 0.75rem 1rem;
        font-size: 14px;
    }
}

