body {
    background-color: #f8f9fa; /* Light grey background */
}

#wrapper {
    display: flex;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: 250px;
    background-color: #212529; /* Dark background for sidebar */
    color: white;
}


#sidebar-wrapper .sidebar-heading {
  padding: 1rem;
  border-bottom: 1px solid #495057;
}



#sidebar-wrapper .sidebar-heading a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  font-size: 1.2rem;
  font-weight: bold;
}

#sidebar-wrapper .sidebar-heading img {
  width: 50px;
  max-width: 50px;
  height: auto;
  margin-right: 10px;
}

#sidebar-wrapper .list-group-item {
    border: none;
    padding: 1rem;
    color: #adb5bd; /* Lighter text for links */
}

#sidebar-wrapper .list-group-item i {
    color: #6c757d; /* Muted color for icons */
}

#sidebar-wrapper .list-group-item:hover,
#sidebar-wrapper .list-group-item:focus {
    background-color: #343a40 !important; /* Slightly lighter on hover */
    color: white;
}

#sidebar-wrapper .sidebar-category {
    padding: 1rem 1rem 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #6c757d;
}

#page-content-wrapper {
    flex: 1;
    padding: 20px;
}

/* Ensure card has a subtle shadow and rounded corners */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

  /* Removes rounded corners on the right side of the left element */
  .connected-left {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  /* Removes rounded corners on the left side of the right element */
  .connected-right {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  
  .custom_fields_section{
    background-color: rgb(216, 228, 255);
    padding: 20px;
    border-radius: 5px;
  }
  
  .logged_in_box{
    z-index: 99;
    padding: 10px;
    text-align: center;
    position: fixed;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    background-color: rgba(0, 0, 0, 0.788);
    border-radius: 10px;
    color: rgb(255, 255, 255);
  }


/* ===== Loading Overlay Styles ===== */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  display: none; 
}

/* No changes to #loadingOverlay */

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  perspective: 300px; /* ADD THIS: Creates the 3D space for the spin */
}

.snail-spinner {
  width: 80px;
  height: 80px;
  /* Use the new 3D spin animation */
  animation: spin-y 2s linear infinite; 
  /* ADD THIS: Ensures the element is treated as a 3D object */
  transform-style: preserve-3d;
}

/* No changes to .loading-text */
.loading-text {
  font-size: 3rem;
  color: white;
  font-weight: bold;
}

/* UPDATE THE ANIMATION KEYFRAMES from 'spin' to 'spin-y' */
@keyframes spin-y {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}


.connected-left { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.connected-right { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.is-valid { border-color: #198754 !important; background-color: #bfe9d5; }
.is-invalid { border-color: #dc3545 !important; background-color: #ecbfc4;}
/* Live processing highlight for the active order */
.processing-glow {
    border: 3px solid #fbff00 !important;
    box-shadow: 0 0 2rem rgb(255, 230, 87);
}



.error-image{
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: 400px;
  height: auto;
}

.error-header{
  font-size: 3rem;
  font-weight: 1000;
  text-align: center;
}

.error-text{
  font-size: 0.8rem;
  font-weight: 400;
  text-align: center;
}



#log-viewer-container {
    height: 80vh; 
    background-color: #1e1e1e;
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    padding: 1rem;
    border-radius: 8px;
    overflow-y: auto; 
    line-height: 1.6;
    position: relative; /* For sticky positioning */
}

.log-line {
    display: flex; 
}

.log-timestamp {
    color: #9cdcfe; /* Light Blue for timestamp */
    margin-right: 1.5em;
    white-space: nowrap; 
    flex-shrink: 0;
}

.log-level {
    font-weight: bold;
    text-transform: uppercase;
    margin-right: 1.5em;
    width: 70px;
    white-space: nowrap; 
    flex-shrink: 0;
}

.log-message {
    color: #d4d4d4; /* Light Grey for message */
    white-space: pre-wrap; 
    word-break: break-all; 
}

/* Log Level Colors (for the level itself) */
.log-info { color: #4ec9b0; }
.log-warning { color: #ffd700; }
.log-error { color: #f44747; }
.log-critical { color: #f44747; background-color: #400; }
.log-debug { color: #b5cea8; }
.log-raw { color: #aaa; font-style: italic; }


/* --- NEW: Search Box & Highlighting --- */
#log-search-box {
    position: sticky;   /* <-- FIX: Stays visible */
    top: -1px;          /* <-- FIX: Pins to the top of the scrollable area */
    z-index: 10;
    background: rgba(80, 80, 80, 0.7);
    backdrop-filter: blur(5px);
    padding: 5px 8px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    
    /* --- FIX: Replaced 'float' with margin for positioning --- */
    margin-left: auto; 
    width: fit-content;
    margin-bottom: 5px; 
}

#log-search-input {
    background-color: #333;
    color: #eee;
    border: 1px solid #555;
    border-radius: 3px;
    font-size: 0.8rem;
    padding: 2px 5px;
    width: 150px;
}

#log-search-count {
    font-size: 0.8rem;
    color: #ccc;
    margin: 0 8px;
}

#log-search-box button {
    background: #555;
    color: #eee;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    padding: 0 6px;
    line-height: 1.5;
    margin-left: 3px;
    cursor: pointer;
}
#log-search-box button:hover {
    background: #666;
}

.log-message mark {
    background-color: #ffd700;
    color: #000;
    border-radius: 2px;
}
.log-message mark.current-match {
    background-color: #ff6a00;
    box-shadow: 0 0 5px #ff6a00;
}

@keyframes flash-border {
  0% {
    border-color: rgb(129, 10, 10); 
  }
  50% {
    border-color: rgb(255, 137, 26);; 
  }
  100% {
    border-color: rgb(129, 0, 0); 
  }
}

.offline-highlight {
  border: 6px solid rgb(150, 10, 10);
  border-radius: 10px;
  animation: flash-border 2.5s ease-in-out infinite;
}

/* --- Other Page Styles --- */
.batch-log-list .list-group-item { cursor: pointer; }
.batch-log-list .list-group-item.active { font-weight: bold; }
#app-logs-container { height: 80vh; display: flex; flex-direction: column; }
#app-logs-container .dataTables_wrapper { flex-grow: 1; overflow-y: auto; }