/* ============================================================
   SI JADWAL — Pastel Warm Flat UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:wght@400;500&display=swap');

:root {
  /* Warna Utama */
  --cream:       #FFF8F0;
  --warm-white:  #FFFCF8;
  --sand:        #F5ECD7;
  --sand-dark:   #EAD9BE;

  /* Aksen Pastel */
  --coral:       #FF8B6B;
  --coral-light: #FFD4C8;
  --coral-dark:  #E8734F;
  --peach:       #FFBE8A;
  --peach-light: #FFE5CC;
  --mint:        #7DC9B0;
  --mint-light:  #C8EDE4;
  --sky:         #7BB8E8;
  --sky-light:   #C8E2F7;
  --lilac:       #B09ADE;
  --lilac-light: #DDD4F5;
  --butter:      #F5D778;
  --butter-light:#FBF0C0;

  /* Teks */
  --text-dark:   #3D2B1F;
  --text-mid:    #7A5C4A;
  --text-soft:   #B09080;
  --text-white:  #FFFCF8;

  /* Sidebar */
  --sidebar-bg:  #3D2B1F;
  --sidebar-w:   240px;

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(61,43,31,.08);
  --shadow-md:   0 4px 16px rgba(61,43,31,.12);
  --shadow-lg:   0 8px 32px rgba(61,43,31,.16);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Transition */
  --t: .18s ease;
}

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

html { font-size: 15px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

a { text-decoration: none; color: inherit; }

/* ============================================================
   LAYOUT — SIDEBAR + MAIN
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--t);
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand .logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand .logo-icon {
  width: 38px; height: 38px;
  background: var(--coral);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand .logo-text {
  color: var(--text-white);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: .5px;
}

.sidebar-brand .logo-sub {
  color: var(--text-soft);
  font-size: .72rem;
  margin-top: 2px;
  letter-spacing: .3px;
}

.sidebar-ta-badge {
  margin: 12px 16px 0;
  background: rgba(255,255,255,.07);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: .75rem;
  color: var(--peach-light);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
}

.sidebar-ta-badge span {
  display: block;
  color: var(--text-soft);
  font-weight: 400;
  font-size: .68rem;
  margin-bottom: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-group-label {
  font-size: .65rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 12px 8px 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.65);
  font-size: .88rem;
  font-weight: 500;
  transition: all var(--t);
  margin-bottom: 2px;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: var(--text-white);
}

.nav-item.active {
  background: var(--coral);
  color: var(--text-white);
  font-weight: 600;
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.75);
  font-size: .82rem;
}

.sidebar-user .avatar {
  width: 32px; height: 32px;
  background: var(--peach);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-dark);
  flex-shrink: 0;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: rgba(255,139,107,.15);
  color: var(--coral-light);
  font-size: .82rem;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background var(--t);
}
.btn-logout:hover { background: rgba(255,139,107,.28); }

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--warm-white);
  border-bottom: 2px solid var(--sand);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}

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

.page-content {
  padding: 28px;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--warm-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--sand);
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1.5px solid var(--sand);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--warm-white);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.card-body {
  padding: 20px 24px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: .85rem;
  border: none;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}

.btn-primary {
  background: var(--coral);
  color: white;
}
.btn-primary:hover { background: var(--coral-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-secondary {
  background: var(--sand);
  color: var(--text-dark);
}
.btn-secondary:hover { background: var(--sand-dark); }

.btn-success {
  background: var(--mint);
  color: white;
}
.btn-success:hover { background: #62B096; }

.btn-warning {
  background: var(--butter);
  color: var(--text-dark);
}
.btn-warning:hover { background: #E8C95F; }

.btn-danger {
  background: #FFB3B3;
  color: #C0392B;
}
.btn-danger:hover { background: #FF9494; }

.btn-info {
  background: var(--sky-light);
  color: #2471A3;
}
.btn-info:hover { background: var(--sky); color: white; }

.btn-sm {
  padding: 5px 12px;
  font-size: .78rem;
}

.btn-icon {
  padding: 7px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1.5px solid var(--sand-dark);
  cursor: pointer;
  color: var(--text-mid);
  transition: all var(--t);
  font-size: .9rem;
}
.btn-icon:hover { background: var(--sand); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: .82rem;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--sand-dark);
  border-radius: var(--r-sm);
  background: var(--warm-white);
  color: var(--text-dark);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}

.form-control:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-light);
}

.form-control::placeholder { color: var(--text-soft); }

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A5C4A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-row {
  display: grid;
  gap: 16px;
}
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-hint {
  font-size: .75rem;
  color: var(--text-soft);
  margin-top: 4px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

table.data-table thead th {
  background: var(--sand);
  color: var(--text-mid);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--sand-dark);
}

table.data-table tbody tr {
  border-bottom: 1px solid var(--sand);
  transition: background var(--t);
}

table.data-table tbody tr:hover {
  background: var(--cream);
}

table.data-table tbody td {
  padding: 11px 14px;
  color: var(--text-dark);
  vertical-align: middle;
}

table.data-table tbody tr:last-child {
  border-bottom: none;
}

/* ============================================================
   BADGES & CHIPS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.badge-coral   { background: var(--coral-light);  color: #C0442A; }
.badge-mint    { background: var(--mint-light);   color: #1E8C6A; }
.badge-sky     { background: var(--sky-light);    color: #1A5F9E; }
.badge-lilac   { background: var(--lilac-light);  color: #5B3FA0; }
.badge-butter  { background: var(--butter-light); color: #8B6A00; }
.badge-sand    { background: var(--sand);         color: var(--text-mid); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61,43,31,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--warm-white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px);
  transition: transform var(--t);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1.5px solid var(--sand);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--sand);
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mid);
  transition: background var(--t);
}
.modal-close:hover { background: var(--coral-light); color: var(--coral-dark); }

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1.5px solid var(--sand);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   ALERTS & TOASTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: .87rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: var(--mint-light); color: #1E8C6A; }
.alert-danger   { background: #FFD4CC; color: #C0392B; }
.alert-warning  { background: var(--butter-light); color: #8B6A00; }
.alert-info     { background: var(--sky-light); color: #1A5F9E; }

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--text-dark);
  color: var(--text-white);
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: .87rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  animation: slideUp .25s ease;
  pointer-events: all;
}

.toast.success { background: var(--mint); }
.toast.error   { background: #E05050; }
.toast.warning { background: var(--peach); color: var(--text-dark); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--warm-white);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1.5px solid var(--sand);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: .78rem;
  color: var(--text-soft);
  font-weight: 500;
}

/* ============================================================
   WARNA CHIP (untuk mapel)
   ============================================================ */
.color-dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.color-picker-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--t), border-color var(--t);
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--text-dark); transform: scale(1.1); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-soft);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: .6;
}

.empty-state p {
  font-size: .9rem;
  margin-bottom: 16px;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-wrap {
  position: relative;
}

.search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  font-size: .9rem;
  pointer-events: none;
}

.search-wrap input {
  padding-left: 36px;
}

/* ============================================================
   TOGGLE / SWITCH
   ============================================================ */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--sand-dark);
  border-radius: 22px;
  transition: background var(--t);
}

.slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t);
}

input:checked + .slider { background: var(--mint); }
input:checked + .slider::before { transform: translateX(18px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-dark);
  padding: 4px 8px;
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }

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

  .main-content {
    margin-left: 0;
  }

  .hamburger { display: block; }

  .page-content { padding: 16px; }

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

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

/* ============================================================
   UTILITIES
   ============================================================ */
.d-flex   { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8    { gap: 8px; }
.gap-12   { gap: 12px; }
.gap-16   { gap: 16px; }
.mt-4     { margin-top: 4px; }
.mt-8     { margin-top: 8px; }
.mt-16    { margin-top: 16px; }
.mt-24    { margin-top: 24px; }
.mb-16    { margin-bottom: 16px; }
.mb-24    { margin-bottom: 24px; }
.text-sm  { font-size: .82rem; }
.text-soft{ color: var(--text-soft); }
.text-mid { color: var(--text-mid); }
.fw-600   { font-weight: 600; }
.fw-700   { font-weight: 700; }
.w-100    { width: 100%; }
.text-center { text-align: center; }
.separator { height: 1px; background: var(--sand); margin: 16px 0; }
