/* Crop Defenders Automations — minimal, clean, no framework. */
:root {
  --green: #1f8a4c;
  --green-dark: #16683a;
  --bg: #f7f8f7;
  --surface: #ffffff;
  --text: #1a1f1a;
  --muted: #6b7280;
  --border: #e3e6e3;
  --error: #b91c1c;
  --warn: #b45309;
  --success: #14532d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 0 0 8px; }
.muted { color: var(--muted); }

/* Topbar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo {
  background: var(--green);
  color: white;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.logo-lg { width: 56px; height: 56px; font-size: 22px; border-radius: 12px; margin: 0 auto 16px; }
.brand-name em { color: var(--muted); font-style: normal; font-weight: 400; }
.topbar nav { display: flex; align-items: center; gap: 20px; }
.topbar nav a { color: var(--text); font-weight: 500; }
.topbar nav a:hover { color: var(--green); text-decoration: none; }
.user { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--border); }
.user img { width: 28px; height: 28px; border-radius: 50%; }
.logout { font-size: 13px; color: var(--muted); }

/* Container */
.container { max-width: 1100px; margin: 32px auto; padding: 0 32px 80px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.card-link {
  display: block;
  color: var(--text);
  transition: transform .1s ease;
}
.card-link:hover { text-decoration: none; transform: translateY(-2px); }
.card-icon { font-size: 28px; margin-bottom: 12px; }
.card-cta { color: var(--green); font-weight: 600; display: inline-block; margin-top: 12px; }
.card-disabled { opacity: 0.5; cursor: not-allowed; }
.badge {
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: 6px;
  font-weight: 500;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.btn-primary:hover { background: var(--green-dark); color: white; }
.btn-danger { background: var(--surface); color: var(--error); border-color: #f1c5c5; }
.btn-danger:hover { background: #fef2f2; }
.btn-small { padding: 4px 10px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* Forms / dropzone */
.dropzone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: border-color .1s, background .1s;
}
.dropzone:hover, .dropzone.drag-active { border-color: var(--green); background: #f0fdf4; }
.dropzone input[type=file] { display: none; }
.dropzone-icon { font-size: 36px; display: block; margin-bottom: 12px; color: var(--green); }
.dropzone-inner small { color: var(--muted); display: block; margin-top: 4px; }

input[type=text], input[type=email], input:not([type]), textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  background: var(--surface);
}
input:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.data-table input { padding: 6px 8px; }
label { display: block; margin-top: 12px; font-size: 13px; color: var(--muted); }
label input, label textarea { margin-top: 4px; color: var(--text); }
textarea { min-height: 80px; }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafbfa; }

/* Pills */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.pill-success { background: #dcfce7; color: var(--success); }
.pill-warn { background: #fef3c7; color: var(--warn); }
.pill-error { background: #fee2e2; color: var(--error); }

/* Flash */
.flash-stack { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 14px;
}
.flash-success { background: #dcfce7; border-color: #bbf7d0; color: var(--success); }
.flash-error { background: #fee2e2; border-color: #fecaca; color: var(--error); }

/* Login */
.login-card {
  max-width: 380px;
  margin: 64px auto;
  text-align: center;
  background: var(--surface);
  padding: 40px 32px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 22px; margin-bottom: 8px; }

/* Modal */
.modal {
  border: none;
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.modal::backdrop { background: rgba(0,0,0,.4); }

/* Error pages */
.error-page { text-align: center; padding: 64px 0; }
.error-page h1 { font-size: 64px; margin-bottom: 0; color: var(--green); }

/* Misc */
code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
details summary { cursor: pointer; }
