body {
    padding-top: 50px;
    background-color: #f1f4f6;
}

.sub-header {
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.navbar-fixed-top {
    border: 0;
}

.sidebar {
    display: none;
}

@media (min-width: 768px) {
    .sidebar {
        position: fixed;
        top: 51px;
        bottom: 0;
        left: 0;
        z-index: 1000;
        display: block;
        padding: 20px;
        overflow-x: hidden;
        overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
        /*background-color: #f8f8f8;*/
        background-color: #fff;
        border-right: 1px solid #eee;
    }
}

@media screen and (max-width: 768px) {
    .row-offcanvas {
        position: relative;
        -webkit-transition: all 0.25s ease-out;
        -moz-transition: all 0.25s ease-out;
        transition: all 0.25s ease-out;
    }

    .row-offcanvas .sidebar {
        left: -33%;
    }

    .row-offcanvas.active {
        left: 33%;
    }

    .sidebar {
        position: absolute;
        display: block;
        top: 0;
        width: calc(33% - 16px);
    }
}

/* Sidebar navigation */
.nav-sidebar {
    margin-right: -21px; /* 20px padding + 1px border */
    margin-bottom: 20px;
    margin-left: -20px;
}

.nav-sidebar > li > a {
    padding-right: 20px;
    padding-left: 20px;
}

.nav-sidebar > .active > a,
.nav-sidebar > .active > a:hover,
.nav-sidebar > .active > a:focus {
    color: #fff;
    background-color: #428bca;
}


/*
 * Main content
 */

.main {
    padding: 20px;
}

@media (min-width: 768px) {
    .main {
        padding-right: 20px;
        padding-left: 20px;
    }
}

.main .page-header {
    margin-top: 0;
}


/*
 * Placeholder dashboard ideas
 */

.placeholders {
    margin-bottom: 30px;
    text-align: center;
}

.placeholders h4 {
    margin-bottom: 0;
}

.placeholder {
    margin-bottom: 20px;
}

.placeholder img {
    display: inline-block;
    border-radius: 50%;
}

.card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: .50rem;
    margin-bottom: 20px;
}

.card > .card-header {
    font-size: 110%;
    border-bottom: 1px solid #dee2e6;
    color: rgba(31, 10, 6, 0.6);
}

.card .card-content {
    padding: 8px 15px;
    overflow-x: auto;
}

.sub-title {
    color: rgba(31, 10, 6, 0.6);
}

.page-title {
    color: rgba(31, 10, 6, 0.6);
    margin-top: 5px;
}

.table > tbody > tr > th {
    color: rgba(31, 10, 6, 0.6);
}

.breadcrumb {
    padding-left: 0px;
    margin-bottom: 10px;
    max-width: 800px;
    background-color: #f1f4f6;
}

/* Event type summary strip */
.event-type-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 20px;
    padding: 10px 16px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
}

.summary-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(31, 10, 6, 0.4);
    letter-spacing: 0.2px;
}

.summary-value {
    font-size: 13px;
    color: #444;
}

.summary-toggle {
    cursor: pointer;
    margin-left: auto;
}

.summary-toggle:hover span {
    color: #428bca !important;
}

.badge-count {
    background-color: #6c9bd1;
    font-size: 12px;
    padding: 3px 8px;
    font-weight: 500;
}

/* Expandable source details panel */
.source-details-panel {
    border-top: 1px solid #eee;
    padding: 14px 16px;
    background: #fafbfc;
}

/* Source config details */
.source-config-table {
    margin-bottom: 0;
    max-width: 600px;
}

.source-config-table > tbody > tr > th {
    width: 160px;
    white-space: nowrap;
    font-weight: 600;
}

.join-definition {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.join-definition .table {
    margin-bottom: 0;
    max-width: 500px;
}

/* Data type badges — soft pill style */
.dtype-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

.dtype-string    { background: #e8f4fd; color: #1a6fa8; }
.dtype-long,
.dtype-double    { background: #eae4f6; color: #5b3e9e; }
.dtype-timestamp,
.dtype-date      { background: #fef3e0; color: #b37400; }
.dtype-entity    { background: #e6f5ec; color: #1a7a3a; }
.dtype-boolean   { background: #fce4ec; color: #b71c4a; }

/* Category badges — soft pill style */
.cat-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

.cat-business    { background: #e0ecf7; color: #2d5f8a; }
.cat-diagnostic  { background: #fef3e0; color: #8a6d2d; }

/* Query source type badges (reuse dtype-badge pill shape) */
.dtype-bigquery   { background: #e0ecf7; color: #2d5f8a; }
.dtype-snowflake  { background: #e8f4fd; color: #1a6fa8; }
.dtype-redshift   { background: #fce4ec; color: #b71c4a; }
.dtype-duckdb     { background: #fef3e0; color: #8a6d2d; }
.dtype-druid      { background: #e6f5ec; color: #1a7a3a; }
.dtype-janus_graph { background: #eae4f6; color: #5b3e9e; }

/* Column chooser — prevent card-header overflow from clipping the dropdown */
.card > .card-header > .card-content {
    overflow: visible;
}

.column-chooser-wrapper {
    display: inline-block;
}

.column-chooser-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1050;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px 14px;
    min-width: 200px;
    margin-top: 4px;
}

.column-chooser-item {
    padding: 3px 0;
}

.column-chooser-item label {
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.column-chooser-item input[type="checkbox"] {
    margin: 0;
}

/* Event fields table */
.event-fields-table th {
    border-bottom: 2px solid #ddd;
}

.event-fields-table th:hover {
    background-color: #f5f5f5;
}

.event-fields-table td {
    vertical-align: middle;
}

.event-fields-pagination {
    padding: 12px 0 4px;
    border-top: 1px solid #eee;
}

.event-fields-pagination .pagination > li > a {
    cursor: pointer;
}

/* Sortable table headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-header:hover {
    background-color: #f5f5f5;
}

/* Field detail modal */
.field-detail-modal .modal-header {
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 20px;
}

.field-detail-modal .modal-title code {
    font-size: 16px;
}

.field-detail-modal .modal-body {
    padding: 20px;
}

.field-detail-table th {
    width: 180px;
    color: #888;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
    border-top: none;
    padding: 10px 12px;
}

.field-detail-table td {
    vertical-align: middle;
    border-top: none;
    padding: 10px 12px;
    font-size: 14px;
}

.field-detail-table tr:first-child th,
.field-detail-table tr:first-child td {
    border-top: none;
}

.field-detail-table tr + tr th,
.field-detail-table tr + tr td {
    border-top: 1px solid #f0f0f0;
}

.event-fields-table tbody tr:hover {
    background-color: #f0f7ff;
}
