:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2128;
    --border-color: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-yellow: #d29922;
    --accent-red: #f85149;
    --accent-purple: #a371f7;
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.35);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* Auth Gate */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1f2e 100%);
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    max-width: 380px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    font-size: 48px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(88, 166, 255, 0.3));
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#auth-form input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 16px;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#auth-form input[type="email"] {
    text-align: left;
}

#auth-form input[type="password"] {
    text-align: center;
    letter-spacing: 2px;
}

#auth-form input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

#auth-form button {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

#auth-form button:hover {
    background: #4c9aed;
}

#auth-form button:active {
    transform: scale(0.98);
}

.error-text {
    color: var(--accent-red);
    font-size: 13px;
    margin-top: 8px;
    min-height: 20px;
}

/* Dashboard */
.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left .logo {
    font-size: 28px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.syncing {
    background: var(--accent-yellow);
    animation: pulse 0.8s infinite;
}

.status-indicator.offline {
    background: var(--accent-red);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#sync-status {
    font-size: 13px;
    color: var(--text-secondary);
}

#sync-status.syncing {
    color: var(--accent-yellow);
}

#sync-status.offline {
    color: var(--accent-red);
}
}

.icon-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Quick Add */
.quick-add-section {
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.quick-add-form {
    display: flex;
    gap: 12px;
    max-width: 800px;
}

.quick-add-form input[type="text"] {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.quick-add-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.quick-add-form select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    min-width: 120px;
}

.quick-add-form button {
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.quick-add-form button:hover {
    background: #2ea043;
}

/* Kanban Board */
.main-content {
    flex: 1;
    overflow-x: auto;
}

.kanban-board {
    display: flex;
    gap: 16px;
    padding: 24px;
    min-height: calc(100vh - 200px);
}

.kanban-column {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
}

.column-done {
    opacity: 0.7;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.column-icon {
    font-size: 18px;
}

.column-header h2 {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.task-count {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
}

.task-list {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Task Card */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.task-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.task-card.completed {
    opacity: 0.6;
}

.task-card.completed .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-text {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.task-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.task-owner {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

.task-owner.igor { color: var(--accent-blue); }
.task-owner.argo { color: var(--accent-purple); }
.task-owner.architect { color: #f0883e; }
.task-owner.developer { color: var(--accent-green); }
.task-owner.researcher { color: var(--accent-yellow); }

.task-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-card:hover .task-actions {
    opacity: 1;
}

.task-action-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.task-action-btn:hover {
    background: var(--bg-tertiary);
}

/* Footer */
.footer {
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.footer strong {
    color: var(--accent-purple);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.command-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.command-box code {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: var(--accent-green);
    word-break: break-all;
    line-height: 1.5;
}

.copy-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--border-color);
}

.copy-btn.copied {
    background: var(--accent-green);
    color: white;
}

.modal-hint {
    margin-top: 16px;
    margin-bottom: 8px !important;
}

.telegram-btn {
    display: block;
    background: var(--accent-blue);
    color: white !important;
    text-align: center;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.telegram-btn:hover {
    background: #4c9aed;
}

.modal-content.modal-large {
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #4c9aed;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--border-color);
}

.task-card {
    position: relative;
}

.task-card.has-details::after {
    content: '📝';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    opacity: 0.6;
}

.spawn-btn {
    color: var(--accent-green) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .kanban-board {
        flex-direction: column;
        padding: 16px;
    }
    
    .kanban-column {
        max-width: none;
        min-width: auto;
    }
    
    .quick-add-form {
        flex-direction: column;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .header-left h1 {
        display: none;
    }
}
