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

:root {
    --primary: #0066CC;
    --success: #00AA00;
    --warning: #FF9900;
    --danger: #DD0000;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #333;
    --sidebar-bg: #f8f9fa;
    --sidebar-active: #e3f2fd;
    --fresh-bg: rgba(0, 170, 0, 0.1);
    --aging-bg: rgba(255, 153, 0, 0.1);
    --stale-bg: rgba(221, 0, 0, 0.1);
    --inflated-color: #dc3545;
    --deflated-color: #0066CC;
    --stale-color: #ff8c00;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f7f8fc;
    color: var(--dark-gray);
    overflow: hidden;
    margin: 0;
    padding: 0;
    height: 100vh;
}

/* Top Navigation Bar */
.top-nav {
    background-color: white;
    border-bottom: 1px solid #e1e8ed;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 30px;
}

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

.logo-image {
    height: 40px;
    width: auto;
    margin-left: 17px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-weight: 500;
}

/* App Container */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 65px);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: white;
    border-right: 1px solid #e1e8ed;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-items {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}

.nav-item:hover {
    background-color: #f0f4f8;
    color: #4a90e2;
}

.nav-item.active {
    background-color: #e8f2ff;
    color: #4a90e2;
    border-right: 3px solid #4a90e2;
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-text {
    font-size: 0.85rem;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: #f7f8fc;
    position: relative;
}

/* Dashboard Stats */
.dashboard-stats {
    background: linear-gradient(to bottom, #ffffff, #fafbfc);
    padding: 2rem 2rem;
    border-bottom: 1px solid #e8eaed;
}

.stats-row {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    gap: 1.5rem;
}

.stat-card {
    text-align: center;
    flex: 1;
    padding: 1.25rem 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

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

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.inflated-count {
    color: var(--inflated-color);
}

.deflated-count {
    color: var(--deflated-color);
}

.stale-count {
    color: var(--stale-color);
}

.audit-id {
    color: var(--primary);
    font-size: 2.25rem;
}

.audit-info {
    text-align: center;
}

/* Tabs */
.tabs {
    background: #f5f5f5;
    padding: 0 2rem;
    padding-top: 0.5rem;
    border-bottom: 2px solid var(--medium-gray);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.tab-list {
    display: flex;
    gap: 0.25rem;
}

.tab-actions {
    display: flex;
    align-items: center;
    padding-bottom: 0.5rem;
}

.location-selector {
    padding: 0.5rem 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.location-selector:hover {
    border-color: var(--primary);
}

.location-selector:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.tab-button {
    padding: 0.75rem 1.25rem;
    background: #e8e8e8;
    border: 1px solid #d0d0d0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: -2px;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-width: fit-content;
}

.tab-button:hover {
    color: var(--primary);
    background: #f0f0f0;
}

.tab-button.active {
    color: var(--primary);
    background: white;
    border-color: var(--medium-gray);
    border-bottom: none;
    padding-bottom: calc(0.75rem + 2px);
    z-index: 1;
    text-shadow: 0 0 0.5px currentColor, 0 0 0.5px currentColor;
}

.tab-badge {
    background: var(--danger);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-badge-red {
    background: var(--inflated-color);
}

.tab-badge-green {
    background: var(--success);
}

.tab-badge-yellow {
    background: var(--warning);
}

/* Sub-tabs */
.sub-tabs {
    background: white;
    padding: 1rem 2rem;
   
    display: flex;
    gap: 0.75rem;
    align-items: center;
    border-bottom: 1px solid var(--medium-gray);
    position: relative;
}

.sub-tab-button {
    padding: 0.65rem 1.25rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.sub-tab-button .icon {
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f0f0f0;
}

.sub-tab-button[data-subtab="action-required"] .icon {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.15);
}

.sub-tab-button[data-subtab="ready-to-sync"] .icon {
    color: var(--success);
    background: rgba(34, 197, 94, 0.15);
}

.sub-tab-button:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sub-tab-button.active {
    color: var(--primary);
    border-color: var(--primary);
    background: #f0f4ff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    text-shadow: 0 0 0.5px currentColor, 0 0 0.5px currentColor;
}

.sub-tab-button.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary) 0%, #60a5fa 100%);
    z-index: -1;
    opacity: 0.1;
}

/* Toolbar */
.toolbar {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--medium-gray);
}

.toolbar-left {
    display: flex;
    gap: 1rem;
}

.toolbar-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 3px;
}

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #0066CC 0%, #0052a3 100%);
    color: white;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0052a3 0%, #004080 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.25);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    border: 1px solid #d1d5db;
    color: var(--dark-gray);
}

.btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.filter-search {
    padding: 0.5rem 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    min-width: 250px;
    transition: border-color 0.2s ease;
}

.filter-search:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-search::placeholder {
    color: #999;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-date {
    padding: 0.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 0.9rem;
    width: 140px;
}

/* Table */
.table-container {
    background: white;
    flex: 1;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead {
    background: var(--light-gray);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid var(--medium-gray);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    font-size: 0.8rem;
}

th:hover {
    background: #e8e8e8;
}

th.sortable::after {
    content: ' ↕';
    opacity: 0.3;
}

th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
}

th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
}

td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: rgba(0, 102, 204, 0.03);
}

/* Row highlighting based on freshness */
tr.fresh-row {
    border-left: 3px solid var(--success);
}

tr.aging-row {
    border-left: 3px solid var(--warning);
}

tr.stale-row {
    border-left: 3px solid var(--danger);
}

.checkbox-cell {
    width: 30px;
    text-align: center;
}

.sku-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

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

.discrepancy-type {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-inflated {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.type-deflated {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.type-increase {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.type-decrease {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.variance-amount {
    font-weight: bold;
    font-size: 0.9rem;
}

.variance-amount.positive {
    color: #16a34a;
}

.variance-amount.negative {
    color: #dc3545;
}

.count-comparison {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.count-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.count-label {
    color: #666;
    min-width: 45px;
}

.count-value {
    font-weight: bold;
    color: var(--dark-gray);
}

.freshness-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.freshness-fresh {
    background: var(--fresh-bg);
    color: var(--success);
}

.freshness-aging {
    background: var(--aging-bg);
    color: var(--warning);
}

.freshness-stale {
    background: var(--stale-bg);
    color: var(--danger);
}

/* Modal */
.modal-overlay {
    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-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--medium-gray);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--medium-gray);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input:read-only {
    background: #f5f5f5;
    color: #666;
}

/* Action Cell */
.action-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pending-action {
    color: var(--warning);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Action Badges */
.action-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.action-synced {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.action-cleared {
    background: rgba(128, 128, 128, 0.15);
    color: #6b7280;
}

/* Resolution Form */
.resolution-step {
    display: none;
}

.resolution-step.active {
    display: block;
}

.reason-list {
    list-style: none;
}

.reason-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reason-item:hover {
    background: var(--light-gray);
    border-color: var(--primary);
}

.reason-item.selected {
    background: rgba(0, 102, 204, 0.1);
    border-color: var(--primary);
}

.reason-item input[type="radio"] {
    margin-right: 0.5rem;
}

.custom-reason-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    margin-top: 0.5rem;
}

.adjustment-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.adjustment-input {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    text-align: center;
    font-size: 1.2rem;
}

.adjustment-buttons {
    display: flex;
    gap: 0.25rem;
}

.adjustment-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--medium-gray);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
}

.adjustment-btn:hover {
    background: var(--light-gray);
}

.preview-box {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.notes-field {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    min-height: 80px;
    resize: vertical;
}

.warning-box {
    background: var(--stale-bg);
    color: var(--danger);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* SKU History Modal */
.history-timeline {
    padding: 1rem 0;
}

.timeline-item {
    position: relative;
    padding: 1rem 1rem 1rem 3rem;
    border-left: 2px solid var(--medium-gray);
    margin-left: 1rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary);
}

.timeline-item.discovery::before {
    border-color: var(--warning);
}

.timeline-item.resolution::before {
    border-color: var(--success);
}

.timeline-item.sync::before {
    border-color: var(--primary);
}

.timeline-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.timeline-content {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.badge-discovery {
    background: rgba(255, 153, 0, 0.2);
    color: var(--warning);
}

.badge-resolution {
    background: rgba(0, 170, 0, 0.2);
    color: var(--success);
}

.badge-sync {
    background: rgba(0, 102, 204, 0.2);
    color: var(--primary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 1rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

/* Analytics */
.analytics-container {
    background: white;
    padding: 2rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.chart-placeholder {
    height: 200px;
    background: var(--light-gray);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* Chart Styles */
.bar-chart {
    display: flex;
    align-items: flex-end;
    height: 200px;
    gap: 10px;
    padding: 10px;
}

.bar {
    flex: 1;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    min-height: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.bar:hover {
    opacity: 0.8;
}

.bar-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    white-space: nowrap;
}

.bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: bold;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.spinner {
    border: 3px solid var(--light-gray);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        order: 2;
    }

    .main-content {
        order: 1;
    }

    .stats-row {
        flex-wrap: wrap;
        gap: 2rem;
        justify-content: center;
    }

    .stat-card {
        min-width: 120px;
    }

    .audit-info {
        margin-left: 0;
        text-align: center;
    }

    .toolbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: center;
    }

    .modal {
        width: 95%;
    }

    .table-container {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.4rem;
    }

    .count-comparison {
        font-size: 0.75rem;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* Fullscreen modal styles */
.modal-overlay.fullscreen {
    background: rgba(0, 0, 0, 0.95);
}

.modal.fullscreen-modal {
    width: 95vw;
    height: 95vh;
    max-width: none;
    max-height: none;
    margin: 2.5vh auto;
    display: flex;
    flex-direction: column;
}

.fullscreen-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ledger-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ledger-summary {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-weight: 600;
    color: var(--dark-gray);
}

.stat-value {
    font-weight: bold;
    color: var(--primary);
}

.ledger-table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ledger-table th,
.ledger-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
    white-space: nowrap;
}

.ledger-table th {
    background: var(--light-gray);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ledger-table tbody tr:hover {
    background: rgba(0, 102, 204, 0.05);
}

.event-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.event-discovery { background: rgba(255, 153, 0, 0.2); color: var(--warning); }
.event-resolution { background: rgba(0, 170, 0, 0.2); color: var(--success); }
.event-sync { background: rgba(0, 102, 204, 0.2); color: var(--primary); }
.event-audit { background: rgba(128, 0, 128, 0.2); color: purple; }
.event-adjustment { background: rgba(255, 0, 0, 0.2); color: var(--danger); }
.event-review { background: rgba(255, 165, 0, 0.2); color: orange; }
.event-system { background: rgba(128, 128, 128, 0.2); color: gray; }

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-completed { background: rgba(0, 170, 0, 0.2); color: var(--success); }
.status-pending { background: rgba(255, 153, 0, 0.2); color: var(--warning); }
.status-failed { background: rgba(221, 0, 0, 0.2); color: var(--danger); }
.status-in-progress { background: rgba(0, 102, 204, 0.2); color: var(--primary); }

/* Freshness Settings */
.freshness-settings-icon {
    margin-left: 6px;
    font-size: 0.85em;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.freshness-settings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.freshness-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.freshness-label {
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 120px;
}

.freshness-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.freshness-number-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

.freshness-number-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.freshness-unit-select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 100px;
}

.freshness-unit-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}
