/* General Page Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

header {
    background-color: #f4f4f4;
    padding: 10px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.brand-logo {
    max-height: 60px;
    height: 60px;
    width: auto;
    margin: 10px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    text-align: center;
}

footer {
    background-color: #d4eff9;
    color: #813d9e;
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    max-height: 70px;
    height: 70px;
    width: auto;
    margin-top: 10px;
    display: block;
}

/* Search Form Styling */
form {
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.search-help {
    margin: 0 0 14px;
    color: #555;
}

.search-status {
    min-height: 1.5em;
    margin-top: 10px;
    color: #555;
    font-size: 0.95rem;
}

input[type="text"] {
    width: 300px;
    padding: 10px;
    margin-right: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    position: relative;
}

button {
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

button:hover {
    background: #0056b3;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.results-summary {
    margin: 18px 0 10px;
    text-align: left;
    color: #333;
}

.results-table-wrap {
    width: 100%;
    overflow-x: auto;
}

th,
td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #007bff;
    color: white;
}

tr:nth-child(even) {
    background: #f9f9f9;
}

.results-note {
    margin-top: 12px;
    color: #555;
    font-size: 0.95rem;
}

/* Fixed widths for Name and Code columns */
th:nth-child(2),
td:nth-child(2) {
    width: 150px;
}

th:nth-child(3),
td:nth-child(3) {
    width: 250px;
}

/* Responsive Styling */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    input[type="text"] {
        width: min(80vw, 320px);
        margin-right: 0;
        margin-bottom: 10px;
    }

    form {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    button {
        width: min(80vw, 320px);
    }

    table {
        min-width: 720px;
    }

    th,
    td {
        font-size: 0.95rem;
    }

    th:nth-child(3),
    td:nth-child(3),
    th:nth-child(6),
    td:nth-child(6) {
        white-space: normal;
    }
}

/* Autocomplete Styles */
#suggestions {
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
}

#suggestions li {
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

#suggestions li:hover,
#suggestions li.active {
    background-color: #e6f0ff;
}

/* Pagination Styles */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    padding: 10px 15px;
    margin: 0 5px;
    text-decoration: none;
    color: #007bff;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: background 0.3s;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    pointer-events: none;
    border-color: #007bff;
}

/* Log Viewer */
.logs-container {
    margin-top: 24px;
    margin-bottom: 24px;
    text-align: left;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.logs-title {
    margin: 0;
    font-size: 2rem;
}

.logs-subtitle {
    margin: 6px 0 0;
    color: #666;
}

.logs-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.secondary-link {
    display: inline-block;
    padding: 10px 14px;
    text-decoration: none;
    color: #1f4d8f;
    border: 1px solid #c9d4e5;
    border-radius: 8px;
    background: #f7faff;
}

.secondary-link:hover {
    background: #edf4ff;
}

.logs-filter-form {
    display: block;
    background: #f9fbfd;
    border: 1px solid #dde7f3;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.95rem;
    color: #444;
}

.filter-field input,
.filter-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #c8d2de;
    border-radius: 8px;
    font: inherit;
    background: white;
}

.filter-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.filter-chip {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef5ff;
    color: #285ea8;
    font-size: 0.92rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    border: 1px solid #dfe8f3;
    box-shadow: 0 4px 16px rgba(29, 58, 99, 0.06);
}

.stat-label {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.stat-value {
    display: block;
    color: #123d73;
    font-size: 1.6rem;
    line-height: 1.2;
}

.stat-value-small {
    font-size: 1rem;
}

.logs-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(260px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.logs-main,
.logs-sidebar {
    min-width: 0;
}

.logs-table th,
.logs-table td {
    vertical-align: top;
}

.logs-query-cell {
    min-width: 220px;
    white-space: normal;
}

.table-link {
    color: #1d5fbf;
    text-decoration: none;
}

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

.panel-card {
    background: #fff;
    border: 1px solid #dde7f3;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(29, 58, 99, 0.05);
}

.panel-card + .panel-card {
    margin-top: 16px;
}

.panel-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.mini-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mini-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #edf2f7;
}

.mini-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.mini-list li:last-child {
    padding-bottom: 0;
}

.mini-list span {
    color: #475569;
    white-space: nowrap;
}

.mini-list-stack small {
    display: block;
    color: #64748b;
    margin-top: 4px;
}

.pagination-slim {
    text-align: left;
}

.trend-card {
    margin-bottom: 20px;
}

.trend-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.trend-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 0.92rem;
}

.trend-chart-wrap {
    width: 100%;
    overflow-x: auto;
}

.trend-chart-svg {
    width: 100%;
    min-width: 720px;
    height: auto;
    display: block;
}

.chart-grid-line {
    stroke: #dbe7f3;
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke: #1d5fbf;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-point {
    fill: #1d5fbf;
}

.chart-axis-label {
    fill: #64748b;
    font-size: 12px;
    font-family: Arial, sans-serif;
}

.chart-axis-label-left {
    text-anchor: end;
}

.chart-axis-label-bottom {
    text-anchor: middle;
}

.empty-chart-state {
    margin: 0;
    color: #64748b;
}
