:root {
  --blue: #283875;
  --green: #006600;
  --gold: #f0a500;
  --white: #ffffff;
  --text-color: #000000;
  --bg-color: #ffffff;
  --card-bg: #f9f9f9;
  --hover-bg: #e8f0ff;
  --table-header-bg: #004080;
  --table-row-hover: #e8f0ff;
}

body.dark-mode {
  --blue: #9cbff8;
  --green: #88cc88;
  --gold: #ffd700;
  --white: #1c1c1c;
  --text-color: #f0f0f0;
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --hover-bg: #2a2a2a;
  --table-header-bg: #222e50;
  --table-row-hover: #2a2a2a;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  overflow: auto;
  height: auto;           /* Do NOT fix it to 100% */
  overflow-y: auto;       /* Allow vertical scrolling */
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

/*.main-content {
  margin-top: 80px;
}
*/

  td.details-control {
    cursor: pointer;
    text-align: center;
  }

/* Flex layout for top controls */
div.dataTables_wrapper > div.top-controls {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* Left-align the search */
div.dataTables_filter {
  order: 1;
  flex: 1 1 auto;
  text-align: left !important;
}

/* Right-align the entries dropdown */
div.dataTables_length {
  order: 2;
  flex: 0 0 auto;
  text-align: right;
}

/* Search input styling */
div.dataTables_filter input {
  width: 350px !important;
  margin-left: 0.5em;
  padding: 6px 10px;
  font-size: 14px;
  color: #333;
}

/* Placeholder style */
div.dataTables_filter input::placeholder {
  color: #888;
  font-style: italic;
}

/* Bold label */
div.dataTables_filter label {
  font-weight: bold;
}


#vehicles-table thead select {
  width: 100%;
  padding: 2px;
  font-size: 13px;
  box-sizing: border-box;
}


.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 1.0em;
  background-color: #fefefe;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
  text-align: center !important;
}

.admin-table th,
.admin-table td {
  padding: 10px 14px;
  border: 1px solid #ddd;
  text-align: center !important;
  vertical-align: middle !important;
}

.admin-table th {
  background-color: #334488;
  color: white;
  font-weight: 600;
  text-align: center;
}

.admin-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.admin-role-form {
  text-align: center;
}
/* Action button wrapper (update + delete) */
.admin-flex-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

/* Forms for buttons */
.admin-inline-form {
  margin: 0;
}

/* Inputs and buttons */
.admin-input {
  padding: 5px 8px;
  font-size: 0.9em;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
}

.admin-btn {
  font-size: 0.85em;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.admin-btn-update {
  background-color: #3498db;
  color: white;
}
.admin-btn-update:hover {
  background-color: #2874a6;
}

.admin-btn-delete {
  background-color: #e74c3c;
  color: white;
}
.admin-btn-delete:hover {
  background-color: #c0392b;
}







.login-error {
  max-width: 400px;
  margin: 1rem auto;
  padding: 0.75rem 1rem;
  background-color: #f44336;
  color: white;
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.textcustom-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.textcustom {
  font-size: 2rem;
  font-weight: 600;
  color: #283875;
}


.login-form {
  max-width: 400px;
  margin: 2rem auto;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-input {
  padding: 10px;
  font-size: 16px;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-submit {
  background-color: #283875;
  color: white;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.login-submit:hover {
  background-color: #1f2f6d;
}



/*.hero {
  background: url('/static/figures/background.jpg') center center / cover no-repeat;
  color: white;
  text-align: center;
  min-width: 100vh;
  padding: 6rem 1rem 4rem;
  position: relative;
  width: 100vw; 
  left:-15px;        
  overflow: hidden;
}*/

.hero {
  background: url('/static/figures/background.jpg') center center / cover no-repeat;
  color: white;
  text-align: center;
  padding: 6rem 1rem 6rem;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(40, 56, 117, 0.6); /* subtle dark overlay */
  z-index: 1;
}

.hero h1,
.hero p {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.3rem;
  color: #eaeaea;
}




.welcome-box {
  max-width: 600px;
  margin: 3rem auto;
  padding: 2rem;
  background: #f4f7ff;
  border: 1px solid #d0d8f0;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  text-align: center;
}

.welcome-box h1 {
  color: #283875;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.user-role {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 1rem;
}

.welcome-instructions {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.primary-link {
  display: inline-block;
  padding: 10px 20px;
  background-color: #283875;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.primary-link:hover {
  background-color: #1f2f6d;
}

.form-box {
  max-width: 500px;
  margin: 2rem auto;
  padding: 2rem;
  background: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
  margin-bottom: 1.2rem;
}

.input-field {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.submit-button {
  width: 100%;
  padding: 12px;
  background-color: #283875;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

.submit-button:hover {
  background-color: #1f2f6d;
}

.form-error {
  color: red;
  font-weight: bold;
  text-align: center;
  margin-bottom: 1rem;
}




.page-header {
  text-align: center;
  margin-top: 120px;
}

.section {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.styled-table th,
.styled-table td {
  border: 1px solid #ccc;
  padding: 10px 12px;
  text-align: left;
}

.styled-table th {
  background-color: #283875;
  color: white;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-field {
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.btn-submit {
  background-color: #283875;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-submit:hover {
  background-color: #1f2f6d;
}

.btn-delete {
  background-color: #a83232;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-delete:hover {
  background-color: #8a2a2a;
}

.link-back {
  text-decoration: none;
  color: #283875;
  font-weight: bold;
}




.flash-message {
  padding: 12px 16px;
  margin: 1rem auto;
  border-radius: 5px;
  font-weight: bold;
  max-width: 800px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.flash-message.success {
  background-color: #dff0d8;
  color: #3c763d;
  border: 1px solid #d0e9c6;
}

.flash-message.error {
  background-color: #f2dede;
  color: #a94442;
  border: 1px solid #ebccd1;
}





/* Toggle button (matches section-toggle) */
.status-toggle {
  border: 2px solid #1f3c88;
  background-color: #fff;
  color: #1f3c88;
  font-size: 18px;
  font-weight: bold;
  border-radius: 12px;
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;

  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  width: auto;

  margin-bottom: 12px;
}

.status-toggle:hover {
  background-color: #006600; /* Green */
  color: white;
  border-color: #006600;
}


/* Arrow behavior */
.status-arrow {
  font-size: 16px;
  display: inline-block;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.status-toggle.open .status-arrow {
  transform: rotate(-90deg);
}


/* LED indicators */
.led {
  flex-shrink: 0;              
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #888;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

.led-warning.led-true {
  background-color: orange; /* override red with orange */
}

.led-true {
  background-color: red;
}

.led-false {
  background-color: #28a745; /* green */
}

.led-unknown {
  background-color: gray;
}

/* Button at bottom (matches section style) */
.action-button {
  display: inline-block;
  padding: 8px 14px;
  margin: 6px;
  font-size: 15px;
  font-weight: bold;
  color: white;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}


.toast-close-button {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
}

.action-button:hover {
  background-color: #006600;
}

/* 🛠 Repair Button */
.repair-button {
  background-color: #1f3c88 !important;
}
.repair-button:hover {
  background-color: #2e5dd4 !important;
}


/* 🛠 Repair Button */
.history-button {
  background-color: #055200 !important;
}
.history-button:hover {
  background-color: #CCB10E !important;
}




/* ✏️ Edit Button */
.edit-button {
  background-color: #007bff !important;
}
.edit-button:hover {
  background-color: #0056b3 !important;
}

/* 🗑 Delete Button */
.delete-button {
  background-color: #c82333;
}
.delete-button:hover {
  background-color: #a71d2a;
}


.save-button {
  background-color: #5cb85c;
}

.save-button:hover {
  background-color: #449d44;
}

.back-button {
  background-color: #5bc0de;
}

.back-button:hover {
  background-color: #31b0d5;
}




header {
  background-color: var(--blue);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header img {
  height: 50px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul li a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: var(--gold);
}




/*
 HEADER 
.main-header {
  background-color: #283875;
  color: white;
  padding: 8px 16px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);

  flex-wrap: wrap;
  height: auto; 

}


.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

*/




/* Center Section */
/*.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}*/



/*
.logo-menu-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  max-width: 100%;
  height: 50px;

}
.title {
  font-weight: bold;
  font-size: 20px;
  white-space: nowrap;
}

.nav-buttons {
  display: flex;
  gap: 10px;
}

.header-btn {
  background: transparent;
  border: 1px solid white;
  padding: 5px 12px;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  text-decoration: none;
  white-space: nowrap;
}

.header-btn:hover {
  background-color: #006600;
}
*/

.repair-toast {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #aaa;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  font-size: 15px;
  width: 800px;
  min-height: 400px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 10001;
}

/* Dark semi-transparent background behind toast */
#toast-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right:0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.3);  /* Lightly darken */
  z-index: 10000;
}


.repair-textarea {
  width: 96%;
  height: 100px;
  font-size: 15px;
  padding: 8px;
  padding-right: 14px;
  border-radius: 6px;
  border: 1px solid #aaa;
  margin-right: 2%;
  margin-bottom: 10px; /* ✅ Add this line */
}

.sticky-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 900px;  /* Allows horizontal scroll if screen is narrow */
}

.sticky-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: #004080;
  color: white;
  font-size: 12px;
  text-align: center;
  padding: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 100px;
  text-align: center;
  align-items: center;

}

.sticky-table td {
  font-size: 12px;
  text-align: center !important;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 100px;
  vertical-align: middle !important;
}

.table-scroll-container {
  overflow-x: auto;
  max-width: 100%;
  max-height: 100vh;
  border: 1px solid #ccc;
}

.vehicle-row td {
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ddd;
}

.vehicle-action-row td {
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 8px double #999;
}

.spacer-row td {
  height: 15px;
  border: none;
  background: transparent;
  padding: 0px;
}

 table {
    border-collapse: collapse;
    width: 100%;
    font-family: Arial, sans-serif;
  }
  th, td {
    border: 1px solid #999;
    padding: 8px;
    text-align: center;
  }
  th {
    background-color: #004080;
    color: white;
  }
  tr:nth-child(even) {
    background-color: #f2f2f2;
  }
  tr:hover {
    background-color: #e8f0ff;
  }
  .actions {
    text-align: right;
  }




@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .sticky-table {
    font-size: 12px;
    min-width: 900px;
  }

  .sticky-table th,
  .sticky-table td {
    font-size: 12px;
    padding: 6px;
    text-align: center !important;

  }

  .table-scroll-container {
    overflow-x: auto;
  }

  .action-button {
    font-size: 12px;
    padding: 6px 10px;
  }

  .repair-toast {
    width: 95vw;
  }

  .device-characteristics-table td,
  .device-characteristics-table th {
    font-size: 0.8rem;
    padding: 8px;
  }

  .variable-toast-table {
    font-size: 14px;
  }

  .table-cell {
    padding: 4px 6px;
  }

  .toast-container {
    width: 95vw;
    max-width: none;
    max-height: auto;
  }

/*
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    gap: 8px;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .logo-section {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }

  .title {
    font-size: 14px;
    white-space: normal; 
    word-break: break-word;
  }

  .nav-buttons {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
  }

  .header-bottom {
    flex-direction: row;
    align-items: center;
    width: 100%;
     gap: 10px;
  }




  .menu-toggle {
    flex-shrink: 0;
  }

  .nav-page-title {
    font-size: 14px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
  }

.status-wrapper {
  position: static;
  margin: 40px auto;
  width: 100%;
}

  .list1-status-wrapper {
    padding: 10px;
    max-width: 100%;
  }


h2 {
    text-align: center;
  }

  form {
    margin: 1rem;
    padding: 1rem;
  }

  .main-header .header-top,
  .main-header .nav-buttons {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .main-header .logo {
    height: 40px;
  }

  .main-header .title {
    font-size: 16px;
  }

*/

  .textcustom {
    font-size: 1.5rem;
    margin-top: 30px;
  }

  nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  header {
    flex-direction: column;
    gap: 1rem;
  }
}
