:root {
  color-scheme: light;
  --bg: #0f172a;
  --bg-alt: #111827;
  --surface: #ffffff;
  --surface-muted: #f3f4f6;
  --text-dark: #0f172a;
  --text-light: #e2e8f0;
  --accent: #2563eb;
  --accent-2: #60a5fa;
  --danger: #ef4444;
  --empty: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  background: #f8fafc;
  color: var(--text-dark);
  margin: 0;
}

.app {
  min-height: 100vh;
}

.hero {
  background: linear-gradient(135deg, var(--bg), var(--bg-alt));
  color: var(--text-light);
  padding: 3.5rem 0 3rem;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.hero .lead {
  max-width: 720px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--accent-2);
  margin-bottom: 0.75rem;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.controls-stack {
  display: grid;
  gap: 1.5rem;
}

.leave-overview {
  width: 100%;
}

.leave-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.leave-overview-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.employee-panels {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.employee-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.employee-cell {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem;
  text-align: left;
  background: var(--surface-muted);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.draggable-employee {
  cursor: grab;
}

.draggable-employee:active {
  cursor: grabbing;
}

.employee-cell:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

.employee-cell.active {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
  background: #e0e7ff;
}

.employee-name {
  font-weight: 600;
}

.employee-contract {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.employee-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #475569;
  margin-top: 0.5rem;
}

.employee-details {
  display: grid;
  gap: 1rem;
}

.employee-details.empty {
  color: #64748b;
  font-size: 0.95rem;
}

.employee-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.employee-metrics {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.employee-weekly ul li {
  padding: 0.25rem 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 0.85rem;
}

.employee-leave-panel {
  display: grid;
  gap: 0.75rem;
}

.employee-leave-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.leave-range-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 0.85rem;
}

.leave-form {
  display: grid;
  gap: 0.75rem;
}

.leave-summary li {
  padding: 0.35rem 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 0.9rem;
}

.leave-summary ul,
.leave-manager-overview ul,
.employee-leave-overview ul {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.calendar {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.calendar-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.month-selector {
  display: flex;
  flex-direction: column;
  min-width: 160px;
}

.legend {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.legend-item {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
}

.status-working {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.35);
}

.status-leave {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-empty {
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.week-container {
  display: grid;
  gap: 1.5rem;
}

.week-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  background: #f8fafc;
}

.week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.week-title {
  font-weight: 600;
  margin-bottom: 0;
}

.week-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.day-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 0.5rem;
  align-content: start;
  grid-template-rows: auto repeat(2, minmax(0, 1fr));
  min-height: 255px;
}

.day-card.day-placeholder {
  background: #f8fafc;
  border-style: dashed;
  color: #94a3b8;
}

.day-drop-zone.day-drop-disabled {
  opacity: 0.5;
  border-style: dashed;
}

.day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
  gap: 0.25rem 0.5rem;
  min-width: 0;
}

.day-label {
  grid-column: 1;
}

.day-date {
  grid-column: 1;
  font-weight: 500;
}

.day-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.day-label {
  white-space: nowrap;
}

.day-date {
  white-space: nowrap;
  font-weight: 500;
}

.day-drop-zone {
  align-self: flex-start;
  flex-shrink: 0;
  white-space: normal;
  text-align: center;
  max-width: 84px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  border: 1px dashed #cbd5f5;
  color: #475569;
  background: #f8fafc;
}

.drop-active {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
  background: rgba(37, 99, 235, 0.08);
}

.slot-card {
  border-radius: 10px;
  padding: 0.5rem;
  background: var(--empty);
  border: 1px dashed #cbd5f5;
  display: grid;
  gap: 0.4rem;
  align-content: start;
  min-height: 92px;
}

.slot-card.status-working {
  background: rgba(37, 99, 235, 0.1);
  border-style: solid;
}

.slot-card.status-leave {
  background: rgba(239, 68, 68, 0.1);
  border-style: solid;
}

.slot-card.status-empty {
  background: rgba(148, 163, 184, 0.12);
}

.slot-card.slot-empty .slot-employee {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-start;
  font-weight: 600;
  color: #64748b;
}

.slot-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px dashed #94a3b8;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
}

.slot-header {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.slot-employee {
  font-weight: 600;
}

.slot-employee-list {
  display: grid;
  gap: 0.35rem;
}

.slot-employee-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-size: 0.85rem;
}

.slot-employee-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.slot-add-button {
  width: 100%;
  margin-top: 0.35rem;
}

.slot-assign-panel {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.slot-assign-panel.show {
  display: grid;
}

.slot-remove-button {
  width: 100%;
  margin-top: 0.35rem;
}

.modal-backdrop {
  background-color: #cbd5f5;
}

.modal-backdrop.show {
  opacity: 0.6;
}

@media (max-width: 768px) {
  .calendar {
    padding: 1rem;
  }

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

  .day-card {
    min-height: auto;
    grid-template-rows: auto;
  }
}
