/* App Layout */

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--k-bg-main);
}

/* Sidebar */
.sidebar {
    width: 64px;
    height: 100%;
    background: var(--k-gradient-sidebar);
    border-right: 1px solid var(--k-glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md) 0;
    z-index: 10;
}

.logo-mini {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--k-text-primary);
    margin-bottom: var(--space-2xl);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--k-text-primary);
    color: var(--k-bg-main);
    border-radius: 6px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    width: 100%;
    align-items: center;
}

.nav-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--k-text-muted);
    transition: all var(--transition-fast);
    font-size: 1.2rem;
}

.nav-item:hover {
    color: var(--k-text-primary);
    background-color: var(--k-bg-hover);
}

.nav-item.active {
    color: var(--k-accent-primary);
    background-color: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    align-items: center;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--k-accent-primary), #a855f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* Main View */
.main-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--k-bg-main);
    position: relative;
}

.view-header {
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-lg);
    border-bottom: 1px solid var(--k-glass-border);
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
}

.view-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--k-text-primary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.view-controls {
    display: flex;
    gap: var(--space-xs);
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--k-text-secondary);
}

.btn-icon:hover {
    background-color: var(--k-bg-hover);
    color: var(--k-text-primary);
}

.content-body {
    flex: 1;
    overflow: hidden;
    padding: var(--space-lg);
}

/* Calendar Grid Structure */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: 40px repeat(auto-fill, minmax(100px, 1fr));
    /* Adaptive rows */
    height: 100%;
    gap: 1px;
    background-color: rgba(255, 255, 255, 0.05);
    /* Grid lines */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    /* overflow: hidden; Removed to allow hover effects to show */
    padding: var(--space-md);
}

.weekday-header {
    background-color: var(--k-bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--k-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day {
    background-color: var(--k-bg-main);
    padding: var(--space-sm);
    min-height: 100px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: day-entry 0.4s ease backwards;
}

.calendar-day:hover {
    background-color: var(--k-bg-subtle);
    z-index: 5;
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--k-accent-primary);
    border-radius: var(--radius-md);
}

/* Staggered animation for days (up to 35 for a standard month view) */
.calendar-day:nth-child(7n+1) {
    animation-delay: 0.1s;
}

.calendar-day:nth-child(7n+2) {
    animation-delay: 0.15s;
}

.calendar-day:nth-child(7n+3) {
    animation-delay: 0.2s;
}

.calendar-day:nth-child(7n+4) {
    animation-delay: 0.25s;
}

.calendar-day:nth-child(7n+5) {
    animation-delay: 0.3s;
}

.calendar-day:nth-child(7n+6) {
    animation-delay: 0.35s;
}

.calendar-day:nth-child(7n+7) {
    animation-delay: 0.4s;
}

.day-number {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--k-text-secondary);
    margin-bottom: var(--space-xs);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.calendar-day.current-month {
    color: var(--k-text-primary);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today .day-number {
    background-color: var(--k-accent-primary);
    color: white;
    box-shadow: 0 0 10px var(--k-accent-glow);
    animation: pulse-today 2s infinite;
}

@keyframes pulse-today {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

@keyframes day-entry {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Right Panel */
.context-panel {
    width: 320px;
    background-color: var(--k-bg-card);
    border-left: 1px solid var(--k-glass-border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-smooth), width var(--transition-smooth);
    overflow: hidden;
}

.context-panel.hidden {
    transform: translateX(100%);
    width: 0;
    border: none;
}

.panel-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--k-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-close:hover {
    background-color: var(--k-bg-hover);
    color: var(--k-text-primary);
}

.panel-body {
    padding: var(--space-lg);
    flex: 1;
    overflow-y: auto;
}

.day-header-meta {
    margin-bottom: var(--space-xl);
}

.day-name {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--k-text-primary);
}

.day-full-date {
    font-size: 0.9rem;
    color: var(--k-text-muted);
}

.day-tasks-list {
    margin-bottom: var(--space-xl);
}

.day-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: auto;
}

/* Sidebar Panel */
.sidebar-panel {
    width: 250px;
    background-color: var(--k-glass-bg);
    border-right: 1px solid var(--k-glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s ease, opacity 0.2s ease;
    overflow: hidden;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    /* Context for absolute positioning */
}

.sidebar-panel .btn-collapse-sidebar {
    position: absolute;
    top: var(--space-lg);
    right: 8px;
    /* Close to the edge */
    z-index: 10;
}

.sidebar-panel.collapsed {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right: none;
    border-right: none;
    opacity: 0;
}

.btn-sidebar-expand {
    position: absolute;
    left: 64px;
    /* Width of the navigation sidebar */
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 24px;
    height: 48px;
    background: var(--k-bg-subtle);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--k-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.btn-sidebar-expand:hover {
    background: var(--k-bg-hover);
    color: var(--k-text-primary);
}

.btn-sidebar-expand.hidden {
    display: none;
}


/* Mini Calendar */
.mini-calendar {
    margin-bottom: var(--space-xl);
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.mini-month-year {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--k-text-primary);
}

.mini-controls {
    display: flex;
    gap: 4px;
    /* Small gap for mini controls */
}

.btn-mini-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--k-text-muted);
    font-size: 0.8rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-mini-icon:hover {
    background-color: var(--k-bg-hover);
    color: var(--k-text-primary);
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 8px;
    /* Vertical spacing between rows */
    column-gap: 2px;
    /* Horizontal spacing */
}

.mini-weekday {
    text-align: center;
    font-size: 0.7rem;
    color: var(--k-text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.mini-day {
    width: 28px;
    /* Fixed square size */
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--k-text-secondary);
    border-radius: 50%;
    cursor: pointer;
    margin: 0 auto;
}

.mini-day:hover {
    background-color: var(--k-bg-hover);
    color: var(--k-text-primary);
}

.mini-day.other-month {
    color: var(--k-text-disabled);
    opacity: 0.5;
}

.mini-day.today {
    color: var(--k-accent-primary);
    font-weight: 700;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        order: 3;
        /* Bottom navigation */
        padding: 0 var(--space-md);
        justify-content: space-between;
    }

    .logo-mini {
        margin-bottom: 0;
        margin-right: var(--space-md);
        display: none;
        /* Hide mini logo on mobile nav */
    }

    .sidebar-nav {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
    }

    .sidebar-footer {
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    /* Mobile Sidebar Panel (Context) */
    .sidebar-panel {
        display: flex;
        /* Restored from none */
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 85%;
        /* Cover most of the screen */
        max-width: 320px;
        z-index: 200;
        background-color: var(--k-bg-card);
        /* Ensure solid background */
        border-right: none;
        border-left: 1px solid var(--k-glass-border);
        transform: translateX(100%);
        /* Hidden by default */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar-panel.mobile-visible {
        transform: translateX(0);
    }

    /* Backdrop for mobile panel */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .main-view {
        height: calc(100vh - 60px);
        /* Subtract nav height */
        width: 100vw;
    }

    .calendar-grid {
        /* Adjust for smaller screens */
        grid-template-rows: 30px repeat(auto-fill, minmax(60px, 1fr));
        padding: 4px;
        /* Minimize padding */
        gap: 0;
        /* Remove gap if needed to save space */
        border: none;
    }

    .calendar-day {
        min-height: 50px;
        /* Even smaller */
        padding: 2px;
    }

    .day-number {
        font-size: 0.8rem;
        width: 20px;
        height: 20px;
    }


}

/* Sidebar Panel Dynamics */
.sidebar-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--k-text-primary);
}

.sidebar-actions-row {
    margin-bottom: var(--space-md);
}

/* Month List Scroll */
.month-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    /* Space for scrollbar */
}

.month-list-scroll::-webkit-scrollbar {
    width: 4px;
}

.month-list-scroll::-webkit-scrollbar-thumb {
    background: var(--k-bg-hover);
    border-radius: 4px;
}

.month-item {
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 2px;
    font-size: 0.9rem;
    color: var(--k-text-secondary);
    transition: all var(--transition-fast);
    animation: slideInLeft 0.5s cubic-bezier(0.2, 0, 0, 1) backwards;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-year {
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 500;
}

.month-item:hover {
    background-color: var(--k-bg-hover);
    color: var(--k-text-primary);
}

.month-item.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--k-accent-primary);
    font-weight: 600;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.month-item:nth-child(1) {
    animation-delay: 0.1s;
}

.month-item:nth-child(2) {
    animation-delay: 0.15s;
}

.month-item:nth-child(3) {
    animation-delay: 0.2s;
}

.month-item:nth-child(4) {
    animation-delay: 0.25s;
}

.month-item:nth-child(5) {
    animation-delay: 0.3s;
}

.month-item:nth-child(6) {
    animation-delay: 0.35s;
}

.month-item:nth-child(7) {
    animation-delay: 0.4s;
}

.month-item:nth-child(8) {
    animation-delay: 0.45s;
}

/* Sidebar List Styling (Tasks & Notes) */
.sidebar-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.sidebar-item {
    padding: var(--space-sm) var(--space-md);
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    cursor: grab;
    /* Indicates draggable */
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), background-color var(--transition-fast), opacity var(--transition-fast);
    border-left: 2px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    will-change: transform;
    animation: slideInLeft 0.5s cubic-bezier(0.2, 0, 0, 1) backwards;
}

.sidebar-item:nth-child(1) {
    animation-delay: 0.2s;
}

.sidebar-item:nth-child(2) {
    animation-delay: 0.3s;
}

.sidebar-item:nth-child(3) {
    animation-delay: 0.4s;
}

.sidebar-item:active {
    cursor: grabbing;
}

.sidebar-item.dragging {
    opacity: 0.4;
    background-color: var(--k-bg-card-hover);
    box-shadow: var(--shadow-md);
    border: 1px dashed var(--k-accent-primary);
    transform: scale(0.98);
    z-index: 10;
}

.sidebar-list.drag-active .sidebar-item:not(.dragging) {
    opacity: 0.6;
}

.sidebar-item:hover {
    background-color: var(--k-bg-hover);
}

.sidebar-item.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--k-accent-primary);
    border-left-color: var(--k-accent-primary);
}

.sidebar-item.active .sidebar-item-title {
    color: var(--k-accent-primary);
    font-weight: 600;
}

.sidebar-item-content {
    flex: 1;
    overflow: hidden;
}

.btn-delete-note {
    background: transparent;
    border: none;
    color: var(--k-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast), color var(--transition-fast);
    padding: 0 4px;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.sidebar-item:hover .btn-delete-note {
    opacity: 1;
}

.btn-delete-note:hover {
    color: var(--k-error);
    background-color: rgba(239, 68, 68, 0.1);
}

.sidebar-item-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.btn-delete-sidebar {
    background: transparent;
    border: none;
    color: var(--k-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast), color var(--transition-fast);
    padding: 0 4px;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    width: 24px;
    height: 24px;
}

.sidebar-item:hover .btn-delete-sidebar {
    opacity: 1;
}

.btn-delete-sidebar:hover {
    color: var(--k-error);
    background-color: rgba(239, 68, 68, 0.1);
}

.sidebar-item-title {
    font-size: 0.9rem;
    color: var(--k-text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-item-meta {
    font-size: 0.75rem;
    color: var(--k-text-muted);
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    position: fixed;
    /* Changed from relative to fixed to center properly if needed, but contextually it sits in backdrop usually. If separate: */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 500px;
    background-color: var(--k-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 101;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--k-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-close-modal:hover {
    background-color: var(--k-bg-hover);
    color: var(--k-text-primary);
}

.modal-body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-size: 0.85rem;
    color: var(--k-text-secondary);
    font-weight: 500;
}

.form-input {
    background-color: var(--k-bg-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--k-text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--k-accent-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.type-selector {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.type-option {
    background-color: var(--k-bg-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    /* Pillow shape */
    padding: 6px 16px;
    color: var(--k-text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: transparent;
}

.type-option:hover {
    transition: none !important;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--k-text-primary);
    color: var(--k-text-primary);
    transform: scale(1.02);
}

.type-option[data-value="work"].active {
    background-color: var(--k-task-work);
    border-color: var(--k-task-work);
}

.type-option[data-value="personal"].active {
    background-color: var(--k-task-personal);
    border-color: var(--k-task-personal);
}

.type-option[data-value="health"].active {
    background-color: var(--k-task-health);
    border-color: var(--k-task-health);
}

.type-option[data-value="event"].active {
    background-color: var(--k-task-event);
    border-color: var(--k-task-event);
}

.type-option[data-value="work"]:hover {
    border-color: var(--k-task-work);
    color: var(--k-task-work);
    background-color: rgba(59, 130, 246, 0.15);
}

.type-option[data-value="personal"]:hover {
    border-color: var(--k-task-personal);
    color: var(--k-task-personal);
    background-color: rgba(236, 72, 153, 0.15);
}

.type-option[data-value="health"]:hover {
    border-color: var(--k-task-health);
    color: var(--k-task-health);
    background-color: rgba(16, 185, 129, 0.15);
}

.type-option[data-value="event"]:hover {
    border-color: var(--k-task-event);
    color: var(--k-task-event);
    background-color: rgba(245, 158, 11, 0.15);
}

/* Custom types hover */
.type-option:hover {
    border-color: var(--type-color, var(--k-text-primary));
    color: var(--type-color, var(--k-text-primary));
    background-color: rgba(255, 255, 255, 0.1);
}

/* When active, ensure text is white */
.type-option.active:hover {
    color: white;
}

.modal-footer {
    padding: var(--space-lg);
    background-color: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}



/* Custom Type Form */
.custom-type-form {
    background: rgba(255, 255, 255, 0.03);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.color-input {
    padding: 2px !important;
    height: 40px;
    cursor: pointer;
}

.form-actions-mini {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.btn-add-type {
    background: transparent;
    border: 1px dashed var(--k-text-muted);
    border-radius: 20px;
    padding: 6px 16px;
    color: var(--k-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-add-type:hover {
    transition: none !important;
    border-color: var(--k-text-primary);
    color: var(--k-text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Mobile adjustments */
/* Mobile adjustments */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        order: 3;
        padding: 0 var(--space-md);
        justify-content: space-around;
        z-index: 100;
    }

    /* Show hamburger */
    .mobile-only {
        display: flex !important;
    }

    .logo-mini,
    .sidebar-footer {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
    }

    /* Transform Sidebar Panel into Drawer */
    .sidebar-panel {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 60px;
        /* Above nav bar */
        width: 85%;
        max-width: 300px;
        background-color: var(--k-bg-subtle);
        z-index: 98;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: var(--space-xl);
        /* Space for header overlap if needed */
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar-panel.mobile-open {
        transform: translateX(0);
    }

    /* Overlay for sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 95;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .main-view {
        height: calc(100vh - 60px);
        width: 100vw;
    }

    .calendar-grid {
        grid-template-rows: 30px repeat(auto-fill, minmax(60px, 1fr));
    }

    .modal {
        width: 95%;
        max-width: none;
    }
}

/* Desktop Defaults for mobile-only elements */
.mobile-only {
    display: none;
}

.sidebar-overlay {
    display: none;
}