/* ═══════════════════════════════════════════════════════════════
   Meetings V2 — Risk-Grid-Style CSS
   Prototype: docs/meeting-idea-D-risk-grid-style.html
   ═══════════════════════════════════════════════════════════════ */

/* ── Z-Index Block (from original — required for ExcelGridBase managers) ── */

.meetings-v2-container .column-menu,
.meetings-v2-container .egb-column-menu {
    z-index: 99999 !important;
    position: fixed !important;
}

.meetings-v2-container .advanced-filter-modal,
.advanced-filter-modal {
    z-index: 99999 !important;
    position: fixed !important;
}

.meetings-v2-container .context-menu,
.meetings-v2-container .egb-context-menu {
    z-index: 99999 !important;
    position: fixed !important;
}

.meetings-v2-container .column-visibility-modal,
.meetings-v2-container .conditional-format-modal,
.meetings-v2-container .column-group-modal {
    z-index: 99999 !important;
}

.meetings-v2-container .filter-row th {
    position: relative !important;
}
.meetings-v2-container .filter-row .advanced-filter-trigger {
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
}
.meetings-v2-container .filter-row .column-filter {
    padding-right: 28px !important;
}

.meetings-v2-container .toolbar-container {
    z-index: 10000 !important;
    position: relative !important;
}

/* ═══════════════════════════════════════════════════════════════
   Container & Layout
   ═══════════════════════════════════════════════════════════════ */

.meetings-v2-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    color: #1a1a1a;
}

/* ═══════════════════════════════════════════════════════════════
   TOP BAR — Meeting selector + actions
   ═══════════════════════════════════════════════════════════════ */

.mtg-topbar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.mtg-topbar h2 {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    margin: 0 4px 0 0;
}

.mtg-separator {
    width: 1px;
    height: 24px;
    background: #dee2e6;
    flex-shrink: 0;
}

.mtg-spacer {
    flex: 1;
}

/* ── Meeting Selector Pill ── */

.mtg-selector-wrap {
    position: relative;
}

.mtg-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    user-select: none;
}
.mtg-selector:hover {
    background: #e9ecef;
}

.mtg-sel-series {
    color: #495057;
}
.mtg-sel-num {
    color: #212529;
    font-weight: 700;
}
.mtg-sel-date {
    color: #6c757d;
    font-weight: 400;
}
.mtg-sel-arrow {
    font-size: 10px;
    color: #6c757d;
    margin-left: 2px;
}

/* ── Meeting Selector Dropdown ── */

.mtg-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
    z-index: 100;
    min-width: 320px;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}
.mtg-dropdown.visible {
    display: block;
}

.md-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #adb5bd;
    padding: 8px 12px 4px;
    letter-spacing: .5px;
}

.md-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.md-item:hover {
    background: #f3f4f6;
}
.md-item.active {
    background: #eff6ff;
}

.md-num {
    font-weight: 700;
    color: #2563eb;
    min-width: 30px;
}
.md-name {
    flex: 1;
    font-size: 13px;
    color: #212529;
}
.md-date {
    font-size: 11px;
    color: #adb5bd;
}
.md-items {
    font-size: 11px;
    color: #6c757d;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   Buttons (topbar + general)
   ═══════════════════════════════════════════════════════════════ */

.btn {
    padding: 6px 14px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    transition: all .12s;
    white-space: nowrap;
}
.btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}
.btn.primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.btn.primary:hover {
    background: #1d4ed8;
}
.btn.success {
    background: #198754;
    color: #fff;
    border-color: #198754;
}
.btn.success:hover {
    background: #157347;
}
.btn.outline-blue {
    color: #2563eb;
    border-color: #2563eb;
}
.btn.outline-blue:hover {
    background: #eff6ff;
}

/* ── Save Indicator ── */

.mtg-save-indicator {
    font-size: 11px;
    color: #198754;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   META STRIP — Date, time, location, attendance
   ═══════════════════════════════════════════════════════════════ */

.mtg-meta-strip {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #6c757d;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.meta-field {
    display: flex;
    align-items: center;
    gap: 4px;
}
.meta-field strong {
    color: #495057;
    font-weight: 600;
}
.meta-field input {
    border: 1px solid transparent;
    background: transparent;
    font-size: 12px;
    color: #495057;
    padding: 2px 4px;
    border-radius: 3px;
    width: auto;
    font-family: inherit;
}
.meta-field input:hover {
    border-color: #dee2e6;
    background: #f8f9fa;
}
.meta-field input:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(37,99,235,.1);
}

/* ── Attendance Chips ── */

.att-section {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}

.att-chip {
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid #dee2e6;
    background: #fff;
    transition: all .12s;
    user-select: none;
}
.att-chip:hover {
    border-color: #adb5bd;
}
.att-chip.present {
    background: #d1e7dd;
    border-color: #a3cfbb;
    color: #0f5132;
}
.att-chip.absent {
    background: #f8d7da;
    border-color: #f1aeb5;
    color: #842029;
    text-decoration: line-through;
    opacity: .6;
}

.att-add {
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 11px;
    cursor: pointer;
    border: 1.5px dashed #adb5bd;
    background: #fff;
    color: #6c757d;
}
.att-add:hover {
    border-color: #2563eb;
    color: #2563eb;
}

/* ═══════════════════════════════════════════════════════════════
   OVERVIEW (collapsible)
   ═══════════════════════════════════════════════════════════════ */

.mtg-overview-strip {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 6px 20px;
    font-size: 12px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
}
.mtg-overview-strip:hover {
    background: #f0f1f3;
}
.mtg-overview-strip .toggle {
    color: #adb5bd;
    font-size: 10px;
}

.mtg-overview-expanded {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 8px 20px;
    flex-shrink: 0;
}
.mtg-overview-expanded textarea {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.5;
    resize: none;
    font-family: inherit;
    min-height: 40px;
    background: #fff;
}
.mtg-overview-expanded textarea:focus {
    outline: none;
    border-color: #2563eb;
}

/* ═══════════════════════════════════════════════════════════════
   TOOLBAR — custom toolbar buttons
   ═══════════════════════════════════════════════════════════════ */

.mtg-toolbar-container {
    flex-shrink: 0;
}

.mtg-custom-toolbar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 4px 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tb-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 8px;
    border-right: 1px solid #e9ecef;
}
.tb-group:last-child {
    border-right: none;
}

.tb-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #adb5bd;
    margin-right: 4px;
    font-weight: 600;
}

.tb-btn {
    padding: 4px 8px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 3px;
}
.tb-btn:hover {
    background: #e9ecef;
}
.tb-btn.active {
    background: #dbeafe;
    color: #2563eb;
}

.tb-select {
    border: 1px solid #dee2e6;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 11px;
    background: #fff;
    color: #495057;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   GRID — main editable grid
   ═══════════════════════════════════════════════════════════════ */

.mtg-grid-container {
    flex: 1;
    overflow: auto;
    background: #fff;
    min-height: 0;
}

.mtg-grid-container table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.mtg-grid-container thead {
    position: sticky;
    top: 0;
    z-index: 200;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: 0 2px 0 0 #dee2e6;
}

.mtg-grid-container thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 7px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
    position: relative;
    user-select: none;
}
.mtg-grid-container thead th:hover {
    background: #e9ecef;
}

.mtg-grid-container thead th .resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    background: transparent;
}
.mtg-grid-container thead th .resize-handle:hover {
    background: #2563eb;
}

.mtg-grid-container thead th .sort-icon {
    color: #adb5bd;
    margin-left: 2px;
    font-size: 10px;
}

/* ── Filter row ── */

.mtg-grid-container .filter-row th {
    background: #fff;
    padding: 3px 4px;
    border-bottom: none; /* box-shadow on thead handles the separator */
}
.mtg-grid-container .filter-row input {
    width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 11px;
    color: #495057;
    background: #fff;
}
.mtg-grid-container .filter-row input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37,99,235,.15);
}
.mtg-grid-container .filter-row input::placeholder {
    color: #ced4da;
}

/* ── Data cells ── */

.mtg-grid-container td {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f8f9fa;
    position: relative;
    vertical-align: top;
}
.mtg-grid-container td .cell {
    padding: 6px 10px;
    min-height: 32px;
    cursor: cell;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}
.mtg-grid-container td .cell:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    background: #f0f7ff;
}
.mtg-grid-container td .cell:hover {
    background: #fafbfc;
}

/* ── Row number column ── */

.mtg-grid-container td.row-num {
    background: #fafafa;
    text-align: center;
    color: #adb5bd;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 4px;
    cursor: pointer;
    user-select: none;
}
.mtg-grid-container td.row-num:hover {
    background: #e9ecef;
    color: #495057;
}
.mtg-grid-container tr.selected td.row-num {
    background: #dbeafe;
    color: #2563eb;
}
.mtg-grid-container tr:hover td {
    background: #fafbfc;
}
.mtg-grid-container tr.selected td {
    background: #eff6ff;
}
.mtg-grid-container tr:hover td.row-num {
    background: #e9ecef;
}

/* ── Category column — color coded ── */

.cat-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.cat-dot.safety    { background: #dc3545; }
.cat-dot.schedule  { background: #0d6efd; }
.cat-dot.newbiz    { background: #6f42c1; }
.cat-dot.general   { background: #6c757d; }
.cat-dot.cat-0     { background: #dc3545; }
.cat-dot.cat-1     { background: #0d6efd; }
.cat-dot.cat-2     { background: #6f42c1; }
.cat-dot.cat-3     { background: #198754; }
.cat-dot.cat-4     { background: #fd7e14; }
.cat-dot.cat-5     { background: #d63384; }
.cat-dot.cat-6     { background: #0dcaf0; }
.cat-dot.cat-7     { background: #6c757d; }

/* ── Status badge ── */

.status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
}
.status-badge.open    { background: #cfe2ff; color: #084298; }
.status-badge.closed  { background: #d1e7dd; color: #0f5132; }
.status-badge.carried { background: #fff3cd; color: #664d03; }
.status-badge.overdue { background: #f8d7da; color: #842029; }

/* ── Priority badge ── */

.priority-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    display: inline-block;
}
.priority-badge.critical { background: #f8d7da; color: #842029; }
.priority-badge.high     { background: #ffe5d0; color: #984c0c; }
.priority-badge.medium   { background: #fff3cd; color: #664d03; }
.priority-badge.low      { background: #f8f9fa; color: #6c757d; }

/* ── Assignee tag ── */

.assignee-tag {
    background: #e8f0fe;
    color: #1a56db;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.assignee-tag:hover {
    background: #dbeafe;
}
.assignee-tag .avatar-sm {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
}

/* ── Due date ── */

.due-cell {
    font-size: 12px;
    color: #495057;
}
.due-cell.overdue {
    color: #dc3545;
    font-weight: 600;
}
.due-cell.soon {
    color: #fd7e14;
    font-weight: 500;
}

/* ── Carried-from tag ── */

.carried-tag {
    font-size: 10px;
    color: #a16207;
    background: #fef9c3;
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px dashed #fbbf24;
    display: inline-block;
    margin-top: 2px;
}

/* ── Add row ── */

.mtg-grid-container tr.add-row td {
    border-bottom: none;
}
.mtg-grid-container tr.add-row .cell,
.mtg-grid-container tr.add-row .add-row-cell {
    color: #adb5bd;
    font-style: italic;
    cursor: pointer;
    padding: 6px 10px;
}
.mtg-grid-container tr.add-row .cell:hover,
.mtg-grid-container tr.add-row .add-row-cell:hover {
    color: #2563eb;
    background: #eff6ff;
}

/* ═══════════════════════════════════════════════════════════════
   GROUP HEADERS — Category section dividers
   ═══════════════════════════════════════════════════════════════ */

.mtg-group-header td {
    padding: 6px 10px;
    font-weight: 700;
    font-size: 12px;
    border-bottom: 1px solid #dee2e6;
}
.mtg-group-header td span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.mtg-group-header .group-toggle {
    cursor: pointer;
    font-size: 10px;
    color: #adb5bd;
}
.mtg-group-header .group-toggle:hover {
    color: #495057;
}

/* Named category group colors */
.mtg-group-header.cat-0 td { background: #fff5f5; border-top: 2px solid #fca5a5; color: #991b1b; }
.mtg-group-header.cat-1 td { background: #eff6ff; border-top: 2px solid #93c5fd; color: #1e40af; }
.mtg-group-header.cat-2 td { background: #f5f3ff; border-top: 2px solid #c4b5fd; color: #5b21b6; }
.mtg-group-header.cat-3 td { background: #f0fdf4; border-top: 2px solid #86efac; color: #166534; }
.mtg-group-header.cat-4 td { background: #fffbeb; border-top: 2px solid #fcd34d; color: #92400e; }
.mtg-group-header.cat-5 td { background: #fdf2f8; border-top: 2px solid #f9a8d4; color: #9d174d; }
.mtg-group-header.cat-6 td { background: #f0f9ff; border-top: 2px solid #7dd3fc; color: #0c4a6e; }
.mtg-group-header.cat-7 td { background: #f9fafb; border-top: 2px solid #d1d5db; color: #374151; }

/* ═══════════════════════════════════════════════════════════════
   BOTTOM BAR — Row count + quick stats
   ═══════════════════════════════════════════════════════════════ */

.mtg-bottom-bar {
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 11px;
    color: #6c757d;
    flex-shrink: 0;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}
.stat .num {
    font-weight: 700;
    color: #212529;
}
.stat .label {
    color: #6c757d;
}
.stat.warn .num {
    color: #dc3545;
}

/* ═══════════════════════════════════════════════════════════════
   COLUMN MENU TRIGGER (3-dot)
   ═══════════════════════════════════════════════════════════════ */

#meetings-table th {
    position: relative;
}

#meetings-table th .column-menu-trigger {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 6px;
    cursor: pointer;
    color: #6c757d;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 14px;
}

#meetings-table th:hover .column-menu-trigger {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   DRAG & DROP
   ═══════════════════════════════════════════════════════════════ */

#meetings-table .drag-handle-cell {
    cursor: grab;
    user-select: none;
    white-space: nowrap;
}

#meetings-table .drag-handle {
    color: #adb5bd;
    font-size: 11px;
    letter-spacing: -2px;
    margin-right: 4px;
    cursor: grab;
}

#meetings-table .drag-handle:hover {
    color: #495057;
}

#meetings-table tr.drag-in-progress {
    opacity: 0.4;
    background: #e9ecef !important;
}

#meetings-table tr.drop-target {
    border-top: 2px solid #2563eb !important;
}

/* ═══════════════════════════════════════════════════════════════
   PIN/FREEZE — colspan row support (group headers, add-rows)
   ═══════════════════════════════════════════════════════════════ */

#meetings-table .mtg-group-header td[style*="sticky"] {
    box-shadow: 1px 0 0 0 #dee2e6;
}

#meetings-table .add-row td[style*="sticky"],
#meetings-table .cat-add-row td[style*="sticky"] {
    background: #fff !important;
    box-shadow: 1px 0 0 0 #dee2e6;
}

/* ═══════════════════════════════════════════════════════════════
   CONTEXT MENU
   ═══════════════════════════════════════════════════════════════ */

#mtg-ctx-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 4px;
    z-index: 100000;
    min-width: 200px;
}

.ctx-item {
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
}
.ctx-item:hover {
    background: #f3f4f6;
}
.ctx-item.danger {
    color: #dc3545;
}

.ctx-sep {
    height: 1px;
    background: #e9ecef;
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL OVERLAY (shared — new series, distribute, link)
   ═══════════════════════════════════════════════════════════════ */

.meetings-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    background: rgba(0, 0, 0, 0.45) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.meetings-modal-dialog {
    z-index: 100000 !important;
    position: relative !important;
    background: #fff !important;
    border-radius: 8px !important;
    max-width: 560px !important;
    width: 90% !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

.meetings-modal-header {
    padding: 12px 16px !important;
    border-bottom: 1px solid #dee2e6 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}
.meetings-modal-header h3 {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #212529 !important;
}

.meetings-modal-close {
    background: none !important;
    border: none !important;
    font-size: 22px !important;
    cursor: pointer !important;
    color: #6c757d !important;
    line-height: 1 !important;
}

.meetings-modal-body {
    padding: 14px 16px !important;
    overflow-y: auto !important;
    flex: 1 !important;
}

.meetings-modal-footer {
    padding: 10px 16px !important;
    border-top: 1px solid #dee2e6 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    background: #f8f9fa !important;
    border-radius: 0 0 8px 8px !important;
    flex-shrink: 0 !important;
}

.meetings-btn-primary {
    padding: 6px 14px !important;
    background: #2563eb !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}
.meetings-btn-primary:hover {
    background: #1d4ed8 !important;
}
.meetings-btn-primary:disabled {
    opacity: 0.6 !important;
    cursor: default !important;
}

.meetings-btn-secondary {
    padding: 6px 14px !important;
    background: #fff !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 13px !important;
}
.meetings-btn-secondary:hover {
    background: #f8f9fa !important;
}

/* ═══════════════════════════════════════════════════════════════
   DROPDOWN EDITOR (cell dropdowns)
   ═══════════════════════════════════════════════════════════════ */

#mtg-cell-dropdown {
    background: #fff;
    border: 1px solid #2563eb;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    z-index: 100000;
    max-height: 200px;
    overflow-y: auto;
}

.mtg-dd-option {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
}
.mtg-dd-option:hover {
    background: #f3f4f6;
}
.mtg-dd-option.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   SUBMENU (context menu sub-items)
   ═══════════════════════════════════════════════════════════════ */

.mtg-submenu {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    padding: 4px;
    z-index: 100001;
    min-width: 160px;
}

/* ═══════════════════════════════════════════════════════════════
   LEVEL 1 — Series Tracker Table
   Prototype: docs/meeting-idea-F-series-tracker-interactive.html
   ═══════════════════════════════════════════════════════════════ */

/* ── Header ── */

.l1-header {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.l1-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    margin: 0;
}
.l1-header .sep {
    width: 1px;
    height: 20px;
    background: #dee2e6;
    flex-shrink: 0;
}
.l1-header .spacer {
    flex: 1;
}

/* ── Inline stats ── */

.sb-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6c757d;
}
.sb-item .sb-n {
    font-weight: 700;
    font-size: 14px;
    color: #212529;
}
.sb-item.hl .sb-n { color: #2563eb; }
.sb-item.warn .sb-n { color: #dc3545; }

/* ── Tabs ── */

.l1-tabs {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0 20px;
    display: flex;
    gap: 0;
    flex-shrink: 0;
}
.l1-tab {
    padding: 8px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    font-weight: 500;
}
.l1-tab:hover { color: #495057; }
.l1-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}
.l1-badge {
    background: #dc3545;
    color: #fff;
    padding: 0 5px;
    border-radius: 8px;
    font-size: 9px;
    margin-left: 3px;
}

/* ── Table ── */

.l1-table-wrapper {
    overflow-y: auto;
    background: #fff;
}
.l1-series-table {
    width: 100%;
    border-collapse: collapse;
}
.l1-series-table thead th {
    background: #f8f9fa;
    padding: 6px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

/* ── Series row ── */

.l1-series-row {
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background .08s;
}
.l1-series-row:hover { background: #f8f9fa; }
.l1-series-row td {
    padding: 10px 12px;
    vertical-align: middle;
    font-size: 12px;
}

/* ── Series dot colors ── */

.sr-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}
.sr-dot.oac        { background: #2563eb; }
.sr-dot.safety     { background: #dc3545; }
.sr-dot.qc         { background: #059669; }
.sr-dot.contractor { background: #ea580c; }
.sr-dot.owner      { background: #7c3aed; }
.sr-dot.general    { background: #6c757d; }

.sr-series {
    font-weight: 700;
    font-size: 13px;
    color: #212529;
    white-space: nowrap;
}
.sr-current {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sr-current-top {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sr-num {
    font-weight: 700;
    color: #2563eb;
    font-size: 13px;
}
.sr-name {
    color: #495057;
    font-size: 12px;
}
.sr-date-loc {
    font-size: 11px;
    color: #adb5bd;
}

/* ── Item counts inline ── */

.l1-items {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.l1-ic {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}
.l1-ic .n { font-weight: 700; }
.l1-ic.total .n   { color: #212529; }
.l1-ic.open .n    { color: #2563eb; }
.l1-ic.overdue .n { color: #dc3545; }
.l1-ic.carried .n { color: #a16207; }

.l1-progress {
    width: 60px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}
.l1-progress .bar {
    height: 100%;
    border-radius: 2px;
    background: #198754;
}

/* ── Attendee avatars ── */

.sr-attendees {
    display: flex;
    align-items: center;
}
.av {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 700;
    color: #fff;
    margin-left: -4px;
    border: 1.5px solid #fff;
}
.av:first-child { margin-left: 0; }
.av.b1 { background: #2563eb; }
.av.b2 { background: #7c3aed; }
.av.b3 { background: #059669; }
.av.b4 { background: #dc3545; }
.av.b5 { background: #ea580c; }
.av-more {
    font-size: 10px;
    color: #adb5bd;
    margin-left: 3px;
}

/* ── Status badges (Level 1) ── */

.status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}
.status.open        { background: #cfe2ff; color: #084298; }
.status.minutes     { background: #d1e7dd; color: #0f5132; }
.status.draft       { background: #fff3cd; color: #664d03; }
.status.distributed { background: #e8daef; color: #6c3483; }
.status.agenda      { background: #d5f5e3; color: #1e8449; }

/* ── Actions ── */

.sr-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
}
.sr-expand {
    cursor: pointer;
    font-size: 9px;
    color: #adb5bd;
    padding: 3px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
    background: #fff;
    white-space: nowrap;
    font-weight: 500;
}
.sr-expand:hover {
    color: #495057;
    border-color: #adb5bd;
    background: #f3f4f6;
}

.btn.sm {
    padding: 3px 8px;
    font-size: 10px;
}
.btn.outline {
    border: 1px solid #2563eb;
    color: #2563eb;
    background: #fff;
}
.btn.outline:hover {
    background: #eff6ff;
}

/* ── History rows ── */

.l1-history {
    display: none;
}
.l1-history.visible {
    display: table-row-group;
}
.l1-history-row {
    background: #fafbfc;
    cursor: pointer;
}
.l1-history-row td {
    padding: 6px 12px;
    font-size: 11px;
    color: #6c757d;
    border-bottom: 1px solid #f0f0f0;
}
.l1-history-row:hover td {
    background: #f0f0f0;
}
.hr-num {
    font-weight: 600;
    color: #6c757d;
}
.hr-indent {
    padding-left: 30px !important;
}

/* ── Level 2 — Two-Row Compact Header ── */

.mtg-l2-row1 {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mtg-l2-back {
    cursor: pointer;
    color: #6c757d;
    font-size: 16px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
}
.mtg-l2-back:hover {
    color: #2563eb;
    background: #eff6ff;
}

.mtg-l2-row2 {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 4px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
    font-size: 11px;
}

/* Ensure dropdown sits above the toolbar */
.mtg-l2-row1 .mtg-selector-wrap {
    z-index: 300;
}
.mtg-l2-row1 .mtg-dropdown {
    z-index: 300;
}

/* ── Bottom bar (Level 1) ── */

.l1-bottom-bar {
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #6c757d;
    flex-shrink: 0;
}
.l1-bottom-bar .n {
    font-weight: 700;
    color: #212529;
}
.l1-bottom-bar .spacer {
    flex: 1;
}
