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

:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #22c55e;
  --primary-soft: #dcfce7;
  --bg-sidebar: #06281a;
  --bg-sidebar-active: #0e3d27;
  --bg-page: #f3f6f4;
  --bg-card: #ffffff;
  --text-dark: #14241c;
  --text-muted: #5b6b63;
  --text-light: #eafaf0;
  --border: #e1e8e3;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(6, 40, 26, 0.05), 0 8px 24px rgba(6, 40, 26, 0.06);
  --shadow-hover: 0 4px 10px rgba(6, 40, 26, 0.07), 0 14px 32px rgba(6, 40, 26, 0.1);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
}

/* ---------- Auth pages (login/register) ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    display: none;
  }
}

.auth-hero {
  background: radial-gradient(circle at 30% 20%, #0e3d27 0%, #06281a 60%, #03150d 100%);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
}

.auth-hero .badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--primary-light);
  color: var(--primary-light);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  width: fit-content;
  margin-bottom: 24px;
}

.auth-hero h1 {
  font-size: 42px;
  line-height: 1.15;
  margin: 0 0 16px;
}

.auth-hero h1 span {
  color: var(--primary-light);
}

.auth-hero p {
  color: #b7d8c5;
  font-size: 16px;
  max-width: 420px;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.brand h2 {
  margin: 0;
  font-size: 20px;
}

.brand span {
  color: var(--primary);
}

.auth-panel h3 {
  font-size: 26px;
  margin: 0 0 4px;
}

.auth-panel .subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fafdfb;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-dark);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.portal-switch {
  display: flex;
  gap: 8px;
  background: #f0f4f1;
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 22px;
}

.portal-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.portal-btn.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(6, 40, 26, 0.1);
}

.portal-icon {
  font-size: 15px;
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 600;
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 18px;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert-success {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.hidden {
  display: none !important;
}

/* ---------- App shell (sidebar + content) ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  color: var(--text-light);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar .brand {
  margin-bottom: 28px;
  padding: 0 8px;
}

.sidebar .brand h2 {
  color: #fff;
  font-size: 18px;
}

.sidebar .brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9fc7af;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #c9e6d3;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.nav-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.nav-link .badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}

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

.main {
  flex: 1;
  padding: 28px 36px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.topbar p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .count {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #cdeada;
}

.tool-card .tool-icon {
  height: 110px;
  background: linear-gradient(135deg, var(--primary-soft), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  color: var(--primary-dark);
  font-weight: 800;
}

.tool-card .tool-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
}

.tool-card .tool-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tool-card h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.tool-card p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.tool-card .tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-success {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.badge-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-expired,
.badge-rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:hover td {
  background: #fafdfb;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 40, 26, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal h3 {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

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

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.proof-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-dark);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow-hover);
  z-index: 100;
  animation: toast-in 0.2s ease;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--primary-dark);
}
