/* Overall page styling */
body {
    font-family: Verdana, sans-serif;
    background-color: #b4bcb4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.dashboard-body {
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 100vh;
}

body.dashboard-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
}

.dashboard-shell {
    margin: 1.5rem;
    padding: 1.5rem;
    background-color: #a4ada4;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-brand img {
    height: 40px;
    object-fit: contain;
}

.brand-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #324233;
}

.dashboard-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    border-radius: 999px;
    padding: 0.45rem 1.2rem;
    border: 1px solid transparent;
    background-color: #cfd5cf;
    color: #324233;
    font-size: 0.9rem;
    cursor: pointer;
}

.nav-tab:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Active tab: same green as .primary-button (action pills) */
.nav-tab-active {
    background-color: #6b8760;
    color: #fff;
    font-weight: bold;
    border: 1px solid #5a7352;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nav-tab-active:hover {
    background-color: #445f39;
    border-color: #3d5235;
}

.nav-accent {
    background-color: #6b8760;
    color: #fff;
}

.nav-logout {
    background-color: #c25a3c;
    color: #fff;
}

.nav-logout:hover {
    background-color: #a3432a;
}

.fullscreen-button {
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    border: none;
    background-color: #cfd5cf;
    color: #324233;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.fullscreen-button:hover {
    background-color: #b8c0b8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.dashboard-main {
    background-color: #dfe3df;
    border-radius: 12px;
    padding: 1.5rem;
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
}


.dashboard-section {
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-header-sub {
    margin-top: 1rem;
}

.chip-button {
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    border: none;
    background-color: #cfd5cf;
    color: #324233;
    font-size: 0.8rem;
    cursor: pointer;
}

.card-table {
    background-color: #f5f5f3;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #c7cdc7;
}

.card-table-header,
.card-table-row {
    display: grid;
    grid-template-columns: 2fr 3fr;
    padding: 0.6rem 0.9rem;
    column-gap: 0.75rem;
    align-items: center;
}

.card-table-header {
    background-color: #e5e8e5;
    font-weight: bold;
    font-size: 0.85rem;
}

.card-table-row {
    font-size: 0.82rem;
}

.card-table-row:nth-child(odd) {
    background-color: #f9faf9;
}

.card-table-row:nth-child(even) {
    background-color: #f0f2f0;
}

.card-col-param {
    font-weight: 600;
}

.card-col-value {
    font-family: monospace;
    font-size: 0.9rem;
    text-align: right;
}

.status-connected {
    color: #2f7d32;
    font-weight: 700;
}

.status-disconnected {
    color: #b23a2b;
    font-weight: 700;
}

.status-unknown {
    color: #666;
}

/* One row: IP (left) + Subnet (right) */
.card-table-row-ip-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
    align-items: stretch;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.card-ip-pair-half {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    column-gap: 0.5rem;
    align-items: center;
    min-width: 0;
    background-color: #e9eee9;
    border: 1px solid #c8d0c8;
    border-radius: 10px;
    padding: 0.4rem 0.55rem;
}

.card-ip-pair-half-full {
    grid-column: 1 / -1;
}

.card-ip-pair-label {
    font-weight: 600;
    font-size: 0.82rem;
}

.card-ip-pair-value {
    font-family: monospace;
    font-size: 0.9rem;
    text-align: right;
    word-break: break-all;
}

.card-table-row-ip-pair:nth-child(odd) .card-ip-pair-half {
    background-color: #edf2ed;
}

.card-table-row-ip-pair:nth-child(even) .card-ip-pair-half {
    background-color: #e6ece6;
}

.dashboard-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.primary-button {
    border-radius: 999px;
    padding: 0.6rem 1.6rem;
    border: none;
    background-color: #6b8760;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
}

.primary-button:hover {
    background-color: #445F39;
}

/* Image container reused on login/config pages */
.image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
    margin-top: 3rem;
}

.image-container img {
    height: 100px;
    object-fit: contain;
}

/* Form container for login/config pages */
.form-container {
    background-color: #dfdfdf;
    padding: 2rem;
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 350px;
    width: 100%;
}

/* Header styling (dashboard) */
.dashboard-section h1 {
  font-size: 1.5rem;
  margin: 0;
  text-align: left;
  color: #324233;
}

.dashboard-section h2 {
  font-size: 1.1rem;
  margin: 0;
  text-align: left;
  color: #324233;
}

/* Spacing for each form group (login/config) */
.form-container form > div {
  margin-bottom: 1.5rem;
}

/* Label styling (login/config) */
.form-container label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  font-size: 1rem;
  color: #555;
}

/* Input styling (login/config) */
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background-color: #efefef;
  color: #555;
  font-size: 1.2rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: 1px solid #8F9F88;
  border: 1px solid #8F9F88;
}

textarea {
    resize: none;
    width: 100%;
    height: 95%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background-color: #efefef;
    color: #555;
    font-size: 0.8rem;
}

textarea:focus {
    outline: 1px solid #8F9F88;
}

/* Submit button styling (login/config pages only) */
.form-container button {
  width: 100%;
  padding: 0.75rem;
  background-color: #8F9F88;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.form-container button:hover {
  background-color: #445F39;
}

.form-container button:disabled {
  background-color: #ccc;
  color: #555;
}

/* Styling for the error message */
.success {
    justify-self: center;
    color: #445F39;
}

.error {
    justify-self: center;
    color: #cc5535;
}

.hidden {
    visibility: hidden;
}

/* Flex container for zip and city (config) */
.zip-city-container {
  display: flex;
  gap: 1rem; /* Space between fields */
}

/* ZIP field takes 1/3 of the container */
.zip-field {
  flex: 1;
}

/* City field takes 2/3 of the container */
.city-field {
  flex: 2;
}


.log-entry {
  margin-bottom: 8px;            /* Space between entries */
  padding: 5px 10px;             /* Padding for readability */

  white-space: pre-wrap;         /* Preserves whitespace and allows wrapping */
  word-wrap: break-word;         /* For legacy browser support */
  overflow-wrap: break-word;     /* Modern equivalent for breaking long words */
}

/* Settings page layout */
.settings-layout {
    display: flex;
    gap: 1.5rem;
    min-height: 300px;
}

.settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 180px;
    flex-shrink: 0;
    background-color: #b5beb5;
    border: 1px solid #9aa49a;
    border-radius: 10px;
    padding: 0.5rem;
}

.sidebar-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.7rem 1rem;
    border: 1px solid #9aa49a;
    border-radius: 8px;
    background-color: #d8dfd8;
    color: #324233;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.08s ease;
}

.sidebar-btn:hover {
    background-color: #c9d2c9;
    border-color: #808d80;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.sidebar-btn-active {
    background-color: #6b8760;
    border-color: #5a7352;
    color: #fff;
    font-weight: bold;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 5px rgba(0, 0, 0, 0.12);
}

.sidebar-btn-active:hover {
    background-color: #445f39;
    border-color: #3d5235;
}

.settings-content {
    flex: 1;
    min-width: 0;
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

.settings-title {
    font-size: 1rem;
    font-weight: bold;
    color: #324233;
    margin: 0 0 1rem 0;
}

.settings-subtitle {
    font-size: 0.85rem;
    font-weight: bold;
    color: #324233;
    margin: 0 0 0.5rem 0;
}

.settings-panel {
    padding: 0.5rem 0;
}

.connection-status {
    margin: 0 0 0.9rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #c7cdc7;
    background-color: #f0f2f0;
    color: #324233;
    font-size: 0.82rem;
    font-weight: 600;
}

.connection-title {
    font-weight: 700;
}

.connection-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background-color: #9aa49a;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.connection-status.state-connected .connection-dot {
    background-color: #2f7d32;
}

.connection-status.state-disconnected .connection-dot {
    background-color: #b23a2b;
}

.connection-status.state-unknown .connection-dot {
    background-color: #9aa49a;
}

.network-layout {
    display: block;
}

.network-current {
    max-width: 860px;
}

.network-config {
    margin-top: 1.5rem;
    max-width: 860px;
    background-color: #f5f5f3;
    border: 1px solid #c7cdc7;
    border-radius: 12px;
    /* Match .card-table-row horizontal padding so columns line up with Current values */
    padding: 0.6rem 0.9rem;
}

/* Form left | status right (same split as Current values + Mittelstreifen) */
.network-form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.4rem;
    align-items: stretch;
}

.network-form-main {
    min-width: 0;
}

.network-form-aside {
    border-left: 1px solid #c7cdc7;
    padding-left: 1rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Same level / style as .settings-field label (e.g. IP Address *) */
.network-info-title {
    margin: 0 0 0.3rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    line-height: 1.2;
}

.network-status-box {
    min-height: 4.25rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid #c7cdc7;
    border-radius: 8px;
    background-color: #fff;
    box-sizing: border-box;
}

.network-status-panel {
    margin: 0;
    min-height: 2.8rem;
    font-size: 0.85rem;
    line-height: 1.45;
    font-family: monospace;
    color: #324233;
    word-break: break-word;
}

.network-status-panel.success {
    color: #445f39;
    font-weight: 600;
}

.network-status-panel.error {
    color: #cc5535;
    font-weight: 600;
}

.network-form-fields {
    min-width: 0;
}

.network-form-fields .settings-field {
    margin-bottom: 0.75rem;
}

.network-form-fields .settings-field:last-child {
    margin-bottom: 0;
}

.network-form-fields .settings-field label {
    display: block;
    margin-bottom: 0.3rem;
}

/* Inputs fill only the left column — right edge aligns with the IP | Netmask divider */
.network-form-fields .settings-field input[type="text"] {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.network-form-submit {
    margin-top: 0.75rem;
}

.network-config-title {
    margin-top: 1.2rem !important;
}

/* Development settings (PartinoDev) — extensible workspaces / tabs */
.dev-intro,
.dev-hint {
    margin: 0 0 1rem 0;
    font-size: 0.82rem;
    color: #4a564a;
    line-height: 1.45;
}

.dev-hint code {
    font-family: monospace;
    font-size: 0.8rem;
    background-color: #e8ece8;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.dev-workspace {
    margin-top: 0.5rem;
}

.dev-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.dev-tab {
    border-radius: 999px;
    padding: 0.4rem 1rem;
    border: 1px solid #9aa49a;
    background-color: #d8dfd8;
    color: #324233;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.dev-tab:hover {
    background-color: #c9d2c9;
}

.dev-tab-active {
    background-color: #6b8760;
    border-color: #5a7352;
    color: #fff;
    font-weight: bold;
}

.dev-panel {
    display: none;
}

.dev-panel-active {
    display: block;
}

.dev-hardware-table {
    max-width: 640px;
}

.dev-control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.85rem;
    max-width: 860px;
}

.dev-control-group {
    background-color: #eef2ee;
    border: 1px solid #c7cdc7;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
}

.dev-control-group-wide {
    grid-column: 1 / -1;
}

.dev-control-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #324233;
    margin-bottom: 0.45rem;
}

.dev-toggle-row {
    display: flex;
    gap: 0.4rem;
}

.dev-toggle-row-wrap {
    flex-wrap: wrap;
}

.dev-toggle-btn {
    flex: 1 1 auto;
    min-width: 4.5rem;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    border: 1px solid #9aa49a;
    background-color: #f5f7f5;
    color: #324233;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.dev-toggle-btn:hover {
    background-color: #e2e8e2;
}

.dev-toggle-btn-active {
    background-color: #6b8760;
    border-color: #5a7352;
    color: #fff;
}

.dev-status-message {
    margin: 1rem 0 0 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.dev-status-message.success {
    color: #445f39;
}

.dev-status-message.error {
    color: #cc5535;
}

/* Settings current values should look like display rows, not inputs */
.settings-current-table .card-table-row-ip-pair {
    column-gap: 1.4rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.settings-current-table .card-table-row-ip-pair .card-ip-pair-half {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.settings-current-table .card-table-row-ip-pair .card-ip-pair-half + .card-ip-pair-half {
    border-left: 1px solid #c7cdc7;
    padding-left: 1rem;
}

.settings-current-table .card-ip-pair-label {
    font-weight: 700;
    color: #324233;
    white-space: nowrap;
}

.settings-current-table .card-ip-pair-value {
    color: #1f2a1f;
    min-width: 150px;
}

.settings-field {
    margin-bottom: 0.75rem;
}

.settings-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.3rem;
}

.settings-field input[type="text"] {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
    font-family: monospace;
    color: #324233;
}

/* Keep DNS placeholder (e.g. 8.8.8.8) in default style; only tint network fields */
#ipAddress::placeholder,
#netmask::placeholder,
#gateway::placeholder {
    color: #324233;
    opacity: 1;
}

/* Responsive design for mobile devices */
@media (max-width: 600px) {
  .dashboard-shell {
      margin: 0.75rem;
      padding: 0.75rem;
  }

  .dashboard-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.75rem;
  }

  .dashboard-main {
      padding: 1rem;
  }

  .card-table-header,
  .card-table-row:not(.card-table-row-ip-pair) {
      grid-template-columns: 1.5fr 2.5fr;
  }

  .card-table-row-ip-pair {
      grid-template-columns: 1fr;
      row-gap: 0.65rem;
  }

  .card-ip-pair-half {
      grid-template-columns: 1fr 2fr;
  }

  .card-ip-pair-half-full {
      grid-column: auto;
  }

  .settings-current-table .card-table-row-ip-pair .card-ip-pair-half + .card-ip-pair-half {
      border-left: none;
      padding-left: 0;
  }

  .settings-current-table .card-ip-pair-value {
      min-width: 0;
  }

  input[type="text"],
  input[type="password"] {
      font-size: 1rem;
  }

  .settings-layout {
      flex-direction: column;
  }

  .settings-sidebar {
      flex-direction: row;
      min-width: 0;
      overflow-x: auto;
  }

  .network-layout {
      grid-template-columns: 1fr;
  }

  .network-form-layout {
      grid-template-columns: 1fr;
  }

  .network-form-aside {
      border-left: none;
      padding-left: 0;
      padding-top: 0.75rem;
      margin-top: 0.5rem;
      border-top: 1px solid #c7cdc7;
  }
}