:root {
    --primary-bg: #f8fafc;
    --secondary-bg: #ffffff;
    --accent-primary: #6366f1; /* Indigo */
    --accent-secondary: #f59e0b; /* Amber */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0.02) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.02) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.02) 0, transparent 50%);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    height: 100vh;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Login Screen */
#login-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    padding: 48px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
}

.logo {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo i {
    color: var(--accent-primary);
}

.login-container p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    letter-spacing: 0.02em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #5558e6 0%, #7c4fe0 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 80px;
    height: calc(100vh - 40px);
    margin: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    background: var(--secondary-bg);
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 20px;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
}

.nav-item span {
    display: none; /* Hide text on desktop sidebar */
}

.nav-item:hover {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
}

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px 40px 20px 20px;
    overflow-y: auto;
    position: relative;
}

/* Custom scrollbar */
.main-content::-webkit-scrollbar {
    width: 6px;
}
.main-content::-webkit-scrollbar-track {
    background: transparent;
}
.main-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.main-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-top: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--secondary-bg);
    padding: 8px 16px 8px 8px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
}

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

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.greeting {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-profile i.fa-chevron-down {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.top-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--secondary-bg);
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Page Typography */
.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.date-subtitle {
    color: var(--accent-primary);
    font-size: 14px;
    margin-bottom: 28px;
    font-weight: 500;
}

/* Action Cards */
.action-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.card {
    background: var(--secondary-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 20px;
}

.action-card.create-note {
    background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%);
    border: 1px solid #fde68a;
}

.action-card.create-note:hover {
    border-color: #f59e0b;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.action-card.create-task {
    background: linear-gradient(135deg, #e0e7ff 0%, #eef2ff 100%);
    border: 1px solid #c7d2fe;
}

.action-card.create-task:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    flex-shrink: 0;
}

.create-note .icon-wrapper {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.create-task .icon-wrapper {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.action-card h3 {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
}

.action-card h3 strong {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Profile Progress */
.profile-progress {
    margin-bottom: 32px;
    background: #ffffff;
    padding: 20px 24px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 14px;
}

.percentage {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.progress-bar-container {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 3px;
    transition: width 1s ease-in-out;
}

/* Notes Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.see-all {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    padding: 4px 10px;
    border-radius: 6px;
}

.see-all:hover {
    background: rgba(99, 102, 241, 0.08);
}

.notes-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Note Card Styles */
.note-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 16px;
    position: relative;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.note-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.note-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    border: none;
}

.note-content h4 {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 600;
}

.note-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Task Card Styles */
.task-card {
    border-radius: 14px !important;
    padding: 14px 18px !important;
    margin-bottom: 10px !important;
    border: 1px solid var(--border-color) !important;
    transition: var(--transition) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.task-card:hover {
    border-color: #c7d2fe !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08) !important;
    transform: translateY(-1px) !important;
}

/* Task action buttons */
.task-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.task-action-btn.edit {
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
}
.task-action-btn.edit:hover {
    background: rgba(99, 102, 241, 0.16);
}

.task-action-btn.delete {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}
.task-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.16);
}

/* Note action buttons */
.note-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    flex-shrink: 0;
}

.note-action-btn.edit {
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
}
.note-action-btn.edit:hover {
    background: rgba(99, 102, 241, 0.16);
}

.note-action-btn.delete {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}
.note-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.16);
}

/* Time badge */
.time-badge {
    font-size: 11px;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.empty-state-subtext {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Calendar View */
.calendar-container {
    background: var(--secondary-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-nav {
    display: flex;
    gap: 6px;
}

.calendar-nav button {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--secondary-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.calendar-nav button:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: #c7d2fe;
    color: #6366f1;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}

.calendar-day {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 2px;
    font-size: 13px;
    font-weight: 500;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.calendar-day-number {
    z-index: 2;
    align-self: flex-end;
    margin-right: 4px;
    margin-bottom: 4px;
}

.calendar-day.today .calendar-day-number {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.calendar-day.selected {
    background: rgba(99, 102, 241, 0.05);
}

.calendar-day:hover {
    background: rgba(99, 102, 241, 0.06);
}

.calendar-day.other-month {
    color: var(--text-tertiary);
    opacity: 0.4;
}

.calendar-events-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.calendar-event-pill {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    font-weight: 500;
}

.calendar-event-pill.holiday { background: #f59e0b; }
.calendar-event-pill.user-event { background: #d946ef; /* macOS style pinkish */ }

.calendar-tasks-section {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.calendar-tasks-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid #f1f5f9;
    transition: var(--transition);
}

.calendar-task-item:hover {
    border-color: #e2e8f0;
}

.calendar-task-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-task-dot.pending { background: #f59e0b; }
.calendar-task-dot.completed { background: #22c55e; }

.calendar-task-info {
    flex: 1;
}

.calendar-task-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.calendar-task-time {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ── EVENT / REMINDER MODAL ─────────────────────────────────────────────────── */
.event-modal-card {
    padding: 0;
    border-radius: 18px;
    width: 420px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    color: #000000;
    box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

.event-tab-switcher {
    display: flex;
    background: #e5e5ea;
    border-radius: 12px;
    margin: 16px 16px 12px;
    padding: 3px;
    gap: 2px;
}

.event-tab {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #8e8e93;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.event-tab.active {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#tab-event.active {
    background: #ffffff;
}

.event-title-input {
    display: block;
    width: calc(100% - 32px);
    margin: 0 16px 6px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 22px;
    font-weight: 600;
    color: #000000;
    font-family: inherit;
}

.event-title-input::placeholder { color: #c7c7cc; }

.event-notes-input {
    display: block;
    width: calc(100% - 32px);
    margin: 0 16px 6px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    color: #3a3a3c;
    font-family: inherit;
    padding: 4px 0;
}

.event-notes-input::placeholder { color: #c7c7cc; }

.event-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px 6px;
}

.event-section-card {
    background: #ffffff;
    border-radius: 12px;
    margin: 0 16px 12px;
    overflow: hidden;
    border: 1px solid #e5e5ea;
}

.event-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    min-height: 44px;
}

.event-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #000000;
}

.event-row-left i {
    width: 20px;
    text-align: center;
    color: #8e8e93;
}

.event-row-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-divider {
    height: 1px;
    background: #e5e5ea;
    margin: 0 14px;
}

.event-inline-input {
    background: transparent;
    border: none;
    outline: none;
    color: #000000;
    font-size: 15px;
    font-family: inherit;
    text-align: right;
}

.event-inline-select {
    background: transparent;
    border: none;
    outline: none;
    color: #000000;
    font-size: 15px;
    font-family: inherit;
    text-align: right;
    cursor: pointer;
    -webkit-appearance: none;
}

.event-inline-select option { background: #ffffff; color: #000000; }

.event-inline-text-input {
    background: transparent;
    border: none;
    outline: none;
    color: #000000;
    font-size: 15px;
    font-family: inherit;
    text-align: right;
    width: 180px;
}

.event-inline-text-input::placeholder { color: #c7c7cc; }

.event-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
}

.event-color-dot:hover { transform: scale(1.15); }
.event-color-dot.selected { border: 2px solid #000000; transform: scale(1.15); }

.event-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px 16px;
}

.event-modal-actions .btn-cancel {
    background: #e5e5ea;
    color: #000000;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.event-modal-actions .btn-cancel:hover { background: #d1d1d6; }

.event-modal-actions .btn-primary {
    background: #007aff;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.event-modal-actions .btn-primary:hover { background: #0056b3; }

/* --- PREMIUM WHITE SWITCH ACCOUNT DROPDOWN (Google Style) --- */
.account-dropdown-google {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    background: #e9eef6;
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0,0,0,0.08);
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.account-dropdown-google.show {
    display: flex;
    animation: fadeInDown 0.2s ease-out forwards;
}

.google-dropdown-top {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    position: relative;
}

.google-email {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.google-close-btn {
    position: absolute;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.google-close-btn:hover {
    background: #f1f5f9;
}

.google-active-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    padding-bottom: 24px;
    margin-bottom: 4px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
}

.google-avatar-large-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
    background: #0b57d0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
    font-weight: 500;
}

.google-avatar-large {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.google-hi {
    font-size: 20px;
    font-weight: 500;
    color: #1f1f1f;
    margin-bottom: 16px;
}

.google-manage-btn {
    padding: 8px 24px;
    border-radius: 100px;
    border: 1px solid #cbd5e1;
    color: #0b57d0;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.google-manage-btn:hover {
    background: #f8fafc;
}

.google-switch-section {
    background: #e9eef6;
    padding-bottom: 8px;
}

.google-switch-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    padding: 8px 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.google-account-list-container {
    background: #ffffff;
    border-radius: 20px;
    margin: 0 8px 8px 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.google-account-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

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

.google-account-item:hover {
    background: #f8fafc;
}

.google-account-avatar-container {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    background: #0b57d0;
    flex-shrink: 0;
    overflow: hidden;
}

.google-account-avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.google-account-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.google-account-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.google-account-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f1f1f;
}

.google-account-email {
    font-size: 13px;
    color: #444746;
}

.google-signed-out-badge {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.google-account-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.google-btn-signin {
    background: #e0e7ff;
    color: #4f46e5;
    border: none;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.google-btn-signin:hover { background: #c7d2fe; }

.google-btn-remove {
    background: transparent;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.google-btn-remove:hover { background: #f1f5f9; color: #0f172a; }

.google-add-account-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
}

.google-add-account-btn:hover {
    background: #f8fafc;
}

.google-add-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #475569;
    font-size: 14px;
    margin-right: 12px;
}

.google-add-text {
    font-size: 14px;
    font-weight: 500;
    color: #1f1f1f;
}

.google-signout-container {
    padding: 0 8px 8px 8px;
}

.google-signout-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #1f1f1f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.google-signout-all-btn:hover {
    background: #f8fafc;
}

.google-signout-all-btn i {
    color: #64748b;
    font-size: 16px;
}

.google-dropdown-footer {
    text-align: center;
    padding: 12px;
    font-size: 12px;
    color: #64748b;
}

.google-dropdown-footer a {
    color: #64748b;
    text-decoration: none;
    margin: 0 4px;
}

.google-dropdown-footer a:hover {
    color: #1f1f1f;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

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

.modal-card {
    background: #ffffff;
    width: 90%;
    max-width: 440px;
    padding: 28px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
    border: 1px solid rgba(0,0,0,0.04);
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #f8fafc;
    color: var(--text-primary);
}

.modal-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fff;
}

.modal-input::placeholder {
    color: var(--text-tertiary);
}

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

.btn-cancel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.btn-cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

/* Quill Content Styling */
.quill-content p {
    margin-bottom: 8px;
}
.quill-content p:last-child {
    margin-bottom: 0;
}
.quill-content ul, .quill-content ol {
    margin-left: 20px;
    margin-bottom: 8px;
}
.quill-content a {
    color: #6366f1;
    text-decoration: none;
}
.quill-content a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: calc(100% - 40px);
        height: 70px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0 20px;
        margin: 20px 20px 0 20px;
    }

    .nav-items {
        flex-direction: row;
        justify-content: space-between;
    }

    .main-content {
        padding: 20px;
    }

    .action-cards {
        grid-template-columns: 1fr;
    }

    .notes-list {
        grid-template-columns: 1fr;
    }
    
    .account-dropdown-google {
        width: calc(100vw - 40px);
        right: -20px;
        top: calc(100% + 20px);
    }
}
/* ── MASTER-DETAIL NOTES LAYOUT ──────────────────────────────────────────────── */
.master-detail-layout {
    gap: 0;
    height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.tab-view.active.master-detail-layout {
    display: flex !important;
}

.master-pane {
    width: 320px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.master-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.master-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.master-add-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #6366f1;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.master-add-btn:hover {
    background: #e0e7ff;
}

.master-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.master-list-item {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: 1px solid transparent;
}

.master-list-item:hover {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.master-list-item.active {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.master-list-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.master-list-preview {
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    min-width: 0;
}

.detail-header {
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 16px;
}

.inline-title-input {
    border: none;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    flex: 1;
    min-width: 200px;
    background: transparent;
}

.inline-title-input::placeholder {
    color: #cbd5e1;
}

.detail-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.lock-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.lock-icon {
    font-size: 14px;
}

.detail-footer {
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
}

.save-status {
    font-size: 13px;
    color: #94a3b8;
}

.inline-save-btn {
    padding: 8px 24px;
    border-radius: 12px;
    font-size: 14px;
    background: #6366f1;
}

/* ── Quill Editor Alignment ─────────────────────────────────────────────────── */
#inline-editor {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#inline-editor .ql-editor {
    padding: 16px 20px;
    font-size: 15px;
    line-height: 1.7;
}

#inline-editor .ql-editor.ql-blank::before {
    left: 20px;
    font-style: italic;
    color: #94a3b8;
}

#inline-editor .ql-toolbar {
    border-left: none;
    border-right: none;
    border-color: #e2e8f0;
    padding: 8px 16px;
    flex-shrink: 0;
}

#inline-editor .ql-container {
    border: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.dropdown-item i {
    color: #64748b;
    margin-right: 8px;
}

.dropdown-item.danger:hover {
    background: #fef2f2;
}
.dropdown-item.danger i {
    color: #ef4444;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}
.preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.preview-text {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Image Gallery Styles */
.image-gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px !important;
}

.gallery-image-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.gallery-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.gallery-image-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    opacity: 1;
    transition: opacity 0.2s, background 0.2s;
}

.gallery-image-wrapper:hover .gallery-image-delete {
    opacity: 1;
}

.gallery-image-delete:hover {
    background: #ef4444;
}
