/* Focus list (modules/next, PLAN41): tray, Focus page, day control on Next rows. */

/* ---------- Next page layout: rows left, tray right ---------- */
/* #view-area has p-6 (24px); the layout fills it edge to edge and scrolls inside. */
.next-focus-layout { display: flex; margin: -24px; height: calc(100% + 48px); min-height: 0; }
.next-focus-layout-main { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: 8px 0 24px; }

/* ---------- All / Focus toggle ---------- */
.next-focus-mode-toggle { display: inline-flex; padding: 4px; background: #f1f5f9; border-radius: 8px; align-items: center; }
.next-focus-mode-button {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 6px;
    font-size: 14px; color: #475569; background: none; border: none; cursor: pointer;
}
.next-focus-mode-button:hover { color: #0f172a; }
.next-focus-mode-button.is-active { background: #fff; color: #0f172a; font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.next-focus-mode-count {
    font-size: 10.5px; background: #4f46e5; color: #fff; border-radius: 9999px; padding: 0 6px; min-width: 18px; text-align: center;
}

.next-focus-toolbar-button {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; cursor: pointer;
    border: 1px solid #e2e8f0; background: #fff; font-size: 13px; color: #334155;
}
.next-focus-toolbar-button:hover { border-color: #cbd5e1; background: #f8fafc; }
.next-focus-toolbar-button.is-ghost { border-color: transparent; background: none; }
.next-focus-toolbar-button.is-primary { background: #4f46e5; border-color: #4f46e5; color: #fff; font-weight: 600; }
.next-focus-toolbar-button.is-primary:hover { background: #4338ca; border-color: #4338ca; }

.next-focus-icon-button {
    width: 26px; height: 26px; border-radius: 6px; border: none; background: none; cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 16px;
}
.next-focus-icon-button:hover { background: #f1f5f9; color: #334155; }

/* ---------- Day control: −1d | chip | +1d, dot day bar below ---------- */
.next-focus-expiry { display: inline-flex; flex-direction: column; align-items: stretch; gap: 3px; flex-shrink: 0; }
.next-focus-expiry-buttons { display: inline-flex; align-items: center; }
.next-focus-expiry-buttons button {
    height: 24px; border: 1px solid #e2e8f0; background: #fff; font-size: 11.5px; cursor: pointer; padding: 0 7px; white-space: nowrap;
}
.next-focus-expiry-buttons button + button { border-left: none; }
.next-focus-expiry-buttons button { color: #64748b; font-weight: 400; }
.next-focus-expiry-buttons button:hover:not(:disabled) { background: #f1f5f9; color: #0f172a; }
.next-focus-minus-day { border-radius: 6px 0 0 6px; }
.next-focus-plus-day { border-radius: 0 6px 6px 0; }
.next-focus-minus-day:disabled { color: #cbd5e1; cursor: not-allowed; }
.next-focus-expiry-chip { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 72px; }
.next-focus-expiry.is-last .next-focus-expiry-chip { color: #b45309; background: #fef3c7; }
.next-focus-expiry.is-last .next-focus-expiry-buttons button { border-color: #fcd34d; }
.next-focus-expiry.is-preview .next-focus-expiry-chip { color: #64748b; }
.next-focus-expiry.is-preview .next-focus-expiry-chip:hover { color: #4f46e5; background: #eef2ff; }

.next-focus-daybar { display: flex; align-items: center; gap: 3px; height: 5px; padding: 0 2px; }
.next-focus-daybar-dot { width: 4px; height: 4px; border-radius: 50%; flex-shrink: 0; background: #818cf8; }
.next-focus-expiry.is-last .next-focus-daybar-dot { background: #f59e0b; }
.next-focus-expiry.is-preview .next-focus-daybar-dot { background: #cbd5e1; }
.next-focus-daybar-more { font-size: 8px; line-height: 5px; color: #94a3b8; margin-left: 2px; font-weight: 700; }

/* ---------- Next rows and cards ---------- */
.next-focus-row-controls { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.next-focus-row-hover { opacity: 0; transition: opacity 0.12s; }
.next-view-row:hover .next-focus-row-hover,
.next-view-card:hover .next-focus-row-hover,
.next-focus-row-hover:focus-within { opacity: 1; }
.next-focus-row-menu-btn { font-size: 17px; }
.next-view-row.is-focused .next-focus-row-menu-btn,
.next-view-card.is-focused .next-focus-row-menu-btn { color: #4f46e5; }
.next-focus-row-unpin-btn { font-size: 17px; color: #8b5cf6; }
.next-focus-row-unpin-btn:hover { color: #dc2626; background: #fee2e2; }
.next-focus-row-pin-btn { font-size: 17px; color: #94a3b8; }
.next-focus-row-pin-btn:hover { color: #8b5cf6; background: #ede9fe; }

.next-view-section .next-view-row.is-focused,
.next-view-card.is-focused {
    background: #ede9fe; border-color: #c4b5fd; box-shadow: inset 3px 0 0 #4f46e5, 0 1px 2px rgba(15, 23, 42, 0.04);
}
.next-view-section .next-view-row.is-focused:hover,
.next-view-card.is-focused:hover { border-color: #a78bfa; }
.next-view-section .next-view-row.is-quick-added { background: #dcfce7; border-color: #86efac; box-shadow: none; }
.next-view-section .next-view-row.is-quick-added:hover { border-color: #4ade80; }
.next-view-row[draggable="true"], .next-view-card[draggable="true"] { cursor: grab; }
.next-view-row.is-dragging, .next-view-card.is-dragging { opacity: 0.5; }

.next-view-card { position: relative; }
.next-focus-card-controls { position: absolute; top: 4px; right: 4px; display: inline-flex; align-items: center; gap: 2px; }
.next-view-card .next-view-task-title { padding-right: 24px; }
.next-view-card.is-focused .next-view-task-title { padding-right: 76px; }
.next-focus-card-days { font-size: 10.5px; font-weight: 600; color: #4f46e5; }
.next-focus-card-days.is-last { color: #b45309; }

/* ---------- Tray ---------- */
.next-focus-tray {
    width: 350px; flex-shrink: 0; border-left: 1px solid #e2e8f0; background: #fff;
    display: flex; flex-direction: column; min-height: 0;
}
.next-focus-tray.is-collapsed { width: 48px; cursor: pointer; }
.next-focus-tray.is-collapsed:hover { background: #f5f3ff; }
.next-focus-tray-collapsed { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; }
.next-focus-tray-collapsed-icon { color: #4f46e5; font-size: 18px; }
.next-focus-tray-collapsed-label { writing-mode: vertical-rl; font-size: 12px; font-weight: 600; color: #64748b; letter-spacing: 0.04em; }
.next-focus-tray-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; }
.next-focus-tray-title { font-size: 14px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 7px; }
.next-focus-tray-title i { color: #4f46e5; }
.next-focus-count { font-size: 11px; background: #4f46e5; color: #fff; border-radius: 9999px; padding: 0 7px; }
.next-focus-tray-list { flex: 1; overflow-y: auto; padding: 4px 12px 24px; }
.next-focus-tray.is-drop-target .next-focus-tray-list { background: #eef2ff; outline: 2px dashed #a5b4fc; outline-offset: -6px; border-radius: 12px; }
.next-focus-tray-empty {
    border: 1.5px dashed #cbd5e1; border-radius: 12px; padding: 24px 14px; text-align: center; color: #64748b;
    font-size: 13px; line-height: 1.5;
}
.next-focus-tray-empty i { font-size: 26px; color: #cbd5e1; display: block; margin-bottom: 4px; }

/* ---------- Focus cards (tray and Focus page) ---------- */
.next-focus-card {
    display: flex; align-items: flex-start; gap: 8px; background: #ede9fe; border: 1px solid #c4b5fd; border-radius: 10px;
    padding: 10px 10px 10px 4px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); cursor: pointer;
}
.next-focus-card + .next-focus-card { margin-top: 8px; }
.next-focus-card:hover { border-color: #a78bfa; }
.next-focus-card.is-dragging { opacity: 0.4; }
.next-focus-card.is-drop-before { box-shadow: 0 -3px 0 #4f46e5; }
.next-focus-drag-handle { color: #a78bfa; cursor: grab; font-size: 16px; margin-top: 2px; }
/* Focus tasks in the list and board views: purple crosshair (sidebar Focus icon) before the title. */
.next-focus-task-icon { display: none; color: #7c3aed; margin-right: 5px; vertical-align: -2px; font-size: 15px; }
.is-next-focus-task .next-focus-task-icon { display: inline-block; }

/* Quick-added tasks (Inbox list, not from a Next column) are light green. */
.next-focus-card.is-quick-added { background: #dcfce7; border-color: #86efac; }
.next-focus-card.is-quick-added:hover { border-color: #4ade80; }
.next-focus-card.is-quick-added .next-focus-drag-handle { color: #4ade80; }
.next-focus-toolbar-button.is-quick-add { background: #dcfce7; border-color: #86efac; color: #166534; }
.next-focus-quick-added-switch { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; cursor: pointer; padding: 0 4px; font-size: 12px; color: #64748b; }
.next-focus-quick-added-switch-track { position: relative; width: 28px; height: 16px; border-radius: 8px; background: #cbd5e1; transition: background 0.15s; flex-shrink: 0; }
.next-focus-quick-added-switch-knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.3); transition: transform 0.15s; }
.next-focus-quick-added-switch.is-on { color: #166534; }
.next-focus-quick-added-switch.is-on .next-focus-quick-added-switch-track { background: #4ade80; }
.next-focus-quick-added-switch.is-on .next-focus-quick-added-switch-knob { transform: translateX(12px); }
.next-focus-toolbar-button.is-quick-add:hover { background: #bbf7d0; border-color: #4ade80; }
.next-focus-quick-add-popover {
    position: fixed; z-index: 1000; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14); padding: 10px; width: 340px;
}
.next-focus-quick-add-popover input { width: 100%; border: 1px solid #86efac; border-radius: 6px; padding: 6px 8px; font-size: 13.5px; }
.next-focus-quick-add-hint { font-size: 11px; color: #94a3b8; margin-top: 6px; }
.next-focus-card-body { flex: 1; min-width: 0; }
.next-focus-card-title { font-size: 13.5px; font-weight: 500; line-height: 1.35; color: #0f172a; overflow-wrap: anywhere; }
.next-focus-card-list { font-size: 11px; color: #64748b; margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---------- Focus page ---------- */
.next-focus-page { max-width: 760px; padding: 0 0 24px; }
.next-focus-page-date { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: #0f172a; margin-top: 4px; }
.next-focus-page-progress { font-size: 12.5px; color: #64748b; margin-top: 2px; }
.next-focus-progress-track { height: 4px; background: #e2e8f0; border-radius: 9999px; overflow: hidden; width: 160px; margin: 6px 0 20px; }
.next-focus-progress-fill { height: 100%; background: #059669; border-radius: 9999px; transition: width 0.25s; }
.next-focus-card.is-page-card { align-items: center; padding: 12px 12px 12px 6px; }
.next-focus-card.is-page-card .next-focus-drag-handle { margin-top: 0; }
.next-focus-card.is-page-card .next-focus-card-title { font-size: 15px; }
.next-focus-complete-check {
    width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #cbd5e1; background: #fff; flex-shrink: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; padding: 0; color: transparent; font-size: 11px;
}
.next-focus-complete-check:hover { border-color: #059669; color: #059669; }
.next-focus-page-footer { margin-top: 22px; font-size: 12px; color: #94a3b8; display: flex; align-items: center; gap: 6px; }
.next-focus-section-title {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; margin: 20px 0 8px;
}
.next-focus-done-row {
    display: flex; align-items: center; gap: 8px; padding: 4px 6px; color: #94a3b8; text-decoration: line-through;
    font-size: 12.5px; cursor: pointer; border-radius: 6px;
}
.next-focus-done-row:hover { background: #f1f5f9; }
.next-focus-done-row i { color: #059669; }
.next-focus-page-empty { text-align: center; color: #64748b; padding: 56px 16px; max-width: 460px; margin: 0 auto; }
.next-focus-page-empty i { font-size: 36px; color: #cbd5e1; }
.next-focus-page-empty h3 { font-size: 15px; font-weight: 600; color: #0f172a; margin: 10px 0 4px; }
.next-focus-page-empty p { margin: 0 0 14px; line-height: 1.5; font-size: 13px; }

/* ---------- Snooze (Focus page) ---------- */
.next-focus-snooze { position: relative; flex-shrink: 0; }
.next-focus-snooze-menu {
    display: none; position: absolute; top: 100%; right: 0; z-index: 50; background: #fff; border: 1px solid #e2e8f0;
    border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14); padding: 6px; min-width: 200px; font-size: 12.5px; cursor: default;
}
/* Invisible bridge so the menu stays open while the pointer moves from the button into it. */
.next-focus-snooze-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.next-focus-snooze:hover .next-focus-snooze-menu, .next-focus-snooze:focus-within .next-focus-snooze-menu { display: block; }
.next-focus-snooze:hover .next-focus-snooze-button { background: #f1f5f9; color: #4f46e5; }
.next-focus-card.is-snoozed { background: #f1f5f9; border-color: #e2e8f0; }
.next-focus-card.is-snoozed .next-focus-card-body, .next-focus-card.is-snoozed .next-focus-complete-check { opacity: 0.55; }
.next-focus-card.is-snoozed .next-focus-drag-handle { color: #cbd5e1; }
.next-focus-snoozed-chip {
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 11.5px; font-weight: 500; color: #64748b;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 3px 8px;
}

/* Snooze item in the task right-click menu: the day list opens to the right on hover. */
.next-focus-task-menu-snooze { position: relative; }
.next-focus-task-menu-snooze > button { width: 100%; }
.next-focus-task-menu-snooze-caret { margin-left: auto; font-size: 12px; }
.next-focus-task-menu-snooze:hover > .next-focus-task-menu-snooze-flyout { display: block; }
.next-focus-task-menu-snooze-flyout { top: -6px; left: 100%; right: auto; }
.next-focus-task-menu-snooze-flyout.is-left { left: auto; right: 100%; }
.next-focus-task-menu-snooze-flyout::before { top: 0; bottom: 0; left: -8px; right: auto; width: 8px; height: auto; }
.next-focus-task-menu-snooze-flyout.is-left::before { left: auto; right: -8px; }

/* ---------- Days menu ---------- */
.next-focus-days-menu {
    position: fixed; z-index: 1000; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14); padding: 6px; min-width: 220px; font-size: 12.5px;
}
.next-focus-days-menu-title {
    font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 8px 4px;
}
.next-focus-days-menu-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
    border: none; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; color: #334155;
}
.next-focus-days-menu-item:hover { background: #f1f5f9; }
.next-focus-days-menu-item.is-current { font-weight: 600; color: #4f46e5; }
.next-focus-days-menu-item small { color: #94a3b8; font-size: 11px; }
.next-focus-days-menu-item.is-danger { color: #dc2626; }
.next-focus-days-menu-separator { height: 1px; background: #e2e8f0; margin: 4px 0; }
.next-focus-days-menu-custom { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 12px; color: #64748b; }
.next-focus-days-menu-custom input { width: 52px; border: 1px solid #e2e8f0; border-radius: 6px; padding: 3px 6px; font: inherit; }

/* ---------- Undo toast ---------- */
.next-focus-undo-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000;
    background: #0f172a; color: #fff; border-radius: 9px; padding: 9px 14px; font-size: 13px;
    display: flex; align-items: center; gap: 14px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}
.next-focus-undo-toast button { background: none; border: none; color: #a5b4fc; font-weight: 600; cursor: pointer; padding: 0; }

/* Right-click task menu: Rename / Add subtask form (NextFocusTaskMenu.showNextFocusTaskMenuForm) */
.next-focus-task-menu-form {
    position: fixed;
    z-index: 200;
    width: 320px;
    max-width: calc(100vw - 16px);
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.06);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.next-focus-task-menu-form-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}
.next-focus-task-menu-form-parent {
    margin-top: -4px;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.next-focus-task-menu-form input {
    width: 100%;
    padding: 7px 10px;
}
.next-focus-task-menu-form-footer {
    display: flex;
    align-items: center;
    gap: 6px;
}
.next-focus-task-menu-form-hint {
    flex: 1;
    font-size: 11px;
    color: #94a3b8;
}
.next-focus-task-menu-form-cancel,
.next-focus-task-menu-form-submit {
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    cursor: pointer;
}
.next-focus-task-menu-form-cancel:hover { background: #f1f5f9; }
.next-focus-task-menu-form-submit {
    border-color: #2563eb;
    background: #2563eb;
    color: white;
}
.next-focus-task-menu-form-submit:hover { background: #1d4ed8; }
.next-focus-task-menu-form-submit:disabled { opacity: 0.5; cursor: default; }

.next-focus-task-menu-form-entered {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 160px;
    overflow-y: auto;
}
.next-focus-task-menu-form-entered:empty { display: none; }
.next-focus-task-menu-form-entered li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 2px;
    font-size: 13px;
    color: #475569;
}
.next-focus-task-menu-form-entered li { cursor: grab; border-radius: 4px; }
.next-focus-task-menu-form-entered li:hover { background: #f8fafc; }
.next-focus-task-menu-form-entered li:active { cursor: grabbing; }
.next-focus-task-menu-form-entered li.is-dragging {
    background: #eff6ff;
    outline: 1px dashed #60a5fa;
    outline-offset: -1px;
}
.next-focus-task-menu-form-entered li.is-dragging > * { visibility: hidden; }
.next-focus-task-menu-form-entered li span { flex: 1; min-width: 0; }
.next-focus-task-menu-form-entered-move {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: none;
    cursor: pointer;
}
.next-focus-task-menu-form-entered:not(.is-sorting) li:hover .next-focus-task-menu-form-entered-move { display: flex; }
.next-focus-task-menu-form-entered li:first-child .next-focus-task-menu-form-entered-move-up,
.next-focus-task-menu-form-entered li:last-child .next-focus-task-menu-form-entered-move-down { visibility: hidden; }
.next-focus-task-menu-form-entered-move:hover { background: #e2e8f0; }
.next-focus-task-menu-form-entered-move:hover i { color: #1e293b; }
.next-focus-task-menu-form-entered li i { color: #94a3b8; flex-shrink: 0; }
.next-focus-task-menu-form-entered li span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Keyboard selection (NextFocusKeyboard): Next rows/cards and Focus page cards */
.next-view-row.is-keyboard-selected,
.next-view-card.is-keyboard-selected,
.next-focus-card.is-keyboard-selected,
.next-view-more.is-keyboard-selected { outline: 2px solid #6366f1; outline-offset: 1px; }
