:root {
    /* Ink and Stone palette */
    --color-bg: #f5f3f0;
    --color-surface: #ffffff;
    --color-border: #e5e2dd;
    --color-text: #1c1917;
    --color-text-muted: #78716c;
    --color-text-light: #a8a29e;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-light: #eef2ff;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;

    --color-backlog: #78716c;
    --color-in_progress: #ea580c;
    --color-review: #7c3aed;
    --color-done: #059669;

    --font-heading: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

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

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body.panel-open {
    overflow: hidden;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    font-family: var(--font-heading);
}

.text-muted {
    color: var(--color-text-muted);
}

/* Nav */
.nav {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 24px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--color-text);
    letter-spacing: -0.3px;
}

.nav-logo:hover {
    text-decoration: none;
}

.nav-sep {
    color: var(--color-border);
    font-size: 16px;
    font-weight: 300;
    margin: 0 14px;
    user-select: none;
}

.nav-links {
    display: flex;
    gap: 2px;
    align-items: center;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    position: relative;
}

.nav-link:hover {
    color: var(--color-text);
    background: var(--color-bg);
    text-decoration: none;
}

.nav-link--active {
    color: var(--color-text);
}

.nav-link--active::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

.nav-kbd {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-light);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0px 4px;
    line-height: 16px;
    vertical-align: middle;
    opacity: 0.6;
    transition: opacity 0.2s;
}

body.show-hints .nav-kbd {
    opacity: 1;
}

.nav-kbd--on-primary {
    color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-new-btn {
    gap: 6px;
}

.nav-new-btn .nav-kbd {
    opacity: 0.6;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.15s;
}

.btn:hover {
    background: var(--color-bg);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

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

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

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

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

.btn-ghost {
    border: none;
    background: none;
    color: var(--color-text-muted);
}

.btn-ghost:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

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

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    display: block;
    color: inherit;
    transition: transform 0.15s;
}

.project-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.project-card .shortcode {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.project-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.project-card .counts {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.project-card .counts span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-card .counts .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Board */
.board-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.board-header h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.board-shortcode {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.board-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px;
    color: var(--color-text-muted);
}

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

.board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: start;
}

.column {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 200px;
    transition: border-color 0.2s, opacity 0.2s, box-shadow 0.2s;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-title .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.column-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-light);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 99px;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.column-body {
    padding: 10px;
}

/* Task Card */
.task-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 6px;
    transition: box-shadow 0.15s, border-color 0.15s;
    color: inherit;
    border-left: 3px solid var(--color-backlog);
    cursor: pointer;
}

.task-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--color-text-light);
    text-decoration: none;
}

.task-card.state-in_progress { border-left-color: var(--color-in_progress); }
.task-card.state-review { border-left-color: var(--color-review); }
.task-card.state-done { border-left-color: var(--color-done); opacity: 0.75; }
.task-card.state-done:hover { opacity: 1; }

.task-card[draggable="true"] {
    cursor: grab;
}

.task-card[draggable="true"]:active {
    cursor: grabbing;
}

.task-card .task-id {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.task-card .task-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.task-card .task-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.task-card .assignee {
    display: flex;
    align-items: center;
    gap: 4px;
}

.avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

/* Drag States */
.task-card.dragging {
    opacity: 0.3;
}

.column.drop-target {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.column.drop-target .column-header {
    background: var(--color-primary-light);
}

.column.drop-invalid {
    opacity: 0.35;
}

/* Quick Add */
.quick-add {
    margin-top: 2px;
}

.quick-add-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--color-text-light);
    background: none;
    border: 1px dashed transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: color 0.15s, background 0.15s;
}

.quick-add-trigger svg {
    flex-shrink: 0;
}

.quick-add-trigger:hover {
    color: var(--color-primary);
    background: var(--color-bg);
}

.quick-add-form {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px;
}

.quick-add-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    margin-bottom: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.quick-add-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.quick-add-actions {
    display: flex;
    gap: 6px;
}

/* Task Detail */
.task-detail {
    max-width: 720px;
}

.task-detail-header {
    margin-bottom: 16px;
}

.task-detail-header .task-id {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.task-detail-header h1 {
    font-size: 22px;
    font-weight: 600;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.detail-meta-sep {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    margin: 0 4px;
}

.detail-assignee {
    position: relative;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.detail-section-header h3 {
    margin-bottom: 0;
}

.detail-section .description {
    color: var(--color-text);
    line-height: 1.7;
    white-space: pre-wrap;
}

.detail-section .description:empty::before {
    content: 'No description';
    color: var(--color-text-light);
    font-style: italic;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* State Badge */
.state-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 99px;
}

.state-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.state-badge-backlog { background: #f5f5f4; color: #57534e; }
.state-badge-backlog .dot { background: var(--color-backlog); }
.state-badge-in_progress { background: #fff7ed; color: #9a3412; }
.state-badge-in_progress .dot { background: var(--color-in_progress); }
.state-badge-review { background: #f5f3ff; color: #6d28d9; }
.state-badge-review .dot { background: var(--color-review); }
.state-badge-done { background: #ecfdf5; color: #065f46; }
.state-badge-done .dot { background: var(--color-done); }

/* Transitions */
.transition-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Timeline */
.timeline {
    margin-top: 24px;
}

.timeline h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-time {
    color: var(--color-text-light);
    font-size: 12px;
    white-space: nowrap;
    min-width: 120px;
}

/* Work Logs */
.worklog-section {
    margin-top: 32px;
}

.worklog-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.worklog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.worklog-table th {
    text-align: left;
    padding: 8px;
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
}

.worklog-table td {
    padding: 8px;
    border-bottom: 1px solid var(--color-border);
}

.worklog-total {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.worklog-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.worklog-form .form-group {
    margin-bottom: 10px;
}

.worklog-form .form-group:last-of-type {
    margin-bottom: 12px;
}

.worklog-form .form-group label {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 3px;
}

.worklog-form .form-row {
    display: flex;
    gap: 10px;
}

.worklog-form .form-row .form-group {
    flex: 1;
}

.worklog-form input[type="number"] {
    width: 100%;
}

.worklog-form input[type="date"] {
    width: 100%;
}

/* Users page */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info .name {
    font-weight: 500;
}

.user-info .email {
    color: var(--color-text-muted);
    font-size: 13px;
}

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

.empty-state p {
    margin-bottom: 12px;
}

/* Flash messages */
.flash {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
}

.flash-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ========== Task Detail Panel ========== */

.panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(28, 25, 23, 0.25);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 460px;
    max-width: 100vw;
    z-index: 101;
    background: var(--color-surface);
    box-shadow: -8px 0 32px rgba(0,0,0,0.10);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.panel.active {
    transform: translateX(0);
}

.panel.expanded {
    width: 680px;
}

/* Top bar: task ID + close */
.panel-identity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 10px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    flex-shrink: 0;
}

.panel-task-id {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.panel-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}

.panel-close:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.panel-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 13px;
}

/* Scrollable body */
.panel-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Title */
.panel-hero {
    padding: 20px 20px 12px;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.2px;
    color: var(--color-text);
    margin: 0;
}

/* State picker */
.panel-state-row {
    padding: 0 20px 16px;
}

.panel-state-picker {
    position: relative;
    display: inline-block;
}

.state-badge--interactive {
    cursor: pointer;
    transition: box-shadow 0.15s, opacity 0.15s;
    gap: 6px;
}

.state-badge--interactive:hover {
    box-shadow: 0 0 0 2px var(--color-border);
}

.state-badge-chevron {
    opacity: 0.5;
    margin-left: 2px;
}

.panel-dropdown-item .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.panel-dropdown-empty {
    display: block;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--color-text-light);
}

/* Zone 3: Content — description */
.panel-content-area {
    padding: 0 20px 16px;
}

.panel-desc {
    display: block;
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text);
    white-space: pre-wrap;
    text-align: left;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    min-height: 40px;
    background: var(--color-bg);
    border: 1px solid transparent;
    transition: border-color 0.15s;
}

.panel-desc:hover {
    border-color: var(--color-border);
}

.panel-desc-empty {
    color: var(--color-text-light);
    font-style: italic;
}

.panel-desc-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    line-height: 1.65;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    resize: vertical;
    min-height: 100px;
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.panel-desc-input:focus {
    outline: none;
}

.panel-desc-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* Zone 4: Utilities — assignee + time strips */
.panel-utils {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.panel-util-row {
    display: flex;
    flex-direction: column;
}

.panel-assignee {
    position: relative;
}

.panel-util-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-family: var(--font-sans);
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text);
    transition: background 0.12s;
}

.panel-util-btn:hover {
    background: var(--color-bg);
}

.panel-util-btn-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.panel-util-btn-inner--muted {
    color: var(--color-text-muted);
    font-weight: 400;
}

.panel-util-btn-inner--active {
    color: var(--color-primary);
}

.panel-time-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-time-total {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding-right: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.panel-entries-toggle {
    font-size: 12px;
    font-weight: 400;
    font-family: var(--font-sans);
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.12s;
}

.panel-entries-toggle:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* Panel work log form */
.panel-wl-form {
    margin: 8px 0 4px;
    padding: 14px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.panel-wl-form .form-group {
    margin-bottom: 10px;
}

.panel-wl-form .form-group:last-of-type {
    margin-bottom: 12px;
}

.panel-wl-form .form-group label {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 3px;
}

.panel-wl-form .form-row {
    display: flex;
    gap: 10px;
}

.panel-wl-form .form-row .form-group {
    flex: 1;
}

.panel-wl-form input[type="number"] {
    width: 100%;
}

.panel-wl-form input[type="date"] {
    width: 100%;
}

.panel-wl-form input[type="text"] {
    width: 100%;
}

/* Compact worklog table for panel */
.worklog-table--compact {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 6px 0 4px;
}

.worklog-table--compact th {
    text-align: left;
    padding: 5px 8px;
    font-weight: 500;
    color: var(--color-text-light);
    border-bottom: 1px solid var(--color-border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.worklog-table--compact td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.worklog-table--compact tr:last-child td {
    border-bottom: none;
}

/* Dropdown (shared panel + detail page) */
.panel-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 4px;
    z-index: 10;
}

.panel-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    font-family: var(--font-sans);
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text);
    transition: background 0.1s;
}

.panel-dropdown-item:hover {
    background: var(--color-bg);
}

/* Zone 5: Footer */
.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    margin-top: auto;
    flex-shrink: 0;
}

.panel-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.12s, background 0.12s;
}

.panel-footer-link:hover {
    color: var(--color-primary);
    background: var(--color-surface);
}

.panel-footer-link--danger {
    color: var(--color-text-light);
}

.panel-footer-link--danger:hover {
    color: var(--color-danger);
    background: #fef2f2;
}

/* Expanded panel section transitions */
.panel-expand-enter {
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.panel-expand-enter-start {
    opacity: 0;
    transform: translateY(8px);
}
.panel-expand-enter-end {
    opacity: 1;
    transform: translateY(0);
}
.panel-expand-leave {
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.panel-expand-leave-start {
    opacity: 1;
    transform: translateY(0);
}
.panel-expand-leave-end {
    opacity: 0;
    transform: translateY(4px);
}

/* Staggered delays for enter */
.panel-expand-delay-1 {
    transition-delay: 60ms;
}
.panel-expand-delay-2 {
    transition-delay: 120ms;
}

/* Expanded panel sections */
.panel-expanded-section {
    padding: 0 20px 16px;
}

.panel-section-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 -20px 12px;
    padding: 8px 20px;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.panel-section-bar svg {
    flex-shrink: 0;
}

.panel-section-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0;
}

.panel-section-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-light);
}

.worklog-table--panel {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.worklog-table--panel th {
    text-align: left;
    padding: 6px 8px;
    font-weight: 500;
    color: var(--color-text-light);
    border-bottom: 1px solid var(--color-border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.worklog-table--panel td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--color-border);
}

.worklog-table--panel tr:last-child td {
    border-bottom: none;
}

.panel-timeline-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
}

.panel-timeline-item:last-child {
    border-bottom: none;
}

.panel-timeline-time {
    color: var(--color-text-light);
    font-size: 12px;
    white-space: nowrap;
    min-width: 90px;
}

.panel-timeline-states {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.panel-timeline-arrow {
    color: var(--color-text-light);
    flex-shrink: 0;
}

.panel-created {
    font-size: 12px;
}

/* Footer shortcut hint */
.panel-shortcut-hint {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    font-family: var(--font-sans);
    color: var(--color-text-light);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 500;
    vertical-align: middle;
}

/* Size variants */
.avatar--sm {
    width: 18px;
    height: 18px;
    font-size: 9px;
}

/* Settings */
.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
}

.settings-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: background 0.15s, color 0.15s;
}

.settings-back:hover {
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
}

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

.settings-project-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

/* Section card */
.settings-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.settings-section-icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.settings-section-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.1px;
}

.settings-section-body {
    padding: 20px;
}

.settings-section-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.settings-section--danger .settings-section-header {
    background: #fef2f2;
    border-bottom-color: #fecaca;
}

.settings-section--danger .settings-section-icon {
    color: var(--color-danger);
}

.settings-section--danger {
    border-color: #fecaca;
}

/* Form hint */
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.input--readonly {
    background: var(--color-bg);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* Export fields */
.export-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.export-date-range {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.export-date-range .form-group {
    flex: 1;
    margin-bottom: 0;
}

.export-date-sep {
    color: var(--color-text-light);
    padding-bottom: 9px;
    font-size: 16px;
    flex-shrink: 0;
}

/* Users section (outside form-group to avoid label override) */
.export-users-section {
    margin-top: 2px;
}

.export-users-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}

.export-users-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
}

.export-toggle-link {
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.12s;
}

.export-toggle-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* User chips grid */
.export-user-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.export-user-chip {
    display: inline-flex;
    align-items: center;
    flex-direction: row;
    gap: 6px;
    height: 34px;
    padding: 0 12px 0 4px;
    border: 1px solid var(--color-border);
    border-radius: 99px;
    background: var(--color-surface);
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--color-text);
    user-select: none;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.export-user-chip:hover {
    border-color: var(--color-text-light);
    background: var(--color-bg);
}

.export-user-chip--active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.export-user-chip--active:hover {
    border-color: var(--color-primary-hover);
    background: #dbeafe;
}

.export-user-chip-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-bg);
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.export-user-chip--active .export-user-chip-avatar {
    background: var(--color-primary);
    color: #fff;
}

.export-user-chip-name {
    font-weight: 500;
    line-height: 1;
}

.export-user-chip-check {
    color: var(--color-primary);
    flex-shrink: 0;
}

.export-user-count {
    font-size: 12px;
    margin-top: 10px;
}

.export-empty-users {
    padding: 20px;
    text-align: center;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--color-text-muted);
}

.export-empty-users p {
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 900px) {
    .board {
        grid-template-columns: 1fr;
    }

    .panel {
        width: 100vw;
    }

    .panel.expanded {
        width: 100vw;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 16px;
    }

    .nav {
        padding: 0 16px;
    }

    .export-date-range {
        flex-direction: column;
    }

    .export-date-sep {
        display: none;
    }

    .settings-layout {
        max-width: 100%;
    }
}

/* View transitions */
.view-enter { transition: opacity 0.15s ease; }
.view-enter-start { opacity: 0; }
.view-enter-end { opacity: 1; }
.view-leave { transition: opacity 0.1s ease; }
.view-leave-start { opacity: 1; }
.view-leave-end { opacity: 0; }
