.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-header h1 {
  margin-bottom: 1rem;
}

/* Toolbar */
.task-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;         
  gap: 1rem;
}

.card .task-toolbar {
  margin: 0;                     
  border-bottom: 1px solid #ddd;
  background: #f8f9fa;           
}

.task-toolbar-left,
.task-toolbar-center,
.task-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Filter panel */
.task-filter-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: #f5f5f5;
  border: 1px solid #ddd;
}

.filter-form .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-field {
  min-width: 160px;
  flex: 1 1 160px;
}

.filter-field label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.filter-field input,
.filter-field select,
.filter-field textarea {
  width: 100%;
}

.filter-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

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

.task-table,
.cadet-table {
  width: 100%;
  border-collapse: collapse;
}

.task-table th,
.task-table td,
.cadet-table th,
.cadet-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9rem;
}

.task-table th {
  text-align: left;
  background: #fafafa;
}

.task-table tbody tr:hover {
  background: #fafafa;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Red = urgent / not started / problem */
.status-red {
  background: #f8d7da;  /* light red */
  color: #721c24;       /* dark red text */
}

/* In Progress = yellow */
.status-in-progress {
  background: #fff3cd;  /* light yellow */
  color: #856404;       /* dark yellow/brown text */
}

/* Complete = green */
.status-complete {
  background: #d4edda;  /* light green */
  color: #155724;       /* dark green text */
}


/* Priority */
.priority-cell {
  font-weight: 700;
}

/* Card */
.card {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.card-body {
  padding: 1rem;
}

/* Task details row */
.task-details-row td {
  background: #fafafa;
}

.task-details {
  padding: 0.75rem 0.5rem;
}

.task-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.task-details-header h3 {
  margin: 0;
}

.task-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1.5rem;
}

.task-details-grid strong {
  display: block;
  margin-bottom: 0.15rem;
}

/* Modal base */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 0.75rem;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-large {
  max-width: 900px;
}

.modal-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 1rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Form layout */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.form-field-full {
  grid-column: 1 / -1;
}

/* Assign cadets layout */
.assign-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.assign-main {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 1rem;
}

.assign-column h3 {
  margin-bottom: 0.5rem;
}

.selected-cadets-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 0.5rem;
  border: 1px solid #e0e0e0;
  max-height: 300px;
  overflow-y: auto;
}

.selected-cadets-list li {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.selected-cadets-list li:last-child {
  border-bottom: none;
}

/* Utilities */
.hidden {
  display: none !important;
}
