* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #121212;
    color: #eee;
    font-family: system-ui, sans-serif;
    line-height: 1.6;
}

a { color: #eee; text-decoration: none; }

main {
    padding: 2rem;
    max-width: 1240px;
    margin: auto;
}

.glow {
    text-shadow: 0 0 10px #9b59b6, 0 0 20px #8e44ad80;
}

nav {
    background: rgba(15, 15, 30, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(140, 80, 180, 0.35);
    padding: 0.9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.logo {
    font-size: 1.95rem;
    font-weight: 800;
    color: #b19cd9;
    letter-spacing: -0.8px;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.nav-center a {
    color: #d0d0ff;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    transition: all 0.22s;
}

.nav-center a:hover {
    background: rgba(155, 89, 182, 0.18);
    color: #ffffff;
}

.page-header {
    text-align: center;
    margin: 1rem 0 2rem;
}

.page-header.align-left { text-align: left; }

.page-header h1 {
    font-size: 2.4rem;
    margin-bottom: 0.8rem;
    color: #eee;
}

.project-desc {
    color: #a8a8c8;
    font-size: 0.95rem;
    margin: 0 0 1rem 0;
    max-width: 850px;
    line-height: 1.45;
}

.page-header:not(.align-left) .project-desc {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.header-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.header-actions.centered { justify-content: center; }
.header-actions.wrap { flex-wrap: wrap; }

.flash-stack {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1.4rem;
}

.flash-message {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(45, 45, 65, 0.7);
}

.flash-message.success {
    border-color: rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.13);
    color: #b8f0cc;
}

.flash-message.danger {
    border-color: rgba(231, 76, 60, 0.4);
    background: rgba(231, 76, 60, 0.13);
    color: #ffb1a8;
}

.flash-message.warning {
    border-color: rgba(243, 156, 18, 0.4);
    background: rgba(243, 156, 18, 0.13);
    color: #ffd898;
}

input, textarea, select, button {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background: #2a2a2a;
    border: none;
    border-radius: 8px;
    color: #eee;
    font: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.22);
}

textarea { resize: vertical; }

.auth-container {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: #1a1a1a;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(142,68,173,0.15);
    border: 1px solid #2a2a2a;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #9b59b6;
}

.switch-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #aaa;
}

.switch-link a {
    color: #9b59b6;
    font-weight: 500;
}

.form-message {
    margin-top: 1rem;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.form-message.error {
    background: #4a1a1a;
    color: #ff6b6b;
    border: 1px solid #7f0000;
}

.hidden { display: none; }

.btn-purple {
    background: #8e44ad;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-purple:hover { background: #6f42c1; }

.btn-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: auto;
    min-width: 170px;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    background: rgba(35, 35, 55, 0.68);
    border: 1px solid rgba(130, 100, 180, 0.35);
    box-shadow: 0 6px 20px rgba(0,0,0,0.22);
    cursor: pointer;
    transition: 0.22s ease;
}

.btn-glass:hover {
    transform: translateY(-2px);
    border-color: rgba(155, 89, 182, 0.58);
    background: rgba(45, 45, 70, 0.78);
}

.btn-glass.full { width: 100%; }
.btn-glass.add { color: #d9c8ff; }
.btn-glass.edit { color: #a9c7ff; }
.btn-glass.danger { color: #ffb1a8; }
.btn-glass.secondary-link { color: #ddd; }
.btn-glass.small { min-width: auto; padding: 0.6rem 0.9rem; font-size: 0.92rem; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.project-card {
    background: rgba(30, 30, 50, 0.48);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(140, 80, 180, 0.32);
    border-radius: 14px;
    padding: 1.5rem 1.6rem;
    transition: all 0.28s ease;
    box-shadow: 0 6px 22px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(142, 68, 173, 0.28);
    border-color: rgba(155, 89, 182, 0.55);
    background: rgba(40, 40, 65, 0.58);
}

.project-card h3 {
    margin: 0;
    font-size: 1.35rem;
    color: #d0c0ff;
}

.project-card p,
.empty-text,
.empty-column,
.hint-text {
    color: #b7b7d3;
}

.project-card-top,
.project-progress-inline,
.section-head,
.progress-head,
.progress-meta,
.detail-list,
.comment-head,
.activity-item,
.task-header,
.task-meta,
.task-badges,
.filters-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
}

.project-card-top,
.section-head,
.progress-head,
.comment-head,
.task-header {
    align-items: center;
}

.project-progress-inline,
.progress-meta,
.task-meta,
.task-badges,
.detail-list,
.activity-item {
    flex-wrap: wrap;
}

.mini-chip,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    background: rgba(155, 89, 182, 0.14);
    border: 1px solid rgba(155, 89, 182, 0.28);
}

.badge.danger { color: #ffb1a8; border-color: rgba(231, 76, 60, 0.35); background: rgba(231, 76, 60, 0.15); }
.badge.warning { color: #ffd89b; border-color: rgba(243, 156, 18, 0.35); background: rgba(243, 156, 18, 0.15); }
.badge.success { color: #b8f0cc; border-color: rgba(46, 204, 113, 0.35); background: rgba(46, 204, 113, 0.15); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.stats-grid.compact { margin-bottom: 1rem; }

.stat-card {
    background: rgba(30, 30, 50, 0.48);
    border: 1px solid rgba(140, 80, 180, 0.25);
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 8px 22px rgba(0,0,0,0.3);
}

.stat-card.success { border-color: rgba(46, 204, 113, 0.25); }
.stat-card.warning { border-color: rgba(243, 156, 18, 0.25); }
.stat-card.danger { border-color: rgba(231, 76, 60, 0.25); }
.stat-card.accent { border-color: rgba(155, 89, 182, 0.35); }

.stat-title {
    color: #b8b8d8;
    font-size: 0.92rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.filters-panel,
.detail-card,
.column {
    background: rgba(25, 25, 45, 0.52);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(120, 90, 170, 0.3);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.38);
}

.filters-panel {
    padding: 1rem;
    margin-bottom: 1rem;
}

.filters-form {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr) auto;
    gap: 0.8rem;
    align-items: end;
}

.filters-form input,
.filters-form select { margin: 0; }

.project-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.3rem 0 2rem;
    flex-wrap: wrap;
}

.kanban {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.4rem;
}

.column {
    padding: 1.2rem;
    min-height: 420px;
}

.column h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: #b19cd9;
}

.task-list { min-height: 320px; }

.task-card {
    background: rgba(35, 35, 55, 0.6);
    border: 1px solid rgba(130, 100, 180, 0.35);
    border-radius: 12px;
    padding: 1rem 1rem 0.95rem;
    margin-bottom: 0.9rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: all 0.22s ease;
    cursor: grab;
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(142, 68, 173, 0.25);
    border-color: rgba(155, 89, 182, 0.5);
}

.task-card.overdue {
    border-color: rgba(231, 76, 60, 0.5);
    box-shadow: 0 6px 18px rgba(231, 76, 60, 0.15);
}

.task-card:active { cursor: grabbing; }

.task-header h4 {
    margin: 0;
    font-size: 1.08rem;
    color: #e8e8ff;
    flex: 1;
}

.task-controls { display: flex; gap: 0.4rem; }

.btn-icon,
.btn-delete-task,
.btn-edit-task {
    background: none;
    border: none;
    color: #a7a7c8;
    width: auto;
    margin: 0;
    padding: 0.1rem 0.35rem;
    cursor: pointer;
}

.btn-delete-task:hover { color: #ff7777; }
.btn-edit-task:hover { color: #aaffaa; }

.task-desc {
    font-size: 0.94rem;
    color: #c8c8e0;
    margin: 0.2rem 0 0.8rem;
    line-height: 1.38;
}

.task-meta {
    margin-bottom: 0.7rem;
    font-size: 0.83rem;
    color: #adadca;
}

.task-badges {
    align-items: center;
    margin-bottom: 0.8rem;
}

.priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(155, 89, 182, 0.38);
    background: rgba(40, 40, 70, 0.45);
}

.priority.low {
    border-color: rgba(46, 204, 113, 0.55);
    background: rgba(46, 204, 113, 0.14);
    color: #a8e4c2;
}

.priority.medium {
    border-color: rgba(243, 156, 18, 0.55);
    background: rgba(243, 156, 18, 0.14);
    color: #ffd080;
}

.priority.high {
    border-color: rgba(231, 76, 60, 0.55);
    background: rgba(231, 76, 60, 0.16);
    color: #ffaaa0;
}

.task-link {
    display: inline-block;
    color: #c9bbff;
    font-size: 0.9rem;
}

.task-link:hover { text-decoration: underline; }

.dashboard-grid,
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.detail-card {
    padding: 1.25rem;
}

.detail-card h2 {
    margin-bottom: 1rem;
    color: #d7ccff;
}

.full-width { width: 100%; }

.detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.detail-description p {
    margin-top: 0.5rem;
    color: #c8c8df;
}

.project-progress-list,
.comments-list,
.activity-list {
    display: grid;
    gap: 0.9rem;
}

.progress-item,
.comment-item,
.activity-item {
    padding: 0.9rem;
    border-radius: 12px;
    background: rgba(40, 40, 65, 0.42);
    border: 1px solid rgba(120, 90, 170, 0.22);
}

.progress-head a { color: #d8cbff; font-weight: 600; }
.progress-head span,
.comment-head span,
.activity-time { color: #a8a8c8; }

.progress-bar {
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.8rem 0;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #8e44ad, #b19cd9);
    border-radius: inherit;
}

.comment-item p,
.activity-text { color: #d7d7ef; }

.comment-form textarea { min-height: 110px; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-form-container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

.modal-content {
    background: rgba(28, 28, 45, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(140, 80, 180, 0.38);
    border-radius: 16px;
    padding: 1.8rem 2rem 2.2rem;
    box-shadow: 0 15px 50px rgba(0,0,0,0.55);
    min-width: 420px;
    color: #f0f0ff;
    position: relative;
}

.modal-content h2 {
    font-size: 1.55rem;
    margin: 0 0 1.2rem;
    color: #d0c0ff;
    text-align: center;
}

.modal-content p {
    margin: 0 0 1.1rem;
    text-align: center;
    color: #c7c7df;
}

.modal-content input[type="text"],
.modal-content input[type="date"],
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
    background: rgba(40, 40, 60, 0.7);
    border: 1px solid rgba(120, 100, 180, 0.4);
    border-radius: 10px;
    color: #f0f0ff;
}

.close {
    position: absolute;
    right: 1.2rem;
    top: 0.8rem;
    font-size: 2rem;
    color: #777;
    cursor: pointer;
}

.close:hover { color: #9b59b6; }

.modal-buttons.single { margin-top: 0.4rem; }

@media (max-width: 1024px) {
    .filters-form,
    .dashboard-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    nav {
        padding: 0.9rem 1rem 1.1rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .nav-center {
        position: static;
        transform: none;
        justify-content: center;
    }

    main { padding: 1rem; }

    .page-header h1 { font-size: 1.9rem; }

    .modal-content {
        min-width: auto;
        width: calc(100vw - 1.5rem);
        padding: 1.3rem 1rem 1.5rem;
    }
}

.modal-form-container label {
    display: block;
    margin: 10px 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #cbb6ff;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.detail-list.stacked,
.compact-list {
    display: grid;
    gap: 10px;
}

.timer-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timer-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.timer-display {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #f1e8ff;
}

.timer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.timer-actions .btn-glass {
    min-width: 120px;
}

.timer-actions .btn-glass:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.heat-cell {
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    font-weight: 600;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(130, 100, 180, 0.2);
}

.heat-cell span {
    font-size: 14px;
    color: #e9e0ff;
}

.intensity-0 { opacity: 0.3; }
.intensity-1 { opacity: 0.52; }
.intensity-2 { opacity: 0.7; }
.intensity-3 { opacity: 0.86; }
.intensity-4 { opacity: 1; }

.stacked-item {
    align-items: flex-start;
}

@media (max-width: 900px) {
    .heatmap-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .timer-actions {
        flex-direction: column;
    }

    .timer-actions .btn-glass {
        width: 100%;
    }

    .heatmap-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


.user-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 18px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    margin-left: 10px;
    margin-right: 24px;   /* двигает блок немного влево от правого края */
}

.user-name {
    color: #f5ecff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.user-logout {
    color: #ffb4b4;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.user-logout:hover {
    color: #ffd1d1;
}

.task-create-center {
    display: flex;
    justify-content: center;
    margin: 24px 0 18px;
}

.big-add-btn {
    min-width: 240px;
    font-size: 17px;
    font-weight: 700;
}

.btn-glass.success {
    border: 1px solid rgba(80, 200, 120, 0.45);
    color: #d8ffe4;
}

.btn-glass.success:hover {
    box-shadow: 0 0 18px rgba(80, 200, 120, 0.18);
}

.topbar {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center !important;
    min-height: 78px;
    padding: 0 32px !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.22);
    background: rgba(8, 8, 20, 0.95);
}

.topbar-left {
    justify-self: start;
    display: flex;
    align-items: center;
}

.topbar-center {
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 42px;
}

.topbar-center a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 14px;
    line-height: 1;
    color: #d9d4ff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
}

.topbar-center a:hover {
    color: #ffffff;
}

.topbar-right {
    justify-self: end;
    display: flex;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 14px 22px;
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.user-name {
    color: #f5ecff;
    font-weight: 800;
    font-size: 15px;
}

.user-logout {
    color: #d9d4ff;
    text-decoration: none;
    font-weight: 700;
}

.user-logout:hover {
    color: #ffb4b4;
}