/* General Styles */
body {
    background-color: #008080;
    font-family: Arial, sans-serif;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    height: auto;;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
}

.container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.container-report {
    max-width: 90%;
    margin: 50px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

h1 {
    text-align: center;
}

* {
    box-sizing: border-box;
  }

html {
    overflow-y: scroll; /* always reserve space for vertical scrollbar */
  }

.chatBox > * {
    
    width: 100%;
    margin-top: 8px;
    max-width: 600px;
    border: 1px solid;
    height: 100px;
    padding: 8px;
    /*width: 100%; height: 100px; padding: 8px; border: 1px solid #ccc; background: #fff; overflow-y: auto; white-space: pre-wrap*/
}

.chat-btn {
    text-decoration: none;
}

#chatInput:empty::before {
    content: attr(data-placeholder);
    color: #aaa;
}   

input, button {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    width: auto;
    font-size: 16px;
    margin: 8px 0;
}
button {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 16px;
    border: none;
    background: #2980b9;
    color: white;
    cursor: pointer;
    transition: 0.3s;
    width: 100%; /* standard for uniform buttons */
    display: block;
}
.action-button {
    display: inline-flex; /* or inline-block */
    text-decoration: none;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    text-decoration: none;
    vertical-align: middle;
    /* remove width: 100% if it's there */
  }
.action-button.width-10 {
    width: 10%;
    min-width: 60px; /* optional: prevent too small on very narrow screens */
    max-width: 120px; /* optional: prevent too wide on large screens */
}
button:hover {
    background: #1c577d;
}
.width-100 {
    width: 100%;
}
.centered {
margin: 0 auto;
}


.button-group, .user-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;           /* tighter or looser spacing */
    margin-top: 1rem;
    width: 100%;
}

.button-group form {
  margin: 0;
  padding: 0;
}

.logout-button {
    background: #cc0000;
    
}

textarea {
    width: 100%;
    height: 100px;
    margin-top: 10px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 10px;
    resize: none;
}

.username-display {
    font-size: 14px;
    color: #666;
    text-align: left;
    margin-bottom: 20px;
}

.tab-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    transition: all 0.3s ease-in-out;
}

.active-tab {
    display: block;
}

.tab-links {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tab-link {
    padding: 8px 16px;
    background: #ddd;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 5px;
}

.tab-link.active {
    background: #2980b9;
    color: white;
}

.user-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.user-card {
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 15px;
    width: 300px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.user-card-header {
    font-size: 1.1em;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.user-email {
    color: #888;
    font-size: 0.9em;
}

.user-role {
    margin: 8px 0;
    font-weight: bold;
}

.user-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.delete-button {
    background: #ff4d4d;
    color: white;
}

.role-button {
    background: #2980b9;
    color: white;
}

.add-user-btn {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}
/*
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}
.modal-dialog {
    background: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 700px;
}
*/

body.modal-open {
    overflow: visible;
    padding-right: 0 !important;
}

/* Ensure modal appears above footer */
.modal {
    z-index: 1060;
}


.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.add-user-submit {
    background-color: #28a745;
    color: white;
    padding: 10px;
    margin-top: 10px;
    border: none;
    border-radius: 8px;
    width: 100%;
    font-size: 1em;
    cursor: pointer;
}
.control-panel {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Base button style */
.action-button {
    background-color: #2980b9;
    text-decoration: none;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.3s ease;
   
}

.action-button:hover {
    background-color: #0056b3;
}

/* Logout button style */
.logout-button {
    background-color: #dc3545;
    
}

.logout-button:hover {
    background-color: #b02a37;
}

/* Sort dropdown */
.sort-select {
    height: 40px;
    font-size: 1rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    flex-shrink: 0;
}


@media (max-width: 800px) { /*was 600px*/
    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }
}

.control-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.extra-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.action-button, .sort-select {
    display: inline-block;
}

.inline-form {
    display: inline-block;
    margin: 0;
}

.flash-messages {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers horizontally */
    gap: 10px; /* Spacing between multiple messages */
    margin: 20px 0; /* Adds vertical spacing */
    width: 100%;
}

.flash {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    width: 80%; /* Adjust width as needed (e.g., 50% for narrower) */
    max-width: 600px; /* Prevents overly wide messages */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in-out;
    margin: 10px 0;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    color: white;
}

/* Category-specific styles */
.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.flash.error {
    background-color: #e74c3c;
}

.flash.success {
    background-color: #2ecc71;
}

/* Fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

 

#chatAI, #actionLog {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#chatAI[style*="display: block"], 
#actionLog[style*="display: block"] {
    max-height: 500px; /* Adjust based on your content height */
    transition: max-height 0.5s ease-in;
}

#chatAI.active, #actionLog.active {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}
/* Loading animation styles */
.loading-dots {
    color: #666;
    font-size: 24px;
}
.loading-dots span {
    animation: blink 1.4s infinite both;
    opacity: 0;
}
.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes blink {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Header styles */
header {
    text-align: center; /* Center the title horizontally */
    margin-bottom: 20px; /* Add spacing below the header */
    padding: 10px; /* Add padding around the header */
    background-color: #008080; /* Match the page background color */
    color: white; /* Ensure the text is visible */
    font-size: 1.8rem; /* Adjust the font size for better visibility */
    font-weight: bold; /* Make the title bold */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Add a subtle shadow for separation */
}

/* Remove/override header styles that are no longer needed for admin.html */
header, .navbar {
    background: none !important;
    box-shadow: none !important;
    color: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: none !important; /* Hide any header/navbar if rendered */
}

/* Sticky Admin Navbar (like footer, always visible at top) */
.admin-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 101;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    color: #7f8c8d;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

/* Ensure page content is not hidden behind the sticky admin navbar and footer */
body, main, .container, .container-report {
    padding-top: 70px; /* adjust if navbar height changes */
    padding-bottom: 70px; /* adjust if footer height changes */
}

/* Admin Navbar Buttons (exactly match footer .action-button) */
.admin-navbar .action-button {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    background-color: #246998;
    color: #fff;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(22, 160, 133, 0.08);
}
.admin-navbar .action-button:hover {
    background-color: #1c577d;
}
.admin-navbar .action-button i[data-lucide] {
    font-size: 1.2em;
    vertical-align: middle;
    margin-right: 0.3em;
}

/* Footer */
.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    z-index: 100;
    background: #fff;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.05);
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #7f8c8d;
    border-top: 1px solid #e0e6ed;
}

/* Footer buttons in a row */
.footer-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

/* Buttons (footer and admin-navbar) */
.action-button {
    display: flex;
    text-decoration: none;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    background-color: #2674a8;
    color: #fff;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}
.action-button:hover {
    background-color: #1c577d;
}

.logout-button {
    background-color: #e74c3c;
}
.logout-button:hover {
    background-color: #c0392b;
}

.logout-form {
    margin: 0;
}

.footer-copy {
    margin: 0;
    font-size: 0.75rem;
    color: #95a5a6;
}

/* Button row */
.footer-actions {
    display: flex;
    justify-content: center;
    gap: 1rem; /* spacing between buttons */
    margin-bottom: 0.25rem;
}
.footer-actions a,
.footer-actions form {
    display: inline-block;
    margin: 0;
    padding: 20;
}
.action-button,
.logout-form .action-button {
     display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    background-color: #2980b9; /* teal */
    color: #fff;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.action-button:hover {
    background: #2980b9;
}

.logout-button {
    background: #e74c3c;
}

.logout-button:hover {
    background: #c0392b;
}



/* Icon styles */
.icon {
    font-size: 1.2em;
    vertical-align: middle;
}

/* Input fields */
input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}
input[type="text"].width-20 {
    width: 20%;
    min-width: 80px;
    max-width: 300px;
}
/* Submit button */
button.action-button {
    width: 100%;
    padding: 10px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

button.action-button:hover {
    background-color: #0056b3;
}
.logs-container {
    margin-top: 20px;
    max-width: 80%;
    overflow-x: auto;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.logs-table th, .logs-table td {
    padding: 10px;
    border: 1px solid #ddd;
}
.logs-table th {
    background-color: #2980b9;
    color: white;
    cursor: pointer;
    text-align: left;
    padding: 8px;
}

.logs-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.logs-table tr:hover {
    background-color: #ddd;
}

.logs-table th {
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    text-align: left;
    padding: 8px;
}
table table-bordered {
    border: 1px solid #ddd;
}
.logs-table th, .logs-table td {
    border: 1px solid #ddd;
    padding: 8px;
}
bi bi-people-fill {
    font-size: 1.5rem;
    color: #2980b9;
    margin-right: 8px;
    width: 20px;
}
/* Dropdown styling */
.styled-dropdown {
    font-family: 'Arial', sans-serif; /* Match the font of the page */
    font-size: 14px; /* Adjust font size to match the rest of the page */
    color: #333; /* Text color */
    background-color: #f8f9fa; /* Background color */
    border: 1px solid #ced4da; /* Border color */
    border-radius: 4px; /* Rounded corners */
    padding: 5px 10px; /* Padding for better spacing */
    transition: all 0.3s ease; /* Smooth transition for hover effects */
}

.styled-dropdown:focus {
    outline: none; /* Remove default focus outline */
    border-color: #2980b9; /* Highlight border on focus */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Add shadow on focus */
}

.styled-dropdown:hover {
    background-color: #e9ecef; /* Slightly darker background on hover */
    cursor: pointer; /* Change cursor to pointer */
}

/* Ensure buttons are inline and take only the necessary width */
.btn {
    display: inline-block; /* Align buttons horizontally */
    width: auto; /* Prevent buttons from taking full width */
    margin: 0 5px; /* Add spacing between buttons */
    vertical-align: middle; /* Align buttons with other elements in the row */
    margin-bottom: 0.4rem;
    
}
.btn-wide {
    min-width: 60px; /* or whatever width you need */
}
.btn-34 {
    width: 75%;
    max-width: 300px;
    min-width: 120px;
    display: block;
    margin: 0.5em auto;
    font-size: 1.1em;
}

/* Ensure forms inside table cells do not force stacking */
form {
    display: block; /* Keep forms inline to prevent stacking */
}

/* Ensure table cells do not force stacking */
td {
    white-space: nowrap; /* Prevent wrapping of content inside table cells */
}
.table th, .table td {
    text-align: left; /* Center align text in table headers and cells */
}
button i[data-lucide] {
    vertical-align: middle;
    margin-right: 4px; /* optional, to separate icon from text */
    position: relative;
    top: -1px; /* fine-tune vertically */
}
.nav-button {
display: flex;
align-items: center;
justify-content: center; /* centers contents horizontally */
gap: 6px;
padding: 8px 12px;
font-size: 1rem;
cursor: pointer;
background-color: #f0f0f0; /* your button style */
border: 1px solid #ccc;
border-radius: 5px;
}



#chatInput {
    display: block;
    text-align: left;
    
}

.summary-box {
    background-color: #fff;
    padding: 1em;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: fit-content;
    margin-top: 1em;
    overflow-x: auto;
}

.summary-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px;
}

.summary-table th, .summary-table td {
    border: 1px solid #ccc;
    padding: 8px 12px;
    text-align: left;
}

.summary-table th {
    background-color: #f9f9f9;
    font-weight: bold;
}
form.edit-client-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    font-size: 14px;
}

.client-col {
    min-width: 200px;
    width: 250px;
    text-align: left;
}
.phone-col {
    max-width: 80px;
    width: 40px;
}
.alert {
padding: 10px;
border: 1px solid #ccc;
margin-bottom: 10px;
border-radius: 5px;
opacity: 1;
transition: opacity 1s ease-out;
}
.alert-success { background-color: #d4edda; color: #155724; }
.alert-danger  { background-color: #f8d7da; color: #721c24; }
.fade {
opacity: 0;
}
/* Email Helper Page Specific Styles */
.email-helper-wrapper .row {
    display: flex;
    flex-wrap: nowrap;
    height: 80vh;
    margin: 0;
}

.email-helper-wrapper .col-md-4 {
    max-width: 30%;
    min-width: 250px;
    border-right: 1px solid #ddd;
    height: 100%;
    overflow-y: auto;
    flex: 0 0 30%;
}

.email-helper-wrapper .col-md-8 {
    flex: 1 1 70%;
    max-width: 70%;
    height: 100%;
    overflow-y: auto;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
}

.email-helper-wrapper #email-body-box {
    min-height: 200px;
    margin-bottom: 1em;
}

.email-helper-wrapper form {
    display: block !important;
}

.email-helper-wrapper button {
    width: auto !important;
    display: inline-block !important;
    margin: 0 5px 0 0;
}

.dropdown {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    color: #333;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}
.dropdown:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
.dropdown:hover {
    background-color: #e9ecef;
    cursor: pointer;
}
/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background: #f7f9fc;
    margin: 0;
    padding: 0;
    color: #333;
}

.container {
    max-width: 80%;
    flex: 1;
    margin: 2rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.container-narrow {
    max-width: 450px;
    margin: 50px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}
h1 {
    text-align: center;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #34495e;
    border-bottom: 2px solid #e0e6ed;
    padding-bottom: 0.3rem;
}


input[type="text"], select {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 0.8rem;
    border-radius: 8px;
    border: 1px solid #dfe6ee;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s ease;
}

input[type="text"]:focus, select:focus {
    border-color: #3498db;
}

button {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.25s ease;
}

button[type="submit"] {
    background: #3498db;
}

button[type="submit"]:hover {
    background: #2980b9;
}

.big-btn {
    font-size: 1.1rem;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
}

.big-btn.red {
    background: #e74c3c;
}

.big-btn.red:hover {
    background: #c0392b;
}

.big-btn:not(.red) {
    background: #27ae60;
}

.big-btn:not(.red):hover {
    background: #1e874b;
}

/* Entries */
.entries .entry {
    background: #f9fbfd;
    border: 1px solid #e3e9f0;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #2c3e50;
}

/* Make the body a flex container */
html, body {
    min-height: 100%;
    height: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.big-btn.red {
    background: #e74c3c;
}

.big-btn.red:hover {
    background: #c0392b;
}

.big-btn:not(.red) {
    background: #27ae60;
}

.big-btn:not(.red):hover {
    background: #1e874b;
}

/* Entries */
.entries .entry {
    background: #f9fbfd;
    border: 1px solid #e3e9f0;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #2c3e50;
}

/* Make the body a flex container */
html, body {
    height: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Admin Panel Header (match footer style) */
header {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #16a085; /* match footer teal */
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Navbar in Admin Panel */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    background: none;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Admin Panel Buttons (match footer .action-button) */
.navbar button,
.navbar .action-button {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    background-color: #196bae;
    color: #fff;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(22, 160, 133, 0.08);
}
.navbar button:hover,
.navbar .action-button:hover {
    background-color: #138d75;
}

.navbar button i[data-lucide] {
    margin-right: 6px;
    vertical-align: middle;
}

/* Admin Panel Background (darker teal) */
body.admin-panel-bg {
    background-color: #f9f9f9 !important;
}

/* Admin Panel Header (darker teal, rounded) */
header {
    text-align: center;
    margin-bottom: 20px;
    padding: 18px 10px 18px 10px;
    background-color: #2980b9; /* darker teal */
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 18px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Admin Panel Main Container (rounded, shadow, consistent) */
main {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 900px;
    margin: 2rem auto 2rem auto;
    padding: 2rem;
}

/* Footer Home button: icon and text aligned */
.footer-actions .main-button {
    display: flex;
    align-items: center;
    gap: 0.4em;
    font-size: 1rem;
    vertical-align: middle;
    padding: 0.4rem 0.8rem;
}
.footer-actions .main-button i[data-lucide] {
    font-size: 1.2em;
    vertical-align: middle;
    margin-right: 0.3em;
}
.footer-actions .main-button span {
    vertical-align: middle;
    line-height: 1;
    display: inline-block;
    margin: 0;
    padding: 0;
}

/* Sticky Admin Navbar (like footer, always visible at top) */
.admin-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 101;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    color: #7f8c8d;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

/* Ensure page content is not hidden behind the sticky admin navbar */
body, main, .container, .container-report {
    padding-top: 70px; /* adjust if navbar height changes */
    padding-bottom: 70px; /* adjust if footer height changes */
}

/* Admin Navbar Buttons (exactly match footer .action-button) */
.admin-navbar .action-button {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    background-color: #2980b9; 
    color: #fff;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(22, 160, 133, 0.08);
}
.admin-navbar .action-button:hover {
    background-color: #1e5980;
}
.admin-navbar .action-button i[data-lucide] {
    font-size: 1.2em;
    vertical-align: middle;
    margin-right: 0.3em;
}

/* Fix: Only inline forms (e.g. in tables) should be display:inline.
   All top-level forms (e.g. food entry) should be block by default. */
form {
    display: block;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* If you want table cell forms inline, use a more specific selector: */
td form, .inline-form {
    display: inline;
}


/* Specific styles for buttons in forms */
form button {
    padding: 0.5em 1em;
    font-size: 1rem;
    cursor: pointer;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }
.mb-3 { margin-bottom: 1em; }
.mb-4 { margin-bottom: 1.5em; }
.p-3 { padding: 1em; }
.p-4 { padding: 1.5em; }

.card {
    background-color: var(--card-bg, #fff);
    border-radius: 1rem;
    box-shadow: var(--shadow, 0 2px 6px rgba(0,0,0,0.1));
}

.muted {
    color: #777;
    font-style: italic;
}

.big-btn {
    font-size: 1.2rem;
    padding: 0.75em 1.5em;
    border-radius: 12px;
}



/* Form rows */
.form-row, .drink-buttons, .output-buttons, .output-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
}

.input-text, .dropdown {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 1rem;
}

/* Grid Display */
.grid-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.grid-column h3 {
    margin-bottom: 0.5rem;
}
.entry {
    background: #f9fafb;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
}
.entry.food { border-left: 5px solid #3b82f6; }
.entry.output { border-left: 5px solid #22c55e; }
.entry.poop { border-left: 5px solid #a16207; }

.timeline {
    text-align: center;
    font-size: 0.95rem;
    color: #555;
}
.highlight-gap {
    background: #fef3c7;
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: bold;
    color: #92400e;
    margin-bottom: 0.4rem;
}

/* Make .container full width on mobile, remove background edge */
@media (max-width: 600px) {
    .container, .container-narrow, .container-report {
        max-width: 100vw;
        width: 100vw;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0.5em 0.2em;
    }
    body {
        background-color: #fff;
        padding: 0;
        margin: 0;
    }
}

/* Improved chat header row alignment for AI chat page */
.chat-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: flex-start;
}

.chat-header-row > form,
.chat-header-row > a {
    margin: 0;
    padding: 0;
    align-self: center;
    height: 40px;
    display: flex;
    align-items: center;
}

.chat-header-row .chat-btn,
.chat-header-row .dropdown {
    height: 40px;
    margin: 0;
    display: flex;
    align-items: center;
}

.chat-header-row .dropdown {
    min-width: 180px;
    max-width: 320px;
}

.chat-header-row .chat-btn.logout-btn {
    margin-left: auto;
}
.bubble {
    display: inline-block;       /* needed for hover detection */
    cursor: pointer;             /* shows it’s hoverable */
    padding: 10px 16px;
    border-radius: 18px;
    max-width: 80%;
    position: relative;
}

.thinking-tooltip {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9em;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    white-space: pre-wrap;
    z-index: 9999;
    pointer-events: none;
    max-width: 300px;
    transition: opacity 0.2s;
    display: none; /* initially hidden */
}



@media (max-width: 900px) {
    .chat-header-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    .chat-header-row > form,
    .chat-header-row > a {
        width: auto;
        min-width: 120px;
    }
}

/* Scoped AI chat header overrides */
.ai-chat-page .chat-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.ai-chat-page .chat-header-row form,
.ai-chat-page .chat-header-row a {
    display: flex !important;
    align-items: center;
    margin: 0;
    padding: 0;
    width: auto;
}
.ai-chat-page .chat-header-row form button,
.ai-chat-page .chat-header-row .chat-btn,
.ai-chat-page .chat-header-row .header-action,
.ai-chat-page .chat-header-row .logout-btn {
    width: auto !important;
    min-width: auto;
    padding: 0.35rem 0.65rem;
}
.ai-chat-page .chat-header-row .chat-new-form {
    flex: 0 0 auto;
    min-width: 70px;
    justify-content: center;
}
.ai-chat-page .chat-header-row .chat-select-form {
    flex: 1 1 auto;
    padding-left: 0;
}
.ai-chat-page .chat-header-row .chat-select-form .dropdown {
    width: 100%;
    min-width: 0;
}

/* Mobile: two rows (New+Select, then the three action buttons) */
@media (max-width: 600px) {
    .ai-chat-page .chat-header > .chat-header-row {
        flex-wrap: wrap;
        flex-direction: row;
        align-items: stretch;
    }
    .ai-chat-page .chat-header-row .chat-new-form {
        order: 1;
        flex: 0 0 80px;
    }
    .ai-chat-page .chat-header-row .chat-new-form .new-conv-btn {
        width: 100%;
        padding: 0.45rem 0.55rem;
    }
    .ai-chat-page .chat-header-row .chat-select-form {
        order: 1;
        flex: 1 1 calc(100% - 90px);
    }
    .ai-chat-page .chat-header-row .chat-select-form .dropdown {
        width: 100%;
        min-width: 0;
    }
    .ai-chat-page .chat-header-row .header-action {
        order: 2;
        flex: 1 1 calc(33% - 8px);
        justify-content: center;
    }
    .ai-chat-page .chat-header-row .header-action.logout-btn {
        flex: 1 1 calc(33% - 8px);
    }
}

.ai-chat-page .chat-container {
    min-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}
.ai-chat-page .chat-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.ai-chat-page .chat-history {
    flex: 1 1 auto;
    min-height: 0;
}
.ai-chat-page .chat-input-form {
    margin-top: 12px;
}
.ai-chat-page .chat-header-row--primary,
.ai-chat-page .chat-header-row--actions {
    width: 100%;
}
.ai-chat-page .chat-header-row--primary {
    flex-wrap: nowrap;
}
.ai-chat-page .chat-header-row--actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}
.ai-chat-page .chat-header-row--actions .header-action {
    flex: 0 0 auto;
}
