* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(180deg, #f5f7ff, #e4e8f8);
    color: #1b1f2b;
    min-height: 100vh;
}

a {
    color: #0a6cf1;
    text-decoration: none;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.2;
}

.btn.primary {
    background: linear-gradient(135deg, #3f69ff, #7c3bff);
    color: #fff;
    box-shadow: 0 10px 20px rgba(63, 105, 255, 0.3);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.7);
    color: #111;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn.link {
    background: transparent;
    color: #0a6cf1;
    padding: 0.5rem;
}

.btn.small {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
}

.btn.full {
    width: 100%;
    text-align: center;
}

.sidebar {
    position: fixed;
    top: 1rem;
    left: 1rem;
    bottom: 1rem;
    width: 250px;
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.sidebar-inner {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
    border-radius: 24px;
    background: rgba(11, 18, 38, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px rgba(10, 16, 30, 0.35);
    backdrop-filter: blur(18px);
}

.sidebar-logo {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.85;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
    color: #d7def4;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.sidebar-link .icon {
    font-size: 1.2rem;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.12));
    color: #131a2e;
    box-shadow: 0 10px 25px rgba(15, 18, 34, 0.35);
    transform: translateX(4px);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.user-chip {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.user-chip .avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f86ff, #6b5bff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.container {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 10, 20, 0.55);
    z-index: 15;
    display: none;
}

.sidebar-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 14px;
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
    display: none;
    z-index: 30;
    box-shadow: 0 10px 20px rgba(34, 42, 70, 0.15);
}

.container.with-sidebar {
    margin-left: 310px;
    padding: 1.5rem 2rem;
}

.card {
    background: rgba(255, 255, 255, 0.85);
    padding: 1.5rem;
    border-radius: 18px;
    margin-bottom: 1.5rem;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
}

.stat strong {
    font-size: 2rem;
    display: block;
    margin-top: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.6rem;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

tr.danger td {
    background: #ffecec;
}

.table-responsive table {
    min-width: 600px;
}

form label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 0.3rem;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert.success {
    background: #e7f6ed;
    color: #1c7c3e;
}

.alert.error {
    background: #fdecea;
    color: #c03a2b;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.text-muted {
    color: #6f7785;
    margin: 0;
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
}

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #889;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #0d1b2a, #1b263b);
}

.login-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    width: 320px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-card h1 {
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.floating-add {
    position: fixed;
    left: 280px;
    bottom: 1.5rem;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #4c6ef5, #8c4fff);
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 15px 30px rgba(58, 60, 125, 0.3);
    z-index: 50;
    cursor: pointer;
}

.floating-add span {
    position: relative;
    top: -5px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 100;
}

.modal.open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    margin: 4% auto;
    background: #fff;
    width: min(420px, 90vw);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: pop 0.25s ease;
}

.modal.large .modal-content {
    width: min(620px, 95vw);
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.optional-fields {
    margin-top: 1rem;
}

.two-col {
    display: flex;
    gap: 1rem;
}

.two-col > div {
    flex: 1;
}

.quick-task-feedback {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #1c7c3e;
}

.quick-task-feedback.error {
    color: #c03a2b;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

body.modal-open {
    overflow: hidden;
}

@keyframes pop {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.task-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.task-stat-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #555;
}

.task-stat-chips span {
    background: #eef2ff;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.task-column {
    background: #f2f4f8;
    border-radius: 10px;
    padding: 0.8rem;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.task-dropzone {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.task-card {
    background: #fff;
    border-radius: 10px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    cursor: grab;
}

.task-card.dragging {
    opacity: 0.5;
}

.task-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.task-card h3 {
    margin: 0;
    font-size: 1rem;
}

.task-card p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #444;
}

.task-card footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
}

.task-card .badge {
    background: #eef2ff;
    color: #2536a7;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.task-card.priority-high {
    border-left: 4px solid #f2695c;
}

.task-card.priority-normal {
    border-left: 4px solid #2d9cdb;
}

.task-card.priority-low {
    border-left: 4px solid #6fcf97;
}

.task-card.overdue {
    background: #fff3f1;
}

@media (max-width: 700px) {
    .sidebar {
        display: none;
        width: min(82vw, 320px);
        top: 0.5rem;
        left: 0.5rem;
        bottom: 0.5rem;
    }
    body.sidebar-open .sidebar {
        display: flex;
    }
    .sidebar-toggle {
        display: block;
    }
    body.sidebar-open .sidebar-toggle {
        background: rgba(9, 12, 24, 0.85);
        color: #fff;
    }
    .sidebar-overlay {
        display: none;
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
    .container.with-sidebar {
        margin-left: 0;
        padding: 1.5rem 1rem;
    }
    .inline-form,
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    .floating-add {
        left: 1rem;
        bottom: 1rem;
    }
    .two-col {
        flex-direction: column;
    }
    .modal-content {
        margin: 10% auto;
    }
    .table-responsive table {
        min-width: 500px;
    }
}
