/* ===== CSS Variables ===== */
:root {
    --sidebar-bg: #292f4c;
    --sidebar-text: #c3c6d4;
    --sidebar-active: #cce5ff;
    --sidebar-hover: #383e5a;
    --header-bg: #ffffff;
    --header-border: #e6e9ef;
    --body-bg: #f6f7fb;
    --board-bg: #ffffff;
    --text-primary: #323338;
    --text-secondary: #676879;
    --text-muted: #c3c6d4;
    --border-color: #e6e9ef;
    --row-hover: #f5f6f8;
    --group-todo: #784bd1;
    --group-completed: #00c875;
    --status-working: #fdab3d;
    --status-done: #00c875;
    --status-stuck: #e2445c;
    --status-blank: #c4c4c4;
    --priority-low: #579bfc;
    --priority-medium: #cab641;
    --priority-high: #e2445c;
    --priority-critical: #333333;
    --primary-blue: #0073ea;
    --primary-hover: #0060c2;
    --font-family: 'Rubik', 'Noto Sans Hebrew', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --timeline-green: #00c875;
    --timeline-blue: #579bfc;
    --timeline-red: #e2445c;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    background: var(--body-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    direction: ltr;
}

/* ===== Top Header ===== */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 0 16px;
    z-index: 100;
}

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

.butterli-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-suffix {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

.see-plans-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f0f0f8;
    border: 1px solid #d0d0e0;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-family);
}

.see-plans-btn:hover {
    background: #e0e0f0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.15s;
}

.header-icon-btn:hover {
    background: #e8e8ee;
}

.header-icon-btn .material-icons-outlined {
    font-size: 20px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0073ea, #00c875);
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-img {
    border-radius: 50%;
    object-fit: cover;
    background: transparent;
    cursor: pointer;
}

.header-avatar {
    margin-right: 4px;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    height: calc(100vh - 48px);
    overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 8px;
    user-select: none;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.sidebar-nav {
    padding: 0 8px;
    margin-bottom: 4px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 4px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
    cursor: pointer;
    white-space: nowrap;
}

.sidebar-item .material-icons-outlined {
    font-size: 19px;
    opacity: 0.7;
}

.sidebar-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-item.active {
    background: #0073ea;
    color: #fff;
}

.sidebar-item.active .material-icons-outlined {
    opacity: 1;
}

.sub-item {
    padding-right: 28px;
    font-size: 13.5px;
}

.sidebar-section {
    padding: 0 8px;
    margin-top: 8px;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9699a6;
}

.sidebar-section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.workspace-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
}

.workspace-selector:hover {
    background: var(--sidebar-hover);
}

.workspace-icon {
    width: 24px;
    height: 24px;
    background: #0073ea;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.add-workspace-btn {
    margin-right: auto;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-workspace-btn:hover {
    background: rgba(255,255,255,0.2);
}

.sidebar-project-list {
    margin-top: 4px;
}

.project-item {
    font-size: 13.5px;
    position: relative;
}

.project-item .board-menu-trigger {
    opacity: 0;
    transition: opacity 0.15s;
    margin-inline-start: auto;
    flex-shrink: 0;
}

.project-item:hover .board-menu-trigger {
    opacity: 1;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--board-bg);
}

/* Board Header */
.board-header {
    padding: 16px 24px 8px 24px;
}

.board-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.board-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.board-title-dropdown {
    font-size: 18px !important;
    color: var(--text-secondary);
    cursor: pointer;
}

.board-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.board-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-family);
    transition: background 0.15s;
}

.board-action-btn:hover {
    background: #e8e8ee;
}

.board-action-btn .material-icons-outlined {
    font-size: 18px;
}

.sidekick-btn {
    color: #0073ea;
}

.ai-btn .badge-new {
    background: #e2445c;
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
}

.board-action-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

.board-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
}

.invite-text {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* View Tabs */
.view-tabs {
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    gap: 4px;
}

.tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-blue);
    font-weight: 500;
}

.tab:hover {
    background: var(--row-hover);
}

.add-tab-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-tab-btn:hover {
    background: var(--row-hover);
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-family);
    transition: all 0.15s;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: #e8e8ee;
}

.toolbar-btn .material-icons-outlined {
    font-size: 18px;
}

.toolbar-btn.primary-btn {
    background: var(--primary-blue);
    color: #fff;
    font-weight: 500;
    padding: 6px 16px;
}

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

/* ===== Table Content ===== */
.table-content {
    flex: 1;
    overflow: auto;
    padding: 0 24px 40px 24px;
    position: relative;
}

.table-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-content::-webkit-scrollbar-thumb {
    background: #c0c0c8;
    border-radius: 4px;
}

.table-content::-webkit-scrollbar-track {
    background: transparent;
}

/* ===== Group ===== */
.group {
    margin-bottom: 24px;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
}

.group-select-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-blue);
    flex-shrink: 0;
}

.group-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    color: inherit;
}

.group-toggle.collapsed {
    transform: rotate(-90deg);
}

.group-title {
    font-size: 16px;
    font-weight: 600;
    cursor: text;
}

.group-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===== Table ===== */
.board-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    width: 100%;
    min-width: 800px;
}

/* ===== Sticky Left Columns (Color + Checkbox + Task) on Horizontal Scroll ===== */
/* Only thead cells get sticky left positioning - body rows scroll normally */
.board-table thead th.group-color-cell {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 210;
    background: #fff;
}

.board-table thead th[data-col="checkbox"] {
    position: sticky;
    top: 0;
    left: 6px;
    z-index: 210;
    background: #fff;
}

.board-table thead th.col-task {
    position: sticky;
    top: 0;
    left: 42px;
    z-index: 210;
    background: #fff;
}

.board-table thead th {
    background: #fff;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 200;
    user-select: none;
    overflow: visible;
}

.board-table thead th:last-child {
    border-right: none;
}

/* Column resize handle */
.col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
}

.col-resize-handle:hover,
.col-resize-handle.active {
    background: var(--primary-blue);
}

.board-table thead th:first-child {
    width: 36px;
    text-align: center;
}

.board-table thead th.col-task {
    text-align: center;
    min-width: 180px;
    max-width: 750px;
}

.board-table thead th .th-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.board-table thead th .th-content .th-label {
    text-align: center;
}

/* Column header tooltip - rendered via JS into body */
.col-header-tooltip {
    position: fixed;
    background: #333;
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.col-header-tooltip.visible {
    opacity: 1;
}

.col-header-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.board-table thead th .th-content .material-icons-outlined {
    font-size: 14px;
    opacity: 0.5;
}

.board-table thead th.col-add {
    width: 36px;
    cursor: pointer;
}

/* Color indicator on left */
.group-color-cell {
    width: 6px;
    padding: 0 !important;
    border: none !important;
    position: relative;
}

.group-color-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 6px;
    border-radius: 0 4px 4px 0;
}

/* Table rows */
.board-table tbody tr {
    transition: background 0.1s;
}

.board-table tbody tr:hover {
    background: var(--row-hover);
}

.board-table tbody td {
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    height: 38px;
    vertical-align: middle;
    font-size: 13px;
    position: relative;
}

/* Universal vertical centering for all cell content including subtask rows */
.board-table tbody td .file-icon,
.board-table tbody td .updated-content,
.board-table tbody td .cell-task-content {
    height: 100%;
    min-height: 38px;
}

.board-table tbody td.cell-owner,
.board-table tbody td.cell-files,
.board-table tbody td.cell-due-date,
.board-table tbody td.cell-notes,
.board-table tbody td.cell-budget,
.board-table tbody td.cell-updated,
.board-table tbody td.cell-status,
.board-table tbody td.cell-priority,
.board-table tbody td.cell-timeline,
.board-table tbody td.cell-checkbox,
.board-table tbody td.cell-add-col {
    vertical-align: middle;
}

.board-table tbody td.cell-notes,
.board-table tbody td.cell-budget,
.board-table tbody td.cell-due-date {
    line-height: 38px;
}

.subtask-row td.cell-notes,
.subtask-row td.cell-budget,
.subtask-row td.cell-due-date {
    line-height: 38px;
}

.board-table tbody td:last-child {
    border-right: none;
}

.board-table tbody td.cell-checkbox {
    width: 36px;
    text-align: center;
}

.board-table tbody td.cell-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

.board-table tbody td.cell-task {
    padding: 0 16px 0 8px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.cell-task-content {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    height: 100%;
    min-height: 38px;
    direction: ltr;
}

.cell-task-content .subtask-expand-btn {
    flex-shrink: 0;
    margin-right: 4px;
}

.cell-task-content .task-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    direction: rtl;
    unicode-bidi: plaintext;
}

.cell-task-content .subtask-info-badge {
    flex-shrink: 0;
    margin-left: 4px;
}

.cell-task-content .task-icons {
    margin-left: auto;
    flex-shrink: 0;
}

.task-icons {
    display: flex;
    gap: 4px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.board-table tbody tr:hover .task-icons {
    opacity: 1;
}

.task-icon-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 4px;
}

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

.task-icon-btn .material-icons-outlined {
    font-size: 16px;
}

/* Owner Cell */
.cell-owner {
    width: 80px;
    text-align: center;
}

.owner-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.owner-avatar.has-owner {
    background: linear-gradient(135deg, #0073ea, #7b61ff);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
}

.owner-avatar.no-owner {
    border: 2px dashed var(--text-muted);
    background: transparent;
}

.owner-avatar.no-owner .material-icons-outlined {
    font-size: 16px;
    color: var(--text-muted);
}

/* Status Cell */
.cell-status {
    width: 120px;
    text-align: center;
    padding: 4px 2px !important;
}

.status-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    width: 110px;
    cursor: pointer;
    height: 28px;
    user-select: none;
    transition: opacity 0.15s;
}

.status-label:hover {
    opacity: 0.85;
}

/* Due Date Cell */
.cell-due-date {
    width: 100px;
    text-align: center;
    font-size: 13px;
    color: var(--text-primary);
}

.cell-due-date .date-display {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.cell-due-date .date-display:hover {
    background: var(--row-hover);
}

/* Priority Cell */
.cell-priority {
    width: 110px;
    text-align: center;
    padding: 4px 2px !important;
}

.priority-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    width: 110px;
    cursor: pointer;
    height: 28px;
    user-select: none;
    transition: opacity 0.15s;
}

.priority-label:hover {
    opacity: 0.85;
}

/* Notes Cell */
.cell-notes {
    width: 120px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.cell-notes:hover {
    background: var(--row-hover);
}

/* Budget Cell */
.cell-budget {
    width: 90px;
    text-align: center;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

.cell-budget:hover {
    background: var(--row-hover);
}

/* Files Cell */
.cell-files {
    width: 70px;
    text-align: center;
}

.file-icon {
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.file-icon:hover {
    color: var(--primary-blue);
}

.file-icon .material-icons-outlined {
    font-size: 18px;
}

/* Timeline Cell */
.cell-timeline {
    width: 140px;
    text-align: center;
    padding: 4px 6px !important;
}

.timeline-bar {
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    padding: 0 6px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.timeline-bar.has-dates {
    background: linear-gradient(90deg, var(--timeline-green), var(--timeline-blue));
}

.timeline-bar.no-dates {
    background: #e6e9ef;
    color: var(--text-muted);
}

/* Last Updated Cell */
.cell-updated {
    width: 140px;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    position: relative;
    padding: 0 8px !important;
}

.updated-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    height: 100%;
    min-height: 38px;
    padding-left: 12px;
}

.updated-avatar {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0073ea, #7b61ff);
    color: #fff;
    font-size: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Add column cell */
.cell-add-col {
    width: 36px;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    border-right: none !important;
    background: transparent !important;
    pointer-events: none;
}

.cell-add-col:hover {
    color: var(--primary-blue);
}

/* Add task row */
.add-task-row td {
    border-bottom: none !important;
    padding: 6px 0 !important;
}

.add-task-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.15s;
}

.add-task-trigger:hover {
    color: var(--primary-blue);
}

/* ===== Subtask / Subitem Styles ===== */

/* Expand button on parent task */
.subtask-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    margin-left: -4px;
    margin-right: 4px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s;
}

.subtask-expand-btn:hover {
    background: #e8e8ee;
}

.subtask-expand-btn .material-icons-outlined {
    font-size: 18px;
    color: #323338;
    transition: transform 0.2s;
}

.subtask-expand-btn .subtask-collapse-arrow {
    transition: transform 0.2s;
}

.subtask-expand-btn .subtask-collapse-arrow.collapsed {
    transform: rotate(-90deg);
}

.subtask-count-badge {
    display: none;
}

/* Subtask info badge - right of task name */
.subtask-info-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0073ea;
    flex-shrink: 0;
    margin-left: 4px;
}

.subtask-info-count {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.subtask-info-icon {
    display: none;
}

tr.subtasks-open > td {
    border-bottom-color: transparent !important;
}

/* Done/Completed task text grayed out */
tr.task-done .cell-task .task-name {
    color: #9a9daa;
}

tr.subtask-done .subtask-name,
tr.subtask-done .cell-notes,
tr.subtask-done .cell-budget,
tr.subtask-done .cell-updated span,
tr.subtask-done .date-display {
    color: #9a9daa;
}

/* Subtask data row — uses proper table cells aligned with main task columns */
.subtask-row td {
    background: #f7f8fa !important;
    border-bottom: 1px solid #ecedf0 !important;
    height: 38px;
    vertical-align: middle;
}

.subtask-row:hover td {
    background: #eef0f4 !important;
}

.subtask-task-cell .cell-task-content.subtask-task-content {
    padding-left: 24px;
}



.subtask-task-cell .cell-task-content {
    position: relative;
}

.subtask-name {
    font-size: 13px;
    color: var(--text-primary);
    cursor: default;
    padding: 2px 4px;
    border-radius: 3px;
}

.subtask-name:hover {
    background: #e8e8ee;
}

.subtask-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 10px !important;
}

.subtask-status-label {
    font-size: 12px !important;
    padding: 3px 8px !important;
    min-width: 90px;
}

.subtask-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    margin-left: auto;
}

.subtask-row:hover .subtask-actions {
    opacity: 1;
}

.subtask-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-muted);
}

.subtask-delete-btn:hover {
    background: #fce4ec;
    color: #e2445c;
}

.subtask-delete-btn .material-icons-outlined {
    font-size: 16px;
}

/* Add subitem row */
.subtask-add-row td {
    background: #f7f8fa !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0 !important;
}

.subtask-add-trigger {
    padding: 6px 16px 6px 42px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    transition: color 0.15s;
}

.subtask-add-trigger:hover {
    color: var(--primary-blue);
}

.subtask-inline-input {
    width: 250px !important;
}

/* Summary Row */
.summary-row td {
    background: #f5f6f8 !important;
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color) !important;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    height: 38px !important;
    vertical-align: middle;
    text-align: center;
    padding: 4px 6px !important;
}

.summary-colors {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    width: 80%;
    margin: auto;
}

.summary-colors span {
    flex: 1;
    transition: flex 0.3s;
}

.summary-timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 38px;
}

.summary-timeline-bar {
    height: 20px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--timeline-green), var(--timeline-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    padding: 0 8px;
    white-space: nowrap;
}

.summary-files {
    text-align: center;
    vertical-align: middle;
    font-size: 11px;
    line-height: 1.3;
}

.summary-budget {
    text-align: center;
    vertical-align: middle;
    font-size: 12px;
    line-height: 1.3;
}

.summary-value {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.summary-label {
    display: block;
    font-size: 10px;
    color: #aaa;
}

/* Add New Group */
.add-group-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px dashed var(--border-color);
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: var(--font-family);
    transition: all 0.15s;
    margin-top: 8px;
}

.add-group-btn:hover {
    background: var(--row-hover);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 520px;
    max-width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    color: var(--text-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--row-hover);
}

.modal-body {
    padding: 20px 24px 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--text-primary);
    transition: border-color 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 115, 234, 0.1);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

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

.modal-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.15s;
}

.save-btn {
    background: var(--primary-blue);
    color: #fff;
}

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

.cancel-btn {
    background: #f0f0f5;
    color: var(--text-secondary);
}

.cancel-btn:hover {
    background: #e0e0e8;
}

/* ===== Dropdown Menu ===== */
.dropdown-menu {
    display: none;
    position: fixed;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 500;
    padding: 8px;
    min-width: 140px;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.1s;
    color: #fff;
    margin-bottom: 4px;
}

.dropdown-item:last-child {
    margin-bottom: 0;
}

.dropdown-item:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.dropdown-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
}

/* ===== Inline Edit ===== */
.inline-edit-input {
    width: 100%;
    border: 2px solid var(--primary-blue);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    font-family: var(--font-family);
    outline: none;
    background: #fff;
}

/* ===== Collapse animation ===== */
.group-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.group-body:not(.collapsed) {
    overflow: visible;
}

.group-body.collapsed {
    max-height: 0 !important;
}

/* ===== AUTH SCREEN (Task 4) ===== */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f6f7fb 0%, #e8eaf6 100%);
    overflow: auto;
}

.auth-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    padding: 40px;
    width: 440px;
    max-width: 95%;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.auth-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-logo-suffix {
    font-size: 13px;
    color: var(--text-secondary);
    display: block;
    margin-top: -2px;
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-field input,
.auth-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus,
.auth-field textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,115,234,0.1);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 40px;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #676879;
    border-radius: 4px;
    transition: color 0.15s;
}

.password-toggle-btn:hover {
    color: #323338;
}

.password-toggle-btn .material-icons-outlined {
    font-size: 20px;
}

.auth-error {
    color: #e2445c;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

.auth-error:not(:empty) {
    display: block;
}

.auth-success {
    color: #00c875;
    font-size: 13px;
    margin-bottom: 12px;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.15s;
    margin-bottom: 10px;
}

.auth-btn-primary {
    background: var(--primary-blue);
    color: #fff;
}

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

.auth-btn-google {
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.auth-btn-google:hover {
    background: #f5f6f8;
}

.auth-btn-facebook {
    background: #1877F2;
    color: #fff;
}

.auth-btn-facebook:hover {
    background: #1565C0;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 12px;
}

.auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-links a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

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

.auth-links span {
    display: block;
    margin-top: 8px;
}

/* ===== FLOATING BAR (Task 2 & 3) ===== */
.floating-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    transition: bottom 0.3s ease;
}

.floating-bar.active {
    bottom: 24px;
}

.floating-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #292f4c;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    white-space: nowrap;
}

.floating-bar-count {
    font-size: 14px;
    font-weight: 500;
    padding-left: 16px;
    border-left: 1px solid rgba(255,255,255,0.2);
    margin-left: 4px;
}

.floating-bar-actions {
    display: flex;
    gap: 4px;
}

.floating-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font-family);
    transition: background 0.15s;
}

.floating-btn:hover {
    background: rgba(255,255,255,0.2);
}

.floating-btn .material-icons-outlined {
    font-size: 16px;
}

.floating-btn-danger {
    color: #ff6b6b;
}

.floating-btn-danger:hover {
    background: rgba(255,107,107,0.2);
}

.floating-btn-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.floating-btn-disabled:hover {
    background: rgba(255,255,255,0.1);
}

.floating-bar-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.floating-bar-close:hover {
    background: rgba(255,255,255,0.3);
}

.floating-bar-close .material-icons-outlined {
    font-size: 16px;
}

/* ===== INVITE MODAL (Task 5) ===== */
.invite-modal-content {
    width: 600px;
}

.invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.invite-label {
    font-size: 14px;
    color: var(--text-primary);
}

.invite-from {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.invite-google-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-family);
}

.invite-google-btn:hover {
    background: #f5f6f8;
}

.invite-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.invite-email-wrap {
    flex: 1;
}

.invite-role-select {
    width: 120px;
    flex-shrink: 0;
}

.invite-role-descriptions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.invite-role-desc {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}

.invite-role-desc strong {
    color: var(--text-primary);
    font-size: 13px;
}

.invite-role-desc.active,
.invite-role-desc:hover {
    border-color: var(--primary-blue);
    background: rgba(0,115,234,0.05);
}

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

/* ===== SIDEBAR USER INFO ===== */
.sidebar-user-info {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-user-details {
    flex: 1;
    min-width: 0;
}

.sidebar-user-details .sidebar-label {
    display: block;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}

.sidebar-user-role {
    font-size: 10px;
    color: #9699a6;
    text-transform: uppercase;
}

.sidebar-logout-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--sidebar-text);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logout-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ===== USER MENU DROPDOWN ===== */
.user-menu-dropdown {
    display: none;
    position: fixed;
    top: 52px;
    left: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 600;
    min-width: 200px;
    padding: 8px;
}

.user-menu-dropdown.active {
    display: block;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.user-menu-name {
    font-weight: 600;
    font-size: 14px;
}

.user-menu-role {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: 4px;
    font-family: var(--font-family);
}

.user-menu-item:hover {
    background: var(--row-hover);
}

.user-menu-item .material-icons-outlined {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .sidebar {
        width: 48px;
        min-width: 48px;
    }
    .sidebar-label,
    .sidebar-section-header span,
    .workspace-selector span,
    .sidebar-section-actions,
    .sidebar-user-details {
        display: none;
    }
    .sidebar-item {
        justify-content: center;
        padding: 10px;
    }
    .workspace-selector {
        justify-content: center;
    }
    .floating-bar-inner {
        flex-wrap: wrap;
        max-width: 95vw;
    }
    .floating-bar-actions {
        flex-wrap: wrap;
    }
    .auth-container {
        margin: 16px;
    }
}

/* Scrollbar for table */
.table-scroll-wrapper {
    padding-left: 28px;
    margin-left: -28px;
}

/* Sticky thead */
.sticky-thead {
    z-index: 200;
    background: #fff;
}

.sticky-thead th {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #fff !important;
    border-bottom: 2px solid var(--border-color) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Group header row inside table */
.group-header-row td {
    background: #fff;
    border: none !important;
    padding: 8px 0 !important;
    height: auto !important;
}

.group-header-cell {
    cursor: pointer;
    user-select: none;
}

.group-header-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    padding-left: 16px;
}

.group-drag-handle {
    position: absolute;
    left: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    cursor: grab;
    color: #c3c6d4;
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: 4px;
}

/* Collapsed group - hide all rows except header */
.group-tbody.group-collapsed tr:not(.group-header-row) {
    display: none;
}

.groups-container {
    padding-left: 28px;
    margin-left: -28px;
}

/* Empty state dot for status/priority */
.empty-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-blank);
    display: inline-block;
}

/* Arrow for collapse/expand */
.collapse-arrow {
    font-size: 16px;
    transition: transform 0.2s;
}

.collapse-arrow.collapsed {
    transform: rotate(-90deg);
}

/* ===== Group Header Actions (+, ...) ===== */
.group-header-row:hover .group-drag-handle {
    opacity: 1;
}

.group-drag-handle:hover {
    color: #676879;
    background: rgba(0,0,0,0.05);
}

.group-drag-handle .material-icons-outlined {
    font-size: 16px;
}

.group-header-row:hover .group-drag-handle,
.group-header:hover > .group-drag-handle {
    opacity: 1;
}

.group-dragging {
    opacity: 0.5;
}

.group-drag-over-top {
    border-top: 2px solid var(--primary-blue, #0073ea) !important;
}

.group-drag-over-bottom {
    border-bottom: 2px solid var(--primary-blue, #0073ea) !important;
}

/* Row drag handle (tasks and subtasks) */
.row-drag-handle {
    position: absolute;
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    cursor: grab;
    color: #c3c6d4;
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: 4px;
}

.row-drag-handle:hover {
    color: #676879;
    background: rgba(0,0,0,0.05);
}

.row-drag-handle .material-icons-outlined {
    font-size: 16px;
}

tr[data-task-id]:hover > .group-color-cell > .row-drag-handle,
tr.subtask-row:hover > .group-color-cell > .row-drag-handle {
    opacity: 1;
}

.group-color-cell {
    position: relative;
}

.group-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.group-header-row:hover .group-header-actions {
    opacity: 1;
    pointer-events: auto;
}

.group-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    color: #676879;
    transition: background 0.15s, color 0.15s;
}

.group-action-btn:hover {
    background: rgba(0,0,0,0.08);
    color: #323338;
}

.group-action-btn .material-icons-outlined {
    font-size: 18px;
}

/* ===== Group Context Menu ===== */
.group-context-menu {
    position: fixed;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.08);
    padding: 6px 0;
    min-width: 180px;
    z-index: 9999;
    direction: ltr;
    text-align: left;
}

.group-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #323338;
    transition: background 0.12s;
    white-space: nowrap;
}

.group-menu-item:hover {
    background: #f5f6f8;
}

.group-menu-item .material-icons-outlined {
    font-size: 18px;
    color: #676879;
}

.group-menu-item.has-submenu {
    position: relative;
}

.group-menu-item .submenu-arrow {
    margin-left: auto;
    font-size: 16px;
    color: #676879;
}

.group-menu-item.delete-item {
    color: #e2445c;
}

.group-menu-item.delete-item .material-icons-outlined {
    color: #e2445c;
}

.group-menu-item.delete-item:hover {
    background: #fef2f2;
}

.group-menu-divider {
    height: 1px;
    background: #e6e9ef;
    margin: 4px 0;
}

/* Invite trigger highlight */
.invite-trigger:hover {
    color: var(--primary-blue) !important;
}

/* ===== TASK 2/3: Red checkbox accent when selected ===== */
input[type="checkbox"].cb-selected {
    accent-color: #e2445c;
}

/* Selected row highlight */
tr.task-selected {
    background: rgba(226, 68, 92, 0.04) !important;
}

tr.task-selected:hover {
    background: rgba(226, 68, 92, 0.08) !important;
}

/* Header checkbox red when active */
thead input[type="checkbox"].cb-selected {
    accent-color: #e2445c;
}

/* ===== Toast Notifications ===== */
.toast-msg {
    background: #292f4c;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.toast-msg.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Group body animation fix ===== */
.group-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.group-body:not(.collapsed) {
    max-height: none !important;
    overflow: visible;
}
}

/* ===== ADMIN DASHBOARD ===== */

.sidebar-admin-section {
    margin-top: 8px;
    padding-bottom: 4px;
}

.sidebar-admin-item {
    background: rgba(0, 115, 234, 0.15) !important;
    border: 1px solid rgba(0, 115, 234, 0.3);
}

.sidebar-admin-item:hover {
    background: rgba(0, 115, 234, 0.3) !important;
}

.sidebar-admin-item .material-icons-outlined {
    color: #4fc3f7 !important;
    opacity: 1 !important;
}

.admin-dashboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: adminFadeIn 0.2s ease;
}

@keyframes adminFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.admin-dashboard {
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: adminSlideUp 0.25s ease;
    direction: ltr;
    text-align: left;
}

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

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid #e6e9ef;
    background: #fafbfc;
}

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

.admin-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #323338;
    margin: 0;
}

.admin-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #676879;
    transition: all 0.15s;
}

.admin-close-btn:hover {
    background: #e6e9ef;
    color: #323338;
}

.admin-filters {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 16px 28px;
    border-bottom: 1px solid #e6e9ef;
    flex-wrap: wrap;
}

.admin-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #676879;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f6f8;
    border: 1px solid #d0d4e4;
    border-radius: 8px;
    padding: 0 12px;
    min-width: 300px;
    transition: border-color 0.15s;
}

.admin-search-wrap:focus-within {
    border-color: #0073ea;
    background: #fff;
}

.admin-search-wrap .material-icons-outlined {
    font-size: 20px;
    color: #676879;
}

.admin-search-input {
    border: none;
    background: none;
    padding: 10px 0;
    font-size: 14px;
    font-family: var(--font-family);
    color: #323338;
    outline: none;
    width: 100%;
}

.admin-select {
    padding: 9px 12px;
    border: 1px solid #d0d4e4;
    border-radius: 8px;
    background: #f5f6f8;
    font-size: 13px;
    font-family: var(--font-family);
    color: #323338;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    min-width: 120px;
}

.admin-select:focus {
    border-color: #0073ea;
    background: #fff;
}

.admin-table-wrap {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.admin-th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f5f6f8;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #676879;
    border-bottom: 2px solid #d0d4e4;
    white-space: nowrap;
    user-select: none;
}

.admin-th.sortable {
    cursor: pointer;
    transition: background 0.15s;
}

.admin-th.sortable:hover {
    background: #e6e9ef;
}

.admin-th .sort-icon {
    font-size: 16px;
    vertical-align: middle;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.admin-th.sort-active .sort-icon {
    opacity: 1;
    color: #0073ea;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e6e9ef;
    color: #323338;
    vertical-align: middle;
    text-align: left;
}

.admin-table tbody tr {
    transition: background 0.1s;
}

.admin-table tbody tr:hover {
    background: #f5f6f8;
}

.admin-loading {
    text-align: center;
    padding: 40px !important;
    color: #676879;
    font-size: 14px;
}

/* User row name cell */
.admin-user-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0073ea, #00c875);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.admin-name-text {
    font-weight: 500;
    color: #323338;
}

/* Role badge */
.admin-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.admin-role-badge.super_admin {
    background: #fdecef;
    color: #d83a52;
}

.admin-role-badge.admin {
    background: #e6f4ea;
    color: #1e7e34;
}

.admin-role-badge.member {
    background: #e8f0fe;
    color: #1a73e8;
}

.admin-role-badge.viewer {
    background: #f4f0e6;
    color: #9a7b2e;
}

/* Role select dropdown */
.admin-role-select {
    padding: 6px 10px;
    border: 1px solid #d0d4e4;
    border-radius: 8px;
    font-size: 12px;
    font-family: var(--font-family);
    cursor: pointer;
    background: #fff;
    color: #323338;
    outline: none;
    min-width: 110px;
    transition: border-color 0.15s;
}

.admin-role-select:focus {
    border-color: #0073ea;
}

.admin-role-select:disabled {
    background: #f5f6f8;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Provider badge */
.admin-provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #f0f0f0;
    color: #555;
}

.admin-provider-badge.google {
    background: #e8f0fe;
    color: #4285f4;
}

.admin-provider-badge.facebook {
    background: #e7f3ff;
    color: #1877f2;
}

.admin-provider-badge.local {
    background: #f0f0f0;
    color: #555;
}

.admin-provider-badge.invited {
    background: #fff4e5;
    color: #e67700;
}

/* IP cell */
.admin-ip {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #676879;
}

/* Date cell */
.admin-date {
    font-size: 12px;
    color: #323338;
    white-space: nowrap;
}

.admin-date-time {
    font-size: 10.5px;
    color: #9699a6;
}

.admin-no-data {
    color: #c4c4c4;
    font-style: italic;
    font-size: 12px;
}

/* Pagination */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 28px;
    border-top: 1px solid #e6e9ef;
    background: #fafbfc;
}

.admin-page-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid #d0d4e4;
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--font-family);
    color: #323338;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0 10px;
}

.admin-page-btn:hover:not(.active):not(:disabled) {
    background: #e6e9ef;
}

.admin-page-btn.active {
    background: #0073ea;
    border-color: #0073ea;
    color: #fff;
    font-weight: 600;
}

.admin-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.admin-page-info {
    font-size: 13px;
    color: #676879;
    padding: 0 12px;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    border-bottom: 1px solid #ecedf0;
    background: #f9fafb;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #676879;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.admin-tab:hover {
    color: #323338;
    background: rgba(0,0,0,0.03);
}

.admin-tab.active {
    color: #0073ea;
    border-bottom-color: #0073ea;
}

.admin-tab .material-icons-outlined {
    font-size: 18px;
}

/* Admin Email Section */
.admin-email-section {
    padding: 20px 24px;
    border-bottom: 1px solid #ecedf0;
}

.admin-email-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #323338;
    margin: 0 0 12px;
}

.admin-email-section h3 .material-icons-outlined {
    font-size: 20px;
    color: #0073ea;
}

.admin-email-desc {
    font-size: 13px;
    color: #676879;
    margin: 0 0 12px;
}

.admin-invite-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-invite-fields {
    display: flex;
    gap: 8px;
    flex: 1;
}

/* Invite Wizard Steps */
.invite-wizard {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.invite-step {
    display: none;
    animation: fadeInStep 0.2s ease;
}

.invite-step.active {
    display: block;
}

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

.invite-step-label {
    font-size: 12px;
    font-weight: 600;
    color: #676879;
    margin-bottom: 6px;
    display: block;
}

.invite-step-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.invite-step-row .admin-input {
    flex: 1;
}

.invite-btn-back {
    padding: 8px 12px;
    border: 1px solid #d0d4e4;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #323338;
    transition: background 0.15s;
}

.invite-btn-back:hover {
    background: #f0f0f3;
}

.admin-input {
    padding: 8px 12px;
    border: 1px solid #d0d4e4;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    flex: 1;
    min-width: 180px;
}

.admin-input:focus {
    outline: none;
    border-color: #0073ea;
    box-shadow: 0 0 0 2px rgba(0,115,234,0.1);
}

.admin-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d4e4;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 8px;
}

.admin-textarea:focus {
    outline: none;
    border-color: #0073ea;
    box-shadow: 0 0 0 2px rgba(0,115,234,0.1);
}

.admin-btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #0073ea;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.admin-btn-primary:hover {
    background: #0060c2;
}

.admin-btn-primary .material-icons-outlined {
    font-size: 16px;
}

.admin-invite-result {
    margin-top: 8px;
    font-size: 13px;
}

.admin-email-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-email-table thead th {
    text-align: center;
    padding: 8px 12px;
    background: #f5f6f8;
    font-weight: 500;
    color: #676879;
    border-bottom: 1px solid #ecedf0;
}

.admin-email-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #323338;
    text-align: center;
}

.admin-email-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.admin-notification-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-notification-form .admin-btn-primary {
    align-self: flex-start;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-dashboard {
        width: 98vw;
        height: 95vh;
        border-radius: 8px;
    }

    .admin-filters {
        gap: 10px;
        padding: 12px 16px;
    }

    .admin-search-wrap {
        min-width: 200px;
    }
}

/* ============================================================
   SPRINT 1.2 STYLES
   ============================================================ */

/* ===== Task 1: Subtask Arrow - Dark, LTR direction ===== */
.subtask-expand-btn .subtask-arrow-icon {
    font-size: 18px;
    color: #323338;
    transition: transform 0.2s;
}

.subtask-expand-btn:not(.expanded) .subtask-arrow-icon {
    transform: rotate(-90deg);
}

.subtask-expand-btn.expanded .subtask-arrow-icon {
    transform: rotate(0deg);
}

/* ===== Task 3: Overdue Due Date - Red exclamation ===== */
.due-overdue {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #e2445c;
    font-weight: 500;
}

.due-overdue-icon {
    font-size: 16px !important;
    color: #e2445c;
}

/* ===== Task 4: Completed Due Date - Green check + strikethrough ===== */
.due-done {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #00c875;
}

.due-done s {
    color: #999;
}

.due-check-icon {
    font-size: 16px !important;
    color: #00c875;
}

/* ===== Task 5: Today Due Date - Gray circle ===== */
.due-today {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #676879;
}

.due-today-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9699a6;
}

/* ===== Task 6: File Count Badge ===== */
.file-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.file-count-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: #0073ea;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* ===== Task 7: Timeline Hover - Days display ===== */
.timeline-bar.has-dates:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #292f4c;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}



.subtask-add-row td {
    background: #f7f8fa !important;
    border-bottom: 1px solid #ecedf0 !important;
}

.subtask-add-trigger {
    padding: 6px 8px;
    color: #999;
    font-size: 12px;
    cursor: pointer;
}

.subtask-add-trigger:hover {
    color: #0073ea;
}

/* Timeline modal overlay */
.timeline-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.timeline-modal {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    min-width: 280px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

/* ===== Task 12-13: Board Context Menu ===== */
.board-context-menu {
    position: fixed;
    z-index: 2000;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 6px;
    min-width: 200px;
    animation: boardCtxFadeIn 0.15s ease;
}

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

.board-ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #323338;
    transition: background 0.1s;
}

.board-ctx-item:hover {
    background: #f5f6f8;
}

.board-ctx-item .material-icons-outlined {
    font-size: 18px;
    color: #676879;
}

.board-ctx-danger {
    color: #e2445c !important;
}

.board-ctx-danger .material-icons-outlined {
    color: #e2445c !important;
}

.board-ctx-divider {
    height: 1px;
    background: #e6e9ef;
    margin: 4px 0;
}

/* Board sidebar hover menu trigger */
.board-menu-trigger {
    color: #c3c6d4;
    cursor: pointer;
    border-radius: 4px;
    padding: 2px;
    font-size: 16px !important;
}

.board-menu-trigger:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

/* ===== Task 14: Auth Loading Spinner ===== */
.auth-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== Task 15: Password Validation Rules ===== */
.password-rules {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pw-rule {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    transition: color 0.15s;
}

.pw-rule.pass {
    color: #00c875;
}

.pw-rule.fail {
    color: #c3c6d4;
}

.pw-rule .material-icons-outlined {
    font-size: 14px;
}

/* ===== Task 16: Column Drag & Drop Visual Feedback ===== */
.board-table thead th.col-dragging {
    opacity: 0.4;
    background: #e0e4ef;
}

.board-table thead th.col-drag-over {
    border-left: 2px solid var(--primary-blue);
}

.board-table tbody td.col-dragging {
    opacity: 0.4;
    background: #f0f2f8;
}

/* ===== Task 16: Row Drag & Drop ===== */
.board-table tbody tr.row-dragging {
    opacity: 0.3;
    background: #e8f4fd !important;
}

.board-table tbody tr.row-drag-over-top {
    position: relative;
}

.board-table tbody tr.row-drag-over-top td {
    border-top: 2px solid #0073ea !important;
}

.board-table tbody tr.row-drag-over-bottom {
    position: relative;
}

.board-table tbody tr.row-drag-over-bottom td {
    border-bottom: 2px solid #0073ea !important;
}

tr.add-task-row.row-drag-over-top td {
    border-top: 2px solid #0073ea !important;
    background: #e8f4fd;
}

/* Nest indicator - when dragging a task into another task's middle zone */
.board-table tbody tr.row-drag-over-nest {
    position: relative;
}

.board-table tbody tr.row-drag-over-nest td {
    background: #e8f4fd !important;
    border-top: 2px solid #0073ea !important;
    border-bottom: 2px solid #0073ea !important;
}

.board-table tbody tr.row-drag-over-nest td:first-child::before {
    content: '\e5d8';
    font-family: 'Material Icons Outlined';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #0073ea;
}

/* Move to menu */
.move-to-menu {
    position: fixed;
    z-index: 3000;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 280px;
    max-height: 350px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e6e9ef;
}

.move-to-header {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #676879;
    border-bottom: 1px solid #e6e9ef;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.move-to-search {
    padding: 8px 10px;
    border-bottom: 1px solid #e6e9ef;
}

.move-to-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d0d4e4;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.move-to-search input:focus {
    border-color: #0073ea;
}

.move-to-list {
    overflow-y: auto;
    max-height: 260px;
    padding: 4px 0;
}

.move-to-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 13px;
}

.move-to-item:hover {
    background: #f0f3ff;
}

.move-to-item.move-to-current {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.move-to-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.move-to-task-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #323338;
}

.move-to-group-name {
    font-size: 11px;
    color: #9699a6;
    flex-shrink: 0;
}

/* Subtask action btn (move icon) */
.subtask-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    transition: color 0.15s;
}

.subtask-action-btn .material-icons-outlined {
    font-size: 16px;
}

.subtask-action-btn:hover {
    color: #0073ea;
    background: #e8f4fd;
}

tr.subtask-row:hover .subtask-action-btn {
    opacity: 1;
}

/* Row drag handle */
.row-drag-handle {
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #c3c6d4;
    border-radius: 4px;
}
}

.board-table tbody tr[data-task-id]:hover > .group-color-cell > .row-drag-handle,
.board-table tbody tr.subtask-row:hover > .group-color-cell > .row-drag-handle {
    opacity: 1;
}

.row-drag-handle:active {
    cursor: grabbing;
}

/* Column ghost element during drag */
.col-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.8;
    background: #fff;
    border: 2px solid var(--primary-blue);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Row ghost element during drag */
.row-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.85;
    background: #fff;
    border: 2px solid var(--primary-blue);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

/* ===== Workspace UI ===== */
.workspace-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.workspace-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
    color: var(--text-primary);
}

.workspace-item:hover {
    background: rgba(255,255,255,0.1);
}

.workspace-item.active {
    background: rgba(255,255,255,0.15);
    font-weight: 500;
}

.workspace-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.workspace-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #d5d8df;
}

.workspace-item-role {
    font-size: 10px;
    color: #9699a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-workspace-btn-full {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #9699a6;
    transition: background 0.15s, color 0.15s;
}

.add-workspace-btn-full:hover {
    background: rgba(255,255,255,0.1);
    color: #d5d8df;
}

/* Active workspace header - blue highlighted section */
.active-workspace-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin: 6px 0 4px;
    border-radius: 6px;
    background: #0073ea;
    cursor: pointer;
    transition: background 0.15s;
}

.active-workspace-header:hover {
    background: #0060c2;
}

.active-workspace-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.active-workspace-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

/* Workspace Modals */
/* Workspace modals use inline style="display:none/flex" for toggle */
#workspaceSettingsModal.modal-overlay,
#createWorkspaceModal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.15s;
}

.modal-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e6e9ef;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #323338;
}

.modal-header h3 .material-icons-outlined {
    font-size: 20px;
    color: #0073ea;
}

.modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #676879;
    transition: background 0.15s;
}

.modal-close-btn:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e6e9ef;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #323338;
    margin-bottom: 6px;
    margin-top: 12px;
}

.modal-label:first-child {
    margin-top: 0;
}

.modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c3c6d4;
    border-radius: 6px;
    font-size: 14px;
    color: #323338;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: #0073ea;
}

.btn-primary {
    padding: 8px 16px;
    background: #0073ea;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: #0060c2;
}

.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    color: #323338;
    border: 1px solid #c3c6d4;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: #f6f7fb;
}

.btn-danger {
    padding: 8px 16px;
    background: #e2445c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-danger:hover {
    background: #c73a4f;
}

/* Workspace Settings Tabs */
.workspace-settings-modal {
    max-width: 560px;
}

.ws-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e6e9ef;
    margin-bottom: 16px;
}

.ws-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #676879;
    transition: color 0.15s, border-color 0.15s;
}

.ws-tab.active {
    color: #0073ea;
    border-bottom-color: #0073ea;
}

.ws-tab:hover {
    color: #323338;
}

.ws-tab-content {
    display: none;
}

.ws-tab-content.active {
    display: block;
}

.ws-settings-actions {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ws-role-info {
    margin-top: 16px;
    padding: 12px;
    background: #f6f7fb;
    border-radius: 6px;
    font-size: 13px;
    color: #676879;
}

/* Members list */
.ws-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ws-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f6f7fb;
}

.ws-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0073ea;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.ws-member-info {
    flex: 1;
    min-width: 0;
}

.ws-member-name {
    font-size: 13px;
    font-weight: 500;
    color: #323338;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-member-email {
    font-size: 11px;
    color: #676879;
}

.ws-member-role {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ws-member-role.owner { background: #fdab3d22; color: #fdab3d; }
.ws-member-role.admin { background: #0073ea22; color: #0073ea; }
.ws-member-role.member { background: #00c87522; color: #00c875; }
.ws-member-role.viewer { background: #c3c6d422; color: #676879; }

.ws-member-actions select {
    padding: 4px 8px;
    border: 1px solid #c3c6d4;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.ws-member-actions button {
    padding: 4px 8px;
    border: 1px solid #e2445c;
    border-radius: 4px;
    background: transparent;
    color: #e2445c;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s;
}

.ws-member-actions button:hover {
    background: #e2445c;
    color: #fff;
}

/* Pending invites */
.ws-pending-invites {
    margin-top: 20px;
}

.ws-pending-invites h4 {
    font-size: 13px;
    font-weight: 600;
    color: #323338;
    margin: 0 0 8px 0;
}

.ws-invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 4px;
    background: #f6f7fb;
    margin-bottom: 4px;
    font-size: 12px;
}

.ws-invite-row .invite-email {
    color: #323338;
    font-weight: 500;
}

.ws-invite-row .invite-role {
    color: #676879;
    margin-left: 8px;
}

.ws-invite-row .revoke-btn {
    background: transparent;
    border: none;
    color: #e2445c;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
}

.ws-invite-row .revoke-btn:hover {
    background: #fee;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Version Update Popup ===== */
.version-update-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    animation: versionPopupSlideIn 0.3s ease-out;
}

.version-update-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.05);
    min-width: 220px;
}

.version-update-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.version-update-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    margin: 0 0 18px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.version-update-buttons {
    display: flex;
    gap: 12px;
}

.version-btn-later {
    padding: 8px 18px;
    border: 1.5px solid #1a1a1a;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background 0.15s;
}

.version-btn-later:hover {
    background: #f5f5f5;
}

.version-btn-refresh {
    padding: 8px 18px;
    border: none;
    background: #1c1c1e;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background 0.15s;
}

.version-btn-refresh:hover {
    background: #333333;
}

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

/* Mobile: popup at bottom center */
@media (max-width: 600px) {
    .version-update-popup {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    .version-update-content {
        width: 100%;
    }
}

/* ===== SNAPSHOT STYLES ===== */
.snapshot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.snapshot-info-card {
    background: #f6f7fb;
    border-radius: 8px;
    padding: 16px;
}

.snapshot-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.snapshot-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.snapshot-info-label {
    font-size: 11px;
    color: #676879;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.snapshot-info-value {
    font-size: 15px;
    font-weight: 600;
    color: #323338;
}

.snapshot-status-valid {
    color: #00c875;
}

.snapshot-trigger-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.snapshot-trigger-auto {
    background: #e6f4ea;
    color: #1e7e34;
}

.snapshot-trigger-manual {
    background: #e3f2fd;
    color: #1565c0;
}

.snapshot-trigger-startup {
    background: #fff3e0;
    color: #e65100;
}

.snapshot-trigger-pre-restore {
    background: #fce4ec;
    color: #c62828;
}

.snapshot-action-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: #676879;
    transition: all 0.15s;
}

.snapshot-action-btn:hover {
    background: #e6e9ef;
}

.snapshot-view-btn:hover {
    color: #0073ea;
}

.snapshot-restore-btn:hover {
    color: #e2445c;
}

.snapshot-loading {
    color: #676879;
    font-style: italic;
}

.snapshot-empty {
    color: #676879;
    font-style: italic;
    margin: 0;
}

.snapshot-error {
    color: #e2445c;
}

.snapshot-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.snapshot-detail-header h4 {
    margin: 0;
    color: #323338;
}

.snapshot-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.snapshot-user-card {
    background: #f6f7fb;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e6e9ef;
}

.snapshot-user-email {
    font-weight: 600;
    color: #323338;
    margin-bottom: 6px;
    font-size: 13px;
    word-break: break-all;
}

.snapshot-user-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #676879;
}

.snapshot-user-meta strong {
    color: #323338;
}
