/* ============= KANBAN APP STYLES ============= */
/* Kanban-specific overrides and additions to the shared style.css */

/* ===== VARIABLE ALIASES ===== */
/* Map kanban variable names to the shared style.css variable values */
:root {
    --bg-light: #f5f5f5;
    --text-dark: #333;
    --text-muted: #666;
}

/* ===== KANBAN HEADER ===== */
header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

/* ===== BRANDED LOGO ===== */
.logo-s {
    height: 1.15em;
    width: auto;
    vertical-align: -0.15em;
    border-radius: 3px;
    display: inline;
    margin-right: -2px;
}

.logo-hub {
    color: #404040;
}

/* ===== BOARD PICKER ===== */
.btn-board-picker {
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--border);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-board-picker:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.12);
    transform: none;
}

.board-picker-content {
    max-width: 460px;
    padding: 0 !important;
}

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

.board-picker-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 4px;
    line-height: 1;
}

.board-picker-close:hover {
    color: var(--text-dark);
}

.board-picker-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.board-picker-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.board-picker-item:hover {
    background: var(--bg-light);
    border-color: var(--border);
}

.board-picker-item.active {
    background: rgba(255, 102, 0, 0.06);
    border-color: var(--primary);
}

.board-picker-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.board-picker-item.active .board-picker-icon {
    background: rgba(255, 102, 0, 0.12);
}

.board-picker-info {
    flex: 1;
    min-width: 0;
}

.board-picker-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-picker-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    align-items: center;
}

.board-picker-role {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.board-picker-role.role-admin { background: rgba(255, 102, 0, 0.12); color: var(--primary); }
.board-picker-role.role-contributor { background: rgba(16, 185, 129, 0.12); color: #10B981; }
.board-picker-role.role-viewer { background: rgba(107, 114, 128, 0.12); color: #6B7280; }

.board-picker-check {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0;
}

.board-picker-item.active .board-picker-check {
    opacity: 1;
}

.board-picker-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.board-picker-footer {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
}

.board-picker-new {
    display: flex;
    gap: 8px;
    align-items: center;
}

.board-picker-new input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg-light);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.board-picker-new input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
    background: white;
}

.board-picker-new .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ===== SETTINGS ICON BUTTON ===== */
.board-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-settings-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.btn-settings-icon:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(255, 102, 0, 0.05);
    transform: none;
    box-shadow: none;
}

.btn-icon-signout {
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.btn-icon-signout:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.05);
    transform: none;
    box-shadow: none;
}

/* ===== BUTTON OVERRIDES ===== */
button, .btn {
    border-radius: 10px;
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

/* ===== VIEW SWITCHER ===== */
.view-switcher {
    display: flex;
    gap: 0;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 2px;
}

.view-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.view-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

/* ===== TABLE VIEW ===== */
.table-view {
    display: none;
}

.table-view.active {
    display: block;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table thead {
    background: var(--bg-light);
    border-bottom: 2px solid var(--border);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-dark);
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-id {
    font-weight: 700;
    color: var(--primary);
}

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

.table-priority.critical {
    background: #FEE2E2;
    color: #DC2626;
}

.table-priority.high {
    background: #FECACA;
    color: #B91C1C;
}

.table-priority.medium {
    background: #FEF3C7;
    color: #B45309;
}

.table-priority.low {
    background: #DBEAFE;
    color: #1E40AF;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 4px 8px;
}

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

/* ===== KANBAN VIEW ===== */
.kanban-view.hidden {
    display: none;
}

.kanban-view.active {
    display: block;
}

/* ===== CONTAINER OVERRIDE ===== */
.container {
    max-width: 1280px;
    padding: 40px 20px;
}

/* ===== BOARD SECTION ===== */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.board-title h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.board-info {
    color: var(--text-muted);
    font-size: 14px;
}

.board-controls {
    display: flex;
    gap: 10px;
}

/* ===== KANBAN BOARD WRAPPER ===== */
.kanban-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    margin-bottom: 20px;
}

.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 102, 0, 0.85);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0.7;
}

.scroll-button:hover {
    background: var(--primary);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.scroll-button:disabled {
    background: rgba(0,0,0,0.15);
    cursor: not-allowed;
    opacity: 0.4;
    transform: translateY(-50%);
}

#scrollLeft {
    left: 4px;
}

#scrollRight {
    right: 4px;
}

/* ===== KANBAN BOARD ===== */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 0;
    scroll-behavior: smooth;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-light);
}

.kanban-board::-webkit-scrollbar {
    height: 6px;
}

.kanban-board::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

.kanban-board::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== COLUMN ===== */
.column {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 320px;
    flex-shrink: 0;
}

.column:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.column.collapsed {
    min-width: 60px;
    padding: 10px;
    align-items: center;
}

.column.collapsed .column-content {
    display: none;
}

.column.collapsed .column-header {
    flex-direction: column;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    width: 100%;
}

.column.collapsed .column-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    transform: rotate(180deg);
    margin: 10px 0;
    font-size: 12px;
}

.column.collapsed .column-count {
    display: none;
}

.column.collapsed .col-add-card-btn {
    display: none;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
    gap: 10px;
}

.column-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
    min-width: 0;
}

.column-count {
    background: var(--bg-light);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.column-actions {
    display: flex;
    gap: 5px;
}

.collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.collapse-btn:hover {
    background: var(--bg-light);
    color: var(--primary);
}

/* ===== ADD CARD BUTTONS (+) ===== */
.col-add-card-btn {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    line-height: 1;
}

.col-add-card-btn:hover {
    background: rgba(255, 102, 0, 0.08);
    color: var(--primary);
    border-color: var(--primary);
}

.board-add-card-btn {
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.board-add-card-btn:hover {
    background: rgba(255, 102, 0, 0.08);
    color: var(--primary);
    border-color: var(--primary);
}

.column-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
}

.cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    min-height: 100px;
    cursor: default;
}

/* ===== KANBAN CARD (overrides shared .card) ===== */
.cards-container .card,
.card[data-card-id] {
    padding: 16px;
    cursor: move;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    touch-action: auto;
    border-radius: 10px;
    margin-bottom: 0;
}

.cards-container .card:hover,
.card[data-card-id]:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

/* SortableJS fallback drag clone */
.card-drag-fallback {
    opacity: 0.9 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    transform: rotate(2deg) !important;
    z-index: 9999 !important;
    border: 2px solid var(--primary) !important;
    cursor: grabbing !important;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}

.card-id {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(255, 102, 0, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 8px;
    /* Wrap at ~50 chars, max 2 lines (~100 chars total) */
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.8em; /* 2 lines * 1.4 line-height */
}

.card-priority {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.priority-critical {
    background: #FEE2E2;
    color: #DC2626;
}

.priority-high {
    background: #FECACA;
    color: #B91C1C;
}

.priority-medium {
    background: #FEF3C7;
    color: #B45309;
}

.priority-low {
    background: #DBEAFE;
    color: #1E40AF;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.card-type {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.card-assignee {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 4px;
}

.card-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

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

.card-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 4px;
}

.card-action-btn:hover {
    opacity: 1;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-dark);
}

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

/* ===== FORM OVERRIDES ===== */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== HIDDEN SELECT (for custom picker) ===== */
.hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* ===== PICKER BUTTON (replaces native select) ===== */
.picker-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: left;
    gap: 8px;
}

.picker-btn:hover {
    border-color: var(--primary);
}

.picker-btn:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.picker-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-arrow {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

/* Inline variant (for settings add rows) */
.picker-btn-inline {
    width: auto;
    min-width: 130px;
}

/* ===== OPTION PICKER MODAL ===== */
.option-picker-content {
    max-width: 400px;
    padding: 0 !important;
}

.option-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.option-picker-list {
    max-height: 50vh;
    overflow-y: auto;
    padding: 8px;
}

.option-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-dark);
    transition: all 0.12s;
    text-align: left;
}

.option-picker-item:hover {
    background: var(--bg-light);
    border-color: var(--border);
}

.option-picker-item.active {
    background: rgba(255, 102, 0, 0.06);
    border-color: var(--primary);
    font-weight: 600;
}

.option-picker-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.option-picker-check {
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 10px;
}

/* ===== CARD DETAIL (view-only) ===== */
.card-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-detail-header .modal-header {
    margin-bottom: 0;
}

.btn-edit-card {
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.btn-edit-card:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(255, 102, 0, 0.05);
    transform: none;
    box-shadow: none;
}

.card-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}

.card-link:hover {
    text-decoration: underline;
}

.detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 6px;
    padding: 6px 0;
    border-bottom: 1px solid var(--bg-light);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
}

.detail-row:last-of-type {
    border-bottom: none;
}

.detail-label {
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.detail-val {
    color: var(--text-dark);
    word-break: break-word;
}

/* ===== COMMENTS SECTION ===== */
.comments-section {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.comments-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.comment {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    font-size: 13px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.comment-text {
    color: var(--text-muted);
    margin-bottom: 6px;
}

.comment-time {
    font-size: 11px;
    color: #999;
}

.comment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-attach-comment {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.5;
    padding: 2px 4px;
    transition: opacity 0.2s;
}

.btn-attach-comment:hover {
    opacity: 1;
}

.comment-attachments {
    margin: 8px 0 4px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
}

.comment-attach-form {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.comment-attach-form .attachment-input {
    flex: 1;
    min-width: 120px;
}

/* ===== ATTACHMENTS SECTION ===== */
.attachments-section {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.attachments-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.attachments-list {
    margin-bottom: 10px;
}

.attachments-empty {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    transition: border-color 0.2s;
}

.attachment-item:hover {
    border-color: var(--primary);
}

.attachment-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-dark);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.attachment-link:hover {
    color: var(--primary);
}

.attachment-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.attachment-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.attachment-size {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.attachment-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.attachment-delete:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}

.attachment-add-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.attachment-input {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

.attachment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

/* Attachment toggle + tabs */
.attachment-add-area {
    margin-top: 10px;
}

.btn-attach-toggle {
    background: none;
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

.btn-attach-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.comment-attach-tabs {
    display: flex;
    gap: 0;
    margin: 10px 0 8px;
    border-bottom: 2px solid var(--border);
}

.attach-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.attach-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.attach-tab:hover {
    color: var(--text-dark);
}

.attach-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-file-input {
    font-size: 13px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    width: 100%;
}

.attachment-file-input::-webkit-file-upload-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
}

.comment-attach-inputs {
    margin-top: 8px;
}

.comment-attach-toggle {
    margin-bottom: 4px;
}

/* ===== HISTORY SECTION ===== */
.history-section {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.history-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.history-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
}

.history-action {
    font-weight: 600;
    color: var(--text-dark);
}

.history-time {
    color: var(--text-muted);
    font-size: 11px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-dark);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

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

/* ===== ROLE BADGE ===== */
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: #FF6600;
    color: white;
}

.role-contributor {
    background: #10B981;
    color: white;
}

.role-viewer {
    background: #6B7280;
    color: white;
}

/* ===== UTILITY ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}


/* ===== BOARD SETTINGS PAGE ===== */
.settings-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-light);
    z-index: 500;
    overflow-y: auto;
}

.settings-page .container {
    max-width: 900px;
    padding: 40px 20px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.settings-header h1 {
    font-size: 28px;
    margin-bottom: 0;
}

.settings-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.settings-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.settings-tab:hover {
    color: var(--primary);
}

.settings-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-panel .card {
    margin-bottom: 0;
}

.settings-panel .card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.settings-panel .card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.settings-list {
    margin-bottom: 20px;
}

.settings-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
}

.settings-list-item .item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-list-item .item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.settings-list-item .item-detail {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-list-item .item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.settings-add-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.settings-add-row input,
.settings-add-row select {
    flex: 1;
    max-width: 300px;
}

.settings-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    margin-bottom: 15px;
}

/* ===== CALENDAR VIEW ===== */
.calendar-view {
    display: none;
}

.calendar-view.active {
    display: block;
}

.calendar-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.calendar-main {
    flex: 1;
    min-width: 0;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.calendar-nav {
    display: flex;
    gap: 6px;
}

.calendar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.calendar-mode-switcher {
    display: flex;
    gap: 0;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 2px;
}

.calendar-mode-btn {
    padding: 7px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.calendar-mode-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-mode-btn:hover {
    color: var(--primary);
}

/* --- Monthly Grid --- */
.cal-month {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.cal-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.cal-day-header {
    padding: 10px 8px;
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
    min-height: 100px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 6px;
    position: relative;
    transition: background 0.15s;
}

.cal-cell:nth-child(7n) {
    border-right: none;
}

.cal-cell:hover {
    background: rgba(255, 102, 0, 0.03);
}

.cal-cell-empty {
    background: #fafafa;
}

.cal-today {
    background: rgba(255, 102, 0, 0.06) !important;
}

.cal-today .cal-day-num {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-day-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.cal-cards {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    max-height: 80px;
}

/* --- Card Chips (shared across views) --- */
.cal-card {
    padding: 4px 6px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    background: var(--bg-light);
    border-left: 3px solid var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: transform 0.1s, box-shadow 0.1s;
    overflow: hidden;
}

.cal-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.cal-card-type {
    font-size: 9px;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 4px;
    border-radius: 3px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.cal-card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-dark);
    max-width: 100%;
    /* Truncate after ~25 chars - JS handles actual truncation */
}

.cal-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Priority border colors */
.priority-border-low { border-left-color: #28a745; }
.priority-border-medium { border-left-color: #ffc107; }
.priority-border-high { border-left-color: #fd7e14; }
.priority-border-critical { border-left-color: #dc3545; }

/* --- Weekly View --- */
.cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.cal-week-day {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    min-height: 200px;
}

.cal-week-day.cal-today {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.cal-week-day-header {
    padding: 10px 12px;
    font-weight: 700;
    font-size: 13px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
}

.cal-today .cal-week-day-header {
    background: rgba(255, 102, 0, 0.08);
    color: var(--primary);
}

.cal-week-day-cards {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cal-empty-day {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 20px 8px;
    font-style: italic;
}

/* --- Daily View --- */
.cal-daily {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cal-daily-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.cal-daily-card {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border: 1px solid var(--border);
    border-left: 4px solid var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
}

.cal-daily-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cal-daily-time {
    flex-shrink: 0;
    width: 120px;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    padding-top: 2px;
}

.cal-daily-info {
    flex: 1;
    min-width: 0;
}

.cal-daily-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.cal-daily-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.cal-daily-desc {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
}

/* --- Calendar responsive --- */
@media (max-width: 900px) {
    .cal-week {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cal-week-day {
        min-height: auto;
    }

    .cal-cell {
        min-height: 60px;
    }

    .cal-daily-card {
        flex-direction: column;
        gap: 8px;
    }

    .cal-daily-time {
        width: auto;
    }

    .calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-title {
        text-align: left;
    }
}

/* --- Unscheduled Cards Sidebar --- */
.cal-unscheduled-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.cal-unscheduled-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    max-height: 600px;
    overflow-y: auto;
    position: sticky;
    top: 100px;
}

.cal-unscheduled-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.cal-unscheduled-count {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
}

.cal-unscheduled-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cal-unscheduled-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 10px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-left: 4px solid var(--text-muted);
    border-radius: 8px;
    cursor: grab;
    transition: transform 0.1s, box-shadow 0.15s;
    font-size: 12px;
}

.cal-unscheduled-card:active {
    cursor: grabbing;
}

.cal-unscheduled-card.dragging {
    opacity: 0.4;
    transform: rotate(2deg);
}

.cal-unscheduled-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.cal-unscheduled-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-unscheduled-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-unscheduled-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.cal-unscheduled-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 20px 8px;
    font-style: italic;
}

/* Drop target highlight */
.cal-cell.drop-over,
.cal-week-day.drop-over,
.cal-daily.drop-over {
    background: rgba(255, 102, 0, 0.12) !important;
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}

.cal-toggle-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ===== MOBILE MENU TOGGLE (hidden on desktop) ===== */
.mobile-menu-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Tools section inside hamburger — hidden on desktop */
.mobile-tools-section {
    display: none;
}

.mobile-tools-divider {
    display: none;
}

.board-controls-wrapper {
    display: contents;
}

@media (max-width: 900px) {
    .calendar-body {
        flex-direction: column;
    }

    .cal-unscheduled-sidebar {
        width: 100%;
        max-height: 200px;
        position: static;
    }
}

/* ===== PULL-TO-REFRESH ===== */
.pull-refresh-indicator {
    height: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-light);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.pull-refresh-spinner {
    font-size: 18px;
    display: inline-block;
}

.pull-refresh-indicator.ready .pull-refresh-text {
    color: var(--primary);
}

.pull-refresh-indicator.refreshing .pull-refresh-spinner {
    animation: pullSpin 0.8s linear infinite;
}

@keyframes pullSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== MOBILE LAYOUT (phones) ===== */
@media (max-width: 768px) {
    /* ===== HEADER: compact with hamburger ===== */
    header {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 0;
    }

    .logo {
        font-size: 18px;
    }

    .mobile-menu-toggle {
        display: flex;
        margin-left: auto;
    }

    .header-actions {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
        margin-top: 10px;
    }

    .header-actions.mobile-open {
        display: flex;
    }

    .header-actions select {
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
        text-align: center;
        margin-left: 0 !important;
        padding: 10px;
        font-size: 14px;
    }

    /* Board picker + settings gear sit side-by-side on mobile */
    .board-picker-row {
        width: 100%;
    }

    .board-picker-row .btn-board-picker {
        flex: 1;
        min-width: 0;
    }

    .board-picker-row .btn-settings-icon {
        width: 40px;
        flex-shrink: 0;
    }

    .board-picker-row .btn-icon-signout {
        width: 40px;
        flex-shrink: 0;
    }

    /* ===== TOOLS inside hamburger on mobile ===== */
    .mobile-tools-section {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .mobile-tools-divider {
        display: block;
        height: 1px;
        background: var(--border);
        margin: 4px 0;
    }

    .mobile-tools-section .mobile-view-switcher {
        width: 100%;
        justify-content: center;
    }

    .mobile-tools-section .view-btn {
        flex: 1;
        text-align: center;
        padding: 8px 8px;
        font-size: 12px;
    }

    .mobile-tools-section .btn {
        width: 100%;
        text-align: center;
    }

    /* ===== Hide desktop board controls on mobile ===== */
    .board-controls-wrapper {
        display: none;
    }

    /* ===== BOARD HEADER: stack vertically, compact ===== */
    .board-header {
        margin-bottom: 12px;
        gap: 8px;
    }

    .board-title h1 {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .board-info {
        font-size: 12px;
    }

    /* ===== CONTAINER: tighter padding ===== */
    .container {
        padding: 12px 10px;
    }

    /* ===== KANBAN: tighter columns + mobile scroll fix ===== */
    .kanban-board {
        -webkit-overflow-scrolling: touch;
    }

    .column {
        min-width: 280px;
    }

    .cards-container .card,
    .card[data-card-id] {
        cursor: default;
    }

    .scroll-button {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    /* ===== CALENDAR TOOLBAR: stack ===== */
    .calendar-toolbar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .calendar-title {
        font-size: 16px;
    }

    /* ===== MODAL: full width on mobile ===== */
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }
}

