body {
    font-family: Arial, sans-serif;
}

/* Dark mode variables and styles */
body.dark-mode {
    background-color: #181a1b !important;
    color: #f1f1f1 !important;
}
body.dark-mode .bg-light {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
}
body.dark-mode .form-control {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
    border-color: #444 !important;
}
body.dark-mode .btn {
    background-color: #343a40;
    color: #f1f1f1;
    border-color: #444;
}
body.dark-mode .btn-success,
body.dark-mode .btn-primary {
    background-color: #198754;
    color: #fff;
    border-color: #198754;
}
body.dark-mode .sidebar {
    background-color: #23272b !important;
}

/* Tables */
body.dark-mode table,
body.dark-mode .table {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
}
body.dark-mode .table th,
body.dark-mode .table td {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
    border-color: #444 !important;
}
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #202225 !important;
}
body.dark-mode .table-hover tbody tr:hover {
    background-color: #343a40 !important;
    color: #fff !important;
}

/* Navs and Tabs */
body.dark-mode .nav,
body.dark-mode .nav-tabs,
body.dark-mode .tab-content {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
    border-color: #444 !important;
}
body.dark-mode .nav-tabs .nav-link {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
    border: 1px solid #444 !important;
}
body.dark-mode .nav-tabs .nav-link.active {
    background-color: #181a1b !important;
    color: #fff !important;
    border-bottom: 2px solid #198754 !important;
}
body.dark-mode .nav-link {
    color: #f1f1f1 !important;
}
body.dark-mode .nav-link:hover {
    background-color: #343a40 !important;
    color: #fff !important;
}

/* Sidebar nav links */
body.dark-mode #sidebarMenu,
body.dark-mode .sidebar,
body.dark-mode .sidebar .nav-link {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
}
body.dark-mode .sidebar .nav-link.active {
    background-color: #1564d6 !important;
    color: #fff !important;
    border-color: #1564d6 !important;
}
body.dark-mode .sidebar .nav-link:hover {
    background-color: #343a40 !important;
    color: #fff !important;
}

/* Sidebar nav-pills and list-group for dark mode */
body.dark-mode .sidebar .nav,
body.dark-mode .sidebar .nav-pills,
body.dark-mode .sidebar .list-group {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
    border-color: #444 !important;
}
body.dark-mode .sidebar .nav-link,
body.dark-mode .sidebar .list-group-item {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
    border: 1px solid #444 !important;
}
body.dark-mode .sidebar .list-group-item.active,
body.dark-mode .sidebar .nav-pills .nav-link.active {
    background-color: #1564d6 !important;
    color: #fff !important;
    border-color: #1564d6 !important;
}
body.dark-mode .sidebar .list-group-item:hover,
body.dark-mode .sidebar .nav-link:hover {
    background-color: #343a40 !important;
    color: #fff !important;
    border-color: #343a40 !important;
}
body.dark-mode .sidebar .list-group-item {
    border-radius: 0 !important;
}


body.dark-mode .modal-content {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
}

/* Cards */
body.dark-mode .card {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
    border-color: #444 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
body.dark-mode .card-header {
    background-color: #181a1b !important;
    color: #f1f1f1 !important;
    border-bottom: 1px solid #444 !important;
}
body.dark-mode .card-body {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
}
body.dark-mode .card-title {
    color: #f1f1f1 !important;
}

body.dark-mode .form-group,
body.dark-mode .card .form-group {
    background-color: transparent !important;
    color: #f1f1f1 !important;
}
body.dark-mode .card .form-control {
    background-color: #181a1b !important;
    color: #f1f1f1 !important;
    border-color: #444 !important;
}

/* Buttons */
body.dark-mode .btn-warning {
    background-color: #b8860b !important;
    color: #fff !important;
    border-color: #b8860b !important;
}

body.dark-mode .nav-link.active {
    background-color: #222 !important;
    color: #fff !important;
}
body.dark-mode .form-label {
    color: #f1f1f1 !important;
}
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background-color: #23272b !important;
    color: #f1f1f1 !important;
    border-color: #444 !important;
}

.nav-pills .nav-link.active {
    background-color: #007bff;
}

/* Chat styles for neo4j dashboard */
.chat-message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 5px;
}

.user-message {
    background-color: #f1f0f0;
    margin-right: 20%;
}

.assistant-message {
    background-color: #dcf8c6;
    margin-left: 20%;
}

.thinking-indicator {
    opacity: 0.8;
    font-style: italic;
}

body.dark-mode .user-message {
    background-color: #2c2c2c;
}

body.dark-mode .assistant-message {
    background-color: #1e4d2b;
}

/* Stabilize chart sizing in chats */
.chat-chart-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 400px;
    max-height: 400px;
    margin: 0 auto 8px auto;
    overflow: hidden; /* prevent overflow-induced growth */
}

.chat-chart-canvas {
    display: block; /* remove inline baseline gap */
    width: 100% !important;
    height: 100% !important;
}

/* Ensure flex child can shrink within modal layout */
#analyticsChatModal #chatMessages {
    min-height: 0; /* allow flexbox to constrain height */
}
