:root {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666;
    --border: #e0e0e0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --error: #dc2626;
    --tag-computer: #3b82f6;
    --tag-office: #8b5cf6;
    --tag-errands: #f59e0b;
    --tag-calls: #10b981;
    --tag-home: #ec4899;
    --tag-anywhere: #6b7280;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.header-actions {
    display: flex;
    gap: 8px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.capture-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.capture-box textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.capture-box textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.capture-box .actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-success { background: var(--success); color: white; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab:hover { color: var(--text); }

.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filters select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--surface);
}

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

.context-group h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.tag-computer  { background: var(--tag-computer); }
.tag-office    { background: var(--tag-office); }
.tag-errands   { background: var(--tag-errands); }
.tag-calls     { background: var(--tag-calls); }
.tag-home      { background: var(--tag-home); }
.tag-anywhere  { background: var(--tag-anywhere); }

.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

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

.task-card input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.task-content { flex: 1; }

.task-title {
    font-size: 14px;
    font-weight: 500;
}

.task-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.task-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.inbox-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.inbox-text {
    font-size: 14px;
    margin-bottom: 6px;
}

.inbox-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    align-items: center;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending    { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-done       { background: #dcfce7; color: #166534; }
.status-error      { background: #fee2e2; color: #991b1b; }

.edit-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.edit-form {
    background: var(--surface);
    border-radius: 8px;
    padding: 24px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-form h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.field {
    margin-bottom: 12px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.field input, .field select, .field textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.search-input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--surface);
    flex: 1;
    min-width: 140px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.task-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.task-due-soon {
    color: var(--warning);
    font-weight: 600;
}

.task-overdue {
    color: var(--error);
    font-weight: 600;
}

.empty {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 14px;
}

.capture-status {
    font-size: 13px;
    margin-right: 8px;
}

.capture-status.success { color: var(--success); }
.capture-status.error { color: var(--error); }

@media (max-width: 640px) {
    .container { padding: 12px; }
    .header { padding: 10px 12px; }
    .header h1 { font-size: 15px; }
    .header-actions { gap: 4px; }
    .filters { flex-direction: column; }
}
