:root {
  --bg: #f4f6fb;
  --text: #1d2939;
  --primary: #1f4db3;
  --danger: #be123c;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}

.auth-wrap {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(900px, 100%);
}

.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}

.topnav {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: #0f172a;
  justify-content: space-between;
  align-items: center;
}

.topnav-pgd {
  background: #164e63;
}

.topnav-pgd a:hover {
  background: #0e7490;
}

.topnav-produksi {
  background: #365314;
}

.topnav-produksi a:hover {
  background: #7c6a0f;
}

.topnav-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topnav a {
  color: #dbeafe;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}

.topnav a:hover {
  background: #1d4ed8;
}

.topnav-right {
  color: #cbd5e1;
  font-size: 14px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 3px 15px rgba(15, 23, 42, 0.07);
  margin-bottom: 14px;
}

.auth-card {
  width: 380px;
}

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

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

input,
select,
button {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  margin-top: 6px;
  margin-bottom: 10px;
}

button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
}

button.danger {
  background: var(--danger);
}

button.picked-btn {
  background: #16a34a;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  padding: 10px;
}

.alert {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
}

.inline-form {
  display: inline;
}

.btn-link {
  text-decoration: none;
  background: #e2e8f0;
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 8px;
}

.btn-link.active {
  background: var(--primary);
  color: #fff;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  max-width: 420px;
  pointer-events: auto;
  animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0;
  transform: translateX(100%);
}

.toast.show {
  animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.toast.hide {
  animation: slideOut 0.3s ease-in forwards;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.toast.success .toast-icon {
  background: #dcfce7;
  color: #166534;
}

.toast.error .toast-icon {
  background: #fee2e2;
  color: #991b1b;
}

.toast.warning .toast-icon {
  background: #fef3c7;
  color: #92400e;
}

.toast.info .toast-icon {
  background: #dbeafe;
  color: #1e40af;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: #64748b;
}

.toast-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 4px;
  transition: all 0.2s;
}

.toast-close:hover {
  background: #f1f5f9;
  color: #475569;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@media (max-width: 768px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .auth-card {
    width: 100%;
  }

  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .topnav {
    align-items: flex-start;
  }

  .toast-container {
    left: 20px;
    right: 20px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}
