:root {
  --app-bg: #f4f8f3;
  --app-sidebar: #0d2010;
  --app-sidebar-soft: #17351a;
  --app-primary: #38bb29;
  --app-primary-rgb: 56, 187, 41;
  --app-primary-dark: color-mix(in srgb, var(--app-primary) 78%, black);
  --app-primary-soft: color-mix(in srgb, var(--app-primary) 12%, white);
  --app-success-soft: #e8f7ef;
  --app-danger-soft: #fdecec;
  --app-warning-soft: #fff6df;
  --app-text: #1f2937;
  --app-muted: #6b7280;
  --app-border: #e5e7eb;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--app-bg);
  color: var(--app-text);
  font-size: 15px;
}

a {
  text-decoration: none;
}

.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--app-primary);
}

.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .28), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, .18), transparent 25%),
    linear-gradient(135deg, rgba(22, 104, 16, .24), rgba(var(--app-primary-rgb), .72));
}

.auth-page .container {
  position: relative;
  z-index: 2;
}

.particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.auth-brand {
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .18);
}

.auth-brand img,
.app-brand img {
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}

.auth-brand img {
  width: 82px;
  height: 82px;
  padding: 8px;
  margin-bottom: 14px;
  box-shadow: 0 14px 38px rgba(8, 74, 15, .25);
}

.auth-brand-mark,
.brand-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--app-primary-dark);
  font-weight: 800;
}

.auth-brand-mark {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  font-size: 28px;
  margin-bottom: 14px;
  box-shadow: 0 14px 38px rgba(8, 74, 15, .25);
}

.auth-card {
  width: 100%;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(8, 74, 15, .22);
  backdrop-filter: blur(8px);
}

.auth-panel {
  width: 100%;
  max-width: 460px;
}

.captcha-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-code {
  flex: 1;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b8efb1;
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(var(--app-primary-rgb), .14) 0 2px, transparent 2px 8px),
    linear-gradient(135deg, #fbfffb, #eefdff);
  color: #176b10;
  font-family: Consolas, "Courier New", monospace;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 7px;
  text-decoration: line-through;
  user-select: none;
  transform: skew(-3deg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65);
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  width: 280px;
  min-height: 100vh;
  background: var(--app-sidebar);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1030;
}

.app-brand {
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  gap: 10px;
  line-height: 1.15;
}

.app-brand img {
  width: 38px;
  height: 38px;
  padding: 4px;
}

.brand-initial {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 14px;
  flex: 0 0 auto;
}

.app-user {
  padding: 18px 24px;
  color: rgba(255, 255, 255, .78);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.app-user strong {
  color: #fff;
  display: block;
}

.app-nav {
  padding: 16px 12px;
}

.app-nav-title {
  color: rgba(255, 255, 255, .45);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 12px;
}

.app-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .78);
  padding: 11px 12px;
  border-radius: 6px;
  font-weight: 500;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.app-nav a:hover,
.app-nav a.active {
  background: var(--app-sidebar-soft);
  color: #fff;
  transform: translateX(2px);
}

.app-nav a.active .nav-mark {
  background: var(--app-primary);
  box-shadow: 0 0 0 4px rgba(var(--app-primary-rgb), .16);
}

.app-nav .nav-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
}

.app-main {
  margin-left: 280px;
  min-height: 100vh;
}

.app-topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 1010;
}

.app-content {
  padding: 28px;
}

.page-title {
  margin-bottom: 24px;
}

.page-title h1 {
  font-size: 28px;
  margin: 0;
}

.page-title p {
  margin: 6px 0 0;
  color: var(--app-muted);
}

.card,
.app-panel {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.app-panel {
  background: #fff;
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--app-border);
  font-weight: 700;
}

.table th {
  color: #374151;
  font-weight: 700;
  background: #f9fafb;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

.table-hover tbody tr {
  transition: background-color .16s ease;
}

.table-hover tbody tr:hover {
  background: #f8fbff;
}

.form-label {
  font-weight: 600;
}

.badge {
  font-weight: 600;
}

.btn {
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    background-color .16s ease,
    border-color .16s ease,
    color .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-sm {
  min-height: 32px;
}

.btn-light {
  border-color: var(--app-border);
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-dark);
  --bs-btn-hover-border-color: var(--app-primary-dark);
  --bs-btn-active-bg: var(--app-primary-dark);
  --bs-btn-active-border-color: var(--app-primary-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--app-primary-dark);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary);
  --bs-btn-hover-border-color: var(--app-primary);
  --bs-btn-active-bg: var(--app-primary-dark);
  --bs-btn-active-border-color: var(--app-primary-dark);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 .25rem rgba(var(--app-primary-rgb), .2);
}

.form-check-input:checked {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-action {
  min-width: 86px;
}

.btn-icon {
  width: 38px;
  min-width: 38px;
  padding-left: 0;
  padding-right: 0;
}

.btn-soft-primary {
  background: var(--app-primary-soft);
  border-color: #b8efb1;
  color: #176b10;
}

.btn-soft-primary:hover {
  background: #d8f8d4;
  color: #0f4b0b;
}

.btn-soft-danger {
  background: var(--app-danger-soft);
  border-color: #f5c2c7;
  color: #842029;
}

.btn-soft-danger:hover {
  background: #f8d7da;
  color: #58151c;
}

.btn-soft-success {
  background: var(--app-success-soft);
  border-color: #badbcc;
  color: #0f5132;
}

.btn-soft-success:hover {
  background: #d1e7dd;
  color: #0a3622;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.toolbar .search-form {
  flex: 1;
  max-width: 620px;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-card {
  position: relative;
}

.status-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--app-primary), #8be37e);
}

.mobile-menu-btn {
  display: none;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
  }

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

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

  .mobile-menu-btn {
    display: inline-flex;
  }

  .app-content {
    padding: 18px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .search-form {
    max-width: none;
  }

  .table-actions {
    justify-content: flex-start;
  }
}
