body {
  background-color: #1e1e1e;
  color: #e0e0e0c8;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

h1 {
  margin-bottom: 10px;
  margin-left: 10px;
  color: #a67b0d;
  font-weight: bold;
}

h3 {
  margin-bottom: 10px;
  color: #ffffff;
}

p {
  color: #d0d0d0;
}

table {
  font-size: 0.92rem;
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  /* Adds a subtle shadow for depth */
}

th,
td {
  font-size: 0.92rem;
  padding: 1rem;
  border: 1px solid #333;
  text-align: center;
}

th {
  font-size: 0.95rem;
  background-color: #3a3a3a;
  color: #ffffff;
  border-bottom: 2px solid #444;
  border-radius: 5px 5px 0 0;
  /* Adds rounded corners to the top header row */
}

tr:nth-child(even) {
  background-color: #1e1e1e;
}

input[type="text"],
input[type="number"],
input[type="password"] {
  width: 100px;
  padding: 0.5rem;
  margin: 0.5rem;
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 5px;
}

select {
  width: 110px;
  padding: 0.5rem;
  margin: 0.5rem;
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.login-form-row input[type="text"],
.login-form-row input[type="password"] {
  width: 100px;
  height: 34px;
  /* Explicit height */
  padding: 0.5rem;
  margin: 0.5rem;
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1;
}

.login-form-row select[name="role"] {
  flex: 1;
  min-width: 0;
  width: 100px;
  height: 34px;
  /* Same explicit height as inputs */
  margin: 0;
  padding: 0.5rem;
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

button {
  margin-top: 1rem;
  padding: 0.5rem 2rem;
  background-color: #a67b0d;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #886409;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc;
    color: #666;
}

/* navbar */
.navbar {
  background: #2d2d2d;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.6);
  border-bottom: none !important;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  gap: 1.5rem;
  padding: 0 2rem;
  min-height: 70px;
  /* Use min-height instead of fixed height */
}

/* Logo and title section */
.navbar-brand {
  display: flex;
  align-items: center;
  min-width: 220px;
  flex-shrink: 0;
}

/* Navigation tabs */
.navbar .tab {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-left: 2.5rem;
  margin-bottom: 0;
  background-color: #2d2d2d;
  box-shadow: none;
  border-bottom: none !important;
  height: 60px;
  justify-content: flex-start;
  margin-top: 0 !important;
}

/* Selectors - push to the right */
.navbar .selector {
  display: flex;
  align-items: center;
  margin-left: auto !important;
  flex-shrink: 0;
}

.tab button,
.tab .tablinks {
  height: 36px;
  line-height: 36px;
  padding: 0 12px;
  font-size: 0.95rem;
  margin: 0 1px;
  background-color: #2d2d2d;
  border: none;
  color: #b0b0b0;
  border-radius: 8px 8px 0 0;
  transition: background 0.2s, color 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.tab button.active,
.tab .tablinks.active,
.tab button:focus,
.tab .tablinks:focus {
  background: #232323;
  color: #fff;
  border-bottom: 2px solid #a67b0d;
  font-weight: bold;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
  .navbar {
    gap: 1rem;
    padding: 0 1rem;
  }

  .navbar .tab {
    margin-left: 1rem;
  }
}

@media (max-width: 900px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    min-height: auto;
  }

  .navbar-brand {
    justify-content: center;
    min-width: auto;
    order: 1;
  }

  .navbar .tab {
    justify-content: center;
    margin-left: 0 !important;
    width: 100%;
    height: auto;
    order: 2;
  }

  .navbar .selector {
    justify-content: center;
    margin-left: 0 !important;
    order: 3;
  }

  .tab button,
  .tab .tablinks {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    margin: 0 0.2rem;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0.5rem;
    gap: 0.3rem;
  }

  .navbar img {
    height: 36px !important;
    margin-right: 0.5rem !important;
  }

  .navbar span {
    font-size: 1rem !important;
  }

  .tab button,
  .tab .tablinks {
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
    margin: 0.1rem;
  }

  .selector select {
    width: 80px;
    font-size: 0.9rem;
    margin: 0.2rem;
  }

  .selector label {
    font-size: 0.95rem;
    margin-right: 0.3rem;
  }
}

.tabcontent {
  display: none;
  max-width: 800px;
  margin-left: 0;
  margin-right: auto;
}

.left-separator {
  border-left: 3px solid #888;
}

.left-separator-double {
  border-left: 3px double #888;
}

.left-separator-dashed {
  border-left: 2px dashed #888;
}

.container {
  display: flex;
  /* debug purpose only */
  /* border: 1px solid #47c772; */
}

.column {
  font-size: 0.95rem;
  flex: 1;
  padding: 10px;
  margin-left: 0;
  margin-right: auto;
  /* debug purpose only */
  /* border: 1px solid #999; */
}

/* Login form styling */
.login-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  margin: auto;
  max-width: 300px;
  gap: 20px;
}

.login-form-row label {
  flex: 0 0 auto;
  min-width: 80px;
  text-align: left;
  color: #e0e0e0;
  font-weight: normal;
}

.login-form-row input {
  flex: 1;
  min-width: 0;
}

.login-button-row {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  margin: auto;
  max-width: 300px;
}

/* logout button */
.logout-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  transition: all 0.2s;
  margin-top: 0;
}

.logout-btn:hover {
  background-color: #2d2d2d;
}

.logout-btn:hover img {
  filter: brightness(1) !important;
}

/* input validation */
.heat-consumption-input {
  width: 100px !important;
  padding: 0.5rem;
  margin: 0 !important;
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 5px;
  box-sizing: border-box;
}

/* Validation states for heat consumption inputs */
.heat-consumption-input.input-warning {
  border-color: #a67b0d !important;
}
