:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eaf0ff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #1d4ed8;
  --primary-soft: #dbeafe;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --border: #d6dce8;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(140deg, #eff6ff, #f8fafc 45%, #eef2ff);
  color: var(--text);
  min-height: 100vh;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: #0f172a;
  color: #dbe4ff;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.brand {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: 0.3px;
}

.brand span {
  color: #93c5fd;
}

.nav-links {
  list-style: none;
  display: grid;
  gap: 8px;
}

.nav-links a {
  display: block;
  text-decoration: none;
  color: #dbe4ff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
  background: #1e293b;
  color: #ffffff;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.menu-btn {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.hero p {
  color: var(--muted);
  line-height: 1.5;
}

.btn-row {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn.secondary {
  background: var(--surface-2);
  color: var(--primary);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.metric {
  font-size: 1.75rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.chip.success {
  background: #dcfce7;
  color: var(--success);
}

.chip.warn {
  background: #ffedd5;
  color: var(--warning);
}

.chip.danger {
  background: #fee2e2;
  color: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.92rem;
}

th {
  background: #f8fafc;
  color: #334155;
}

.form {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
  display: block;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  background: #ffffff;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  min-height: 72px;
  padding: 8px;
  font-size: 0.82rem;
}

.day.present {
  background: #dcfce7;
}

.day.absent {
  background: #fee2e2;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar {
  display: grid;
  gap: 6px;
}

.bar-track {
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.center {
  text-align: center;
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.5);
  z-index: 900;
}

@media (max-width: 960px) {
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .menu-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .overlay.show {
    display: block;
  }

  .content {
    padding: 18px;
  }

  .grid.cols-3,
  .grid.cols-2,
  .form-row {
    grid-template-columns: 1fr;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--surface);
    padding: 6px 10px;
  }

  td {
    border-bottom: 0;
    padding: 8px 4px;
  }

  td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 3px;
  }
}
