:root {
  --at-green: #16a34a;
  --at-green-dark: #15803d;
  --at-orange: #f97316;
  --at-dark: #101828;
  --at-sidebar: #101b2a;
  --at-bg: #f5f7fa;
  --at-card: #ffffff;
  --at-text: #111827;
  --at-muted: #667085;
  --at-border: #e5e7eb;
  --at-radius: 16px;
  --at-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.at-auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  background: #fff;
}

.at-auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 56px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(16, 24, 40, 0.1), rgba(16, 24, 40, 0.86)),
    radial-gradient(circle at 20% 20%, rgba(22, 163, 74, 0.9), transparent 32%),
    linear-gradient(135deg, #0f5132, #14213d);
}

.at-auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
}

.at-auth-visual > div {
  position: relative;
  max-width: 560px;
}

.at-auth-visual h1 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.04;
  margin: 16px 0;
  letter-spacing: -0.04em;
}

.at-auth-visual p {
  font-size: 17px;
  color: rgba(255,255,255,.82);
  max-width: 480px;
}

.at-auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.at-auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #fbfcfd;
}

.at-auth-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--at-border);
  border-radius: 22px;
  box-shadow: var(--at-shadow);
  padding: 34px;
}

.at-auth-card-wide {
  width: min(520px, 100%);
}

.at-logo {
  display: inline-flex;
  align-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--at-green-dark);
  margin-bottom: 22px;
}

.at-auth-card h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--at-text);
}

.at-muted,
.at-auth-card .at-muted {
  color: var(--at-muted);
  margin: 8px 0 22px;
}

.at-form {
  display: grid;
  gap: 15px;
}

.at-form label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 700;
  font-size: 13px;
}

.at-form input,
.at-form select,
.at-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--at-border);
  background: #fff;
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--at-text);
  outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}

.at-form input:focus,
.at-form select:focus,
.at-form textarea:focus {
  border-color: rgba(22, 163, 74, .55);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .12);
}

.at-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.at-form-row a,
.at-auth-footer a {
  color: var(--at-green-dark);
  font-weight: 800;
}

.at-checkbox {
  display: flex !important;
  align-items: center;
  grid-template-columns: auto 1fr;
  gap: 8px !important;
  font-weight: 600 !important;
}

.at-checkbox input {
  width: auto;
  min-height: auto;
}

.at-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none !important;
}

.at-btn-primary {
  background: var(--at-green);
  color: #fff !important;
}

.at-btn-primary:hover {
  background: var(--at-green-dark);
}

.at-auth-footer {
  margin: 22px 0 0;
  color: var(--at-muted);
  text-align: center;
}

.at-auth-simple {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--at-bg);
}

.at-notice {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 16px 0;
  font-weight: 700;
}

.at-notice-error {
  background: #fef2f2;
  color: #b42318;
  border: 1px solid #fecaca;
}

.at-app-shell {
  min-height: 100vh;
  display: block;
  background: var(--at-bg);
}

.at-sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--at-sidebar-width, 280px);
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #101b2a, #0d1725);
  color: #fff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.at-sidebar-logo {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.at-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
  border-radius: 16px;
}

.at-user-card strong,
.at-user-card span {
  display: block;
}

.at-user-card strong {
  font-size: 14px;
}

.at-user-card span {
  color: rgba(255,255,255,.62);
  font-size: 12px;
  margin-top: 2px;
}

.at-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--at-sidebar);
  font-weight: 900;
}

.at-sidebar-nav {
  display: grid;
  gap: 6px;
}

.at-sidebar-nav a,
.at-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.78) !important;
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
}

.at-sidebar-nav a:hover,
.at-sidebar-nav a.is-active {
  background: var(--at-green);
  color: #fff !important;
}

.at-logout {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,.1);
}

.at-main-panel {
  min-height: 100vh;
  margin-left: var(--at-sidebar-width, 280px);
  padding: 34px;
  overflow: hidden;
}

.at-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.at-topbar h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.04em;
  color: var(--at-text);
}

.at-topbar p {
  margin: 6px 0 0;
  color: var(--at-muted);
}

.at-pill {
  display: inline-flex;
  padding: 9px 12px;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--at-green-dark);
  font-weight: 900;
  font-size: 13px;
}

.at-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.at-stat-card,
.at-card {
  background: var(--at-card);
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.at-stat-card {
  padding: 20px;
}

.at-stat-card span,
.at-stat-card small {
  display: block;
  color: var(--at-muted);
}

.at-stat-card strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin: 12px 0;
  color: var(--at-text);
}

.at-stat-card small {
  color: var(--at-green-dark);
  font-weight: 900;
}

.at-dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}

.at-card {
  padding: 24px;
}

.at-card h2 {
  margin: 0 0 10px;
  color: var(--at-text);
  letter-spacing: -0.02em;
}

.at-card p {
  color: var(--at-muted);
  margin: 0;
}

.at-placeholder-card {
  max-width: 820px;
}

.at-next-box {
  margin-top: 20px;
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

@media (max-width: 980px) {
  .at-auth-page {
    grid-template-columns: 1fr;
  }

  .at-auth-visual {
    min-height: 360px;
  }

  .at-app-shell {
    display: block;
  }

  .at-sidebar {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: auto;
  }

  .at-main-panel {
    margin-left: 0;
  }

  .at-stats-grid,
  .at-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .at-main-panel {
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .at-auth-visual,
  .at-auth-panel,
  .at-auth-card,
  .at-main-panel {
    padding: 22px;
  }

  .at-topbar {
    flex-direction: column;
  }
}


/* AgroTrader custom logo */
.at-logo {
  margin-bottom: 24px;
}

.at-logo img {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
}

.at-sidebar-logo {
  background: transparent;
  padding: 4px 0 2px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.at-sidebar-logo img {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Paid access / notifications */
.at-menu-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f97316;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.at-locked-card {
  max-width: 760px;
  border-color: #fed7aa;
  background: #fffaf5;
}

.at-locked-card h2 {
  color: #9a3412;
}

.at-notification-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.at-notification-item {
  padding: 16px;
  border: 1px solid var(--at-border);
  border-radius: 14px;
  background: #fff;
}

.at-notification-item strong,
.at-notification-item small {
  display: block;
}

.at-notification-item small {
  color: var(--at-muted);
  margin-top: 4px;
}

.at-notification-item p {
  margin-top: 10px;
}

/* Product module */
.at-notice-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.at-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.at-form-grid label,
.at-filter-form label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 800;
  font-size: 13px;
}

.at-form-grid input,
.at-form-grid select,
.at-form-grid textarea,
.at-filter-form input,
.at-filter-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--at-border);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--at-text);
  outline: none;
}

.at-form-grid textarea {
  resize: vertical;
}

.at-form-full {
  grid-column: 1 / -1;
}

.at-form-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.at-card-header,
.at-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.at-card-header h2,
.at-results-head h2 {
  margin: 0;
}

.at-table-wrap {
  overflow-x: auto;
}

.at-data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.at-data-table th,
.at-data-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--at-border);
  text-align: left;
  vertical-align: top;
}

.at-data-table th {
  color: var(--at-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.at-data-table small {
  color: var(--at-muted);
}

.at-search-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  align-items: start;
}

.at-search-panel {
  position: sticky;
  top: 24px;
}

.at-filter-form {
  display: grid;
  gap: 13px;
}

.at-filter-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.at-btn-light {
  background: #f8fafc;
  color: var(--at-text) !important;
  border: 1px solid var(--at-border);
}

.at-product-list {
  display: grid;
  gap: 14px;
}

.at-product-card {
  display: grid;
  grid-template-columns: 104px 1fr auto;
  gap: 16px;
  align-items: center;
}

.at-product-thumb {
  width: 104px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  background: #eef2f7;
  display: grid;
  place-items: center;
  color: var(--at-green-dark);
  font-size: 34px;
  font-weight: 900;
}

.at-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.at-product-info h3 {
  margin: 0 0 3px;
  color: var(--at-text);
  font-size: 20px;
}

.at-product-info p {
  margin: 0 0 8px;
}

.at-product-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  color: var(--at-muted);
  font-size: 13px;
}

.at-product-meta strong {
  color: var(--at-text);
}

.at-quality {
  margin-top: 8px !important;
  color: var(--at-muted);
}

.at-product-info small {
  display: block;
  margin-top: 8px;
  color: var(--at-muted);
}

.at-product-actions {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.at-status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.at-status-sold {
  background: #e0e7ff;
  color: #3730a3;
}

.at-status-cancelled {
  background: #f3f4f6;
  color: #374151;
}

@media (max-width: 1100px) {
  .at-search-layout {
    grid-template-columns: 1fr;
  }

  .at-search-panel {
    position: relative;
    top: auto;
  }
}

@media (max-width: 720px) {
  .at-form-grid,
  .at-product-card,
  .at-product-meta,
  .at-filter-two {
    grid-template-columns: 1fr;
  }

  .at-product-thumb {
    width: 100%;
    height: 160px;
  }

  .at-card-header,
  .at-results-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
