:root {
  --primary: #2c3e50;
  --accent: #579ff6;
  --danger: #e74c3c;
  --success: #2ecc71;
  --bg: #f4f7f6;
  --card-bg: lightgray;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  margin: 0;
  color: #333;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.container {
  padding: 20px;
  margin: 0 auto;
}

header {
  background: var(--primary);
  color: white;
  padding: 5px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h2 {
  margin: 5px;
}

.headergroup {
  flex-direction: row;
  display: flex;
}

.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  margin-top: 10px;
}

#planning-list {
    margin-bottom: 20px;
    background-color: lightgray;
    padding: 10px;
    border-radius: 10px;
}

input {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 4px;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
}

button.secondary {
  background: #95a5a6;
}

button.danger {
  background: var(--danger);
}

.btn-edit,
.btn-delete {
  padding: 6px;
  width: initial;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* Tabs */
.tabs {
  background: white;
  display: flex;
  border-bottom: 1px solid #ddd;
}

.tab-link {
  background: none;
  color: var(--primary);
  width: auto;
  flex: 1;
  border-bottom: 3px solid transparent;
  border-radius: 0;
}

.tab-link.active {
  border-bottom-color: var(--accent);
  font-weight: bold;
}

.tab-content {
  display: none;
  padding-top: 20px;
}

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

.tab-content h3 {
  margin-top: 0;
}

/* Shift Planning UI */
.shift-item {
  background: white;
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid black;
  border-left: 5px solid var(--primary);
}

.shift-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.shift-body {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.role-badge {
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.9em;
  cursor: pointer;
  margin-bottom: 5px;
  display: inline-block;
}

.role-badge.responsible {
  background: #e8f8f5;
  color: #1abc9c;
  border: 1px solid #1abc9c;
}

.role-badge.planned {
  background: #eaf2f8;
  color: #3498db;
  border: 1px solid #3498db;
}

.role-badge.interested {
  background: #f9f9f9;
  color: #7f8c8d;
  border: 1px solid #bdc3c7;
}

.role-badge.missing-interest {
  background: #fdeaea;
  color: #c0392b;
  border: 2px solid #e74c3c;
}

.status-link {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.85em;
}

.status-link:hover {
  opacity: 0.8;
}

.status-to-planned {
  background: #3498db;
  color: white;
}

.status-to-responsible {
  background: #1abc9c;
  color: white;
}

.status-to-interested {
  background: #95a5a6;
  color: white;
}

.remove-link {
  margin-left: 6px;
  color: #e74c3c;
  cursor: pointer;
  font-weight: bold;
}

.remove-link:hover {
  color: #c0392b;
}

.add-btn {
  background: #eee;
  color: #555;
  font-weight: bold;
}

.log-entry {
  font-size: 0.9em;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.log-time {
  color: #888;
  font-size: 0.8em;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: white;
  margin: 15% auto;
  padding: 20px;
  width: 300px;
  border-radius: 8px;
}

.close {
  float: right;
  cursor: pointer;
  font-size: 24px;
}

/* Day Grid Layout */
.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.day-unit {
  display: flex;
  flex-direction: column;
}

.day-column-header {
  text-align: center;
  color: white;
  padding: 10px;
  background: var(--primary);
  border-radius: 8px 8px 0 0;
}

.day-column-header strong {
  font-size: 1.1em;
}

.day-column-header small {
  opacity: 0.9;
}

.day-column {
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
  padding: 10px;
  min-height: 100px;
  border: 1px solid black;
  border-width: 0 0 0 1px;
  flex: 1;
}

.shift-item-compact {
  background: white;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.shift-item-compact label {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.shift-item-compact input[type="checkbox"] {
  margin-bottom: 5px;
}

.shift-item-compact strong {
  color: var(--primary);
}

.shift-item-compact small {
  color: #666;
  font-size: 0.85em;
}

/* Wage Table */
.wage-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  font-size: small;
}

.wage-table thead {
  background: var(--primary);
  color: white;
}

.wage-table th {
  padding: 15px 10px;
  text-align: left;
  font-weight: 600;
}

.wage-table td {
  padding: 12px 10px;
  border-bottom: 1px solid black;
}

.wage-table tbody tr:hover {
  background: var(--accent);
}

.wage-table tbody tr:last-child td {
  border-bottom: none;
}

.rotatedText{
  writing-mode: vertical-rl;
 text-orientation: mixed;
}

/* Responsive */
@media (max-width: 600px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .shift-body {
    flex-direction: column;
  }

  .day-grid {
    grid-template-columns: 1fr;
  }

  .wage-table {
    font-size: 0.85em;
  }

  .wage-table th,
  .wage-table td {
    padding: 8px 5px;
  }
}