:root {
  --auth-bg: #f8fafc;
  --auth-primary: #4361ee;
  --info: #3a0ca3;
  --auth-text-muted: #6b7280;
  --auth-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --auth-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --auth-pattern: radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%);
  /* Content */
  --page-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --sidebar-text: rgba(255, 255, 255, 0.9);
  --sidebar-border: rgba(255, 255, 255, 0.2);
  --logo-start: #60a5fa;
  --logo-end: #3b82f6;
  --sidebar-end: #1e3a8a;
  --sidebar-start: #3b82f6;
}
body {
  font-family: Kodchasan, sans-serif;
}
.auth-container {
  background: linear-gradient(135deg, var(--auth-primary) 0%, var(--info) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 480px;
  box-shadow: var(--auth-shadow);
  position: relative;
  background: var(--auth-bg);
  border-radius: 1.5rem;
  padding: 3rem;
  overflow: hidden;
  animation: 0.6s ease-out 0s 1 normal none running authCardSlideUp;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  height: 4px;
  background: var(--auth-gradient);
}
.form-divider {
  text-align: center;
  position: relative;
  margin: 1rem 0px;
}
.form-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0px;
  right: 0px;
  height: 1px;
  background: var(--color-border);
}
.form-divider span {
  font-size: 0.875rem;
  position: relative;
  padding: 0px 1rem;
  background-color: var(--auth-bg);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.auth-logo {
  line-height: 1;
}
.auth-logo:before {
  font-size: 4rem;
}
.auth-header img {
  height: 80px;
  animation: 3s ease-in-out 0s infinite normal none running logoFloat;
}
.auth-header h1 {
  font-size: 2rem;
  font-weight: 600;
  background: var(--auth-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--auth-text);
}
.auth-card a {
  color: var(--auth-primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: 0.2s;
}
.auth-card .login-message {
  color: var(--auth-text-muted);
  margin: 0;
  text-align: center;
}
.auth-card fieldset {
  flex-direction: column;
  margin-bottom: 0 !important;
}
@keyframes authCardSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes loginErrorPop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
  100% {
    transform: translateX(0);
  }
}
@media (max-width: 480px) {
  .auth-container {
    padding: 0;
  }
  .auth-card {
    padding: 2rem;
    max-width: none;
    min-height: 100vh;
    border-radius: 0;
  }
}
.auth-card .login-message.error {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.6rem 1rem;
  margin: 0 0 1rem 0;
  color: #7f1d1d;
  /* darker red for text */
  background-color: #fee2e2;
  /* light red background */
  border: 1px solid #fecaca;
  /* subtle border */
  border-radius: 0.5rem;
  box-shadow: 0 6px 18px rgba(127, 29, 29, 0.06);
  font-weight: 600;
  animation: loginErrorPop 240ms ease-out, shake 0.6s ease-in-out;
  text-align: center;
}
/* Add an icon before the message for quick visual recognition */
.auth-card .login-message.error::before {
  content: "⚠️";
  display: inline-block;
  font-size: 1.05rem;
  line-height: 1;
}
/* Content */
.header .top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background-color: #eee;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 15px;
}
.sidemenu-toggle {
  margin-left: auto;
}
.sidemenu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: currentColor;
}
.logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(45deg, var(--logo-start), var(--logo-end));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  flex-shrink: 0;
}
.nav-tools {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}
.sidebar .sidemenu {
  padding: 20px 0;
}
.main-content {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  min-height: 100vh;
  background: var(--main-bg);
  transition: margin-left 0.3s ease;
}
.main-content > footer > p,
.content:not(.api-component) {
  padding: 20px;
  margin: 0;
}
@media (min-width: 769px) {
  .main-content {
    margin-left: var(--menu-width);
  }
  .sidemenu-close .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }
  .sidemenu-close .sidebar-header {
    padding-left: 10px;
    padding-right: 10px;
  }
  .sidemenu-close .menu-toggle {
    color: var(--color-text);
  }
  .sidemenu-close .logo-text {
    display: none;
  }
}
@media (max-width: 768px) {}
/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--sidebar-start) 0%, var(--sidebar-end) 100%);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
  color: var(--sidebar-text);
}
/* Content */
form > fieldset > legend,
.card-groups > section > h2 {
  border-bottom: var(--button-border-width) solid var(--color-border);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-2);
  font-size: var(--font-size-3xl);
}
.card-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}
/* 404 Page */
.error-404-page {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
/* Animated background pattern */
.error-404-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  animation: backgroundShift 20s ease infinite;
  z-index: 0;
}
@keyframes backgroundShift {
  0%, 100% {
    opacity: 1;
    transform: rotate(0deg);
  }
  50% {
    opacity: 0.8;
    transform: rotate(180deg);
  }
}
.error-404-container {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2rem;
  max-width: 600px;
  animation: errorCardSlideUp 0.8s ease-out;
}
@keyframes errorCardSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.error-404-code {
  font-size: 8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
  text-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}
.error-404-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  animation: fadeInDown 0.8s ease-out 0.2s both;
}
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.error-404-message {
  font-size: 1.125rem;
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.error-404-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}
.error-404-actions .btn {
  min-width: 150px;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.error-404-actions .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}
.error-404-actions .btn:hover::before {
  width: 300px;
  height: 300px;
}
.error-404-actions .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.error-404-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}
.error-404-actions .btn.outline {
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea;
}
.error-404-actions .btn.outline:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}
/* Responsive design */
@media (max-width: 768px) {
  .error-404-code {
    font-size: 6rem;
  }
  .error-404-title {
    font-size: 2rem;
  }
  .error-404-message {
    font-size: 1rem;
  }
  .error-404-container {
    padding: 2rem 1.5rem;
    border-radius: 1.5rem;
  }
  .error-404-actions {
    flex-direction: column;
  }
  .error-404-actions .btn {
    width: 100%;
  }
}
.user-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}
.stat-card {
  background-color: var(--card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--card-border-radius);
  padding: var(--space-4);
  box-shadow: var(--card-shadow);
}
.stat-header {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
}
.stat-header::before {
  font-size: 2em;
  margin-right: 0;
  width: 1.5em;
  height: 1.5em;
  color: #fff;
  border-radius: var(--card-border-radius);
}
.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-change {
  font-size: 0.875rem;
}
.stat-card.positive .stat-change {
  color: var(--color-success);
}
.stat-card.negative .stat-change {
  color: var(--color-error);
}
.stat-card:nth-child(4n+1) {
  background-color: #dcfce7;
  color: #22c55e;
}
.stat-card:nth-child(4n+1) .stat-header:before {
  background-color: #22c55e;
}
.stat-card:nth-child(4n+2) {
  background-color: #dbeafe;
  color: #3b82f6;
}
.stat-card:nth-child(4n+2) .stat-header:before {
  background-color: #3b82f6;
}
.stat-card:nth-child(4n+3) {
  background-color: #ffedd5;
  color: #f97316;
}
.stat-card:nth-child(4n+3) .stat-header:before {
  background-color: #f97316;
}
.stat-card:nth-child(4n+4) {
  background-color: #fee2e2;
  color: #ef4444;
}
.stat-card:nth-child(4n+4) .stat-header:before {
  background-color: #ef4444;
}
img.avatar {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
}