@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@700&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  --bg: #f7f3ee;
  --ink: #1d1b18;
  --accent: #1f7a8c;
  --accent-2: #e27d60;
  --paper: #ffffff;
  --muted: #7a6f63;
  --shadow: 0 20px 45px rgba(30, 30, 30, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #f1ece6, #f7f3ee 45%, #f0ece8 70%);
  min-height: 100vh;
}

body.dark {
  --bg: #151311;
  --ink: #f2eee8;
  --accent: #2aa0b3;
  --accent-2: #f08a6b;
  --paper: #1f1d1a;
  --muted: #b6aa9c;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
  background: radial-gradient(circle at top left, #1c1a18, #151311 45%, #11100f 70%);
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(31, 122, 140, 0.14), transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(226, 125, 96, 0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(31, 122, 140, 0.1), transparent 50%);
  z-index: -1;
}

body.dark .backdrop {
  background:
    radial-gradient(circle at 15% 20%, rgba(42, 160, 179, 0.25), transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(240, 138, 107, 0.22), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(42, 160, 179, 0.18), transparent 50%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  position: sticky;
  top: 0;
  background: rgba(247, 243, 238, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark .topbar {
  background: rgba(21, 19, 17, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent);
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.brand-title {
  font-weight: 700;
  font-size: 20px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  position: relative;
  padding-bottom: 4px;
}

.nav a:hover {
  color: var(--accent);
}

.nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
}

.logout {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31, 122, 140, 0.1);
  font-size: 12px;
}

.main {
  padding: 30px 40px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--paper);
  padding: 24px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.card h2,
.card h3,
.card h1 {
  margin-top: 0;
  font-family: 'Libre Baskerville', serif;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: end;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
}

.form-inline {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

input,
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-family: inherit;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btn.ghost {
  background: rgba(31, 122, 140, 0.12);
  color: var(--accent);
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.table.schedule th,
.table.schedule td {
  text-align: center;
  min-width: 32px;
}

.day-head {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.day-num {
  font-weight: 700;
}

.day-name {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}

.day-holiday {
  font-size: 9px;
  color: var(--accent-2);
  text-transform: uppercase;
}

.day-sunday {
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: #d04141;
}

.table.schedule td.sticky,
.table.schedule th.sticky {
  position: sticky;
  left: 0;
  background: var(--paper);
  z-index: 2;
  text-align: left;
}

.table-scroll {
  overflow: auto;
  max-width: 100%;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(226, 125, 96, 0.1);
  border: 1px solid rgba(226, 125, 96, 0.3);
  display: flex;
  gap: 8px;
  align-items: center;
}

.alert.read {
  opacity: 0.7;
}

.mark-read {
  margin-left: auto;
}

.alert-error {
  background: rgba(226, 80, 80, 0.1);
  border-color: rgba(226, 80, 80, 0.3);
}

.alert-list {
  display: grid;
  gap: 10px;
}

.auth {
  display: grid;
  place-items: center;
  min-height: 70vh;
}

.auth-card {
  max-width: 420px;
  width: 100%;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.cell {
  font-weight: 700;
}

.cell.clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cell.clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.work {
  background: rgba(31, 122, 140, 0.1);
  color: var(--accent);
}

.off {
  background: rgba(226, 125, 96, 0.15);
  color: #a44c33;
}


.comp {
  background: rgba(88, 109, 158, 0.15);
  color: #2c3e64;
}

.holiday-off {
  background: rgba(226, 125, 96, 0.2);
  color: #8a412a;
}

.holiday {
  background: rgba(123, 92, 79, 0.15);
  color: #6d4634;
}

.holiday-work {
  background: rgba(240, 201, 98, 0.25);
  color: #7a5a00;
}

.birthday-off {
  background: rgba(250, 177, 65, 0.2);
  color: #8a4e00;
}

.over-limit {
  background: rgba(123, 78, 164, 0.22);
  color: #5b2c8c;
}

.cell.over-limit {
  background: rgba(123, 78, 164, 0.32);
  color: #4b1f79;
  box-shadow: inset 0 0 0 2px rgba(91, 44, 140, 0.35);
}

body.dark .over-limit {
  background: rgba(158, 125, 224, 0.35);
  color: #e2d1ff;
}

body.dark .cell.over-limit {
  background: rgba(158, 125, 224, 0.5);
  color: #f4eaff;
  box-shadow: inset 0 0 0 2px rgba(226, 209, 255, 0.4);
}

.split {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .main {
    padding: 20px;
  }
}
