/* ──────────────────────────────────────────────────────────
   HomeOffice — JIRA-inspired global styles
────────────────────────────────────────────────────────── */

:root {
    --sidebar-bg: #1D2125;
    --sidebar-text: #9FADBC;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: #2C333A;
    --sidebar-active: #0052CC;
    --sidebar-width: 240px;
    --header-height: 56px;
    --header-bg: #1D2125;
    --primary: #0052CC;
    --primary-hover: #0065FF;
    --surface: #ffffff;
    --surface-alt: #F7F8F9;
    --border: #DFE1E6;
    --text-primary: #172B4D;
    --text-secondary: #6B778C;
    --priority-critical: #FF5630;
    --priority-high: #FF8B00;
    --priority-medium: #FFAB00;
    --priority-low: #6B778C;
    --status-backlog: #6B778C;
    --status-todo: #0052CC;
    --status-inprogress: #00B8D9;
    --status-inreview: #FF8B00;
    --status-done: #36B37E;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface-alt);
}

/* ── App shell ──────────────────────────────────────────── */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.2s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    color: var(--sidebar-text-active);
    font-weight: 700;
    font-size: 16px;
}

.sidebar-logo .logo-icon {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    color: #fff;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 16px 6px;
    color: var(--sidebar-text);
    opacity: 0.7;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li a,
.sidebar-nav li button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 4px;
    margin: 1px 6px;
    transition: background 0.15s, color 0.15s;
    background: none;
    border: none;
    width: calc(100% - 12px);
    cursor: pointer;
    font-size: 14px;
}

.sidebar-nav li a:hover,
.sidebar-nav li button:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-nav li a.active {
    background: var(--primary);
    color: var(--sidebar-text-active);
}

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

.sidebar-footer {
    margin-top: auto;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

/* ── Main wrapper ────────────────────────────────────────── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Top header ──────────────────────────────────────────── */
.top-header {
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
    z-index: 50;
}

.breadcrumb-nav {
    color: var(--sidebar-text);
    font-size: 13px;
    flex: 1;
}

.breadcrumb-nav a { color: var(--sidebar-text); text-decoration: none; }
.breadcrumb-nav a:hover { color: var(--sidebar-text-active); }
.breadcrumb-sep { margin: 0 6px; opacity: 0.5; }

.search-box {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    padding: 6px 12px;
    color: var(--sidebar-text);
    font-size: 13px;
    width: 220px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.search-box:focus {
    background: rgba(255,255,255,0.12);
    border-color: var(--primary);
}

.search-box::placeholder { color: rgba(255,255,255,0.35); }

.btn-create {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

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

/* ── Page content ────────────────────────────────────────── */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

/* ── Priority badges ──────────────────────────────────────── */
.badge-priority {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-priority.critical { background: #FFEBE6; color: var(--priority-critical); }
.badge-priority.high { background: #FFF4E5; color: var(--priority-high); }
.badge-priority.medium { background: #FFFAE6; color: var(--priority-medium); }
.badge-priority.low { background: #F4F5F7; color: var(--priority-low); }

/* ── Status pills ─────────────────────────────────────────── */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-status.backlog { background: #F4F5F7; color: var(--status-backlog); }
.badge-status.todo { background: #DEEBFF; color: var(--status-todo); }
.badge-status.inprogress { background: #E6FCFF; color: var(--status-inprogress); }
.badge-status.inreview { background: #FFF4E5; color: var(--status-inreview); }
.badge-status.done { background: #E3FCEF; color: var(--status-done); }

/* ── Kanban board ─────────────────────────────────────────── */
.board-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    min-height: calc(100vh - 160px);
}

.board-column {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 240px;
    max-width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.board-column-header {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.board-column-body {
    flex: 1;
    padding: 8px;
    min-height: 100px;
    overflow-y: auto;
}

.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: box-shadow 0.15s;
    position: relative;
}

.task-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.task-card-priority-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 4px 0 0 4px;
}

.task-card-priority-bar.critical { background: var(--priority-critical); }
.task-card-priority-bar.high { background: var(--priority-high); }
.task-card-priority-bar.medium { background: var(--priority-medium); }
.task-card-priority-bar.low { background: var(--priority-low); }

.task-card-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    padding-left: 8px;
    color: var(--text-primary);
}

.task-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 8px;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: 13px; color: var(--text-primary); }

.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0,82,204,0.15);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9,30,66,0.54);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.modal-dialog-custom {
    background: var(--surface);
    border-radius: 8px;
    width: 560px;
    max-width: 95vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

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

.modal-body-custom { padding: 20px 24px; }
.modal-footer-custom {
    padding: 12px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Login page ──────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 40px 40px 32px;
    width: 380px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo .logo-mark {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 22px;
    color: #fff;
    margin-bottom: 10px;
}

/* ── Table ───────────────────────────────────────────────── */
.ho-table { width: 100%; border-collapse: collapse; }
.ho-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    text-align: left;
}
.ho-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.ho-table tr:last-child td { border-bottom: none; }
.ho-table tr:hover td { background: var(--surface-alt); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    min-width: 30px;
    padding: 4px 8px;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pagination-btn:hover:not(:disabled) {
    background: var(--surface-alt);
    border-color: var(--primary);
    color: var(--primary);
}
.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary-ho {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary-ho:hover { background: var(--primary-hover); }

.btn-secondary-ho {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-secondary-ho:hover { background: var(--surface-alt); }

.btn-danger-ho {
    background: var(--priority-critical);
    color: #fff;
    border: 1px solid var(--priority-critical);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}
.btn-danger-ho:hover { background: #bf2600; border-color: #bf2600; }

.btn-danger-outline-ho {
    background: transparent;
    color: var(--priority-critical);
    border: 1px solid var(--priority-critical);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}
.btn-danger-outline-ho:hover { background: #FFEBE6; }

/* ── Alert ───────────────────────────────────────────────── */
.alert-error {
    background: #FFEBE6;
    border: 1px solid #FF5630;
    color: #AE2A19;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ── Responsive hamburger ────────────────────────────────── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--sidebar-text-active);
    font-size: 22px;
    cursor: pointer;
    padding: 0 8px;
}

@media (max-width: 768px) {
    .hamburger-btn { display: block; }
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { width: 100%; }
}

/* ── Sortable drag states ────────────────────────────────── */
.sortable-ghost { opacity: 0.4; background: #DEEBFF !important; border: 1px dashed var(--primary) !important; }
.sortable-drag  { box-shadow: 0 4px 16px rgba(0,0,0,0.22); }

/* ── Column drag handle ──────────────────────────────────── */
.column-drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    font-size: 15px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}
.board-column-header:hover .column-drag-handle { opacity: 0.5; }
.column-drag-handle:hover { opacity: 1 !important; }
.column-drag-handle:active { cursor: grabbing; }

.column-sort-ghost {
    opacity: 0.35;
    border: 2px dashed var(--primary) !important;
}

/* ── Column hide button ──────────────────────────────────── */
.column-hide-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s;
    padding: 2px 4px;
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1;
}
.board-column-header:hover .column-hide-btn { opacity: 0.5; }
.column-hide-btn:hover { opacity: 1 !important; color: var(--primary); }

/* ── Hidden swimlanes bar ────────────────────────────────── */
.hidden-lanes-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.hidden-lane-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.hidden-lane-chip button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    padding: 0;
    text-decoration: underline;
}

/* ── Recurring tasks page ────────────────────────────────── */
.recurrence-badge {
    display: inline-block;
    background: rgba(0, 82, 204, 0.08);
    color: var(--primary);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.toggle-active-btn {
    border: 1px solid;
    border-radius: 10px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.toggle-active-btn.active {
    background: rgba(0, 135, 90, 0.1);
    color: var(--status-done);
    border-color: var(--status-done);
}
.toggle-active-btn.active:hover {
    background: rgba(0, 135, 90, 0.2);
}
.toggle-active-btn.inactive {
    background: var(--surface-alt);
    color: var(--text-secondary);
    border-color: var(--border);
}
.toggle-active-btn.inactive:hover {
    background: var(--border);
}

/* ── Stand Ups ───────────────────────────────────────────── */
.standup-shell {
    display: flex;
    height: 100%;
    overflow: hidden;
    gap: 0;
}

.standup-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

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

.standup-new-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
}
.standup-new-btn:hover { background: var(--primary-hover); }

.standup-sidebar-empty {
    padding: 20px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.standup-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.standup-list-item {
    padding: 10px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.1s, border-color 0.1s;
}
.standup-list-item:hover { background: var(--surface-alt); }
.standup-list-item.active {
    background: rgba(0, 82, 204, 0.06);
    border-left-color: var(--primary);
}

.standup-list-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.standup-list-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Main panel */
.standup-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.standup-empty-state {
    margin: auto;
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
}

.standup-header-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.standup-members-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.standup-members-panel {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.standup-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 8px 3px 4px;
    font-size: 12px;
}
.standup-member-chip button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 11px;
    padding: 0;
    line-height: 1;
    margin-left: 2px;
}
.standup-member-chip button:hover { color: var(--priority-critical); }

/* External member indicators */
.ext-avatar {
    background: #6554C0 !important;  /* purple to distinguish from system-user blue */
}
.ext-badge {
    display: inline-block;
    background: rgba(101, 84, 192, 0.12);
    color: #6554C0;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.standup-events-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.standup-no-events {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 28px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.standup-events-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.standup-event-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.standup-event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.1s;
}
.standup-event-header:hover { background: var(--surface-alt); }

.standup-event-date {
    font-weight: 700;
    font-size: 13px;
}

.standup-event-body {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}

/* Notes grid */
.standup-notes-grid {
    display: grid;
    grid-template-columns: 160px 1fr 1fr 1fr;
    gap: 8px;
    align-items: start;
}

.standup-notes-header {
    margin-bottom: 4px;
}

.standup-notes-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.standup-notes-row:last-of-type { border-bottom: none; }

.standup-notes-user-col {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
}

.standup-notes-field-col {
    min-width: 0;
}

.standup-col-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.standup-note-text {
    font-size: 13px;
    color: var(--text-primary);
    white-space: pre-wrap;
    line-height: 1.5;
    padding: 4px 0;
}
.standup-note-text.empty { color: var(--text-secondary); }
.standup-note-text.blocker { color: var(--priority-critical); font-weight: 600; }

.standup-textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color 0.15s;
}
.standup-textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.standup-textarea::placeholder { color: var(--text-secondary); }

/* Confirm dialog (shared) */
.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1100;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px 32px;
    min-width: 340px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.28);
}

/* ── Card edit button ────────────────────────────────────── */
.card-edit-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 4px;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
    line-height: 1;
    border-radius: 3px;
}
.task-card:hover .card-edit-btn { opacity: 1; }
.card-edit-btn:hover { background: var(--surface-alt); color: var(--primary); }

/* ── Fast-add inline ──────────────────────────────────────── */
.quick-add-form {
    padding: 8px;
    border-top: 1px solid var(--border);
}
.quick-add-input {
    width: 100%;
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 8px;
    font-size: 13px;
    resize: none;
    outline: none;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(0,82,204,0.12);
}
.board-add-btn {
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid transparent;
    padding: 8px 12px;
    text-align: left;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.board-add-btn:hover { color: var(--primary); background: rgba(0,82,204,0.04); }

/* ── Add swimlane ghost column ────────────────────────────── */
.board-column-ghost {
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: 6px;
    min-width: 200px;
    max-width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: border-color 0.15s;
}
.board-column-ghost:hover { border-color: var(--primary); }
.add-swimlane-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 20px 16px;
    width: 100%;
    text-align: center;
    transition: color 0.15s;
    letter-spacing: 0.02em;
}
.add-swimlane-btn:hover { color: var(--primary); }

/* ── Typeahead dropdown ───────────────────────────────────── */
.typeahead-wrapper { position: relative; }
.typeahead-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 600;
    max-height: 220px;
    overflow-y: auto;
}
.typeahead-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.1s;
}
.typeahead-item:hover,
.typeahead-item.active { background: #DEEBFF; color: var(--primary); }
.typeahead-create {
    color: var(--primary);
    font-weight: 600;
    border-top: 1px solid var(--border);
}
.typeahead-create:hover { background: #DEEBFF; }

/* ── Task edit drawer ─────────────────────────────────────── */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9,30,66,0.35);
    z-index: 500;
}
.task-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 500px;
    max-width: 96vw;
    background: var(--surface);
    z-index: 501;
    box-shadow: -4px 0 28px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface-alt);
}
.drawer-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.1s;
}
.drawer-close-btn:hover { background: var(--border); color: var(--text-primary); }
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}
.drawer-title-display {
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s;
}
.drawer-title-display:hover { border-bottom-color: var(--primary); }
.drawer-title-input {
    width: 100%;
    font-size: 17px;
    font-weight: 700;
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 6px 10px;
    outline: none;
    color: var(--text-primary);
    background: var(--surface);
    box-shadow: 0 0 0 2px rgba(0,82,204,0.12);
}
.desc-click-area {
    min-height: 60px;
    padding: 10px 12px;
    background: var(--surface-alt);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.5;
}
.desc-click-area:hover { border-color: var(--border); background: #eef0f3; }
.desc-click-area.has-content { color: var(--text-primary); }

/* ──────────────────────────────────────────────────────────
   Calendar page
────────────────────────────────────────────────────────── */
.cal-page {
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* Left panel */
.cal-panel {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    overflow-y: auto;
}
.cal-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
    color: var(--text-primary);
    position: relative;
}
.cal-list-item:hover { background: var(--surface-alt); }
.cal-list-item.selected { background: #EAF0FB; }
.cal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cal-list-name { flex: 1; font-weight: 500; }
.cal-type-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 10px;
    background: var(--surface-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.cal-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 0 2px;
    opacity: 0;
    transition: opacity 0.15s;
}
.cal-list-item:hover .cal-edit-btn { opacity: 1; }

/* Main body */
.cal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
}

/* Toolbar */
.cal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.cal-nav-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: background 0.15s;
}
.cal-nav-btn:hover { background: var(--surface-alt); }
.cal-period-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 8px;
}
.cal-view-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}
.cal-view-btn:hover { background: var(--surface-alt); }
.cal-view-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Month grid */
.cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    overflow-y: auto;
}
.cal-dow-header {
    padding: 6px 0;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}
.cal-day {
    min-height: 100px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 4px;
    cursor: pointer;
    transition: background 0.1s;
    overflow: hidden;
}
.cal-day:hover { background: #f0f4ff; }
.cal-day.other-month { background: #FAFBFC; opacity: 0.6; }
.cal-day.today { background: #EAF0FB; }
.cal-day-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.cal-day.today .cal-day-num {
    background: var(--primary);
    color: #fff;
}
.cal-event-chip {
    display: block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.cal-event-chip:hover { opacity: 0.85; }
.cal-event-more {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 0 4px;
}

/* Week grid */
.cal-week-grid {
    display: grid;
    grid-template-columns: 56px repeat(7, 1fr);
    flex: 1;
    overflow-y: auto;
}
.cal-week-day-header {
    padding: 8px 4px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    background: var(--surface-alt);
}
.cal-week-day-header.today { background: #EAF0FB; }
.cal-today-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
}
.cal-week-time-col { background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.cal-week-allday-label {
    padding: 4px 4px;
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--surface-alt);
}
.cal-week-allday-cell {
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    padding: 2px 4px;
    min-height: 32px;
    cursor: pointer;
}
.cal-week-allday-cell:hover { background: #f0f4ff; }
.cal-week-time-label {
    padding: 2px 6px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}
.cal-week-cell {
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    min-height: 40px;
    padding: 2px 4px;
    cursor: pointer;
    transition: background 0.1s;
}
.cal-week-cell:hover { background: #f0f4ff; }

