/* Header and Navigation Layout Styles */

/* Compact Audit Manager Bar */
.audit-manager-bar {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 1rem;
    padding: 12px 1rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 1.35rem;
}

/* Summary Stats */
.summary-stats {
    display: flex;
    gap: 1.5rem;
    padding-right: 1.5rem;
    border-right: 1px solid #e2e8f0;
}

.stat-item {
    text-align: center;
    min-width: 60px;
}

.stat-number {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
    color: #334155;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Main Controls */
.main-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-right: 1.5rem;
    border-right: 1px solid #e2e8f0;
}

.control-item {
    display: flex;
    align-items: center;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    padding: 0 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}

.filter-group.search-group {
    min-width: 200px;
}

.date-range-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Top Bar Checkbox Wrapper */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 36px;
}

/* Status Indicators */
.status-indicators {
    display: flex;
    gap: 1.5rem;
    padding: 0 1.5rem;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Module 2 overdue page: keep status + actions aligned to the far right */
.overdue-header-bar .status-indicators {
    margin-left: auto;
}

/* App Title */
.app-title {
    font-weight: 400;
    color: #333;
    font-size: 1.1rem;
    white-space: nowrap;
}

.title-highlight {
    color: #1976d2;
    font-weight: 600;
}

/* Header Logo styling to match text dimensions */
.app-logo-header {
    max-height: 28px;
    max-width: 156px;
    height: 28px;
    width: auto;
    display: block;
    object-fit: contain;
    vertical-align: middle;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Control Elements */
.control-select,
.control-input {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: white;
    min-width: 180px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.control-select:focus,
.control-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.control-input::placeholder {
    color: #9ca3af;
}

/* Filter Labels and Inputs */
.filter-label {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    margin-bottom: 2px;
}

.filter-input,
.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: white;
    height: 36px;
    box-sizing: border-box;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.filter-input::placeholder {
    color: #9ca3af;
}

.date-input {
    width: 130px;
}

.date-separator {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    padding: 0 0.25rem;
}

.search-input {
    width: 100%;
}

/* Top Bar Checkbox Styles */
.checkbox-custom-topbar {
    width: 16px;
    height: 16px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.2s ease;
}

.checkbox-custom-topbar:checked {
    background: #1976d2;
    border-color: #1976d2;
}

.checkbox-custom-topbar:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.checkbox-custom-topbar:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.checkbox-label-text {
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

/* Status Indicators */
.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.indicator-dot.perfect {
    background: #10b981;
}

.indicator-dot.issues {
    background: #ef4444;
}

.indicator-dot.missing-quickbooks {
    background: #ef4444;
}

.indicator-dot.quantity-mismatch {
    background: #f59e0b;
}

.indicator-dot.extra-quickbooks {
    background: #a855f7;
}

.indicator-label {
    font-size: 0.9rem;
    color: #64748b;
    white-space: nowrap;
}

.indicator-label span {
    font-weight: 600;
    color: #374151;
}

/* Status Toggles in Header */
.status-toggle-header {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.status-toggle-header:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

/* Inactive state colors */
.status-toggle-header[data-status="perfect-match"]:not(.active) {
    background: white;
    border-color: #d1d5db;
    color: #6b7280;
}

.status-toggle-header[data-status="missing-quickbooks"]:not(.active) {
    background: white;
    border-color: #d1d5db;
    color: #6b7280;
}

.status-toggle-header[data-status="quantity-mismatch"]:not(.active) {
    background: white;
    border-color: #d1d5db;
    color: #6b7280;
}

.status-toggle-header[data-status="extra-quickbooks"]:not(.active) {
    background: white;
    border-color: #d1d5db;
    color: #6b7280;
}

/* Button icons */
.status-toggle-header::before {
    content: '';
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.status-toggle-header[data-status="perfect-match"]::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: normal;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: currentColor;
    color: white;
    line-height: 1;
    text-align: center;
}

.status-toggle-header[data-status="missing-quickbooks"]::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: normal;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: currentColor;
    color: white;
    line-height: 1;
    text-align: center;
}

.status-toggle-header[data-status="quantity-mismatch"]::before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: normal;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: currentColor;
    color: white;
    line-height: 1;
    text-align: center;
}

.status-toggle-header[data-status="extra-quickbooks"]::before {
    content: '+';
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: normal;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: currentColor;
    color: white;
    line-height: 1;
    text-align: center;
    position: relative;
    top: -1px;
}

/* Active state colors */
.status-toggle-header.active[data-status="perfect-match"] {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #059669;
}

.status-toggle-header.active[data-status="missing-quickbooks"] {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #dc2626;
}

.status-toggle-header.active[data-status="quantity-mismatch"] {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #d97706;
}

.status-toggle-header.active[data-status="extra-quickbooks"] {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #7c3aed;
}

/* Active state icon colors */
.status-toggle-header.active[data-status="perfect-match"]::before {
    background: #059669;
}

.status-toggle-header.active[data-status="missing-quickbooks"]::before {
    background: #dc2626;
}

.status-toggle-header.active[data-status="quantity-mismatch"]::before {
    background: #d97706;
}

.status-toggle-header.active[data-status="extra-quickbooks"]::before {
    background: #7c3aed;
}

/* Disabled button styles */
.status-toggle-header.disabled {
    background: white !important;
    border-color: #d1d5db !important;
    color: #6b7280 !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.status-toggle-header.disabled::before {
    background: #6b7280 !important;
}

.status-toggle-header.disabled:hover {
    background: white !important;
    border-color: #d1d5db !important;
    color: #6b7280 !important;
}

/* Responsive Header Adjustments */
@media (max-width: 1200px) {
    .summary-stats {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 0.75rem;
        width: 100%;
        justify-content: center;
    }

    .status-indicators {
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding-top: 0.75rem;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .audit-manager-bar {
        margin: 0.5rem;
        padding: 0.75rem;
    }

    .summary-stats {
        justify-content: center;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 0.75rem;
    }

    .control-select,
    .control-input {
        min-width: auto;
        width: 100%;
    }

    .status-indicators {
        justify-content: center;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding-top: 0.75rem;
    }
}