/**
 * Pandora — Application Stylesheet
 * Login panel, sidebar, nav bar, content area, quick-entry bar,
 * entry cards, modals, and all UI components.
 */

/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */
.login-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    max-width: 92vw;
    padding: 2.5rem 2rem 2rem;
    background: var(--color-bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-dark), var(--shadow-glow);
    z-index: 20;
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand-mark {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.08em;
    text-shadow: 0 0 20px var(--color-accent-glow);
}

.login-brand-sub {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.3rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.form-group input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    color: var(--color-text-bright);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    border-color: var(--color-accent-soft);
    box-shadow: 0 0 0 2px var(--color-accent-glow);
}

.form-group input::placeholder {
    color: var(--color-text-dim);
}

.login-btn {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--color-accent);
    color: var(--color-bg);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s;
}

.login-btn:hover {
    background: var(--color-accent-hover);
    box-shadow: 0 0 15px var(--color-accent-glow);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-error {
    font-size: 0.8rem;
    color: #e05050;
    text-align: center;
    min-height: 1.2rem;
    margin-top: 0.5rem;
}

.auth-toggle {
    text-align: center;
    font-size: 0.78rem;
    color: var(--color-text-dim);
    margin-top: 1rem;
}

.auth-toggle a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

.optional-label {
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--color-text-dim);
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    cursor: pointer;
    user-select: none;
    margin-top: 0.25rem;
    min-height: 44px;
}

.remember-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: var(--color-accent);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════
   TOP NAVIGATION BAR
   ═══════════════════════════════════════════════ */
.nav-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(8, 10, 18, 0.80);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 30;
    gap: 1rem;
}

.nav-brand {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-accent);
    letter-spacing: 0.06em;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.nav-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.4rem 0.8rem 0.4rem 2rem;
    color: var(--color-text);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.3s;
}

.nav-search input:focus {
    border-color: var(--color-accent-soft);
}

.nav-search input::placeholder {
    color: var(--color-text-dim);
}

.nav-search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--color-text-dim);
    pointer-events: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: auto;
    flex-shrink: 0;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.ai-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #555;
    transition: background 0.5s;
}

.ai-status-dot.online {
    background: #40c040;
    box-shadow: 0 0 6px rgba(64, 192, 64, 0.4);
    animation: pulse-dot 2s ease-in-out infinite;
}

.ai-status-dot.processing {
    background: var(--color-accent);
    animation: pulse-dot 0.8s ease-in-out infinite;
}

.ai-status-dot.offline {
    background: #804040;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: background 0.3s;
}

.nav-user:hover {
    background: rgba(255, 255, 255, 0.04);
}

.nav-user-name {
    font-size: 0.8rem;
    color: var(--color-text);
}

.nav-logout {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: color 0.3s;
    background: none;
    border: none;
}

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

.sync-indicator {
    font-size: 0.7rem;
    color: var(--color-accent);
    background: rgba(201, 168, 76, 0.10);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    display: none;
}

.sync-indicator.visible {
    display: inline-block;
}

.app-status {
    position: fixed;
    right: 1rem;
    bottom: calc(var(--quick-entry-height) + 1rem);
    max-width: min(420px, calc(100vw - 2rem));
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: rgba(8, 10, 18, 0.92);
    color: var(--color-text-bright);
    font-size: 0.85rem;
    line-height: 1.5;
    box-shadow: var(--shadow-dark);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 120;
}

.app-status.visible {
    opacity: 1;
    transform: translateY(0);
}

.app-status.info {
    border-color: rgba(201, 168, 76, 0.3);
}

.app-status.error {
    border-color: rgba(208, 80, 80, 0.4);
}

/* ═══════════════════════════════════════════════
   LEFT SIDEBAR
   ═══════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: rgba(8, 10, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    z-index: 20;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-text-dim);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.8rem 1rem 0.3rem;
}

.folder-list {
    list-style: none;
    flex: 1;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.85rem;
    color: var(--color-text);
}

.folder-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.folder-item:focus-visible,
.entry-card:focus-visible,
.journal-entry:focus-visible,
.search-result-item:focus-visible,
.type-pill:focus-visible,
.quick-entry-submit:focus-visible,
.new-folder-btn:focus-visible,
.hamburger-btn:focus-visible,
.nav-logout:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.btn-danger-sm:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.folder-item.active {
    background: rgba(201, 168, 76, 0.06);
    border-left-color: var(--color-accent);
    color: var(--color-text-bright);
}

.folder-item-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    width: 1.2rem;
    text-align: center;
}

.folder-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-item-count {
    font-size: 0.7rem;
    color: var(--color-text-dim);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.sidebar-actions {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--color-border);
}

.new-folder-btn {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: 1px dashed var(--color-border);
    border-radius: 6px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.3s, color 0.3s;
}

.new-folder-btn:hover {
    border-color: var(--color-accent-soft);
    color: var(--color-accent);
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════ */
.main-content {
    position: fixed;
    top: var(--nav-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: var(--quick-entry-height);
    overflow-y: auto;
    padding: 1.5rem;
    z-index: 15;
}

.main-content.sidebar-collapsed {
    left: 0;
}

.folder-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.folder-header-info {
    flex: 1;
    min-width: 0;
}

.folder-header-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-bright);
    margin-bottom: 0.25rem;
}

.folder-header-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.folder-header-type {
    background: rgba(201, 168, 76, 0.10);
    color: var(--color-accent);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════
   ENTRY CARDS — Grid layout
   ═══════════════════════════════════════════════ */
.entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.entry-card {
    background: var(--color-bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.entry-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.entry-card.focused-result,
.journal-entry.focused-result {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.22);
}

.entry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.entry-card-type {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    opacity: 0.8;
}

.entry-card-date {
    font-size: 0.7rem;
    color: var(--color-text-dim);
}

.entry-card-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 0.6rem;
    word-break: break-word;
}

.entry-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.entry-tag {
    font-size: 0.65rem;
    color: var(--color-accent);
    background: rgba(201, 168, 76, 0.08);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.entry-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}

.entry-priority {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.entry-priority.low { color: var(--color-text-dim); }
.entry-priority.medium { color: var(--color-text-muted); }
.entry-priority.high { color: #d09040; }
.entry-priority.urgent { color: #d05050; }

.entry-status-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.entry-status-badge.done {
    color: #40a040;
    background: rgba(64, 160, 64, 0.10);
}

.entry-status-badge.archived {
    color: var(--color-text-dim);
    background: rgba(255, 255, 255, 0.03);
}

/* Todo card specifics */
.todo-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}

.todo-checkbox input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--color-border-hover);
    border-radius: 3px;
    flex-shrink: 0;
    margin-top: 0.2rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.todo-checkbox input[type="checkbox"]:checked {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.todo-checkbox .done-text {
    text-decoration: line-through;
    color: var(--color-text-dim);
}

/* List items */
.list-items-container {
    margin-top: 0.4rem;
}

.list-item {
    padding: 0.15rem 0;
}

.list-item .todo-checkbox {
    font-size: 0.85rem;
}

/* Re-pollinate button */
.repollinate-btn {
    margin-top: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    color: var(--color-accent);
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.repollinate-btn:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--color-accent-soft);
}

.repollinate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.todo-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    margin-top: 0.6rem;
    overflow: hidden;
}

.todo-progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    transition: width 0.3s;
}

/* Idea expansion */
.idea-expansion {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}

.idea-expansion-toggle {
    font-size: 0.75rem;
    color: var(--color-accent);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.3s;
}

.idea-expansion-toggle:hover {
    color: var(--color-accent-hover);
}

.idea-expansion-content {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.idea-expansion-content.collapsed {
    display: none;
}

.idea-connections {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.idea-connection-badge {
    font-size: 0.65rem;
    color: var(--color-silver);
    background: rgba(176, 184, 200, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.idea-connection-badge:hover {
    background: rgba(176, 184, 200, 0.15);
}

/* Journal timeline */
.journal-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.journal-entry {
    padding: 1rem 1.2rem 1rem 2rem;
    border-left: 2px solid var(--color-border);
    position: relative;
}

.journal-entry::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 1.2rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 2px solid var(--color-bg);
}

.journal-date {
    font-size: 0.7rem;
    color: var(--color-accent);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.journal-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text);
}

/* ═══════════════════════════════════════════════
   QUICK-ENTRY BAR
   ═══════════════════════════════════════════════ */
.quick-entry {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--quick-entry-height);
    background: rgba(8, 10, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.6rem;
    z-index: 20;
}

.quick-entry.sidebar-collapsed {
    left: 0;
}

.quick-entry-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    color: var(--color-text-bright);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
    resize: none;
    min-height: 36px;
    max-height: 80px;
}

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

.quick-entry-input::placeholder {
    color: var(--color-text-dim);
}

.quick-entry-folder {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: var(--color-text);
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
}

.quick-entry-types {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}

.type-pill {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.type-pill.active {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(201, 168, 76, 0.08);
}

.type-pill:hover {
    border-color: var(--color-accent-soft);
    color: var(--color-text);
}

.quick-entry-submit {
    padding: 0.45rem 1rem;
    background: var(--color-accent);
    color: var(--color-bg);
    font-weight: 600;
    font-size: 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.3s;
}

.quick-entry-submit:hover {
    background: var(--color-accent-hover);
}

/* ═══════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-overlay.visible {
    display: flex;
}

.modal {
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    width: 480px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-dark);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-bright);
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn-primary {
    padding: 0.5rem 1.2rem;
    background: var(--color-accent);
    color: var(--color-bg);
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

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

.btn-secondary {
    padding: 0.5rem 1.2rem;
    background: transparent;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.3s, color 0.3s;
}

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

.btn-danger {
    padding: 0.5rem 1.2rem;
    background: rgba(220, 60, 60, 0.15);
    color: #e06060;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(220, 60, 60, 0.3);
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
}
.btn-danger:hover {
    background: rgba(220, 60, 60, 0.3);
    color: #f07070;
    border-color: rgba(220, 60, 60, 0.5);
}

.btn-danger-sm {
    padding: 0.3rem 0.8rem;
    background: rgba(220, 60, 60, 0.1);
    color: #d06060;
    font-weight: 500;
    font-size: 0.75rem;
    border: 1px solid rgba(220, 60, 60, 0.2);
    border-radius: 5px;
    cursor: pointer;
    min-height: 44px;
    white-space: nowrap;
}
.btn-danger-sm:hover {
    background: rgba(220, 60, 60, 0.25);
    color: #f07070;
    border-color: rgba(220, 60, 60, 0.4);
}

/* ═══════════════════════════════════════════════
   SEARCH OVERLAY (Cmd+K)
   ═══════════════════════════════════════════════ */
.search-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 110;
    display: none;
    justify-content: center;
    padding-top: 15vh;
}

.search-overlay.visible {
    display: flex;
}

.search-box {
    width: 560px;
    max-width: 92vw;
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-dark);
    max-height: 60vh;
    display: flex;
    flex-direction: column;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-bright);
    font-size: 1rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--color-text-dim);
}

.search-results {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem 0;
}

.search-result-item {
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.search-result-title {
    font-size: 0.9rem;
    color: var(--color-text);
}

.search-result-folder {
    font-size: 0.7rem;
    color: var(--color-text-dim);
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-dim);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state-text {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.empty-state-hint {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

/* ═══════════════════════════════════════════════
   WIDE MODAL VARIANT
   ═══════════════════════════════════════════════ */
.modal-wide {
    width: 600px;
}

/* ═══════════════════════════════════════════════
   HAMBURGER BUTTON (hidden on desktop)
   ═══════════════════════════════════════════════ */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.4rem;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ═══════════════════════════════════════════════
   SIDEBAR MOBILE BACKDROP
   ═══════════════════════════════════════════════ */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 19;
}

.sidebar-backdrop.visible {
    display: block;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Mobile (max-width: 768px)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        --nav-height: 48px;
        --quick-entry-height: auto;
    }

    /* Hamburger visible */
    .hamburger-btn {
        display: flex;
    }

    /* Nav bar: compact */
    .nav-bar {
        gap: 0.5rem;
        padding: 0 0.5rem;
    }

    .nav-search {
        max-width: none;
        flex: 1;
        min-width: 0;
    }

    .nav-search-icon {
        display: none;
    }

    .nav-search input {
        padding-left: 0.8rem;
        font-size: 0.8rem;
    }

    .nav-right {
        gap: 0.4rem;
    }

    .nav-user-name {
        display: none;
    }

    #ai-status-text {
        display: none;
    }

    .nav-logout {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.4rem;
    }

    /* Sidebar: slide-in overlay */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 25;
        padding-top: calc(var(--nav-height) + 0.5rem);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Sidebar touch targets */
    .folder-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
    }

    .new-folder-btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Main content: full width */
    .main-content {
        left: 0;
        bottom: 0;
        padding: 1rem 0.75rem calc(11rem + env(safe-area-inset-bottom, 0px));
    }

    /* Quick-entry bar: stacked layout */
    .quick-entry {
        left: 0;
        height: auto;
        flex-wrap: wrap;
        min-height: 8.5rem;
        padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
        gap: 0.4rem;
    }

    .quick-entry-input {
        flex: 1 1 100%;
        min-width: 0;
    }

    .quick-entry-folder {
        flex: 1;
        min-width: 0;
        min-height: 44px;
    }

    .quick-entry-types {
        flex: 1 1 100%;
        flex-wrap: wrap;
    }

    .type-pill {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.4rem 0.5rem;
    }

    .quick-entry-submit {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem 0.8rem;
    }

    /* Entry cards: single column, narrower min */
    .entries-grid {
        grid-template-columns: 1fr;
    }

    /* Modals: full width on mobile */
    .modal-wide {
        width: auto;
    }

    .modal {
        max-width: 96vw;
        max-height: 90vh;
    }

    /* Search overlay */
    .search-overlay {
        padding-top: 8vh;
    }

    .search-box {
        width: 96vw;
        max-height: 70vh;
    }

    .search-box input {
        min-height: 44px;
    }

    .search-result-item {
        min-height: 44px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Todo checkboxes: larger touch */
    .todo-checkbox input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-width: 44px;
        min-height: 44px;
    }

    /* Login panel */
    .login-panel {
        padding: 2rem 1.5rem 1.5rem;
    }

    /* Sync indicator */
    .sync-indicator {
        font-size: 0.65rem;
        padding: 0.1rem 0.35rem;
    }

    .app-status {
        right: 0.75rem;
        left: 0.75rem;
        bottom: calc(9rem + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Small phones (max-width: 400px)
   ═══════════════════════════════════════════════ */
@media (max-width: 400px) {
    .nav-brand {
        font-size: 0.85rem;
    }

    .login-panel {
        padding: 1.5rem 1rem 1rem;
    }

    .login-brand-mark {
        font-size: 1.4rem;
    }

    .quick-entry-types {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    .entry-card {
        padding: 0.8rem;
    }
}
