@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #11468f;
  --primary-dark: #0b2f5c;
  --accent: #f0b429;
  --bg: #f8f9fc;
  --card-bg: #ffffff;
  --text: #1f2a37;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

body.login-page {
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: linear-gradient(145deg, rgba(17, 70, 143, 0.08), rgba(240, 180, 41, 0.08));
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

.sidebar {
  width: 280px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 0;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar__brand {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar__brand::before {
  content: '🎓';
  font-size: 1.8rem;
}

.sidebar__nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  flex: 1;
}

.sidebar__nav li {
  margin: 0;
}

.sidebar__nav a {
  padding: 14px 18px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
  position: relative;
  text-decoration: none;
}

.sidebar__nav a::before {
  content: '';
  width: 4px;
  height: 0;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: height 0.3s ease;
}

.sidebar__nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateX(4px);
  padding-left: 22px;
}

.sidebar__nav a.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar__nav a.active::before {
  height: 60%;
}

.sidebar__nav a.active:hover {
  transform: translateX(0);
  padding-left: 18px;
}

/* Icon untuk menu items */
.sidebar__nav a[href*="index"]::after {
  content: '📊';
  font-size: 1.3rem;
}

.sidebar__nav a[href*="data-siswa"]::after {
  content: '👥';
  font-size: 1.3rem;
}

.sidebar__nav a[href*="tambah-siswa"]::after {
  content: '➕';
  font-size: 1.3rem;
}

.sidebar__nav a::after {
  margin-left: auto;
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sidebar__nav a:hover::after,
.sidebar__nav a.active::after {
  opacity: 1;
  transform: scale(1.1);
}

/* Sidebar Footer */
.sidebar__footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
  margin-top: auto;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.sidebar__user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.sidebar__logout::before {
  content: '🚪';
  font-size: 1.2rem;
}

.sidebar__logout:hover {
  background: rgba(220, 38, 38, 0.3);
  color: #fff;
  transform: translateX(4px);
}

.layout {
  margin-left: 280px;
  padding: 32px;
  width: calc(100% - 280px);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 600;
}

.page-actions {
  display: flex;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(17, 70, 143, 0.12);
}

.btn-edit-status {
  transition: all 0.2s ease;
}

.btn-edit-status:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 70, 143, 0.3);
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric__label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.metric__value {
  font-size: 2rem;
  font-weight: 700;
}

.progress {
  width: 100%;
  height: 8px;
  background: #e1e7ff;
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

th {
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

tr:hover td {
  background: #f1f5f9;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(240, 180, 41, 0.18);
  color: #b45309;
}

.badge-info {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
}

.filter-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-group input,
.filter-group select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  font-size: 0.95rem;
  min-width: 180px;
}

.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.form-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-control label {
  font-size: 0.92rem;
  font-weight: 600;
}

.form-control input,
.form-control select,
.form-control textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.95rem;
  background: #fff;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.detail-item {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.detail-item span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.detail-item strong {
  font-size: 1.05rem;
}

.timeline {
  border-left: 2px solid var(--border);
  padding-left: 18px;
  margin-top: 12px;
}

.timeline__item {
  margin-bottom: 18px;
  position: relative;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline__title {
  font-weight: 600;
}

.timeline__date {
  font-size: 0.85rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 1.1rem;
  margin-top: 8px;
}

.login-card {
  width: min(960px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  background: var(--card-bg);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 35px 80px rgba(15, 32, 68, 0.15);
}

.login-card__hero {
  background: var(--primary);
  color: #fff;
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-card__hero h2 {
  font-size: 2rem;
  line-height: 1.3;
}

.login-card__stats {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.login-card__stats span {
  display: block;
  font-size: 0.9rem;
  opacity: 0.85;
}

.login-card__form {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.login-card__form h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.login-card__form p {
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-form label {
  font-weight: 600;
  margin-bottom: 6px;
}

.login-form input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  background: #fff;
}

.login-form button {
  width: 100%;
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 18px 35px rgba(13, 71, 161, 0.25);
  transition: transform 0.15s ease;
}

.login-form button:hover {
  transform: translateY(-1px);
}

.login-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-meta a {
  color: var(--primary);
  font-weight: 600;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 1001;
}

.mobile-menu-toggle:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* Alert Messages */
.alert {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

.alert-error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.alert-success {
  background: #efe;
  color: #3a3;
  border: 1px solid #cfc;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Smooth Transitions */
* {
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* Better Focus States */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Improved Card Hover */
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.card img {
  transition: transform 0.3s ease;
}

.card:hover img {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .card img {
    height: 200px !important;
  }
}

/* Better Table Responsiveness */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 1000;
    transition: left 0.3s ease;
    height: 100vh;
    overflow-y: auto;
  }

  .sidebar.active {
    left: 0;
  }

  .mobile-menu-toggle {
    display: block;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .layout {
    margin-left: 0;
    width: 100%;
    padding: 24px 18px 48px;
  }

  .page-header {
    margin-top: 60px;
  }
}

@media (max-width: 768px) {
  .login-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-card__hero {
    padding: 32px 24px;
  }

  .login-card__form {
    padding: 32px 24px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-actions {
    width: 100%;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .metric__value {
    font-size: 1.6rem;
  }
}

@media (max-width: 640px) {
  .page-actions {
    width: 100%;
  }

  .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  table {
    min-width: 100%;
    font-size: 0.85rem;
  }

  th, td {
    padding: 10px 12px;
  }

  .card {
    padding: 18px;
  }

  .page-title {
    font-size: 1.4rem;
  }
}

