* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #1a1a2e;
  color: #eaeaea;
  font-family: 'Segoe UI', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.login-container {
  background: #16213e;
  padding: 40px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: #e94560;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 24px;
  color: #a0a0b0;
}

input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background: #0f3460;
  border: 1px solid #1a4a7a;
  border-radius: 4px;
  color: #eaeaea;
  font-size: 1rem;
}

input::placeholder {
  color: #6a7a8a;
}

button {
  width: 100%;
  padding: 12px;
  background: #e94560;
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background: #c73652;
}

.error {
  background: #3a1a1a;
  color: #e94560;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.hidden {
  display: none;
}

p {
  color: #a0a0b0;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
/* --- Layout --- */
.page-container {
  min-height: 100vh;
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'Segoe UI', sans-serif;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

.page-header h1 {
  font-size: 1.4rem;
  color: #00d4ff;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-content {
  padding: 32px;
}

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

.section-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #00d4ff;
}

/* --- Buttons --- */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.85; }

.btn-primary   { background: #00d4ff; color: #1a1a2e; }
.btn-secondary { background: #2a2a4a; color: #e0e0e0; }
.btn-warning   { background: #f0a500; color: #1a1a2e; }
.btn-danger    { background: #e05252; color: #fff; }
.btn-small     { padding: 4px 10px; font-size: 0.8rem; }

/* --- Table --- */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #16213e;
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #0f3460;
  font-size: 0.9rem;
}

th {
  background: #0f3460;
  color: #00d4ff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #1a2a4a; }

/* --- Badges --- */
.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-admin    { background: #4a1a6a; color: #da8fff; }
.badge-maintenance  { background: #1a4a5a; color: #8ff0ff; }
.badge-management   { background: #3a1a5a; color: #d48fff; }
.badge-engineer { background: #1a3a6a; color: #8fbaff; }
.badge-operator { background: #1a5a3a; color: #8fffc4; }
.badge-viewer   { background: #3a3a1a; color: #fffb8f; }
.badge-active   { background: #1a5a3a; color: #8fffc4; }
.badge-locked   { background: #5a3a1a; color: #ffca8f; }
.badge-disabled { background: #4a1a1a; color: #ff8f8f; }
.badge-warning  { background: #5a4a1a; color: #fffb8f; }

/* --- Modals --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden { display: none; }

.modal-box {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-box h3 {
  margin: 0;
  color: #00d4ff;
}

.modal-box input,
.modal-box select {
  padding: 10px 12px;
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.modal-note {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* --- Status messages --- */
.status-message {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.status-message.success { background: #1a5a3a; color: #8fffc4; }
.status-message.error   { background: #4a1a1a; color: #ff8f8f; }
.status-message.hidden  { display: none; }

/* --- Existing error class --- */
.error {
  background: #4a1a1a;
  color: #ff8f8f;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.hidden { display: none; }