/* ==========================================================================
   SaiNotes CSS Design System & Layout - Premium Glassmorphic Theme
   ========================================================================== */

/* Variables and Tokens */
:root {
    --bg-base: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.72);
    --bg-sidebar: rgba(248, 250, 252, 0.85);
    --bg-header: rgba(255, 255, 255, 0.7);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-hover: rgba(15, 23, 42, 0.16);
    
    /* Brand Colors */
    --primary: #4f46e5;
    --primary-hover: #3730a3;
    --primary-glow: rgba(79, 70, 229, 0.12);
    
    --secondary: #7c3aed;
    --secondary-hover: #6d28d9;
    --assistant-primary: #0891b2;
    --assistant-hover: #0e7490;
    
    /* Semantic Colors */
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-blur: blur(16px);
    --shadow-main: 0 8px 30px 0 rgba(15, 23, 42, 0.06);
}

/* Base resets & fonts */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 10% 10%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(124, 58, 237, 0.04) 0px, transparent 50%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.2);
}

/* Application Layout Structure */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.logo-icon {
    width: 20px;
    height: 20px;
    color: #fff;
}

.sidebar-brand h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(120deg, #0f172a, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    position: relative;
}

.menu-item i {
    width: 18px;
    height: 18px;
    transition: var(--transition-smooth);
}

.menu-item:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.03);
}

.menu-item.active {
    color: var(--primary);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08));
    border-color: rgba(79, 70, 229, 0.15);
    box-shadow: inset 0 0 12px rgba(79, 70, 229, 0.03);
}

.menu-item.active i {
    color: var(--primary);
}

.badge {
    position: absolute;
    right: 16px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
}

.badge-warning {
    background-color: var(--warning);
    color: #000;
}

/* Collapsible Mobile Navigation Elements Hidden on Desktop */
.mobile-only-more, .mobile-more-menu {
    display: none !important;
}

/* User controller at bottom of sidebar */
.user-control-panel {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.01);
}

.panel-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.user-profile-selector {
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    padding: 3px;
    gap: 2px;
}

.profile-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.profile-pill:hover {
    background: rgba(15, 23, 42, 0.04);
}

.profile-pill .avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.65rem;
    color: white;
}

.avatar-boss {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.avatar-assistant {
    background: linear-gradient(135deg, var(--assistant-primary), #0d9488);
}

.profile-pill .role-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-pill.active {
    background: rgba(15, 23, 42, 0.04);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.profile-pill.active[data-role="boss"] {
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.profile-pill.active[data-role="boss"] .role-name {
    color: var(--primary);
}

.profile-pill.active[data-role="assistant"] {
    background: rgba(8, 145, 178, 0.08);
    border: 1px solid rgba(8, 145, 178, 0.15);
}

.profile-pill.active[data-role="assistant"] .role-name {
    color: var(--assistant-primary);
}

.role-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Main Workspace */
.main-workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9;
}

.header-search {
    position: relative;
    width: 320px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.header-search input {
    width: 100%;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 16px 10px 42px;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition-smooth);
}

.header-search input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 12px var(--primary-glow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.quick-action-dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    min-width: 160px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.dropdown-content a {
    color: var(--text-secondary);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.dropdown-content a:hover {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
}

.dropdown-content a i {
    width: 16px;
    height: 16px;
}

.notification-center {
    position: relative;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.06);
    border-color: var(--border-color-hover);
}

.bell-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    z-index: 100;
    overflow: hidden;
}

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

.notif-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.notif-items {
    max-height: 280px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    gap: 12px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.notif-item.unread {
    background: rgba(99, 102, 241, 0.04);
}

.notif-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-item-icon.note { color: var(--primary); }
.notif-item-icon.task { color: var(--success); }
.notif-item-icon.reminder { color: var(--warning); }

.notif-content {
    flex-grow: 1;
}

.notif-content p {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.notif-time {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.empty-notif {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.current-role-avatar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
}

.current-role-avatar .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.current-role-avatar .avatar.boss {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 0 10px var(--primary-glow);
}

.current-role-avatar .avatar.assistant {
    background: linear-gradient(135deg, var(--assistant-primary), #0d9488);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.role-details h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.role-details p {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Content Area */
.content-scroll-wrapper {
    flex-grow: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Tabs Display */
.tab-content {
    animation: fadeIn 0.4s ease-out;
}

.tab-content.hidden {
    display: none !important;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.2);
}

.banner-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.banner-text p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    max-width: 500px;
}

.banner-illustration {
    position: relative;
    width: 120px;
    height: 120px;
}

.glass-orb {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.15));
    backdrop-filter: blur(5px);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.25), inset 0 0 20px rgba(255, 255, 255, 0.4);
    animation: floating 4s ease-in-out infinite;
}

/* Stats Widgets Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
    position: relative;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-main);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper.prim { background: rgba(99, 102, 241, 0.12); color: var(--primary); }
.stat-icon-wrapper.succ { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.stat-icon-wrapper.warn { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

.stat-info {
    flex-grow: 1;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-trend {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.trend-neutral { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.trend-positive { background: var(--success-bg); color: var(--success); }
.trend-warning { background: var(--warning-bg); color: var(--warning); }

/* Dashboard Columns Grid */
.dashboard-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.card-section {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-main);
}

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

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Note list, task list simple items */
.empty-state {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.task-list-simple, .reminder-list-simple, .notes-list-simple {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.simple-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.01);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
}

.simple-task-item:hover {
    border-color: var(--border-color-hover);
    background: rgba(15, 23, 42, 0.03);
}

.st-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.st-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.st-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-high { background-color: var(--danger-bg); color: var(--danger); }
.badge-medium { background-color: var(--warning-bg); color: var(--warning); }
.badge-low { background-color: rgba(99, 102, 241, 0.15); color: var(--primary); }

/* Simple note list style */
.simple-note-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
}

.simple-note-item:hover {
    border-color: var(--border-color-hover);
    background: rgba(15, 23, 42, 0.03);
}

.sn-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sn-title {
    font-size: 0.88rem;
    font-weight: 600;
}

.sn-tag {
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-secondary);
}

/* Timeline component */
.activity-timeline-simple {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-left: 8px;
}

.timeline-item {
    position: relative;
    padding-left: 24px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 6px var(--primary);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 14px;
    bottom: -18px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-time {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Content Title & Actions */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.title-area h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.title-area p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Notes Directory Tab Styles */
.notes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 12px;
    gap: 2px;
}

.btn-filter {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-filter i {
    width: 14px;
    height: 14px;
}

.btn-filter:hover {
    color: var(--text-primary);
}

.btn-filter.active {
    background: var(--primary);
    color: #fff;
}

.tag-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tag-pill:hover, .tag-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Notes Grid & Card Design */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.note-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 250px;
    transition: var(--transition-smooth);
    position: relative;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.03);
}

.note-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-main);
}

/* Note Card Themes */
.card-theme-indigo { border-left: 4px solid var(--primary); }
.card-theme-purple { border-left: 4px solid var(--secondary); }
.card-theme-emerald { border-left: 4px solid var(--success); }
.card-theme-amber { border-left: 4px solid var(--warning); }
.card-theme-rose { border-left: 4px solid var(--danger); }
.card-theme-default { border-left: 4px solid var(--text-muted); }

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.note-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.note-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 12px;
}

.btn-card-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-card-action:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.05);
}

.btn-card-action.pinned-active {
    color: var(--warning);
}

.btn-card-action i {
    width: 14px;
    height: 14px;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.note-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.note-status-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.note-status-badge.shared {
    background: rgba(6, 182, 212, 0.15);
    color: var(--assistant-primary);
}

.note-status-badge.private {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-secondary);
}

.note-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    white-space: pre-wrap;
}

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

.note-category-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 2px 8px;
    border-radius: 12px;
}

.note-author-info {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Kanban Board Layout */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
    height: calc(100vh - 210px);
}

.kanban-column {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.column-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.col-title-badge {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.color-todo { background-color: var(--danger); box-shadow: 0 0 8px var(--danger); }
.color-inprogress { background-color: var(--warning); box-shadow: 0 0 8px var(--warning); }
.color-done { background-color: var(--success); box-shadow: 0 0 8px var(--success); }

.column-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-grow: 1;
}

.card-count {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.kanban-cards-wrapper {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 150px;
}

/* Kanban Cards styling */
.task-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition-smooth);
    cursor: grab;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
}

.task-card:active {
    cursor: grabbing;
}

.task-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--primary);
}

.task-card:hover {
    border-color: var(--border-color-hover);
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    padding-right: 12px;
}

.task-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.task-due {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.task-due i {
    width: 12px;
    height: 12px;
}

.task-card-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 4px;
}

/* Reminders View Layout */
.reminders-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 28px;
    align-items: start;
}

.reminder-creator-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-main);
}

.reminder-creator-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.reminders-display-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-main);
    min-height: 400px;
}

.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
}

.reminder-item:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.reminder-item.completed {
    opacity: 0.55;
}

.rem-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rem-indicator {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.reminder-item.completed .rem-indicator {
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-muted);
}

.rem-details h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.reminder-item.completed .rem-details h4 {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.rem-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.rem-target-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-secondary);
    font-weight: 600;
}

/* Activity Log Tab Styles */
.activity-timeline-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-main);
}

.activity-log-timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.activity-log-timeline .timeline-item {
    font-size: 0.92rem;
    padding-left: 32px;
}

.activity-log-timeline .timeline-item::before {
    width: 12px;
    height: 12px;
    left: -2px;
    top: 4px;
}

.activity-log-timeline .timeline-item::after {
    left: 3px;
    top: 20px;
    bottom: -28px;
}

/* Form Styles & Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.25s ease-out;
}

.modal-backdrop.hidden {
    display: none !important;
}

.modal-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-box form {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Detail view body (non-form modals) */
.modal-box > div:not(.modal-header) {
    overflow-y: auto;
    flex: 1;
    padding: 0 24px 24px;
}

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 11px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 10px var(--primary-glow);
}

textarea {
    resize: none;
}

/* Custom checkbox / toggle switch styles */
.form-checkbox-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    margin-top: 14px;
    background: rgba(15, 23, 42, 0.01);
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(15, 23, 42, 0.03);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.1);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.checkbox-label-text span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.checkbox-label-text p.help-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 18px;
}

/* Button UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.04);
    border-color: var(--border-color-hover);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-text:hover {
    color: var(--secondary);
    background: rgba(99, 102, 241, 0.08);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
}

.mt-4 { margin-top: 24px; }

/* Alarm Trigger Overlay Styling */
.alarm-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, #fffbeb 0%, #fef3c7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: alarmGlowPulse 3s infinite alternate;
}

.alarm-dialog-box {
    text-align: center;
    width: 500px;
    max-width: 90%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(217, 119, 6, 0.25);
    border-radius: var(--border-radius-lg);
    padding: 48px 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 40px rgba(217, 119, 6, 0.12);
}

.alarm-icon-glow {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    border: 1.5px solid var(--warning);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px auto;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.alarm-pulsing-icon {
    width: 38px;
    height: 38px;
    color: var(--warning);
    animation: shakingClock 0.5s infinite;
}

.alarm-text {
    margin-bottom: 36px;
}

.alarm-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--warning);
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.alarm-text h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.alarm-text p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.alarm-recipient-badge {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-secondary);
}

.alarm-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Toast System Styling */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--border-radius-md);
    padding: 16px 20px;
    width: 320px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: var(--transition-smooth);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-danger { border-left-color: var(--danger); }

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-danger .toast-icon { color: var(--danger); }

.toast-body {
    flex-grow: 1;
}

.toast-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Role Customizations */
body.assistant-mode {
    --primary: #0891b2;
    --primary-hover: #0e7490;
    --primary-glow: rgba(8, 145, 178, 0.12);
    --secondary: #0f766e;
}

.assistant-mode .boss-only {
    display: none !important;
}

body:not(.assistant-mode) .assistant-only {
    display: none !important;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes toastSlideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes floating {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes alarmGlowPulse {
    from { box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.05); }
    to { box-shadow: inset 0 0 150px rgba(245, 158, 11, 0.15); }
}

@keyframes shakingClock {
    0% { transform: rotate(0); }
    10% { transform: rotate(-8deg); }
    20% { transform: rotate(8deg); }
    30% { transform: rotate(-8deg); }
    40% { transform: rotate(8deg); }
    50% { transform: rotate(0); }
    100% { transform: rotate(0); }
}

@keyframes slideUpFloatingNav {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

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

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
    .kanban-board {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        gap: 24px;
    }
    .kanban-column {
        max-height: 450px;
    }
    .reminders-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column; /* Standard column flow, as navigation floats on top */
    }
    body {
        overflow: hidden;
    }
    .sidebar {
        position: fixed;
        bottom: 16px;
        left: 16px;
        right: 16px;
        width: calc(100% - 32px);
        height: 66px;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-radius: 20px;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
        flex-direction: row;
        justify-content: space-around;
        padding: 0 8px;
        z-index: 1000;
        animation: slideUpFloatingNav 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .mobile-only-more {
        display: flex !important;
    }
    .sidebar-menu > .menu-item[data-tab="reminders"],
    .sidebar-menu > .menu-item[data-tab="activity"],
    .sidebar-menu > .menu-item[data-tab="ai-agent"],
    .sidebar-menu > .menu-item[data-tab="archive"] {
        display: none !important;
    }
    .mobile-more-menu {
        display: flex !important;
        position: absolute;
        bottom: 80px;
        right: 0;
        width: 180px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: 1px solid rgba(255, 255, 255, 0.45);
        border-radius: 18px;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
        padding: 8px;
        flex-direction: column;
        gap: 2px;
        z-index: 1100;
        transform-origin: bottom right;
        animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .mobile-more-menu.hidden {
        display: none !important;
    }
    .more-menu-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 0.82rem;
        font-weight: 600;
        border-radius: 12px;
        transition: var(--transition-smooth);
    }
    .more-menu-item:hover, .more-menu-item.active {
        background: rgba(79, 70, 229, 0.08);
        color: var(--primary) !important;
    }
    .more-menu-item i {
        width: 15px;
        height: 15px;
    }
    .sidebar-brand {
        display: none; /* Hide logo in bottom nav bar */
    }
    .sidebar-menu {
        flex-direction: row;
        padding: 0;
        width: 100%;
        height: 100%;
        justify-content: space-around;
        align-items: center;
        gap: 0;
    }
    .menu-item {
        flex-direction: column;
        gap: 4px;
        padding: 6px 0;
        font-size: 0.7rem;
        color: var(--text-secondary);
        align-items: center;
        flex: 1;
        height: 100%;
        justify-content: center;
        border: none;
        background: transparent !important;
        border-radius: 14px;
        transition: transform 0.2s ease, color 0.2s ease;
    }
    .menu-item:hover {
        background: rgba(15, 23, 42, 0.01) !important;
    }
    .menu-item.active {
        color: var(--primary) !important;
        border-color: transparent;
        box-shadow: none;
    }
    .menu-item.active i {
        transform: translateY(-2px) scale(1.05);
        color: var(--primary);
    }
    .menu-item span {
        display: block !important; /* Show navigation labels on mobile */
        font-size: 0.65rem;
        font-weight: 600;
    }
    .badge {
        right: auto;
        left: 55%;
        top: 6px;
        padding: 2px 5px;
        font-size: 0.6rem;
    }
    .user-control-panel {
        display: none; /* Hidden from bottom nav */
    }
    .main-workspace {
        height: calc(100vh - 60px); /* Fill space below 60px header */
    }
    .app-header {
        padding: 0 16px;
        height: 60px;
    }
    .header-search {
        width: 140px; /* Slimmer search box */
    }
    .header-search input {
        padding: 8px 12px 8px 34px;
    }
    .search-icon {
        left: 10px;
    }
    .header-actions {
        gap: 10px;
    }
    .content-scroll-wrapper {
        padding: 16px;
        padding-bottom: 96px; /* Spacing for the floating tab bar */
    }
    .current-role-avatar {
        padding-left: 8px;
    }
    .role-details {
        display: none; /* Hide text details of profile in narrow viewports */
    }
    
    /* Swipeable Kanban columns on mobile */
    .kanban-board {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        height: calc(100vh - 200px);
        padding-bottom: 8px;
        gap: 16px;
        scrollbar-width: none; /* Hide scrollbar for cleaner look */
    }
    .kanban-board::-webkit-scrollbar {
        display: none;
    }
    .kanban-column {
        flex: 0 0 88vw; /* 88% width per column */
        scroll-snap-align: center;
        max-height: 100%;
    }
}

@media (max-width: 580px) {
    /* Floating circular plus button */
    #btn-quick-create span {
        display: none;
    }
    #btn-quick-create {
        padding: 12px;
        border-radius: 50%;
        width: 42px;
        height: 42px;
        aspect-ratio: 1;
        justify-content: center;
    }
    
    /* Native slide-up bottom sheets for modals */
    .modal-backdrop {
        align-items: flex-end;  /* anchor to bottom of screen */
    }
    .modal-box {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;       /* cap so top of screen stays visible */
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
        position: static;       /* let flexbox in backdrop position it */
        animation: slideUpBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        padding-bottom: env(safe-area-inset-bottom, 12px); /* iOS home bar */
    }
    /* Shrink inner scrollable content areas on mobile */
    #nd-content,
    #td-desc {
        max-height: 200px !important;
        font-size: 0.88rem !important;
    }
    /* Compress detail meta rows for small screens */
    #note-detail-modal .modal-box > div,
    #task-detail-modal .modal-box > div {
        padding: 0 16px 16px !important;
    }
    /* Keep action buttons readable & tappable */
    #nd-action-btns button,
    #td-action-btns button {
        padding: 8px 12px !important;
        font-size: 0.82rem !important;
        min-height: 40px;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    input[type="text"],
    input[type="date"],
    input[type="time"],
    textarea,
    select {
        font-size: 16px !important; /* Prevent iOS focus auto-zoom */
    }
}

@keyframes slideUpBottom {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ==========================================================================
   Detail View Modal Styles
   ========================================================================== */

.detail-modal-box {
    max-width: 600px;
}

.detail-modal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.detail-modal-icon {
    width: 20px;
    height: 20px;
    color: var(--boss-primary);
    flex-shrink: 0;
}

.detail-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.detail-body {
    padding: 16px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

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

.detail-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.detail-due-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-status-badge {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.detail-content-box {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px 18px;
    font-size: 0.93rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 80px;
    max-height: 380px;
    overflow-y: auto;
}

.detail-desc-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-desc-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

.detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}

.detail-author {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.detail-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Mobile overrides for detail modals */
@media (max-width: 768px) {
    .detail-modal-box {
        max-width: 100%;
    }
    .detail-body {
        padding: 12px 16px 16px;
        gap: 12px;
    }
    .detail-content-box {
        max-height: 180px !important;
        font-size: 0.88rem;
        padding: 12px 14px;
    }
    .detail-modal-title {
        font-size: 0.95rem;
    }
    .detail-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .detail-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .detail-actions .btn {
        flex: 1;
        justify-content: center;
        min-height: 42px;
        font-size: 0.85rem;
    }
}


/* Global utility classes */
.hidden {
    display: none !important;
}

/* Alarm linked note preview panel */
.alarm-note-preview {
    margin-top: 24px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--border-radius-md);
    text-align: left;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.04);
}

.alarm-note-preview h4 {
    color: var(--warning);
    font-size: 0.95rem;
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.alarm-note-preview p {
    color: var(--text-primary) !important;
    font-size: 0.85rem !important;
    line-height: 1.4;
    white-space: pre-wrap;
    opacity: 0.85;
}

/* Alarm linked task preview panel */
.alarm-task-preview {
    margin-top: 16px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--border-radius-md);
    text-align: left;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* Login Screen Overlay Layout */
.login-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 15% 15%, rgba(99, 102, 241, 0.1) 0px, transparent 60%),
        radial-gradient(at 85% 85%, rgba(139, 92, 246, 0.08) 0px, transparent 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: var(--transition-smooth);
}

.login-backdrop.hidden {
    display: none !important;
}

.login-box {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 440px;
    max-width: 90%;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    text-align: center;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo {
    margin: 0 auto 20px auto;
    width: 50px;
    height: 50px;
}

.login-box h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    background: linear-gradient(120deg, #0f172a, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.login-role-selector {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.login-role-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.01);
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.login-role-option:hover {
    background: rgba(15, 23, 42, 0.03);
    border-color: var(--border-color-hover);
}

.login-role-option .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
}

.login-role-option span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.login-role-option.active[data-role="boss"] {
    background: rgba(79, 70, 229, 0.06);
    border-color: var(--primary);
}

.login-role-option.active[data-role="boss"] span {
    color: var(--primary);
}

.login-role-option.active[data-role="assistant"] {
    background: rgba(8, 145, 178, 0.06);
    border-color: var(--assistant-primary);
}

.login-role-option.active[data-role="assistant"] span {
    color: var(--assistant-primary);
}

.login-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--danger);
    background: var(--danger-bg);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    animation: shake 0.4s ease-in-out;
}

.login-error.hidden {
    display: none !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Sidebar Profile Display Style */
.active-user-display {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 8px 12px;
}

.active-user-display .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.active-user-display .avatar.boss {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.active-user-display .avatar.assistant {
    background: linear-gradient(135deg, var(--assistant-primary), #0d9488);
}

/* ==========================================================================
   Reminders Calendar Component
   ========================================================================== */
.reminder-calendar-container {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
    transition: all 0.3s ease;
}

.reminder-calendar-container.hidden {
    display: none !important;
}

.calendar-day-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
    margin: 2px auto;
    width: 32px;
    height: 32px;
}

.calendar-day-cell:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.calendar-day-cell.inactive {
    color: var(--text-muted);
    opacity: 0.35;
    cursor: default;
}
.calendar-day-cell.inactive:hover {
    background: transparent;
    color: var(--text-muted);
}

.calendar-day-cell.today {
    border: 1.5px solid var(--primary);
    font-weight: 700;
    color: var(--primary);
}

.calendar-day-cell.selected {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.calendar-day-cell.has-reminder::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: calc(50% - 2px);
    width: 4px;
    height: 4px;
    background: var(--warning);
    border-radius: 50%;
}

.calendar-day-cell.selected.has-reminder::after {
    background: #ffffff;
}

.reminder-view-toggles .btn-icon {
    opacity: 0.55;
    border: 1px solid transparent;
}

.reminder-view-toggles .btn-icon.active {
    opacity: 1;
    background: #ffffff !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--border-color) !important;
}

/* ==========================================================================
   AI Copilot Chat Styles
   ========================================================================== */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 210px);
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .ai-chat-container {
        height: calc(100vh - 220px);
        margin-bottom: 80px;
    }
}

.ai-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.ai-message.assistant {
    align-self: flex-start;
}

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.ai-message.assistant .ai-message-avatar {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
}

.ai-message.user .ai-message-avatar {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.ai-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.45;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.ai-message.assistant .ai-message-bubble {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-top-left-radius: 4px;
}

.ai-message.user .ai-message-bubble {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

.ai-message.user .ai-message-bubble p {
    color: white !important;
}

.ai-message-bubble p {
    margin: 0 0 8px 0;
}

.ai-message-bubble p:last-child {
    margin-bottom: 0;
}

/* Suggested Action Chips */
.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ai-suggestion-chip {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.18);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 550;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-suggestion-chip:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

/* Chat Input Area */
.ai-chat-input-area {
    display: flex;
    padding: 16px;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    align-items: center;
}

.ai-chat-input-area input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 12px 16px;
    font-size: 0.9rem;
    outline: none;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 6px 12px;
    align-items: center;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Styled lists inside AI messages */
.ai-message-bubble ul, .ai-message-bubble ol {
    margin: 4px 0 8px 16px;
    padding: 0;
}

.ai-message-bubble li {
    margin-bottom: 4px;
}

/* Archive Calendar Dot & Linked Note Preview Cards */
.calendar-day-cell.has-archived-task::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: calc(50% - 2px);
    width: 4px;
    height: 4px;
    background: var(--success);
    border-radius: 50%;
}

.calendar-day-cell.selected.has-archived-task::after {
    background: #ffffff;
}

.linked-note-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    transition: var(--transition-smooth);
}

.linked-note-card:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.linked-note-card .note-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    flex-grow: 1;
    overflow: hidden;
}

.linked-note-card .note-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.linked-note-card .note-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.linked-note-card .btn-unlink {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.linked-note-card .btn-unlink:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}
