:root {
    --primary-color: #1a6b36;
    --primary-dark: #124d26;
    --bg-gradient: linear-gradient(90deg, #1a6b36 0%, #207d41 40%, #2b4e91 100%);
    --sidebar-width: 260px;
    --text-dark: #2d3748;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

html, body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-dark);
    transition: padding-left 0.3s ease;
}

input::-ms-reveal, input::-ms-clear {
    display: none !important;
}

.swal2-container {
    z-index: 10000 !important;
}

#sidebarOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
    backdrop-filter: blur(2px);
}

    #sidebarOverlay.active {
        display: block;
    }

.sidebar {
    position: fixed;
    top: 0;
    left: calc(var(--sidebar-width) * -1);
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: white;
    z-index: 2000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

    .sidebar.open {
        left: 0;
    }

.sidebar-header {
    background: var(--bg-gradient);
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding-top: max(20px, env(safe-area-inset-top));
}

    .sidebar-header h2 {
        margin: 0;
        font-size: 1.4rem;
        font-weight: 600;
    }

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding-top: 10px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
    flex-shrink: 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.sidebar-section-title {
    padding: 15px 20px 5px;
    font-size: 12px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.board-list {
    list-style: none;
    padding: 0;
}

.board-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #4a5568;
    font-weight: 500;
}

    .board-item:hover, .board-item.active {
        background: #e6f2ff;
        color: var(--primary-color);
        border-right: 3px solid var(--primary-color);
    }

.close-sidebar-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.8;
}

    .close-sidebar-btn:hover {
        opacity: 1;
    }

@media (min-width: 769px) {
    body.sidebar-open {
        padding-left: var(--sidebar-width);
    }

    .menu-toggle {
        display: block;
    }

    body.sidebar-open .menu-toggle {
        display: none;
    }
}

.container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
}

.board-actions-btn {
    padding: 10px;
}

.menu-toggle {
    position: fixed;
    left: 20px;
    top: 20px;
    background: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 1500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 20px;
    top: max(20px, env(safe-area-inset-top));
}

.kanban-card-placeholder {
    background-color: #edf2f7 !important;
    border: 2px dashed #4299e1 !important;
    box-shadow: none !important;
    opacity: 0.7 !important;
    color: transparent !important;
}

    .kanban-card-placeholder * {
        opacity: 0 !important;
    }

.header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    flex-shrink: 0;
}

#kanflowheader {
    margin: 0 60px 20px 60px;
    flex-shrink: 0;
}

.board {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex: 1;
    min-height: 0;
    height: 100%;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 20px;
    margin-bottom: 0;
}

    .board::-webkit-scrollbar {
        height: 10px;
    }

    .board::-webkit-scrollbar-track {
        background: rgba(0,0,0,0.1);
        border-radius: 10px;
        margin: 0 20px;
    }

    .board::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.7);
        border-radius: 10px;
        border: 2px solid transparent;
        background-clip: content-box;
    }

        .board::-webkit-scrollbar-thumb:hover {
            background: rgba(255,255,255,0.9);
        }

.column {
    background: #f8f9fa;
    border-radius: 12px;
    min-width: 300px;
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.column-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.cards-container {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

    .cards-container::-webkit-scrollbar {
        width: 6px;
    }

    .cards-container::-webkit-scrollbar-thumb {
        background-color: #cbd5e0;
        border-radius: 4px;
    }

.card {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: grab;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
    flex-shrink: 0;
}

.card-desc-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
    font-size: 13px;
    color: #4a5568;
}

.card-footer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f7fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.card-avatar-empty {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #a0aec0;
    border: 1px dashed #cbd5e0;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

    .modal.active {
        display: flex;
    }

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    max-height: 90vh;
    overflow-y: auto;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
    }

    .form-group input {
        width: 100%;
        padding: 12px;
        border: 2px solid var(--border-color);
        border-radius: 8px;
        font-size: 16px;
    }

        .form-group input:focus {
            border-color: var(--primary-color);
            outline: none;
        }

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    color: white;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.otp-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.otp-field {
    width: 45px !important;
    height: 55px !important;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
}

    .otp-field:focus {
        border-color: var(--primary-color);
        transform: translateY(-2px);
    }

.locked-card {
    cursor: not-allowed !important;
    opacity: 0.7;
}

    .locked-card:hover {
        box-shadow: none !important;
        border: 1px solid #ccc;
    }

.card-date {
    font-size: 11px;
    color: #666;
}

.btn {
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.add-board-btn {
    width: 100%;
    padding: 15px;
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    color: #718096;
    cursor: pointer;
    margin: 10px 0;
}

    .add-board-btn:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
        background: #ebf4ff;
    }

.toggle-password {
    position: absolute;
    right: 10px;
    top: 34px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

.column-title {
    font-weight: bold;
    font-size: 18px;
}

.quick-note-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fcd34d;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 2900;
    transition: transform 0.2s;
}

    .quick-note-toggle:hover {
        transform: scale(1.1);
    }

.quick-note-wrapper {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 300px;
    height: 350px;
    background: #fffbeb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 2900;
    display: none;
    flex-direction: column;
    border: 1px solid #fcd34d;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

    .quick-note-wrapper.active {
        display: flex;
    }

.quick-note-header {
    padding: 10px 15px;
    background: #fcd34d;
    font-weight: bold;
    color: #4b5563;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

#quickNoteArea {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    padding: 0 15px;
    background-color: transparent;
    background-image: linear-gradient(#999 1px, transparent 1px);
    background-size: 100% 30px;
    line-height: 30px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    color: #374151;
    outline: none;
    margin-top: 10px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #e53e3e;
    border: 2px solid white;
    border-radius: 50%;
    display: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

    .notification-badge.pulse {
        animation: pulse-red 2s infinite;
    }

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(229, 62, 62, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0);
    }
}

#kanflowheadertitle {
    gap: 6px;
}

.board-actions .btn {
    padding: 10px 15px;
    font-size: 1.2rem;
}

@media screen and (max-width: 768px) {
    body.sidebar-open {
        padding-left: 0 !important;
        overflow: hidden;
    }

    .container {
        width: 100%;
        padding: 15px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        height: 100dvh;
        overflow: hidden;
    }

    .quick-note-toggle {
        bottom: 10px;
        right: 10px;
    }

    .sidebar {
        left: -100%;
        width: 85%;
        max-width: 320px;
        box-shadow: 5px 0 25px rgba(0,0,0,0.3);
    }

        .sidebar.open {
            left: 0;
        }

    .header {
        align-items: center;
        padding: 10px;
        gap: 5px;
    }

    #kanflowheadertitle {
        gap: 2px;
    }

    .board-actions .btn {
        padding: 10px;
        font-size: 1rem;
    }

    .column-title {
        font-weight: bold;
        font-size: 15px;
    }

    .header h1 {
        font-size: 20px;
    }

    #kanflowheader {
        margin: 0px 0px 20px 50px;
    }

    .menu-toggle {
        left: 10px;
        right: 10px;
    }

    .board {
        flex: 1;
        height: auto;
        gap: 10px;
        margin-bottom: 20px;
    }

    .column {
        min-width: 70vw;
        max-width: 70vw;
        max-height: 100%;
    }

    .board.is-dragging {
        scroll-snap-type: none !important;
        overflow-x: auto !important;
        scroll-behavior: auto !important;
    }
}
