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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7fa;
  padding: 20px;
}

.container {
  /* max-width: 1200px; */
  margin: 0 auto;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* ==========================
   Typography
   ========================== */
h1,
h2,
h3 {
  margin-bottom: 20px;
  color: #2c3e50;
}

/* ==========================
   Layout and Containers
   ========================== */
.management-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 2em;
}

.management-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 10px;
  margin-top: 15px;
}

.user-item {
  padding: 12px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-item:hover,
.user-item.active {
  background: #f9f9f9;
}

.role-badge {
  display: inline-block;
  background: #e0e0e0;
  padding: 4px 8px;
  border-radius: 12px;
  margin: 3px;
  font-size: 0.9em;
}

.role-actions {
  margin-top: 15px;
}

.btn-icon i {
  pointer-events: none;
}

.btn-icon {
  background: transparent;
  border: none;
  color: #3498db;
  cursor: pointer;
  font-size: 1.1em;
  padding: 0 6px;
  transition: color 0.2s;
}

.btn-icon.delete-user,
.btn-icon .fa-trash,
.btn-icon .fa-xmark {
  color: #e74c3c;
}

.btn-icon:hover {
  color: #217dbb;
}

.btn-icon.delete-user:hover,
.btn-icon .fa-trash:hover,
.btn-icon .fa-xmark:hover {
  color: #c0392b;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  flex: 1;
}

.user-actions {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}

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

.action-header h3 {
  margin: 0;
}

/* ==========================
   Navigation
   ========================== */
nav {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  overflow-x: auto;
  background: #3498db;
  padding: 10px 20px;
}

nav a {
  color: white;
  text-decoration: none;
  margin-right: 15px;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 1rem;
  white-space: nowrap;
}

nav a:hover {
  background: #2980b9;
}

nav + h2 {
  /* edit h2 header that comes immedieately after the nav tag closes */
  margin-top: 25px;
}

.form-group {
  margin-bottom: 15px;
}

#label-username {
  display: flex;
  align-items: center;
  gap: 30px;
}

#workflow-manager-logo {
  height: 64px;
  width: 64px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

input[type='text'],
input[type='password'],
input[type='date'],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

button,
.btn {
  padding: 10px 20px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

button:hover,
.btn:hover {
  background: #2980b9;
}

.btn-danger {
  background: #e74c3c;
}

.btn-danger:hover {
  background: #c0392b;
}

.table-scroll {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ddd;
  margin-bottom: 1em;
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: #fff;
}

.data-table th {
  background: #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th a {
  color: #2a4d69;
  text-decoration: none;
  font-weight: bold;
}

.data-table th a:hover {
  text-decoration: underline;
}

.filter-form {
  margin-bottom: 1em;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-row input[type='text'],
.filter-row input[type='date'] {
  width: 130px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.btn-clear {
  background: #eee;
  color: #555;
  border: 1px solid #ccc;
}

.btn-clear:hover {
  background: #ddd;
  color: #222;
}

/* ==========================
   Role Permissions List
   ========================== */
.role-permissions-list {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 4px 8px;
  background: #fcfcfc;
}
.role-permission-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid #f3f3f3;
}
.role-permission-item:last-child {
  border-bottom: none;
}

/* ==========================
   Alerts and Messages
   ========================== */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ==========================
    Dashboard Cards
   ========================== */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card .btn {
  display: inline-block;
  margin-top: 15px;
}

/* ==========================
   Workflow
   ========================== */
#workflow-fields-container {
  border: 1px solid #eee;
  padding: 20px;
  border-radius: 8px;
  margin: 15px 0 15px 0;
  background: #f9f9f9;
}

.field-item {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.field-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.required {
  color: #e74c3c;
  margin-left: 3px;
}

/* ==========================
   Responsive Design
   ========================== */
@media (max-width: 900px) {
  .management-container {
    grid-template-columns: 1fr;
  }
}
