* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 10px;
    background: #f5f5f5;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    margin-bottom: 5px;
    color: #333;
    font-size: 24px;
}

.subtitle {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

button.primary {
    background: #0066cc;
    color: white;
}

button.primary:hover {
    background: #0052a3;
}

button.secondary {
    background: #e0e0e0;
    color: #333;
}

button.secondary:hover {
    background: #d0d0d0;
}

button.active {
    background: #0066cc;
    color: white;
}

.view-toggle {
    display: flex;
    gap: 10px;
}

/* Form Styles */
.form-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 30px;
}

.form-section h2 {
    margin-bottom: 15px;
    font-size: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

input,
select,
textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

/* Board Styles */
.board {
    overflow-x: auto;
}

.board-grid {
    display: grid;
    gap: 8px;
    min-width: 800px;
}

.category-view {
    grid-template-columns: 100px repeat(3, 1fr);
}

.team-view {
    /* Set dynamically in JS */
    grid-template-columns: auto;
}

.quarter-label {
    font-weight: 600;
    padding: 8px 5px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
}

.column-header {
    font-weight: 600;
    padding: 10px;
    background: #333;
    color: white;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
}

.cell {
    min-height: 60px;
    padding: 6px;
    background: #fafafa;
    border-radius: 4px;
    border: 1px dashed #e0e0e0;
}

.initiative-card {
    background: white;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 3px;
    border-left: 3px solid;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.initiative-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.initiative-card h4 {
    margin-bottom: 4px;
    font-size: 13px;
    color: #333;
}

.initiative-card p {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.initiative-card .meta {
    font-size: 10px;
    color: #999;
}

/* Size variants */
.initiative-card.size-small {
    padding: 6px;
}

.initiative-card.size-small h4 {
    font-size: 12px;
}

.initiative-card.size-medium {
    padding: 8px;
}

.initiative-card.size-medium h4 {
    font-size: 13px;
}

.initiative-card.size-large {
    padding: 12px;
    min-height: 70px;
}

.initiative-card.size-large h4 {
    font-size: 14px;
    font-weight: 600;
}

.status-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 14px;
    line-height: 1;
}

.time-travel-bar {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    display: none;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.time-travel-bar.active {
    display: flex;
}

.time-travel-bar strong {
    color: #856404;
}

.time-travel-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.time-travel-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    min-width: 250px;
}

.version-info {
    font-size: 12px;
    color: #856404;
    font-style: italic;
}

/* Team Filter */
.team-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 4px;
}

.team-filter label {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
}

.team-filter select {
    padding: 6px 10px;
    font-size: 13px;
}

/* Category Colours */
.cat-run {
    border-left-color: #95a5a6;
    background: #f4f6f6;
}

.cat-grow {
    border-left-color: #3498db;
    background: #eaf3fb;
}

.cat-transform {
    border-left-color: #9b59b6;
    background: #f4ecf7;
}

/* Legend */
.legend {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.legend-colour {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
}

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

/* Admin Modal Sections */
.admin-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.admin-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.admin-section h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-actions button {
    flex: 1;
    min-width: 150px;
}

.data-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Fullscreen Mode */
body.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    overflow: hidden;
}

body.fullscreen .container {
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    padding: 10px;
}

body.fullscreen .header-section {
    display: none;
}

body.fullscreen .controls {
    margin-bottom: 10px;
}

body.fullscreen .board {
    flex: 1;
    overflow: auto;
}

/* Share button hover effect */
#shareBtn:hover {
    background: #d0d0d0 !important;
}

#shareBtn:active {
    transform: scale(0.95);
}

/* Business Value Checkbox Styling */
.value-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s;
    background: white;
}

.value-checkbox-label:hover {
    border-color: #0066cc;
    background: #f0f8ff;
}

.value-checkbox-label input:checked {
    accent-color: #0066cc;
}

.value-checkbox-label:has(input:checked) {
    border-color: #0066cc;
    background: #e6f2ff;
}

/* Business value badges on cards */
.business-value-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.business-value-badge {
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.05);
}

/* Interactive Legend */
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: all 0.2s;
    user-select: none;
}

.legend-item:hover {
    background: #f0f0f0;
    border-color: #d0d0d0;
}

.legend-item.filtered-out {
    opacity: 0.4;
    text-decoration: line-through;
}

.legend-item.filtered-out:hover {
    opacity: 0.6;
}

.legend-colour {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Filter hint */
.legend-hint {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-left: 10px;
}

/* Compare Versions Modal */
.compare-modal-content {
    max-width: 700px;
}

.compare-description {
    color: #666;
    font-size: 13px;
    margin-bottom: 20px;
}

.compare-version-selectors {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.compare-select-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compare-select-group label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.compare-select-group select {
    width: 100%;
}

.compare-arrow {
    font-size: 24px;
    color: #999;
    padding-bottom: 8px;
}

.compare-actions {
    margin-bottom: 20px;
}

/* Compare Results */
.compare-results {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.compare-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    flex: 1;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.summary-card.summary-added {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.summary-card.summary-removed {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.summary-card.summary-modified {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.summary-count {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.summary-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Compare Grouping Toggle */
.compare-grouping {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.compare-grouping button {
    padding: 6px 12px;
    font-size: 12px;
}

/* Compare Details */
.compare-details {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.compare-group {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.compare-group:last-child {
    border-bottom: none;
}

.compare-group-header {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #ddd;
}

.compare-change-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #999;
}

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

.compare-change-item.change-added {
    border-left-color: #28a745;
}

.compare-change-item.change-removed {
    border-left-color: #dc3545;
}

.compare-change-item.change-modified {
    border-left-color: #ffc107;
}

.change-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.change-type-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
}

.change-type-badge.badge-added {
    background: #28a745;
}

.change-type-badge.badge-removed {
    background: #dc3545;
}

.change-type-badge.badge-modified {
    background: #ffc107;
    color: #333;
}

.change-item-name {
    font-weight: 500;
    font-size: 13px;
    color: #333;
}

.change-item-meta {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
}

.compare-field-changes {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e0e0e0;
}

.field-change {
    font-size: 12px;
    color: #555;
    padding: 4px 0;
    padding-left: 12px;
    border-left: 2px solid #e0e0e0;
    margin-bottom: 4px;
}

.field-change:last-child {
    margin-bottom: 0;
}

.compare-no-changes {
    padding: 30px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* ============================================================================
   VERSION PICKER - Custom dropdown with grouped versions
   ============================================================================ */

.version-picker {
    position: relative;
    min-width: 280px;
}

.version-picker-trigger {
    width: 100%;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.version-picker-trigger:hover {
    border-color: #999;
}

.version-picker-trigger:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

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

.picker-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
}

.version-picker.open .picker-arrow {
    transform: rotate(180deg);
}

.version-picker-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
}

.version-picker.open .version-picker-dropdown {
    display: block;
}

/* Latest Version - Always at top */
.version-latest {
    padding: 10px 12px;
    border-bottom: 2px solid #e0e0e0;
    background: #f0f8ff;
}

.version-latest-item {
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    border-left: 3px solid #0066cc;
    background: white;
}

.version-latest-item:hover {
    background: #e6f2ff;
}

.version-latest-item.selected {
    background: #cce5ff;
}

.version-latest-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    background: #0066cc;
    color: white;
    margin-right: 8px;
}

.version-latest-label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.version-latest-meta {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* Day Groups */
.version-day-group {
    border-bottom: 1px solid #e0e0e0;
}

.version-day-group:last-child {
    border-bottom: none;
}

.version-day-header {
    padding: 10px 12px;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.version-day-header:hover {
    background: #ebebeb;
}

.day-expand-icon {
    font-size: 10px;
    color: #666;
    width: 16px;
    text-align: center;
    transition: transform 0.2s;
}

.version-day-group.expanded .day-expand-icon {
    transform: rotate(90deg);
}

.day-header-date {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.day-header-summary {
    font-size: 11px;
    color: #666;
    flex: 1;
}

.day-header-count {
    font-size: 11px;
    color: #999;
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Individual versions within a day */
.version-day-items {
    display: none;
    padding: 6px 0;
    background: #fafafa;
}

.version-day-group.expanded .version-day-items {
    display: block;
}

.version-item {
    padding: 8px 12px 8px 36px;
    cursor: pointer;
    border-left: 3px solid transparent;
    margin: 2px 8px;
    border-radius: 4px;
    background: white;
}

.version-item:hover {
    background: #f0f0f0;
    border-left-color: #999;
}

.version-item.selected {
    background: #e6f2ff;
    border-left-color: #0066cc;
}

.version-item-time {
    font-weight: 500;
    font-size: 12px;
    color: #333;
}

.version-item-user {
    font-size: 11px;
    color: #666;
    margin-left: 8px;
}

.version-item-summary {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* Empty state */
.version-picker-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Adjust compare modal pickers */
.compare-select-group .version-picker {
    min-width: 200px;
}

.compare-select-group .version-picker-dropdown {
    min-width: 280px;
}