/* модуль planer css */
/* ——— Layout ——— */
.container {
    display: flex;
    width: 1200px;
    margin: 0 auto;
}

/* ——— Sidebar ——— */
.sidebar {
    width: 260px;
    background: #f9f9fb;
    color: #222;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    border-radius: 10px;
}
.logo {
    font-size: 1.4rem;
    font-weight: bold;
    padding: 0 20px 20px;
    border-bottom: 1px solid #e5e5ec;
    margin-bottom: 20px;
}
.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}
.nav-item:hover, .nav-item.active {
    background: #a6c6e5;
}

/* ——— Buttons ——— */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: block;
    width: 100%;
    text-align: center;
    max-width: 220px;
}
.btn-primary {
    background: #3498db;
    color: white;
}
.btn-primary:hover {
    background: #2980b9;
}
.btn-success {
    background: #2ecc71;
    color: white;
    width: auto;
    margin: 20px;
}
.btn-danger {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* ——— Main Content ——— */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.header h1 {
    font-size: 1.5rem;
}

/* ——— Financial Stats ——— */
.financial-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.stat-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #2c3e50;
}
.stat-amount {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 8px 0;
}
.stat-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* ——— Search & Tasks ——— */
.search-bar {
    margin-bottom: 20px;
}
.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}
.task-list {
    display: grid;
    gap: 16px;
}
.task-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #a6c6e5;
}
.task-header {
    margin-bottom: 10px;
}
.task-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.task-object {
    font-size: 0.95rem;
    color: #2980b9;
    margin-bottom: 6px;
}
.task-type, .task-phase {
    display: inline-block;
    margin-right: 8px;
    font-size: 0.85rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #ecf0f1;
    color: #2c3e50;
}
.task-type.construction { background: #d5f5e3; color: #27ae60; }
.task-type.renovation { background: #fef9e7; color: #f39c12; }
.task-details {
    margin: 8px 0;
    color: #555;
    font-size: 0.95rem;
}
.task-meta, .task-materials {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 8px 0;
    font-size: 0.92em;
    color: #444;
}
.task-status {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f0f0f0;
    font-size: 0.9em;
}
.task-status.planned { background: #e3f2fd; color: #1976d2; }
.task-status.in-progress { background: #fff8e1; color: #f57f17; }
.task-status.completed { background: #e8f5e9; color: #2e7d32; }
.task-status.on-hold { background: #ffebee; color: #c62828; }
.task-subtasks {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #27ae60;
}
.progress-bar {
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    margin: 12px 0;
    overflow: hidden;
}
.progress {
    height: 100%;
    background: #3498db;
    transition: width 0.3s;
}
.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.action-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* ——— Calendar ——— */
.calendar-view {
    display: none;
}
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.calendar-day-header {
    text-align: center;
    font-weight: bold;
    padding: 8px;
    background: #ecf0f1;
}
.calendar-day {
    min-height: 80px;
    background: white;
    padding: 4px;
    font-size: 0.85rem;
    border: 1px solid #eee;
}
.calendar-day.today {
    border: 2px solid #3c73a9;
}
.calendar-day .calendar-day-header {
    font-weight: normal;
    background: none;
    padding: 2px;
}
.day-task {
    display: block;
    padding: 2px 4px;
    margin-top: 2px;
    font-size: 0.8rem;
    border-radius: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.day-task.construction { background: #d5f5e3; color: #27ae60; }
.day-task.renovation { background: #fef9e7; color: #f39c12; }
.calendar-task.planned      { background-color: #e2e3e5; color: #6c757d; border-left: 3px solid #6c757d; }
.calendar-task.in-progress  { background-color: #cce5ff; color: #004085; border-left: 3px solid #007bff; }
.calendar-task.completed    { background-color: #d4edda; color: #155724; border-left: 3px solid #28a745; }
.calendar-task.on-hold      { background-color: #f8d7da; color: #721c24; border-left: 3px solid #dc3545; }

.calendar-task {
    font-size: 0.85em;
    padding: 4px 6px;
    margin-top: 2px;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
}
button#next-month {
    width: 38px;
}
button#prev-month {
    width: 38px;
}

/* ——— Modal ——— */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
}
.close {
    font-size: 35px;
    cursor: pointer;
    background: #b00;
    width: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    border-radius: 50%;
    height: 30px;
}
.form-group {
    padding: 5px 20px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #666;
}
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
}
.subtasks-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #eee;
}
.subtask-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.subtask-input {
    flex: 1;
    min-width: 0;
}
.subtask-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: none;
    border: none;
    color: #e74c3c;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.subtask-remove:hover {
    background: none;
    border-color: none;
    color: #862c22;
}

/* Кастомный чекбокс */
.subtask-checkbox {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
}
.subtask-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
}
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #3498db;
    border-radius: 4px;
    cursor: pointer;
}
.subtask-checkbox input:checked ~ .checkmark {
    background-color: #3498db;
}
.subtask-checkbox input:checked ~ .checkmark:after {
    display: block;
}
.subtask-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.btn-sm {
    padding: 4px 8px;
    font-size: 0.85rem;
}
.btn-outline {
    background: transparent;
    border: 1px solid #3498db;
    color: #3498db;
}
.btn-outline:hover {
    background: #e8f4fc;
}
.data-actions {
    margin: 0 auto;
    width: 210px;
    margin-top: 30px;
}
.flex {
    display: flex;
}
.flex div{
    flex:1;
}

/* ——— Responsive ——— */
@media (max-width: 768px) {
    .container { flex-direction: column; }
    .sidebar { width: 100%; }
    .financial-stats { grid-template-columns: 1fr; }
}