/* ========================================================
   KAIROVA WORKSPACE — GOOGLE CALENDAR + KEEP + TASKS STYLING
   LIGHT & DARK THEMES WITH FULL RECURRING TASKS & CALENDARS
   ======================================================== */

:root {
    /* Light Theme Variables */
    --g-bg: #ffffff;
    --g-surface: #f8fafd;
    --g-surface-card: #ffffff;
    --g-hover: #f1f3f4;
    --g-active: #e8f0fe;
    --g-border: #dadce0;
    --g-border-subtle: #f1f3f4;
    
    --g-text-primary: #3c4043;
    --g-text-secondary: #70757a;
    --g-text-muted: #80868b;
    
    --g-blue: #1a73e8;
    --g-blue-hover: #1557b0;
    --g-blue-light: #e8f0fe;
    --g-blue-text: #1967d2;
    
    --g-keep-yellow: #fbbc04;
    --g-tasks-blue: #1a73e8;
    --g-red: #ea4335;
    --g-green: #34a853;
    --g-modal-bg: #ffffff;
    
    --sidebar-width: 256px;
    --companion-width: 360px;
    --rail-width: 56px;
    --header-height: 64px;
    --hour-height: 52px;
}

/* --- Dark Theme Variables --- */
body.dark-theme {
    --g-bg: #1f1f1f;
    --g-surface: #18191a;
    --g-surface-card: #28292a;
    --g-hover: #35363a;
    --g-active: #394457;
    --g-border: #3c4043;
    --g-border-subtle: #2d2e30;
    
    --g-text-primary: #e8eaed;
    --g-text-secondary: #9aa0a6;
    --g-text-muted: #80868b;
    
    --g-blue: #8ab4f8;
    --g-blue-hover: #aecbfa;
    --g-blue-light: #283347;
    --g-blue-text: #8ab4f8;
    
    --g-keep-yellow: #fdd663;
    --g-tasks-blue: #8ab4f8;
    --g-modal-bg: #28292a;
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--g-text-primary);
    background-color: var(--g-bg);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* --- Top Header (Google Calendar Style) --- */
.google-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--g-border);
    background: var(--g-bg);
    z-index: 50;
    flex-shrink: 0;
}

.header-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-right: 12px;
}

.calendar-icon-svg {
    width: 36px;
    height: 36px;
    background: var(--g-blue);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.cal-month-name {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.cal-day-num {
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--g-text-primary);
    letter-spacing: -0.2px;
}

.brand-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--g-blue);
    background: var(--g-blue-light);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.current-date-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--g-text-primary);
    min-width: 180px;
}

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

/* View Selector & User */
.view-switcher-dropdown select {
    padding: 8px 12px;
    border: 1px solid var(--g-border);
    border-radius: 4px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--g-text-primary);
    background: var(--g-surface-card);
    cursor: pointer;
    outline: none;
}

.view-switcher-dropdown select:hover {
    background: var(--g-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #9333ea);
    color: #ffffff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Icon Buttons */
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--g-text-secondary);
    transition: background-color 0.15s;
}

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

.icon-btn-sm {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--g-text-secondary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn-sm:hover {
    background: var(--g-hover);
    color: var(--g-text-primary);
}

/* Standard Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.btn-outline {
    background: var(--g-surface-card);
    border: 1px solid var(--g-border);
    color: var(--g-text-primary);
}

.btn-outline:hover {
    background: var(--g-hover);
}

.btn-primary {
    background: var(--g-blue);
    color: #ffffff;
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: var(--g-blue-hover);
}

body.dark-theme .btn-primary {
    color: #1f1f1f;
}

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

.btn-text {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--g-text-secondary);
}

.btn-full {
    width: 100%;
}

.btn-danger-text {
    background: none;
    border: none;
    color: #ea4335;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger-text:hover {
    text-decoration: underline;
}

/* --- Workspace Main Container --- */
.workspace-body {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
    position: relative;
}

/* --- 1. Left Google-Style Sidebar --- */
.left-sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid var(--g-border);
    background: var(--g-bg);
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    overflow-y: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease, width 0.2s ease;
}

.left-sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
    padding: 0;
    border: none;
    overflow: hidden;
}

/* Google + Create Button */
.create-btn-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.google-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--g-surface-card);
    border: 1px solid var(--g-border);
    padding: 6px 20px 6px 12px;
    border-radius: 28px;
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--g-text-primary);
    cursor: pointer;
    transition: box-shadow 0.2s, background-color 0.2s;
}

.google-create-btn:hover {
    background-color: var(--g-hover);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.create-menu {
    position: absolute;
    top: 52px;
    left: 0;
    background: var(--g-surface-card);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid var(--g-border);
    width: 170px;
    z-index: 60;
    overflow: hidden;
}

.create-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--g-text-primary);
}

.create-menu-item:hover {
    background: var(--g-hover);
}

/* Mini Calendar Widget */
.mini-calendar {
    margin-bottom: 24px;
    user-select: none;
}

.mini-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px 8px;
}

.mini-cal-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--g-text-primary);
}

.mini-cal-nav {
    display: flex;
    gap: 4px;
}

.mini-nav-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--g-text-secondary);
    padding: 2px 6px;
    border-radius: 50%;
}

.mini-nav-btn:hover {
    background: var(--g-hover);
}

.mini-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--g-text-secondary);
    margin-bottom: 4px;
}

.mini-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.mini-day {
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    color: var(--g-text-primary);
}

.mini-day:hover {
    background: var(--g-hover);
}

.mini-day.today {
    background: var(--g-blue);
    color: #ffffff;
    font-weight: 700;
}

.mini-day.selected {
    background: var(--g-blue-light);
    color: var(--g-blue);
    font-weight: 700;
}

.mini-day.other {
    color: var(--g-text-muted);
}

/* Section Title Row (e.g. My Calendars + Add) */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 6px;
}

.sidebar-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--g-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 4px;
}

.cal-item-row:hover {
    background: var(--g-hover);
}

.cal-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--g-text-primary);
    cursor: pointer;
    flex: 1;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.btn-del-cal {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0;
    font-size: 0.85rem;
    color: var(--g-text-secondary);
    transition: opacity 0.15s;
}

.cal-item-row:hover .btn-del-cal {
    opacity: 1;
}

.btn-del-cal:hover {
    color: var(--g-red);
}

/* --- 2. Center Calendar Viewport --- */
.calendar-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--g-bg);
    overflow: hidden;
    position: relative;
}

.view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Month View */
.weekdays-bar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--g-border);
    background: var(--g-bg);
    height: 28px;
}

.weekday-col {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--g-text-secondary);
}

.month-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--g-border);
    gap: 1px;
    overflow-y: auto;
}

.month-day-cell {
    background: var(--g-bg);
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 110px;
    cursor: pointer;
    overflow: hidden;
}

.month-day-cell:hover {
    background-color: var(--g-surface);
}

.month-day-cell.other-month {
    background-color: var(--g-surface);
    color: var(--g-text-muted);
}

.month-day-cell.today {
    background-color: var(--g-blue-light);
}

body.dark-theme .month-day-cell.today {
    background-color: rgba(138, 180, 248, 0.08);
}

.cell-date-header {
    text-align: center;
    margin-bottom: 2px;
}

.cell-day-num {
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--g-text-primary);
}

.month-day-cell.today .cell-day-num {
    background: var(--g-blue);
    color: #ffffff;
}

body.dark-theme .month-day-cell.today .cell-day-num {
    color: #1f1f1f;
}

.cell-events-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

/* Event Chips in Month View */
.g-event-chip {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 4px;
}

.g-event-chip:hover {
    opacity: 0.9;
}

.g-task-chip {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--g-blue-text);
    background: var(--g-blue-light);
    border: 1px solid var(--g-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* --- Week View (Hourly Time-Grid) --- */
.week-header-bar {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid var(--g-border);
    height: 48px;
    flex-shrink: 0;
    background: var(--g-bg);
}

.time-col-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--g-text-muted);
    border-right: 1px solid var(--g-border);
}

.week-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--g-border);
}

.week-day-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--g-text-secondary);
    text-transform: uppercase;
}

.week-day-number {
    font-size: 1.1rem;
    font-weight: 600;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--g-text-primary);
}

.week-day-header.today .week-day-number {
    background: var(--g-blue);
    color: #ffffff;
}

body.dark-theme .week-day-header.today .week-day-number {
    color: #1f1f1f;
}

.week-scroll-body {
    flex: 1;
    display: flex;
    overflow-y: auto;
    position: relative;
    height: calc(100% - 48px);
}

.time-gutter {
    width: 60px;
    flex-shrink: 0;
    border-right: 1px solid var(--g-border);
    background: var(--g-bg);
}

.hour-row-label {
    height: var(--hour-height);
    font-size: 0.72rem;
    color: var(--g-text-muted);
    text-align: right;
    padding-right: 8px;
    transform: translateY(-8px);
}

.week-columns-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    position: relative;
    background: var(--g-bg);
}

.week-day-column {
    border-right: 1px solid var(--g-border);
    position: relative;
    height: calc(24 * var(--hour-height));
}

.grid-hour-slot {
    height: var(--hour-height);
    border-bottom: 1px solid var(--g-border-subtle);
    cursor: pointer;
}

.grid-hour-slot:hover {
    background-color: var(--g-hover);
}

/* Timed Event Blocks on Week Grid */
.week-event-card {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 6px;
    padding: 4px 6px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 10;
    line-height: 1.25;
}

.week-event-card .event-time {
    font-size: 0.68rem;
    opacity: 0.9;
    display: block;
    margin-bottom: 1px;
}

/* Day View */
.day-header-bar {
    padding: 12px 20px;
    border-bottom: 1px solid var(--g-border);
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--g-bg);
}

.day-scroll-body {
    flex: 1;
    display: flex;
    overflow-y: auto;
    position: relative;
}

.day-column-events {
    flex: 1;
    position: relative;
    height: calc(24 * var(--hour-height));
    background: var(--g-bg);
}

/* --- 3. Google Workspace Companion Bar & Slide-Out Panel --- */
.companion-wrapper {
    display: flex;
    height: 100%;
    z-index: 40;
}

.companion-rail {
    width: var(--rail-width);
    background: var(--g-bg);
    border-left: 1px solid var(--g-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 16px;
    flex-shrink: 0;
}

.rail-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    position: relative;
}

.rail-btn:hover {
    background: var(--g-hover);
}

.rail-btn.active {
    background: var(--g-blue-light);
}

/* Companion Panel Drawer */
.companion-panel {
    width: var(--companion-width);
    background: var(--g-bg);
    border-left: 1px solid var(--g-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    animation: slidePanel 0.2s ease-out;
}

@keyframes slidePanel {
    from { width: 0; opacity: 0; }
    to { width: var(--companion-width); opacity: 1; }
}

.panel-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--g-border);
}

.panel-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-icon {
    font-size: 20px;
}

.panel-header-title h3 {
    font-size: 1rem;
    font-weight: 600;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Google Keep Panel Specifics --- */
.keep-composer {
    background: var(--g-surface-card);
    border: 1px solid var(--g-border);
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.2s;
}

.keep-composer:focus-within {
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.keep-composer input,
.keep-composer textarea {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    width: 100%;
    background: transparent;
    color: var(--g-text-primary);
}

.keep-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--g-border-subtle);
}

.keep-color-palette {
    display: flex;
    gap: 4px;
}

.palette-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--g-border);
    cursor: pointer;
}

.palette-swatch.selected {
    outline: 2px solid var(--g-blue);
}

.composer-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.keep-search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--g-border);
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    background: var(--g-surface);
    color: var(--g-text-primary);
}

.keep-section-header {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--g-text-secondary);
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.keep-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.keep-note-card {
    border: 1px solid var(--g-border);
    border-radius: 8px;
    padding: 12px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.1s, box-shadow 0.15s;
    color: #1f1f1f;
}

body.dark-theme .keep-note-card {
    color: var(--g-text-primary);
    border-color: rgba(255, 255, 255, 0.12);
}

.keep-note-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.keep-note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.keep-note-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.keep-pin-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
}

.keep-pin-btn:hover,
.keep-pin-btn.pinned {
    opacity: 1;
}

.keep-note-content {
    font-size: 0.82rem;
    white-space: pre-wrap;
    line-height: 1.4;
}

.keep-note-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    gap: 4px;
}

/* --- Google Tasks Panel Specifics --- */
.tasks-filter-tabs {
    display: flex;
    border-bottom: 1px solid var(--g-border);
    gap: 16px;
}

.task-tab {
    background: none;
    border: none;
    padding: 8px 4px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--g-text-secondary);
    cursor: pointer;
    position: relative;
}

.task-tab.active {
    color: var(--g-blue);
}

.task-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--g-blue);
    border-radius: 2px 2px 0 0;
}

.tasks-add-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--g-surface);
    border-radius: 8px;
    border: 1px solid var(--g-border);
}

.btn-task-plus {
    background: none;
    border: none;
    color: var(--g-blue);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
}

.tasks-add-bar input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
    font-family: inherit;
    flex: 1;
    color: var(--g-text-primary);
}

.tasks-detail-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--g-surface);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--g-border);
}

.tasks-detail-inputs textarea {
    border: 1px solid var(--g-border);
    border-radius: 4px;
    padding: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    resize: none;
    background: var(--g-surface-card);
    color: var(--g-text-primary);
}

.tasks-meta-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tasks-meta-row input,
.tasks-meta-row select {
    padding: 4px 6px;
    border: 1px solid var(--g-border);
    border-radius: 4px;
    font-size: 0.78rem;
    background: var(--g-surface-card);
    color: var(--g-text-primary);
}

.tasks-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 6px;
    transition: background 0.1s;
}

.task-item-card:hover {
    background: var(--g-hover);
}

.task-checkbox-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--g-text-secondary);
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
    transition: all 0.15s;
}

.task-item-card.completed .task-checkbox-circle {
    background: var(--g-blue);
    border-color: var(--g-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-item-card.completed .task-checkbox-circle::after {
    content: '✓';
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

body.dark-theme .task-item-card.completed .task-checkbox-circle::after {
    color: #1f1f1f;
}

.task-info {
    flex: 1;
}

.task-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--g-text-primary);
}

.task-item-card.completed .task-title {
    text-decoration: line-through;
    color: var(--g-text-muted);
}

.task-badges-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.task-due-chip {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--g-blue-text);
    background: var(--g-blue-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.task-recurring-badge {
    display: inline-block;
    font-size: 0.72rem;
    color: #059669;
    background: #d1fae5;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

body.dark-theme .task-recurring-badge {
    background: #064e3b;
    color: #6ee7b7;
}

.task-star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--g-text-muted);
}

.task-star-btn.starred {
    color: #f59e0b;
}

/* Completed Collapsible */
.completed-tasks-group {
    border-top: 1px solid var(--g-border);
    padding-top: 12px;
}

.completed-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--g-text-secondary);
    cursor: pointer;
}

/* --- Modals & Floating Dialogs --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(32,33,36,0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.g-modal-card {
    background: var(--g-modal-bg);
    border-radius: 12px;
    box-shadow: 0 24px 38px 3px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    color: var(--g-text-primary);
}

.g-modal-header {
    background: var(--g-surface);
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--g-border);
}

.modal-card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--g-text-secondary);
}

.g-modal-card form {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.g-title-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--g-blue);
    font-size: 1.3rem;
    font-weight: 500;
    padding: 4px 0;
    outline: none;
    background: transparent;
    color: var(--g-text-primary);
}

.g-form-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.row-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.row-fields {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-fields input,
.row-fields select,
.row-fields textarea {
    padding: 8px 10px;
    border: 1px solid var(--g-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    width: 100%;
    background: var(--g-surface-card);
    color: var(--g-text-primary);
}

.row-fields input:focus,
.row-fields select:focus,
.row-fields textarea:focus {
    border-color: var(--g-blue);
}

.to-separator {
    color: var(--g-text-secondary);
    font-weight: bold;
}

.g-conflict-warning {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

body.dark-theme .g-conflict-warning {
    background: #7f1d1d;
    color: #fecaca;
    border-color: #991b1b;
}

.g-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--g-border);
}

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

/* Calendar Color Swatches */
.cal-color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cal-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
    border: 2px solid transparent;
}

.cal-swatch:hover {
    transform: scale(1.15);
}

.cal-swatch.selected {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--g-blue);
}

/* --- Profile & Auth Modal Specifics --- */
.profile-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-header-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--g-surface);
    border-radius: 8px;
    border: 1px solid var(--g-border);
}

.profile-big-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #9333ea);
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

.profile-info span {
    font-size: 0.85rem;
    color: var(--g-text-secondary);
}

.profile-edit-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-lbl {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--g-text-secondary);
}

.profile-input-row {
    display: flex;
    gap: 8px;
}

.profile-input-row input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--g-border);
    border-radius: 4px;
    font-size: 0.88rem;
    background: var(--g-surface-card);
    color: var(--g-text-primary);
}

.profile-footer-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--g-border);
}

.login-header-text h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-header-text p {
    font-size: 0.85rem;
    color: var(--g-text-secondary);
}

.form-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.form-field-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--g-text-secondary);
}

.form-field-group input {
    padding: 8px 10px;
    border: 1px solid var(--g-border);
    border-radius: 4px;
    font-size: 0.9rem;
    background: var(--g-surface-card);
    color: var(--g-text-primary);
}

.test-cred-helper {
    margin-top: 10px;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
}

.toast {
    background: #202124;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 0.88rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    animation: toastIn 0.2s ease-out;
}

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

.hidden { display: none !important; }
