/* =========================================================
   AGRIMIND-X Admin Panel
   File: static/admin.css
   ========================================================= */

:root{
  --bg: #0b1220;
  --panel: #0f172a;
  --panel-2: #111c33;
  --card: #0f1a2e;
  --border: #1f2a44;
  --text: #e5e7eb;
  --muted: #9ca3af;

  --brand: #22c55e;
  --brand-2: #16a34a;
  --warn: #fbbf24;
  --danger: #ef4444;
  --info: #38bdf8;

  --radius: 16px;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1000px 700px at 10% 0%, rgba(34,197,94,.12), transparent 60%),
              radial-gradient(900px 600px at 90% 10%, rgba(56,189,248,.10), transparent 55%),
              var(--bg);
  color: var(--text);
}

a{ color: inherit; text-decoration: none; }
a:hover{ opacity: .95; }

.hidden{ display:none !important; }

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  font-size:12px; white-space:nowrap;
}
.badge.success{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10); }
.badge.warn{ border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.10); }
.badge.danger{ border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); }
.badge.info{ border-color: rgba(56,189,248,.35); background: rgba(56,189,248,.10); }

/* ================= Buttons (supports both styles) ================= */
.btn,
button.btn{
  appearance:none;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  transition:transform .15s ease, background .15s ease, border-color .15s ease;
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-weight:600;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.08); }
.btn:active{ transform: translateY(0); }

.btn.small,
.btn.btn-small,
.btn-sm{
  padding:8px 10px;
  border-radius:10px;
  font-size:13px;
}

/* Primary: supports .btn.primary and .btn-primary and .btn.btn-primary */
.btn.primary,
.btn-primary,
.btn.btn-primary{
  background: linear-gradient(135deg, rgba(34,197,94,.95), rgba(22,163,74,.95));
  border-color: rgba(34,197,94,.35);
  color: #06110a;
}
.btn.primary:hover,
.btn-primary:hover,
.btn.btn-primary:hover{ filter: brightness(1.02); }

/* Danger */
.btn.danger,
.btn-danger,
.btn.btn-danger{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.35);
}

/* Ghost / link */
.btn.link,
.btn-ghost,
.btn.btn-ghost{
  background: transparent;
  border-color: rgba(255,255,255,.10);
  opacity: .95;
}

/* ================= Inputs (supports .input and .inp) ================= */
.input, .select, .textarea,
.inp, select.inp, textarea.inp{
  width:100%;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 12px 12px;
  border-radius: 12px;
  outline: none;
}
.textarea, textarea{ min-height: 92px; resize: vertical; }

.input:focus, .select:focus, .textarea:focus,
.inp:focus, select.inp:focus, textarea.inp:focus{
  border-color: rgba(34,197,94,.45);
  box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}

/* labels supports .lbl and label */
label, .lbl{
  font-size: 12px;
  color: var(--muted);
}

/* ================= Layout ================= */
.adm-shell{ display:flex; min-height:100vh; }

/* Sidebar */
.adm-sidebar{
  width:270px;
  background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(11,18,32,.96));
  border-right:1px solid var(--border);
  padding:18px 14px;
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.adm-brand{
  display:flex; align-items:center; gap:12px;
  padding:10px 10px 14px;
}
.adm-logo{
  width:40px; height:40px;
  border-radius:14px;
  background: radial-gradient(circle at 30% 30%, rgba(34,197,94,.85), rgba(15,23,42,.9));
  border: 1px solid rgba(34,197,94,.25);
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
}
.adm-brand h1{ margin:0; font-size:16px; line-height:1.2; }
.adm-brand p{ margin:0; font-size:12px; color:var(--muted); }

.adm-nav{ display:grid; gap:8px; }
.adm-nav a{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid transparent;
  background: rgba(255,255,255,.03);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.adm-nav a:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(34,197,94,.20);
}
.adm-nav a.active{
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.30);
}
.adm-nav small{ color: var(--muted); }

.adm-sidebar-footer{
  margin-top:auto;
  padding: 12px 10px 6px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px dashed rgba(255,255,255,.08);
}

/* Main */
.adm-main{ flex:1; display:flex; flex-direction:column; min-width:0; }

/* Topbar */
.adm-topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,18,32,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.adm-topbar-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.adm-title{ display:grid; }
.adm-title h2{ margin:0; font-size:16px; }
.adm-title span{ color: var(--muted); font-size: 12px; }
.adm-topbar-right{ display:flex; align-items:center; gap:10px; }

/* Content */
.adm-content{ padding:18px; }

/* Cards & grids */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card h3{ margin:0 0 6px; font-size:14px; }
.card p{ margin:0; color:var(--muted); font-size:13px; }

.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap:14px; }
.grid-3{ display:grid; grid-template-columns: repeat(3, 1fr); gap:14px; }

@media (max-width:980px){
  .grid-2, .grid-3{ grid-template-columns: 1fr; }
}

/* Tables */
.table-wrap{
  overflow:auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table{
  width:100%;
  border-collapse: collapse;
  min-width: 900px;
  background: rgba(255,255,255,.02);
}
th, td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align:left;
  vertical-align: top;
  font-size: 13px;
}
th{
  position: sticky;
  top: 0;
  background: rgba(15,23,42,.85);
  backdrop-filter: blur(8px);
  z-index: 1;
  color: #dbeafe;
}
td .muted{ color: var(--muted); font-size: 12px; }

/* Forms */
.form-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.form-grid.full{ grid-template-columns: 1fr; }
.form-row{ display:grid; gap:8px; }
.actions{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

/* Flash */
.flash{
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  background: rgba(255,255,255,.03);
}
.flash.success{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10); }
.flash.danger{ border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); }
.flash.warn{ border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.10); }

/* ================= Dashboard compatibility (your existing classes) ================= */
.adm-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px; }
.adm-title{ font-weight:800; font-size:20px; }
.adm-sub{ color:var(--muted); font-size:13px; margin-top:4px; }
.adm-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.adm-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap:14px; margin: 12px 0 16px; }
@media (max-width:1200px){ .adm-grid{ grid-template-columns: repeat(2, 1fr);} }
@media (max-width:700px){ .adm-grid{ grid-template-columns: 1fr;} }

.card-k{ color: var(--muted); font-size: 12px; }
.card-v{ font-size: 26px; font-weight: 900; margin-top: 6px; }
.card-h{ color: rgba(229,231,235,.75); font-size: 12px; margin-top: 4px; }

.adm-split{ display:grid; grid-template-columns: 1.2fr .8fr; gap:14px; }
@media (max-width:980px){ .adm-split{ grid-template-columns: 1fr; } }

.card-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.card-title{ font-size: 14px; font-weight: 800; }
.card-sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.form .row{ display:grid; gap:8px; margin-bottom:10px; }

/* Quick links */
.quick-links{ display:grid; gap:10px; }
.ql{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.ql:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(34,197,94,.25);
}
.tips{ margin-top: 12px; }

/* Mobile sidebar */
.adm-mobile-btn{ display:none; }
@media (max-width:980px){
  .adm-sidebar{
    position: fixed;
    left: -290px;
    top: 0;
    z-index: 100;
    transition: left .18s ease;
  }
  body.sidebar-open .adm-sidebar{ left: 0; }
  .adm-mobile-btn{ display:inline-flex; }
  .adm-content{ padding: 14px; }
}

/* Overlay */
.adm-overlay{ display:none; }
@media (max-width:980px){
  body.sidebar-open .adm-overlay{
    display:block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 80;
  }
}
/* ================= Network Moderation ================= */
.net-post-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.net-author{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:0;
}

.net-avatar{
  width:38px;
  height:38px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-weight:900;
  color:#06110a;
  background: linear-gradient(135deg, rgba(34,197,94,.95), rgba(56,189,248,.85));
  border:1px solid rgba(255,255,255,.10);
  flex:0 0 auto;
}

.net-author-info{ min-width:0; }
.net-name{
  font-weight:800;
  font-size:14px;
  line-height:1.2;
}

.net-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:4px;
}

.net-date{
  color: var(--muted);
  font-size:12px;
}

.net-content{
  white-space:pre-wrap;
  color: rgba(229,231,235,.92);
  font-size:13px;
  line-height:1.55;
  margin-top:6px;
}

.net-media{
  display:block;
  margin-top:10px;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}

.net-media img{
  display:block;
  width:100%;
  max-height:360px;
  object-fit:cover;
}
