/* ========================================
   Analytics - Quoting Snapshot
   ======================================== */

/* ========================================
   Filter Bar
   ======================================== */
.snapshot-filter-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.snapshot-filter-dropdowns {
    display: flex;
    gap: 16px;
    flex: 1;
}

.filter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
    user-select: none;
    padding-bottom: 7px;
}

.filter-checkbox input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #059669;
    cursor: pointer;
}

/* ========================================
   Multi-Select Dropdowns
   ======================================== */
.multi-select {
    position: relative;
}

.multi-select-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease;
    min-height: 34px;
}

.multi-select-display:hover {
    border-color: #cbd5e1;
}

.multi-select.open .multi-select-display {
    border-color: #059669;
}

.multi-select-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-select-text.ms-default {
    color: #64748b;
}

.multi-select-chevron {
    color: #94a3b8;
    font-size: 10px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.multi-select.open .multi-select-chevron {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow: hidden;
}

.multi-select-actions {
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.multi-select-action {
    border: none;
    background: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.1s ease;
}

.multi-select-action:hover {
    background: #ecfdf5;
}

.multi-select-options {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #0f172a;
    transition: background 0.1s ease;
    user-select: none;
}

.multi-select-option:hover {
    background: #f8fafc;
}

.multi-select-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #059669;
    cursor: pointer;
    flex-shrink: 0;
}

.multi-select-option label {
    flex: 1;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   Snapshot Card & Table
   ======================================== */
.snapshot-card {
    background: #ffffff;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

.snapshot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

/* ========================================
   Header - Top Group Row
   ======================================== */
.snapshot-header-groups th {
    padding: 14px 12px 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
    border-bottom: none;
}

.snapshot-header-groups .snapshot-entity-col {
    text-align: left;
}

.snapshot-group.quoted-ytd {
    color: #2563eb;
    background: #eff6ff;
}

.snapshot-group.won-ytd {
    color: #059669;
    background: #ecfdf5;
}

/* Week Pager */
.snapshot-week-pager {
    background: #f8fafc;
    padding: 10px 12px 6px !important;
}

.week-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.week-pager-btn {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
}

.week-pager-btn:hover {
    border-color: #059669;
    color: #059669;
    background: #ecfdf5;
}

.week-pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.week-pager-btn:disabled:hover {
    border-color: #e2e8f0;
    color: #475569;
    background: #ffffff;
}

.week-pager-label {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    min-width: 120px;
    text-align: center;
}

/* ========================================
   Header - Sub Group Row
   ======================================== */
.snapshot-header-sub-groups th {
    padding: 4px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
    border-bottom: none;
}

.snapshot-sub-group.pending {
    color: #f59e0b;
    background: #fffbeb;
}

.snapshot-sub-group.quoted {
    color: #2563eb;
    background: #eff6ff;
}

.snapshot-sub-group.won {
    color: #059669;
    background: #ecfdf5;
}

.snapshot-sub-group.lost {
    color: #dc2626;
    background: #fef2f2;
}

/* ========================================
   Header - Labels Row
   ======================================== */
.snapshot-header-labels th {
    padding: 4px 12px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

/* ========================================
   Column Sizing
   ======================================== */
.snapshot-entity-col {
    width: 22%;
    text-align: left;
    padding-left: 20px !important;
}

.snapshot-count {
    width: 4%;
    text-align: center;
}

.snapshot-dollar {
    width: 9%;
    text-align: right;
    padding-right: 14px !important;
}

/* ========================================
   Body Rows
   ======================================== */
.snapshot-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s ease;
}

.snapshot-table tbody tr:hover {
    background: #f8fafc;
}

.snapshot-table tbody td {
    padding: 10px 12px;
}

.snapshot-table tbody td.snapshot-entity-col {
    font-weight: 600;
    color: #0f172a;
}

.snapshot-table tbody td.snapshot-count {
    text-align: center;
    color: #475569;
}

.snapshot-table tbody td.snapshot-dollar {
    text-align: right;
    font-weight: 600;
    color: #0f172a;
}

/* Row depth indentation */
.snapshot-row[data-depth="0"] td.snapshot-entity-col { padding-left: 20px !important; }
.snapshot-row[data-depth="1"] td.snapshot-entity-col { padding-left: 44px !important; }
.snapshot-row[data-depth="2"] td.snapshot-entity-col { padding-left: 68px !important; }
.snapshot-row[data-depth="3"] td.snapshot-entity-col { padding-left: 92px !important; }
.snapshot-row[data-depth="4"] td.snapshot-entity-col { padding-left: 116px !important; }

/* Row depth styling */
.snapshot-row[data-depth="0"] td.snapshot-entity-col {
    font-size: 14px;
    font-weight: 700;
}

.snapshot-row[data-depth="1"] td.snapshot-entity-col {
    font-size: 13px;
    font-weight: 600;
}

.snapshot-row[data-depth="2"] td.snapshot-entity-col,
.snapshot-row[data-depth="3"] td.snapshot-entity-col,
.snapshot-row[data-depth="4"] td.snapshot-entity-col {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

/* ========================================
   Expand/Collapse Toggle
   ======================================== */
.snapshot-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 10px;
    transition: transform 0.15s ease, color 0.15s ease;
    vertical-align: middle;
}

.snapshot-toggle:hover {
    color: #059669;
}

.snapshot-toggle.expanded {
    transform: rotate(90deg);
}

.snapshot-toggle.empty {
    visibility: hidden;
}

.snapshot-entity-icon {
    color: #64748b;
    font-size: 12px;
    margin-right: 6px;
    vertical-align: middle;
}

.snapshot-entity-badge {
    font-size: 10px;
    font-weight: 500;
    color: #94a3b8;
    margin-left: 8px;
    vertical-align: middle;
}

/* Child rows hidden by default */
.snapshot-row.child-hidden {
    display: none;
}

/* ========================================
   Footer Totals
   ======================================== */
.snapshot-totals th {
    padding: 14px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    border-top: 2px solid #e2e8f0;
    background: #f8fafc;
}

.snapshot-totals th.snapshot-count {
    text-align: center;
}

.snapshot-totals th.snapshot-dollar {
    text-align: right;
}

/* ========================================
   Zero Value Muting
   ======================================== */
.snapshot-zero {
    color: #cbd5e1 !important;
    font-weight: 400 !important;
}
