* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f1f5f9;
}

/* PIN overlay */
.pin-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.pin-card {
    background: white;
    padding: 2rem;
    border-radius: 2rem;
    text-align: center;
    width: 320px;
}
.pin-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.pin-icon i { font-size: 28px; color: white; }
.pin-card h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.pin-card p { color: #64748b; font-size: 0.85rem; margin-bottom: 1.5rem; }
.pin-card input {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    margin-bottom: 1.2rem;
}
.pin-buttons { display: flex; gap: 0.8rem; }
.pin-buttons button {
    flex: 1;
    padding: 0.7rem;
    border: none;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
}
#unlockBtn { background: #3b82f6; color: white; }
.error-text { color: #ef4444; font-size: 0.75rem; margin-top: 0.8rem; }

/* Main app */
.app {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
}

/* Top bar */
.top-bar {
    background: white;
    border-radius: 1.5rem;
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.2rem;
}
.logo-area i { color: #3b82f6; font-size: 1.4rem; }
.team-badge {
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-weight: 500;
}
.user-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.sync-indicator { font-size: 0.75rem; color: #475569; }
.member-name {
    padding: 0.4rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    font-size: 0.8rem;
    background: #f8fafc;
}
.lock-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #64748b;
}

/* Stats row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}
.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.stat-card.active {
    background: #eef2ff;
    border-left: 3px solid #3b82f6;
}
.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
}
.stat-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.2rem;
}

/* Add task panel */
.add-task-panel {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.add-task-panel input[type="text"] {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.8rem;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}
.add-options {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.add-options select, .add-options input {
    padding: 0.5rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    background: white;
    font-size: 0.8rem;
}
#addTaskBtn {
    background: #3b82f6;
    border: none;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Action bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.2rem;
}
.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 280px;
}
.search-wrapper i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.8rem;
}
.search-wrapper input {
    width: 100%;
    padding: 0.5rem 0.8rem 0.5rem 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    background: white;
    font-size: 0.8rem;
}
.view-toggle button {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 0.4rem;
}
.view-toggle button.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Kanban board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.column {
    background: white;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 280px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.column-head {
    padding: 0.8rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    border-radius: 1rem 1rem 0 0;
}
.column-head h3 {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.column-head .badge {
    background: #e2e8f0;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
}
.task-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem;
    min-height: 280px;
}
/* Custom scroll */
.task-list::-webkit-scrollbar { width: 4px; }
.task-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.task-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Task card - compact */
.task-card {
    background: white;
    border: 1px solid #eef2ff;
    border-radius: 0.8rem;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: 0.1s;
}
.task-card:hover {
    background: #fefce8;
    border-color: #facc15;
}
.task-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 0.4rem;
    word-break: break-word;
}
.task-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.65rem;
}
.priority {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.priority.high { color: #dc2626; font-weight: 600; }
.priority.medium { color: #f59e0b; }
.priority.low { color: #10b981; }
.due {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: #475569;
}
.due.overdue { color: #dc2626; font-weight: 500; }
.task-meta .assignee {
    color: #6b7280;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.delete-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.7rem;
}
.delete-btn:hover { color: #ef4444; }

/* List view */
.list-view {
    background: white;
    border-radius: 1rem;
    overflow-x: auto;
}
.list-header {
    display: grid;
    grid-template-columns: 3fr 0.7fr 0.9fr 1fr 1fr 0.6fr;
    background: #f8fafc;
    padding: 0.7rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}
.list-row {
    display: grid;
    grid-template-columns: 3fr 0.7fr 0.9fr 1fr 1fr 0.6fr;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.75rem;
    align-items: center;
    cursor: pointer;
}
.list-row:hover { background: #faf5ff; }
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.65rem;
    font-weight: 500;
}
.status-todo { background: #dbeafe; color: #2563eb; }
.status-wip { background: #fed7aa; color: #c2410c; }
.status-hold { background: #e2e8f0; color: #475569; }
.status-done { background: #d1fae5; color: #059669; }
.list-actions {
    display: flex;
    gap: 0.4rem;
}
.list-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    color: #64748b;
}
.load-more {
    text-align: center;
    padding: 0.8rem;
    background: #f8fafc;
    cursor: pointer;
    color: #3b82f6;
    font-weight: 500;
    font-size: 0.75rem;
}
.footer-hint {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.65rem;
    color: #94a3b8;
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 900px) {
    .kanban-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .kanban-board { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .list-header, .list-row { grid-template-columns: 2fr 0.5fr 0.7fr 0.9fr 0.9fr 0.5fr; font-size: 0.65rem; }
}