/* ============================================================================
   REMINDER PANEL - Embedded dashboard component
   ============================================================================
   Reuses --chat-* CSS variables for consistency with todo floating panel.
   ============================================================================ */

/* Container - full width, flex column to fill available height */
.reminder-panel {
    background: var(--chat-bg);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--chat-border);
    display: flex;
    flex-direction: column;
}

/* Break out of engine-form padding so reminder panel fills screen width */
.form-row:has(.reminder-panel) {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    width: calc(100% + 3rem);
    padding: 0;
}

/* Header - gradient matching todo panel */
.reminder-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--chat-bg);
    border-bottom: 1px solid var(--chat-border, #eee);
}

.reminder-header-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--chat-bg-secondary, #f5f5f5);
    border: 1px solid var(--chat-border, #e0e0e0);
    border-radius: 8px;
    padding: 7px 12px;
    transition: all 0.2s ease;
}

.reminder-header-search:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.12);
}

.reminder-header-search-icon {
    font-size: 0.8rem;
    color: var(--chat-text-secondary, #999);
    flex-shrink: 0;
}

.reminder-header-search:focus-within .reminder-header-search-icon {
    color: #667eea;
}

.reminder-header-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--chat-text, #333);
    padding: 0;
    min-width: 0;
}

.reminder-header-search-input::placeholder {
    color: var(--chat-text-secondary, #aaa);
}

.reminder-header-search-clear {
    border: none;
    background: none;
    color: var(--chat-text-secondary, #999);
    cursor: pointer;
    padding: 2px;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.reminder-header-search-clear:hover {
    color: var(--chat-text, #333);
    background: rgba(0, 0, 0, 0.06);
}

/* ── Font Size Selector ── */
.reminder-font-size-group {
    display: flex;
    flex-shrink: 0;
    border: 1.5px solid var(--chat-border, #ddd);
    border-radius: 6px;
    overflow: hidden;
}

.reminder-font-size-opt {
    padding: 3px 7px;
    border: none;
    background: transparent;
    color: var(--chat-text-secondary, #999);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.reminder-font-size-opt + .reminder-font-size-opt {
    border-left: 1px solid var(--chat-border, #ddd);
}

.reminder-font-size-opt:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.06);
}

.reminder-font-size-opt.active {
    color: #fff;
    background: #667eea;
}

[data-theme="dark"] .reminder-font-size-group {
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .reminder-font-size-opt {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .reminder-font-size-opt + .reminder-font-size-opt {
    border-left-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .reminder-font-size-opt:hover {
    color: #a5b4fc;
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .reminder-font-size-opt.active {
    color: #fff;
    background: #667eea;
}

/* ── Font Size Zoom Levels ── */
.reminder-panel.reminder-font-md {
    zoom: 1.08;
}

.reminder-panel.reminder-font-lg {
    zoom: 1.18;
}

/* ── Chip Filter Bar ── */
.reminder-chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    background: var(--chat-bg);
    align-items: center;
}

.reminder-chip-bar-tags {
    padding: 6px 16px 8px;
}

.reminder-chip-bar-time {
    padding: 6px 16px 8px;
}

/* Filter toggle button */
.reminder-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--chat-border, #ddd);
    background: transparent;
    color: var(--chat-text-secondary, #999);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.reminder-filter-toggle:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.06);
}

.reminder-filter-toggle.active {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.reminder-filter-toggle.has-filters .reminder-filter-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 1.5px solid var(--chat-bg, #fff);
}

[data-theme="dark"] .reminder-filter-toggle {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .reminder-filter-toggle:hover,
[data-theme="dark"] .reminder-filter-toggle.active {
    border-color: #818cf8;
    color: #a5b4fc;
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .reminder-filter-toggle.has-filters .reminder-filter-dot {
    border-color: var(--chat-bg, #1a1a2e);
}

/* Filter section labels */
.reminder-filter-label {
    font-size: 0.65rem;
    color: var(--chat-text-secondary, #999);
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.reminder-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    border: 1.5px solid var(--chat-border, #ddd);
    background: transparent;
    color: var(--chat-text-secondary, #777);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.reminder-chip i {
    font-size: 0.65rem;
}

.reminder-chip:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.06);
}

/* Active chip - default */
.reminder-chip.active {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
    font-weight: 600;
}

/* Tag chips - smaller, subtler */
.reminder-chip-tag {
    padding: 3px 10px;
    font-size: 0.7rem;
    border-radius: 12px;
}

.reminder-chip-tag.active {
    background: #4f5d73;
    border-color: #4f5d73;
}

/* Category-specific active colors */
.reminder-chip.chip-todo.active     { border-color: #3b82f6; background: #3b82f6; }
.reminder-chip.chip-event.active    { border-color: #8b5cf6; background: #8b5cf6; }
.reminder-chip.chip-diary.active    { border-color: #10b981; background: #10b981; }
.reminder-chip.chip-shopping.active { border-color: #f59e0b; background: #f59e0b; }
.reminder-chip.chip-expense.active  { border-color: #ef4444; background: #ef4444; }
.reminder-chip.chip-info.active     { border-color: #6b7280; background: #6b7280; }

/* Category hover colors */
.reminder-chip.chip-todo:not(.active):hover     { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.08); }
.reminder-chip.chip-event:not(.active):hover    { border-color: #8b5cf6; color: #8b5cf6; background: rgba(139,92,246,0.08); }
.reminder-chip.chip-diary:not(.active):hover    { border-color: #10b981; color: #10b981; background: rgba(16,185,129,0.08); }
.reminder-chip.chip-shopping:not(.active):hover { border-color: #f59e0b; color: #f59e0b; background: rgba(245,158,11,0.08); }
.reminder-chip.chip-expense:not(.active):hover  { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }
.reminder-chip.chip-info:not(.active):hover     { border-color: #6b7280; color: #6b7280; background: rgba(107,114,128,0.08); }

/* Item tag badges */
.reminder-panel-item-tag {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--chat-primary-light, #e8f0fe);
    color: var(--chat-primary, #667eea);
}

.reminder-panel-item-tag.clickable,
.reminder-panel-item-category {
    cursor: pointer;
    transition: all 0.15s ease;
}

.reminder-panel-item-tag.clickable:hover {
    filter: brightness(0.9);
    text-decoration: underline;
}

.reminder-panel-item-category:hover,
.reminder-panel-item-timeslot.clickable:hover {
    filter: brightness(0.9);
    text-decoration: underline;
}

.reminder-panel-item-timeslot {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 1px 7px;
    border-radius: 4px;
    background: #fff3e0;
    color: #e65100;
}

.reminder-panel-item-timeslot i {
    margin-right: 2px;
    font-size: 0.6rem;
}

/* Dark theme chip overrides */
[data-theme="dark"] .reminder-chip {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .reminder-chip:hover {
    border-color: #818cf8;
    color: #818cf8;
    background: rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] .reminder-chip.active {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
}

[data-theme="dark"] .reminder-chip-tag.active {
    background: #5a6785;
    border-color: #5a6785;
}

[data-theme="dark"] .reminder-panel-item-tag {
    background: rgba(102, 126, 234, 0.15);
    color: #a5b4fc;
}

[data-theme="dark"] .reminder-panel-item-timeslot {
    background: rgba(230, 81, 0, 0.15);
    color: #ffb74d;
}

/* ── Search Bar ── */
.reminder-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--chat-bg);
    position: relative;
}

.reminder-search-icon {
    font-size: 0.8rem;
    color: var(--chat-text-secondary, #999);
    flex-shrink: 0;
}

.reminder-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.8rem;
    color: var(--chat-text, #333);
    padding: 4px 0;
}

.reminder-search-input::placeholder {
    color: var(--chat-text-secondary, #aaa);
}

.reminder-search-clear {
    border: none;
    background: none;
    color: var(--chat-text-secondary, #999);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.reminder-search-clear:hover {
    color: var(--chat-text, #333);
    background: rgba(0, 0, 0, 0.06);
}

.reminder-search-btn {
    border: none;
    background: var(--chat-primary, #667eea);
    color: white;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 0.7rem;
    line-height: 1;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.reminder-search-btn:hover {
    opacity: 0.85;
}

[data-theme="dark"] .reminder-search-input {
    color: var(--chat-text, #e0e0e0);
}

[data-theme="dark"] .reminder-search-clear:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Tabs - same style as todo panel */
.reminder-panel-tabs {
    display: flex;
    padding: 0 16px;
    background: var(--chat-bg);
}

.reminder-panel-tab {
    flex: 1;
    padding: 10px 4px;
    border: none;
    background: none;
    color: var(--chat-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.reminder-panel-tab:hover {
    color: var(--chat-text);
}

.reminder-panel-tab.active {
    color: var(--chat-primary);
    border-bottom-color: var(--chat-primary);
}

.reminder-tab-count {
    background: var(--chat-primary-light);
    color: var(--chat-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.reminder-panel-tab.active .reminder-tab-count {
    background: var(--chat-primary);
    color: white;
}

/* List area */
.reminder-panel-list {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--chat-bg-secondary);
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Fill remaining viewport with generous height */
    height: calc(200vh - 400px);
}

.reminder-panel-list::-webkit-scrollbar {
    display: none;
}

/* Empty state */
.reminder-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--chat-text-secondary);
}

.reminder-panel-empty i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.4;
    color: var(--chat-primary);
}

.reminder-panel-empty p {
    margin: 0;
    font-size: 0.85rem;
}

/* Item card */
.reminder-panel-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    animation: reminder-item-in 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

@keyframes reminder-item-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.reminder-panel-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Item icon */
.reminder-panel-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--chat-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.reminder-panel-item-icon i {
    font-size: 0.7rem;
    color: var(--chat-primary);
}

/* Item content */
.reminder-panel-item-content {
    flex: 1;
    min-width: 0;
}

.reminder-panel-item-title {
    font-size: 0.875rem;
    color: var(--chat-text);
    line-height: 1.4;
    word-break: break-word;
}

.reminder-recurring-icon {
    font-size: 0.65rem;
    color: var(--chat-muted);
    margin-left: 4px;
    vertical-align: middle;
}

/* Expense title - layers + amount on first line */
.reminder-expense-title {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.reminder-expense-title .expense-layer {
    font-weight: 500;
}

.reminder-expense-title .expense-separator {
    font-size: 0.55rem;
    opacity: 0.4;
}

.reminder-expense-title .expense-amount {
    margin-left: auto;
    font-weight: 600;
    color: var(--chat-accent, #4f46e5);
    white-space: nowrap;
}

.reminder-panel-item-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.reminder-panel-item-dates {
    display: flex;
    gap: 10px;
    margin-top: 3px;
    flex-wrap: wrap;
    align-items: center;
}

/* Category chip */
.reminder-panel-item-category {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.reminder-panel-item-category.todo {
    background: #e8f4fd;
    color: #0066b3;
}

.reminder-panel-item-category.event {
    background: #f3e8ff;
    color: #7c3aed;
}

.reminder-panel-item-category.shopping {
    background: #fef3cd;
    color: #d68910;
}

.reminder-panel-item-category.expense {
    background: #fde8e8;
    color: #e74c3c;
}

.reminder-panel-item-category.diary {
    background: #d4edda;
    color: #27ae60;
}

.reminder-panel-item-category.info {
    background: #e2e8f0;
    color: #64748b;
}

/* Date labels */
.reminder-panel-item-date {
    font-size: 0.7rem;
    color: var(--chat-text-secondary);
    display: flex;
    align-items: center;
    gap: 3px;
}

.reminder-panel-item-date i {
    font-size: 0.65rem;
}

.reminder-panel-item-date.reminder-date {
    color: var(--chat-primary);
    font-weight: 500;
}

/* Nth event badge (recurring) */
.reminder-panel-item-nth {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 4px;
    background: #f3e8ff;
    color: #7c3aed;
    display: flex;
    align-items: center;
    gap: 3px;
}

.reminder-panel-item-nth i {
    font-size: 0.55rem;
}

.reminder-panel-item-recurrence {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 1px 7px;
    border-radius: 4px;
    background: #e8f4fd;
    color: #0066b3;
    display: flex;
    align-items: center;
    gap: 3px;
}

.reminder-panel-item-recurrence i {
    font-size: 0.55rem;
}

[data-theme="dark"] .reminder-panel-item-nth {
    background: rgba(124, 58, 237, 0.15);
    color: #c4b5fd;
}

[data-theme="dark"] .reminder-panel-item-recurrence {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

/* ── Title row with indicators ── */
.reminder-panel-item-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.reminder-panel-item-title-row .reminder-panel-item-title {
    flex: 1;
    min-width: 0;
}

.reminder-panel-item-indicators {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 2px 4px;
    border-radius: 4px;
}

.reminder-panel-item-indicators:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .reminder-panel-item-indicators:hover {
    background: rgba(255, 255, 255, 0.06);
}

.reminder-indicator {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.7rem;
    color: #667eea;
}

.reminder-indicator i {
    font-size: 0.7rem;
}

.reminder-indicator-count {
    font-size: 0.65rem;
    font-weight: 600;
}

.reminder-expand-icon {
    font-size: 0.65rem;
    color: #667eea;
    margin-left: 2px;
}

[data-theme="dark"] .reminder-indicator {
    color: #a5b4fc;
}

[data-theme="dark"] .reminder-expand-icon {
    color: #a5b4fc;
}

/* ── Expandable Details Container ── */
.reminder-panel-item-details {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    min-width: 0;
}

.reminder-panel-item-details.no-content {
    display: none;
}

[data-theme="dark"] .reminder-panel-item-details {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.reminder-panel-item.expanded {
    background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .reminder-panel-item.expanded {
    background: rgba(255, 255, 255, 0.02);
}

/* ── Description ── */
.reminder-panel-item-desc {
    font-size: 0.72rem;
    color: #666;
    line-height: 1.4;
}

[data-theme="dark"] .reminder-panel-item-desc {
    color: #9ca3af;
}

/* ── URL ── */
.reminder-panel-item-url {
    font-size: 0.68rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reminder-panel-item-url i {
    color: #667eea;
    font-size: 0.6rem;
}

.reminder-panel-item-url a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.reminder-panel-item-url a:hover {
    text-decoration: underline;
}

[data-theme="dark"] .reminder-panel-item-url i,
[data-theme="dark"] .reminder-panel-item-url a {
    color: #a5b4fc;
}

/* ── Checklist Sub-items ── */
.reminder-panel-item-checklist {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reminder-panel-item-sub {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: #555;
}

.reminder-panel-item-sub i {
    font-size: 0.65rem;
    color: #999;
}

.reminder-panel-item-sub.done span {
    text-decoration: line-through;
    color: #999;
}

.reminder-panel-item-sub.done i {
    color: #22c55e;
}

/* ── Entry Quick Action Buttons (Done / Postpone) ── */
.reminder-panel-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.reminder-action-btn {
    border: 1px solid var(--chat-border, #ddd);
    background: var(--chat-bg, #fff);
    color: var(--chat-text-secondary, #888);
    cursor: pointer;
    padding: 2px 8px;
    font-size: 0.6rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.5;
}

.reminder-action-btn:hover {
    border-color: var(--chat-primary, #667eea);
    color: var(--chat-primary, #667eea);
    background: var(--chat-primary-light, #e8f0fe);
}

.reminder-action-btn.action-done {
    color: #16a34a;
    border-color: #bbf7d0;
}

.reminder-action-btn.action-done:hover {
    background: #dcfce7;
    border-color: #16a34a;
    color: #15803d;
}

.reminder-action-btn.action-today {
    color: #2563eb;
    border-color: #bfdbfe;
}

.reminder-action-btn.action-today:hover {
    background: #dbeafe;
    border-color: #2563eb;
    color: #1d4ed8;
}

[data-theme="dark"] .reminder-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .reminder-action-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
    color: #a5b4fc;
}

[data-theme="dark"] .reminder-action-btn.action-done {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.2);
}

[data-theme="dark"] .reminder-action-btn.action-done:hover {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.4);
    color: #86efac;
}

[data-theme="dark"] .reminder-action-btn.action-today {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .reminder-action-btn.action-today:hover {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.4);
    color: #93bbfd;
}

.reminder-action-btn.action-edit {
    color: #7c3aed;
    border-color: #ddd6fe;
}

.reminder-action-btn.action-edit:hover {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #6d28d9;
}

[data-theme="dark"] .reminder-action-btn.action-edit {
    color: #a78bfa;
    border-color: rgba(167, 139, 250, 0.2);
}

[data-theme="dark"] .reminder-action-btn.action-edit:hover {
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.4);
    color: #c4b5fd;
}

/* ── Delete button in expanded area ── */
.reminder-panel-item-delete-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: flex-end;
}

[data-theme="dark"] .reminder-panel-item-delete-row {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.reminder-delete-btn {
    font-size: 0.7rem;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.reminder-delete-btn:hover {
    color: #dc2626;
    background: #fef2f2;
}

[data-theme="dark"] .reminder-delete-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

/* ── Delete Confirmation Modal ── */
.reminder-delete-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.reminder-delete-modal {
    background: white;
    border-radius: 16px;
    padding: 28px 32px 24px;
    width: 320px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: modalSlideUp 0.2s ease;
}

[data-theme="dark"] .reminder-delete-modal {
    background: #1e1e2e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.reminder-delete-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin: 0 auto 16px;
}

[data-theme="dark"] .reminder-delete-modal-icon {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
}

.reminder-delete-modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

[data-theme="dark"] .reminder-delete-modal-title {
    color: #f3f4f6;
}

.reminder-delete-modal-text {
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 4px;
    line-height: 1.4;
    word-break: break-word;
}

[data-theme="dark"] .reminder-delete-modal-text {
    color: #d1d5db;
}

.reminder-delete-modal-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 20px;
}

.reminder-delete-modal-actions {
    display: flex;
    gap: 10px;
}

.reminder-delete-modal-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.reminder-delete-modal-btn.cancel {
    background: #f3f4f6;
    color: #374151;
}

.reminder-delete-modal-btn.cancel:hover {
    background: #e5e7eb;
}

[data-theme="dark"] .reminder-delete-modal-btn.cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
}

[data-theme="dark"] .reminder-delete-modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.12);
}

.reminder-delete-modal-btn.confirm {
    background: #dc2626;
    color: white;
}

.reminder-delete-modal-btn.confirm:hover {
    background: #b91c1c;
}

[data-theme="dark"] .reminder-delete-modal-btn.confirm {
    background: #ef4444;
}

[data-theme="dark"] .reminder-delete-modal-btn.confirm:hover {
    background: #dc2626;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Expense date in action row ── */
.reminder-action-date {
    font-size: 0.7rem;
    color: #6b7280;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

[data-theme="dark"] .reminder-action-date {
    color: #9ca3af;
}

/* ── Sub-item action buttons (+ < >) ── */
.sub-item-actions {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-left: auto;
    flex-shrink: 0;
}

.sub-item-nest-btn {
    border: 1px solid var(--chat-border, #ddd);
    background: var(--chat-bg, #fff);
    color: #999;
    cursor: pointer;
    width: 20px;
    height: 20px;
    font-size: 0.5rem;
    border-radius: 3px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}

.sub-item-nest-btn:hover {
    color: var(--chat-primary, #667eea);
    border-color: var(--chat-primary, #667eea);
    background: var(--chat-primary-light, #e8f0fe);
}

[data-theme="dark"] .sub-item-nest-btn {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #666;
}

[data-theme="dark"] .sub-item-nest-btn:hover {
    color: #a5b4fc;
    border-color: #818cf8;
    background: rgba(102, 126, 234, 0.1);
}

/* ── Nested sub-item controls ── */
.sub-item-child-count {
    font-size: 0.55rem;
    font-weight: 600;
    background: var(--chat-primary-light, #e8f0fe);
    color: var(--chat-primary, #667eea);
    padding: 0 5px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
    line-height: 1.5;
    flex-shrink: 0;
}

[data-theme="dark"] .sub-item-child-count {
    background: rgba(102, 126, 234, 0.15);
    color: #a5b4fc;
}

.sub-item-collapse-btn {
    cursor: pointer;
    color: var(--chat-text-secondary, #999);
    font-size: 0.7rem;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.sub-item-collapse-btn:hover {
    color: var(--chat-primary, #667eea);
}

/* ── Completed sub-items toggle ── */
.reminder-panel-item-done-toggle {
    font-size: 0.68rem;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
}

.reminder-panel-item-done-toggle:hover {
    color: #667eea;
}

.reminder-panel-item-done-toggle i {
    font-size: 0.55rem;
}

[data-theme="dark"] .reminder-panel-item-sub {
    color: #9ca3af;
}

[data-theme="dark"] .reminder-panel-item-sub i {
    color: #6b7280;
}

[data-theme="dark"] .reminder-panel-item-sub.done i {
    color: #4ade80;
}

[data-theme="dark"] .reminder-panel-item-done-toggle {
    color: #6b7280;
}

[data-theme="dark"] .reminder-panel-item-done-toggle:hover {
    color: #a5b4fc;
}

/* ── Add Sub-item Input ── */
.reminder-panel-add-sub {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.reminder-panel-add-sub input {
    flex: 1;
    border: none;
    border-bottom: 1px solid var(--chat-border, #ddd);
    outline: none;
    background: transparent;
    font-size: 0.68rem;
    color: var(--chat-text, #333);
    padding: 3px 0;
}

.reminder-panel-add-sub input::placeholder {
    color: var(--chat-text-secondary, #aaa);
    font-style: italic;
}

.reminder-panel-add-sub button {
    border: none;
    background: none;
    color: var(--chat-primary, #667eea);
    cursor: pointer;
    padding: 3px 6px;
    font-size: 0.65rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.reminder-panel-add-sub button:hover:not(:disabled) {
    background: var(--chat-primary-light, #e8f0fe);
}

.reminder-panel-add-sub button:disabled {
    opacity: 0.3;
    cursor: default;
}

.reminder-panel-add-sub .add-sub-close-btn {
    color: var(--chat-text-secondary, #999);
}

.reminder-panel-add-sub .add-sub-close-btn:hover {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.08);
}

[data-theme="dark"] .reminder-panel-add-sub input {
    color: var(--chat-text, #e0e0e0);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .reminder-panel-add-sub button:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.1);
}

/* ── Clickable Sub-items ── */
.reminder-panel-item-sub {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.1s ease;
}

.reminder-panel-item-sub:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .reminder-panel-item-sub:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ── Quick Add Entry Bar ── */
.reminder-panel-quick-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-bg);
}

.reminder-quick-add-input {
    flex: 1;
    border: 1px solid var(--chat-border, #ddd);
    outline: none;
    background: var(--chat-bg-secondary, #f8f9fa);
    font-size: 0.8rem;
    color: var(--chat-text, #333);
    padding: 7px 12px;
    border-radius: 20px;
    transition: border-color 0.15s ease;
}

.reminder-quick-add-input:focus {
    border-color: var(--chat-primary, #667eea);
}

.reminder-quick-add-input::placeholder {
    color: var(--chat-text-secondary, #aaa);
}

.reminder-quick-add-btn {
    border: none;
    background: var(--chat-primary, #667eea);
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.reminder-quick-add-btn:hover:not(:disabled) {
    opacity: 0.85;
    transform: scale(1.05);
}

.reminder-quick-add-btn:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

[data-theme="dark"] .reminder-quick-add-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--chat-text, #e0e0e0);
}

[data-theme="dark"] .reminder-quick-add-input:focus {
    border-color: #818cf8;
}

/* ── Load More Button ── */
.reminder-panel-load-more {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}

.reminder-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 20px;
    border: 1.5px solid var(--chat-border, #ddd);
    border-radius: 20px;
    background: var(--chat-bg);
    color: var(--chat-primary, #667eea);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reminder-load-more-btn:hover:not(:disabled) {
    background: var(--chat-primary-light, #e8f0fe);
    border-color: var(--chat-primary, #667eea);
}

.reminder-load-more-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.reminder-load-more-btn i {
    font-size: 0.65rem;
}

[data-theme="dark"] .reminder-load-more-btn {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--chat-bg);
    color: #a5b4fc;
}

[data-theme="dark"] .reminder-load-more-btn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.1);
    border-color: #818cf8;
}

/* ============================================================================
   Mobile Responsive
   ============================================================================ */
@media (max-width: 991px) {
    /* Pull reminder panel flush to navbar on mobile using negative margin.
       main has padding-top:50px, engine-form has padding:2rem 1.5rem (top=1rem).
       Total gap = engine-form padding-top (1rem=16px) + form-grid gap (1rem=16px if present).
       Use negative margin on the panel itself as a reliable fallback. */
    .reminder-panel {
        margin-top: -3rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        border-top: none;
    }

    /* Also zero out parent containers if :has() is supported */
    .engine-form:has(.reminder-panel) {
        padding: 0 !important;
        margin: 0 !important;
    }

    .form-row:has(.reminder-panel) {
        margin: 0 !important;
        gap: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .engine-form:has(.reminder-panel) .form-content-wrapper,
    .engine-form:has(.reminder-panel) .form-grid {
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

@media (max-width: 480px) {
    .reminder-panel {
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .form-row:has(.reminder-panel) {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        width: calc(100% + 3rem);
        padding: 0;
    }

    .reminder-panel-header {
        padding: 8px 12px;
    }

    .reminder-chip-bar {
        padding: 8px 12px;
        gap: 5px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .reminder-chip-bar-tags {
        padding: 4px 12px 6px;
    }

    .reminder-chip {
        padding: 3px 9px;
        font-size: 0.7rem;
    }

    .reminder-panel-list {
        height: calc(200vh - 350px);
        padding: 4px 3px;
        gap: 5px;
    }

    .reminder-panel-item {
        padding: 10px 12px;
        border-radius: 6px;
    }

    .reminder-panel-item-meta {
        gap: 6px;
    }
}

/* ============================================================================
   Detail Display Mode (plain text rows)
   ============================================================================ */
.reminder-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    line-height: 1.5;
    min-height: 22px;
    width: 100%;
    min-width: 0;
}

.reminder-detail-row .reminder-detail-icon {
    margin-top: 3px;
}

.reminder-detail-icon {
    color: #bbb;
    font-size: 0.7rem;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.reminder-detail-text {
    flex: 1;
    min-width: 0;
    color: var(--chat-text, #444);
    word-break: break-word;
    white-space: pre-wrap;
    font-size: 0.8rem;
    overflow-wrap: break-word;
}

.reminder-detail-link {
    flex: 1;
    min-width: 0;
    color: #667eea;
    font-size: 0.8rem;
    word-break: break-all;
    text-decoration: none;
    transition: color 0.15s;
}

.reminder-detail-link:hover {
    color: #5a6fd6;
    text-decoration: underline;
}

/* Dark theme */
[data-bs-theme="dark"] .reminder-detail-text {
    color: #ccc;
}

[data-bs-theme="dark"] .reminder-detail-icon {
    color: #666;
}

/* ============================================================================
   Password display
   ============================================================================ */
.reminder-password-row {
    align-items: center;
}

.reminder-password-text {
    letter-spacing: 0.5px;
}

.reminder-password-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: color 0.15s;
}

.reminder-password-btn:hover {
    color: var(--chat-accent, #7a5c3e);
}

/* ============================================================================
   Copy Button (generic - title, description, URL)
   ============================================================================ */
.reminder-copy-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.65rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.reminder-detail-row:hover .reminder-copy-btn,
.reminder-panel-item-title:hover .reminder-copy-btn {
    opacity: 1;
}

.reminder-copy-btn:hover {
    color: var(--chat-accent, #7a5c3e);
}

[data-bs-theme="dark"] .reminder-copy-btn {
    color: #666;
}

[data-bs-theme="dark"] .reminder-copy-btn:hover {
    color: #aaa;
}

@media (hover: none) {
    .reminder-copy-btn { opacity: 0.6; }
}

/* ============================================================================
   Shared Badge
   ============================================================================ */
.reminder-shared-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.reminder-shared-badge i {
    font-size: 0.6rem;
}

.reminder-shared-badge.shared-out {
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
}

[data-bs-theme="dark"] .reminder-shared-badge {
    background: rgba(102, 126, 234, 0.2);
    color: #8ea4f0;
}

[data-bs-theme="dark"] .reminder-shared-badge.shared-out {
    background: rgba(40, 167, 69, 0.2);
    color: #5cb85c;
}

/* ============================================================================
   View Only Indicator
   ============================================================================ */
.reminder-action-view-only {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--chat-text-secondary, #999);
    font-size: 0.7rem;
    font-weight: 500;
}

[data-bs-theme="dark"] .reminder-action-view-only {
    background: rgba(255, 255, 255, 0.06);
    color: #888;
}

/* ============================================================================
   Share Button (action row + tag chip)
   ============================================================================ */
.reminder-action-btn.action-share {
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.3);
    margin-left: auto;
}

.reminder-action-btn.action-share:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.action-share-count {
    font-size: 0.6rem;
    font-weight: 700;
    background: #667eea;
    color: #fff;
    border-radius: 50%;
    min-width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
}

.reminder-chip-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.reminder-chip-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-size: 0.55rem;
    cursor: pointer;
    margin-left: -2px;
    transition: all 0.15s;
}

.reminder-chip-share:hover {
    background: rgba(102, 126, 234, 0.25);
    transform: scale(1.1);
}

/* ============================================================================
   Share Modal Overlay
   ============================================================================ */
.reminder-share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease-out;
}

.reminder-share-modal {
    background: var(--chat-bg, #fff);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--chat-border, #e0e0e0);
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.reminder-share-modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--chat-border, #e0e0e0);
}

.reminder-share-modal-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--chat-text, #333);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reminder-share-type-badge {
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reminder-share-close {
    background: none;
    border: none;
    color: var(--chat-text-secondary, #999);
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s;
}

.reminder-share-close:hover {
    color: var(--chat-text, #333);
}

.reminder-share-loading {
    padding: 30px;
    text-align: center;
    color: var(--chat-text-secondary, #999);
    font-size: 0.85rem;
}

/* ── Share Tabs ── */
.reminder-share-tabs {
    display: flex;
    border-bottom: 1px solid var(--chat-border, #e0e0e0);
}

.reminder-share-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--chat-text-secondary, #999);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s;
}

.reminder-share-tab:hover {
    color: var(--chat-text, #333);
    background: rgba(0, 0, 0, 0.02);
}

.reminder-share-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* ── Share List (users/groups/current) ── */
.reminder-share-list {
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
}

.reminder-share-empty {
    padding: 20px;
    text-align: center;
    color: var(--chat-text-secondary, #aaa);
    font-size: 0.8rem;
}

/* ── User Row ── */
.reminder-share-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    transition: background 0.1s;
}

.reminder-share-user-row:hover {
    background: rgba(0, 0, 0, 0.02);
}

.reminder-share-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--chat-text, #333);
    flex: 1;
}

.share-check-on {
    color: #667eea;
    font-size: 1.05rem;
}
.share-check-off {
    color: var(--chat-text-secondary, #999);
    font-size: 1.05rem;
}
.reminder-share-user-row.selected,
.reminder-share-group-row.selected {
    background: rgba(102, 126, 234, 0.08);
}

.reminder-share-perm {
    padding: 3px 8px;
    border: 1px solid var(--chat-border, #ddd);
    border-radius: 6px;
    font-size: 0.72rem;
    background: var(--chat-bg, #fff);
    color: var(--chat-text, #333);
    cursor: pointer;
}

.reminder-share-member-count {
    color: var(--chat-text-secondary, #999);
    font-size: 0.7rem;
    margin-left: 4px;
}

/* ── Group Row ── */
.reminder-share-group-row {
    border-bottom: 1px solid var(--chat-border, #f0f0f0);
}

.reminder-share-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    gap: 6px;
}

.reminder-share-group-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.reminder-share-group-manage {
    background: none;
    border: none;
    color: var(--chat-text-secondary, #aaa);
    cursor: pointer;
    padding: 4px;
    font-size: 0.75rem;
    transition: color 0.15s;
}

.reminder-share-group-manage:hover {
    color: var(--chat-text, #333);
}

/* ── Group Management Panel ── */
.reminder-group-manage {
    padding: 8px 16px 12px 32px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--chat-border, #f0f0f0);
}

.reminder-group-manage-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--chat-text-secondary, #888);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.reminder-group-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 0.78rem;
    color: var(--chat-text, #333);
}

.reminder-group-member-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.65rem;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.reminder-group-member-remove:hover {
    opacity: 1;
}

.reminder-group-add-member {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.reminder-group-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px dashed var(--chat-border, #ccc);
    background: none;
    color: var(--chat-text-secondary, #888);
    font-size: 0.68rem;
    cursor: pointer;
    transition: all 0.15s;
}

.reminder-group-add-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.reminder-group-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(231, 76, 60, 0.3);
    background: none;
    color: #e74c3c;
    font-size: 0.68rem;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.15s;
}

.reminder-group-delete-btn:hover {
    background: rgba(231, 76, 60, 0.08);
    border-color: #e74c3c;
}

/* ── Create Group ── */
.reminder-group-create {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
}

.reminder-group-name-input {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid var(--chat-border, #ddd);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--chat-bg, #fff);
    color: var(--chat-text, #333);
}

.reminder-group-name-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.reminder-group-create-btn,
.reminder-group-cancel-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.85rem;
    transition: color 0.15s;
}

.reminder-group-create-btn {
    color: #27ae60;
}

.reminder-group-create-btn:hover {
    color: #219a52;
}

.reminder-group-cancel-btn {
    color: #e74c3c;
}

.reminder-group-cancel-btn:hover {
    color: #c0392b;
}

.reminder-share-create-group {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.1s;
}

.reminder-share-create-group:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* ── Current Shares ── */
.reminder-share-current-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 0.8rem;
}

.reminder-share-current-row:hover {
    background: rgba(0, 0, 0, 0.02);
}

.reminder-share-current-row > i {
    color: var(--chat-text-secondary, #aaa);
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
}

.reminder-share-current-name {
    flex: 1;
    color: var(--chat-text, #333);
}

.reminder-share-current-perm {
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.reminder-share-current-perm.perm-view {
    background: rgba(0, 0, 0, 0.05);
    color: var(--chat-text-secondary, #888);
}

.reminder-share-current-perm.perm-edit {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.reminder-share-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.7rem;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.reminder-share-remove:hover {
    opacity: 1;
}

/* ── Share Actions ── */
.reminder-share-actions {
    padding: 10px 16px;
    border-top: 1px solid var(--chat-border, #e0e0e0);
    display: flex;
    justify-content: flex-end;
}

.reminder-share-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 20px;
    border-radius: 8px;
    border: none;
    background: #667eea;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.reminder-share-save:hover {
    background: #5a6fd6;
}

/* ── Dark Mode for Share Modal ── */
[data-bs-theme="dark"] .reminder-share-modal {
    background: #1e1e2e;
    border-color: #333;
}

[data-bs-theme="dark"] .reminder-share-modal-header {
    border-bottom-color: #333;
}

[data-bs-theme="dark"] .reminder-share-tab:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .reminder-share-user-row:hover,
[data-bs-theme="dark"] .reminder-share-group-header:hover,
[data-bs-theme="dark"] .reminder-share-current-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .reminder-group-manage {
    background: rgba(255, 255, 255, 0.03);
    border-top-color: #333;
}

[data-bs-theme="dark"] .reminder-share-perm {
    background: #2a2a3a;
    border-color: #444;
    color: #ccc;
}

[data-bs-theme="dark"] .reminder-group-name-input {
    background: #2a2a3a;
    border-color: #444;
    color: #ccc;
}

[data-bs-theme="dark"] .reminder-share-create-group:hover {
    background: rgba(102, 126, 234, 0.1);
}

[data-bs-theme="dark"] .reminder-share-actions {
    border-top-color: #333;
}

[data-bs-theme="dark"] .reminder-share-current-perm.perm-view {
    background: rgba(255, 255, 255, 0.06);
    color: #888;
}

[data-bs-theme="dark"] .reminder-share-current-perm.perm-edit {
    background: rgba(39, 174, 96, 0.15);
    color: #2ecc71;
}

/* ============================================================================
   Tag Context Menu (right-click / long-press)
   ============================================================================ */
.reminder-tag-context-menu {
    position: fixed;
    z-index: 9999999;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    padding: 4px 0;
    animation: reminder-ctx-fade-in 0.12s ease-out;
}

@keyframes reminder-ctx-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.reminder-ctx-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--chat-text);
    transition: background 0.1s;
}

.reminder-ctx-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.reminder-ctx-item.disabled {
    opacity: 0.5;
    cursor: default;
}

.reminder-ctx-item.disabled:hover {
    background: transparent;
}

.reminder-ctx-item.danger {
    color: #e74c3c;
}

.reminder-ctx-item.danger:hover {
    background: rgba(231, 76, 60, 0.06);
}

[data-bs-theme="dark"] .reminder-tag-context-menu {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .reminder-ctx-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .reminder-ctx-item.danger:hover {
    background: rgba(231, 76, 60, 0.12);
}

/* Context menu rename input */
.reminder-ctx-rename-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
}

.reminder-ctx-rename-input {
    flex: 1;
    border: 1.5px solid var(--chat-border, #ddd);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.8rem;
    outline: none;
    background: var(--chat-bg, #fff);
    color: var(--chat-text, #333);
    min-width: 0;
}

.reminder-ctx-rename-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.reminder-ctx-rename-confirm,
.reminder-ctx-rename-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.reminder-ctx-rename-confirm {
    background: #667eea;
    color: #fff;
}

.reminder-ctx-rename-confirm:hover {
    background: #5568d3;
}

.reminder-ctx-rename-cancel {
    background: transparent;
    color: var(--chat-text-secondary, #999);
    border: 1px solid var(--chat-border, #ddd);
}

.reminder-ctx-rename-cancel:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--chat-text, #333);
}

[data-bs-theme="dark"] .reminder-ctx-rename-input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
}

[data-bs-theme="dark"] .reminder-ctx-rename-cancel {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
}

[data-bs-theme="dark"] .reminder-ctx-rename-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
}

/* ============================================================================
   Desktop: Increase text sizes (mobile sizes are the base)
   ============================================================================ */
@media (min-width: 768px) {
    /* Header */
    .reminder-header-search-input      { font-size: 0.9rem; }
    .reminder-header-search-icon       { font-size: 0.85rem; }

    /* Category & filter chips */
    .reminder-chip                     { font-size: 0.95rem; padding: 6px 16px; }
    .reminder-chip i                   { font-size: 0.85rem; }
    .reminder-chip-tag                 { font-size: 0.9rem; padding: 5px 14px; }
    .reminder-filter-label             { font-size: 0.85rem; }
    .reminder-filter-toggle            { font-size: 0.9rem; width: 34px; height: 34px; }

    /* Tabs */
    .reminder-panel-tab                { font-size: 1rem; }
    .reminder-tab-count                { font-size: 0.85rem; }

    /* Search (old standalone bar - kept for compatibility) */
    .reminder-search-input             { font-size: 1rem; }
    .reminder-search-btn               { font-size: 0.9rem; padding: 6px 12px; }
    .reminder-search-clear             { font-size: 0.95rem; }

    /* Item card content */
    .reminder-panel-item-title         { font-size: 1.1rem; }
    .reminder-panel-item-icon          { width: 34px; height: 34px; }
    .reminder-panel-item-icon i        { font-size: 0.9rem; }

    /* Meta: category badge, tags, dates */
    .reminder-panel-item-category      { font-size: 0.85rem; padding: 2px 10px; }
    .reminder-panel-item-tag           { font-size: 0.85rem; padding: 2px 9px; }
    .reminder-panel-item-date          { font-size: 0.9rem; }
    .reminder-panel-item-date i        { font-size: 0.85rem; }
    .reminder-panel-item-timeslot      { font-size: 0.85rem; }
    .reminder-panel-item-timeslot i    { font-size: 0.8rem; }
    .reminder-panel-item-nth           { font-size: 0.85rem; }
    .reminder-panel-item-nth i         { font-size: 0.75rem; }
    .reminder-panel-item-recurrence    { font-size: 0.85rem; }
    .reminder-panel-item-recurrence i  { font-size: 0.75rem; }
    .reminder-recurring-icon           { font-size: 0.85rem; }

    /* Expense title */
    .reminder-expense-title .expense-separator { font-size: 0.75rem; }

    /* Expanded details */
    .reminder-panel-item-desc          { font-size: 0.95rem; }
    .reminder-panel-item-url           { font-size: 0.9rem; }
    .reminder-panel-item-url i         { font-size: 0.8rem; }

    /* Indicators (sub-items, share) */
    .reminder-indicator                { font-size: 0.9rem; }
    .reminder-indicator i              { font-size: 0.9rem; }
    .reminder-indicator-count          { font-size: 0.85rem; }
    .reminder-expand-icon              { font-size: 0.85rem; }

    /* Sub-items in expanded view */
    .reminder-panel-item-sub           { font-size: 0.9rem; }
    .reminder-panel-item-sub i         { font-size: 0.85rem; }

    /* Action buttons (Done / Postpone) */
    .reminder-action-btn               { font-size: 0.8rem; padding: 3px 10px; }

    /* Password section */
    .reminder-password-text            { font-size: 0.9rem; }

    /* Empty state */
    .reminder-panel-empty p            { font-size: 1.05rem; }
    .reminder-panel-empty i            { font-size: 2.4rem; }

    /* Load more */
    .reminder-load-more-btn            { font-size: 0.95rem; }
    .reminder-load-more-btn i          { font-size: 0.85rem; }

    /* Delete button */
    .reminder-delete-btn               { font-size: 0.9rem; }

    /* Share chip */
    .reminder-chip-share               { font-size: 0.75rem; }

    /* Context menu */
    .reminder-ctx-item                 { font-size: 1rem; padding: 10px 16px; }
    .reminder-ctx-rename-input         { font-size: 1rem; }
}

/* ============================================================================
   Print: Hide
   ============================================================================ */
@media print {
    .reminder-panel {
        display: none !important;
    }
}
