@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
  --bg: #07111f;
  --bg-soft: #0d1728;
  --card: rgba(9, 18, 32, 0.97);
  --surface: rgba(14, 28, 46, 0.98);
  --surface-strong: rgba(18, 36, 59, 1);
  --text: #f5f9ff;
  --muted: #bdd0ea;
  --accent: #38bdf8;
  --accent-dark: #0ea5e9;
  --accent-warm: #f59e0b;
  --border: rgba(170, 195, 228, 0.24);
  --danger: #ff7a7a;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 24%),
    radial-gradient(circle at left 20%, rgba(245, 158, 11, 0.12), transparent 20%),
    radial-gradient(circle at 50% 120%, rgba(14, 165, 233, 0.16), transparent 30%),
    linear-gradient(160deg, #050b16 0%, #0b1423 48%, #07111f 100%);
  position: relative;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(70px);
}

body::before {
  top: 40px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: rgba(56, 189, 248, 0.16);
}

body::after {
  left: -60px;
  bottom: 80px;
  width: 220px;
  height: 220px;
  background: rgba(245, 158, 11, 0.1);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 40px auto;
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(14, 26, 46, 0.98), rgba(8, 16, 29, 0.96));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0%, rgba(56, 189, 248, 0.08) 58%, transparent 100%);
  pointer-events: none;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 720px;
}

.hero p {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.08rem;
}

.status-pill {
  padding: 10px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  background: rgba(56, 189, 248, 0.1);
  color: #d7f3ff;
  border: 1px solid rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(12px);
}

.status-pill::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-warm);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.8);
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

#app-section {
  grid-column: 1 / -1;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 28px;
  backdrop-filter: blur(10px);
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 25%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.panel h2,
.panel h3 {
  margin-top: 0;
  letter-spacing: -0.03em;
  color: var(--text);
}

label {
  display: block;
  margin-bottom: 16px;
  font-weight: 600;
  color: #ebf3ff;
}

input,
select,
textarea,
button {
  width: 100%;
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  font: inherit;
}

input,
select,
textarea {
  background: rgba(5, 12, 22, 0.96);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 1rem;
}

input::placeholder,
textarea::placeholder {
  color: #6f85a3;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #03111d;
  border: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 14px 30px rgba(14, 165, 233, 0.22);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(14, 165, 233, 0.28);
}

button.secondary {
  background: rgba(141, 164, 197, 0.12);
  color: var(--text);
  border: 1px solid rgba(141, 164, 197, 0.18);
  box-shadow: none;
}

.banner {
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.18);
  color: var(--text);
  font-weight: 500;
}

.banner[data-state='error'] {
  background: rgba(255, 122, 122, 0.1);
  border-color: rgba(255, 122, 122, 0.2);
  color: var(--danger);
}

.user-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar-block {
  display: flex;
  align-items: end;
  gap: 12px;
}

.toolbar-field {
  min-width: 220px;
  margin-bottom: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.admin-grid section {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 31, 52, 0.96), rgba(11, 21, 36, 0.96));
}

.admin-overview {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 31, 52, 0.96), rgba(11, 21, 36, 0.96));
  margin-bottom: 24px;
}

.employee-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.employee-card,
.employee-empty {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 6px;
}

.employee-card strong {
  color: var(--text);
}

.employee-card span,
.employee-empty {
  color: var(--muted);
  line-height: 1.55;
}

#shift-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.shift-card,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.shift-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
  background: var(--surface-strong);
}

.shift-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.shift-card span,
.shift-card p,
.helper-text {
  color: var(--muted);
  line-height: 1.65;
}

.shift-card strong,
#user-name,
#user-role,
.panel h2,
.panel h3 {
  color: var(--text);
}

.shift-card p {
  margin: 10px 0 0;
}

#auth-section {
  align-self: start;
}

#auth-section .helper-text {
  margin-bottom: 22px;
  font-size: 1rem;
}

.empty-state {
  text-align: center;
  color: var(--muted);
}

#auth-section,
#app-section {
  animation: fadeUp 0.45s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 840px) {
  .hero,
  .list-head,
  .toolbar-block,
  .shift-card div {
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100%, calc(100% - 20px));
    margin: 20px auto;
  }

  .hero,
  .panel {
    padding: 22px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-block {
    flex-wrap: wrap;
  }
}

@media (max-width: 980px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}
