:root{
  --bg1:#0b1020;
  --bg2:#101a33;
  --card:#121b36;
  --card2:#0f1730;
  --line:rgba(255,255,255,.08);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.65);
  --good:#2ee59d;
  --warn:#ffcc66;
  --bad:#ff5c7a;
  --primary:#5b8cff;
  --dark:#0c1228;
  --topbar:rgba(10,14,28,.72);
  --inputbg: rgba(8,12,26,.65);
  --surface: rgba(8,12,26,.35);
  --surface2: rgba(8,12,26,.55);
  --modalbg: rgba(8,12,26,.98);
  --toastbg: rgba(20,24,33,.98);
}

*{box-sizing:border-box}
body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 10% 0%, #1b2d67 0%, transparent 60%),
              radial-gradient(900px 600px at 90% 20%, #2b7a63 0%, transparent 60%),
              linear-gradient(180deg, var(--bg1), var(--bg2));
  min-height:100vh;
}

a{color:inherit; text-decoration:none}
.container{max-width:1080px;margin:0 auto;padding:18px}
.topbar{
  position:sticky;top:0;z-index:10;
  background:var(--topbar);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.row{display:flex;gap:12px;align-items:center}
.space{justify-content:space-between}
.right{justify-content:flex-end}
.inline{display:inline-flex;gap:10px;align-items:center}

.brand{display:flex;gap:12px;align-items:center}
.logo{
  width:38px;height:38px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  background:#fff;
  border:1px solid rgba(0,0,0,.06);
  color:#091029;font-weight:900;
  box-shadow: 0 10px 30px rgba(91,140,255,.25);
}
.brandname{font-weight:800;letter-spacing:.2px}
.tag{font-size:12px;color:var(--muted)}

.nav{display:flex;gap:14px;align-items:center}
.navlink{font-size:14px;color:var(--muted)}
.navlink:hover{color:var(--text)}

.themebox{display:flex;align-items:center}
.theme-select{
  width:auto;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  font-size:13px;
}

.card{
  background: linear-gradient(180deg, rgba(18,27,54,.92), rgba(15,23,48,.92));
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
}
.hero{
  background: radial-gradient(900px 260px at 10% 20%, rgba(91,140,255,.32), transparent 60%),
              radial-gradient(800px 260px at 90% 50%, rgba(46,229,157,.22), transparent 60%),
              linear-gradient(180deg, rgba(18,27,54,.95), rgba(15,23,48,.95));
}
.grid2{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}
.grid3{display:grid;grid-template-columns:1fr 1fr .9fr;gap:12px;align-items:end}
@media (max-width: 980px){
  .grid2,.grid3{grid-template-columns:1fr}
}

h2{margin:0 0 6px 0;font-size:26px}
h3{margin:0 0 10px 0}
h4{margin:10px 0 8px 0}
.m0{margin:0}
.small{font-size:12px}
.muted{color:var(--muted)}
.strong{font-weight:800}

.stack{display:flex;flex-direction:column;gap:10px}
.form-grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width: 680px){
  .form-grid2{grid-template-columns:1fr}
}

.section-title{font-weight:800;letter-spacing:.2px;margin-top:4px}

.details{border:1px solid var(--line);border-radius:14px;padding:10px 12px;background: rgba(255,255,255,.03)}
.details > summary{cursor:pointer;list-style:none;font-weight:800;color:var(--text)}
.details > summary::-webkit-details-marker{display:none}
.details > summary:after{content:"▾";float:right;color:var(--muted)}
.details[open] > summary:after{content:"▴"}

.filebtn{padding:9px 12px}
.spacer{height:14px}
.w100{width:100%}

input, select{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: var(--inputbg);
  color:var(--text);
  outline:none;
}
input:focus, select:focus{border-color: rgba(91,140,255,.65)}
.qty{width:76px}

.lbl{font-size:12px;color:var(--muted)}

.btn{
  border:1px solid transparent;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  transition: transform .05s ease, filter .15s ease, background .2s ease;
}
.btn:active{transform: translateY(1px)}
.btn-primary{
  background: linear-gradient(135deg, var(--primary), #6ad3ff);
  color:#0a1025;
}
.btn-dark{
  background: linear-gradient(135deg, #0c1228, #1b2450);
  border-color: var(--line);
  color:#ffffff;
  }
.btn-ghost{
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn:hover{filter: brightness(1.08)}

.toast{
  border:1px solid var(--line);
  background: rgba(8,12,26,.55);
  padding:10px 12px;
  border-radius:14px;
  margin-bottom:10px;
}
.toast.ok{border-color: rgba(46,229,157,.45)}
.toast.danger{border-color: rgba(255,92,122,.55)}
.toast.warn{border-color: rgba(255,204,102,.55)}

.demo-otp{
  padding:12px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,.18);
  background: var(--surface);
}

.list{margin:10px 0 0 18px;color:var(--muted)}
.pillrow{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--surface);
  color:var(--muted);
}

.table{border:1px solid var(--line);border-radius:14px;overflow:hidden}
.thead,.trow{display:grid;grid-template-columns:1.3fr .8fr .7fr 1.1fr;gap:10px;align-items:center}
.thead{
  padding:10px 12px;
  background: var(--surface2);
  color:var(--muted);
  font-size:12px;
}
.trow{
  padding:12px;
  border-top:1px solid var(--line);
}
.orders{display:flex;flex-direction:column;gap:12px;margin-top:10px}
.order-card{
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  background: var(--surface);
}
.status{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
  background: var(--surface);
  white-space:nowrap;
}

/* Delivered status: clear green emphasis */
.status.delivered{
  background: rgba(46, 229, 157, .12);
  border: 2px solid rgba(46, 229, 157, .75);
  color: rgba(46, 229, 157, .95);
}

/* Disabled buttons/links (used for delivered orders) */
.btn.disabled,
.btn[aria-disabled="true"]{
  opacity: .55;
  pointer-events: none;
}
.summary{
  margin-top:10px;
  border-top:1px solid var(--line);
  padding-top:10px;
}
.sumrow{
  display:flex;justify-content:space-between;align-items:center;
  padding:6px 0;
}
.minirow{
  display:flex;justify-content:space-between;align-items:flex-start;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}
.minirow:last-child{border-bottom:none}

.badge{
  display:inline-block;
  font-size:12px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.badge.accepted{border-color: rgba(46,229,157,.55); color: rgba(46,229,157,.95)}
.badge.declined{border-color: rgba(255,92,122,.55); color: rgba(255,92,122,.95)}
.badge.pending{border-color: rgba(255,204,102,.55); color: rgba(255,204,102,.95)}

/* Simple modal used for Install App instructions */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  padding: 24px;
}
.modal-card{
  max-width: 560px;
  margin: 10vh auto;
  background: var(--modalbg);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 18px;
}

.footer{margin-top:22px;text-align:center}

/* Simple toast for Phase-1 notifications */
.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 340px;
  background: var(--toastbg);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  z-index: 9999;
  font-size: .95rem;
  line-height: 1.25;
}
.toast a{color:#fff;text-decoration:underline}


/* Chat */
.chatmsg{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  margin:10px 0;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.chatmsg.me{
  border-color: rgba(82,183,255,.55);
}
.chattext{
  margin-top:6px;
  white-space: pre-wrap;
}


.helpbar{margin:8px 0 0; padding:8px 12px; border:1px solid rgba(255,255,255,.10); border-radius:14px; color:var(--muted); font-size:13px;}
.helpbar a{color:var(--text); text-decoration:underline;}

.big{font-size:28px;font-weight:800;line-height:1.1;margin-top:6px}


.logo img{width:28px;height:28px;display:block}

/* =========================
   Theme overrides
   data-theme: dark | bright | colorful
   ========================= */

body[data-theme="bright"]{
  --bg1:#f7f8fb;
  --bg2:#eef2f9;
  --line:rgba(10,16,40,.10);
  --text:rgba(12,16,30,.92);
  --muted:rgba(12,16,30,.62);
  --primary:#2f6bff;
  --good:#0ea56a;
  --warn:#b7791f;
  --bad:#d83a58;
  --topbar:rgba(255,255,255,.82);
  --inputbg: rgba(255,255,255,.92);
  --surface: rgba(255,255,255,.75);
  --surface2: rgba(255,255,255,.92);
  --modalbg: rgba(255,255,255,.98);
  --toastbg: rgba(18,22,33,.95);

  background: radial-gradient(1200px 650px at 15% 0%, rgba(47,107,255,.14) 0%, transparent 60%),
              radial-gradient(900px 550px at 85% 15%, rgba(14,165,106,.12) 0%, transparent 60%),
              linear-gradient(180deg, var(--bg1), var(--bg2));
}

body[data-theme="bright"] .topbar{
  border-bottom: 1px solid rgba(10,16,40,.10);
}

body[data-theme="bright"] .card{
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.86));
  box-shadow: 0 18px 50px rgba(10,16,40,.10);
}

body[data-theme="bright"] .hero{
  background: radial-gradient(900px 260px at 10% 20%, rgba(47,107,255,.16), transparent 60%),
              radial-gradient(800px 260px at 90% 50%, rgba(14,165,106,.12), transparent 60%),
              linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.88));
}

body[data-theme="bright"] .navlink{color: rgba(12,16,30,.70)}
body[data-theme="bright"] .navlink:hover{color: rgba(12,16,30,.95)}

body[data-theme="bright"] .toast a{color:#fff}


body[data-theme="colorful"]{
  --bg1:#fff6fb;
  --bg2:#f1fbff;
  --line:rgba(20,16,40,.10);
  --text:rgba(18,14,30,.92);
  --muted:rgba(18,14,30,.62);
  --primary:#7c3aed; /* purple */
  --good:#16a34a;
  --warn:#d97706;
  --bad:#e11d48;
  --topbar:rgba(255,255,255,.80);
  --inputbg: rgba(255,255,255,.92);
  --surface: rgba(255,255,255,.78);
  --surface2: rgba(255,255,255,.92);
  --modalbg: rgba(255,255,255,.98);
  --toastbg: rgba(18,22,33,.95);

  background:
    radial-gradient(900px 600px at 10% 0%, rgba(255,0,128,.18) 0%, transparent 60%),
    radial-gradient(900px 600px at 95% 10%, rgba(124,58,237,.20) 0%, transparent 60%),
    radial-gradient(900px 600px at 60% 100%, rgba(34,211,238,.18) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

body[data-theme="colorful"] .card{
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.86));
  box-shadow: 0 18px 55px rgba(18,14,30,.12);
}

body[data-theme="colorful"] .hero{
  background:
    radial-gradient(900px 260px at 10% 20%, rgba(255,0,128,.18), transparent 60%),
    radial-gradient(800px 260px at 90% 50%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(800px 260px at 55% 80%, rgba(34,211,238,.16), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.88));
}

body[data-theme="colorful"] .navlink{color: rgba(18,14,30,.70)}
body[data-theme="colorful"] .navlink:hover{color: rgba(18,14,30,.95)}


/* Floating in-app notification (top-center) */
#agroToast{
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: min(420px, calc(100vw - 24px));
  width: auto;
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
  background: rgba(78, 31, 140, .96); /* deep purple */
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 10px 12px;
  /* Keep notifications compact: never occupy most of the page */
  max-height: 200px;
  overflow: auto;
}
#agroToast a{ color:#fff; text-decoration:underline; }
#agroToast .toast-inner{display:flex; gap:10px; align-items:flex-start;}
#agroToast .toast-text{flex:1; font-size:.95rem; line-height:1.25; overflow-wrap:anywhere;}
#agroToast .toast-link{margin-left:8px; white-space:nowrap;}
#agroToast .toast-close{background:transparent; border:0; color:#fff; font-size:18px; line-height:1; cursor:pointer; opacity:.9;}
#agroToast .toast-close:hover{opacity:1;}

.badge-verified{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:#1f8b4c;
  color:#fff;
  margin-left:6px;
}
.badge-cert{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:#4b2e83;
  color:#fff;
  margin-left:6px;
}


/* Disabled buttons */
.btn:disabled, .btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(35%);
}


/* Product images on buyer cards */
.product-img{width:100% !important;height:140px !important;object-fit:cover;border-radius:12px;display:block;}
