@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --bg-primary: #F5F5F0;
    --bg-sidebar: #1B263B;
    --bg-card: #ffffff;
    --text-primary: #1B263B;
    --text-secondary: #5C6B7A;
    --accent: #FF6B35;
    --accent-hover: #E55A25;
    --border: #D4D4CC;
    --danger: #e01b24;
    --success: #26a269;
    --warning: #e5a50a;
    --radius: 8px;
    --sidebar-width: 230px;
}

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

/* Auth / App containers */
#auth-container {
    min-height: 100vh;
    overflow-y: auto;
    background: var(--bg-primary);
    padding: 60px 32px 32px;
}

#app-container {
    height: 100vh;
}

#app {
    display: flex;
    height: 100vh;
}

/* Sidebar — dark navy */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}

#sidebar h2 {
    padding: 4px 16px 20px;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

#sidebar ul {
    list-style: none;
    flex: 1;
}

#sidebar li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.15s;
}

#sidebar li a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

#sidebar li a.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

#sidebar li.separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 8px 16px;
}

.icon {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    display: none;
}

.badge.visible {
    display: inline-block;
}

#sidebar li a.active .badge {
    background: rgba(255, 255, 255, 0.3);
}

#sync-status {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#sync-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    transition: background 0.15s;
}

#sync-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

#sync-msg {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Main content */
#content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    max-width: 800px;
}

/* View header */
.view-header {
    margin-bottom: 24px;
}

.view-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.view-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Quick add */
.quick-add {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.quick-add input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-card);
    outline: none;
    transition: border-color 0.15s;
}

.quick-add input:focus {
    border-color: var(--accent);
}

.quick-add button {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.quick-add button:hover {
    background: var(--accent-hover);
}

/* Task list */
.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    transition: box-shadow 0.15s;
}

.task-item:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.task-title {
    flex: 1;
    font-size: 14px;
}

.task-title.done {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-meta {
    display: flex;
    gap: 6px;
    align-items: center;
}

.task-context {
    font-size: 11px;
    background: #e8e8e8;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.task-due {
    font-size: 11px;
    color: var(--warning);
    font-weight: 500;
}

.task-delegated {
    font-size: 11px;
    color: var(--accent);
    font-style: italic;
}

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

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

.btn-small {
    padding: 3px 8px;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.15s;
}

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

.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* Task edit modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(27, 38, 59, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(27, 38, 59, 0.25);
}

.modal h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-primary);
    outline: none;
}

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

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

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

.btn {
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: background 0.15s;
}

.btn:hover {
    background: var(--bg-primary);
}

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

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

/* Project view */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.project-card h3 {
    font-size: 15px;
    margin-bottom: 8px;
}

.project-card .task-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.project-card .no-next {
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
}

/* Review view */
.review-section {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.review-section h3 {
    font-size: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-count {
    font-size: 12px;
    font-weight: 600;
    background: var(--accent);
    color: white;
    padding: 1px 8px;
    border-radius: 10px;
}

.review-alert {
    background: var(--danger);
}

/* Settings */
.settings-form {
    max-width: 400px;
}

.settings-form .form-group {
    margin-bottom: 16px;
}

.status-ok {
    color: var(--success);
    font-weight: 500;
}

.status-error {
    color: var(--danger);
    font-weight: 500;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

/* Context tags in modal */
.context-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.context-tag {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    background: var(--bg-primary);
    transition: all 0.15s;
}

.context-tag.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.context-tag:hover {
    border-color: var(--accent);
}

/* Welcome / Onboarding screen */
.welcome-screen {
    max-width: 420px;
    margin: 0 auto;
    padding-top: 20px;
}

.welcome-header {
    text-align: center;
    margin-bottom: 32px;
}

.welcome-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.welcome-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.welcome-card-secondary {
    background: var(--bg-primary);
    border-style: dashed;
}

.welcome-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.welcome-step h2 {
    font-size: 16px;
    font-weight: 600;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.welcome-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.welcome-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
}

.welcome-divider span {
    position: relative;
    background: var(--bg-primary);
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Terminology toggle in settings */
.term-toggle {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.term-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.15s;
}

.term-toggle input[type="radio"] {
    width: auto;
    accent-color: var(--accent);
}

.term-toggle label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(255, 107, 53, 0.06);
}

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

.auth-tab {
    flex: 1;
    padding: 8px 4px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

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

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