/* static/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

body, html {
  font-family: 'Inter', sans-serif;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
  color: #1f2937;
}

main.container {
  flex: 1 0 auto;
}

header {
  background-color: #1e3a8a;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input[type="text"],
input[type="password"] {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
}

select {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
}

button {
  padding: 0.75rem;
  border: none;
  border-radius: 0.375rem;
  background-color: #2563eb;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #1d4ed8;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.table th,
.table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.table th {
  background-color: #f1f5f9;
}

.status-online {
  color: green;
  font-weight: bold;
}

.status-offline {
  color: red;
  font-weight: bold;
}

.actions a,
.actions button {
  margin-right: 0.5rem;
}

/* ---- NAVBAR LINKS ---- */
.navbar-right a {
  color: white;
  margin-left: 1rem;
  text-decoration: none;
  font-weight: 500;
}

.navbar-right a:hover {
  text-decoration: underline;
}

.navbar-left .logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #f0f8ff;
  text-decoration: none;
}

/* ---- FLASH MESSAGES ---- */
.flash {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.375rem;
  color: white;
}

.flash.success {
  background-color: #16a34a; /* vert */
}

.flash.error {
  background-color: #dc2626; /* rouge */
}

/* ---- TABLE ACTIONS ---- */
.btn-small {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  background-color: #3b82f6;
  color: white;
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.btn-small:hover {
  background-color: #2563eb;
}

.footer {
  flex-shrink: 0;
  background-color: #1e3a8a;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo {
  height: 30px;
}

.hamburger {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 2rem;
  background-color: #1e3a8a;
  color: white;
}

/* --- Responsive smartphone --- */
@media (max-width: 768px) {
  .navbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .navbar-right {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: #1e3a8a;
    margin-top: 0.5rem;
  }

  .hamburger {
    display: block;
    font-size: 2rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
  }

  .username {
    padding: 0.5rem 1rem;
  }

  .navbar-left {
    flex: 1;
  }

  .navbar-right a,
  .navbar-right .username {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
  }

  .navbar-right.open {
    display: flex;
  }

  .container {
    margin: 1rem;
    padding: 1rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-logo {
    margin-bottom: 0.5rem;
  }

  .table thead {
    display: none;
  }

  .table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0.75rem;
  }

  .table td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border: none;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
  }

  .actions {
    flex-direction: column;
    gap: 0.3rem;
  }

  .actions a {
    margin-right: 0;
    margin-bottom: 0.3rem;
  }
}