/* GrowiT Complaint Portal — one stylesheet for public (farmer) + staff pages */

:root {
  --brand:       #16a34a;
  --brand-dark:  #14532d;
  --brand-soft:  #dcfce7;
  --bg:          #f3f7f3;
  --card:        #ffffff;
  --text:        #17251a;
  --muted:       #64766a;
  --border:      #dbe4db;
  --danger:      #dc2626;
  --danger-soft: #fee2e2;
  --warn:        #d97706;
  --warn-soft:   #fef3c7;
  --info:        #2563eb;
  --info-soft:   #dbeafe;
  --ok-soft:     #dcfce7;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
               "Noto Sans Devanagari", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand-dark); }
h1 { font-size: 1.35rem; margin: 0 0 .4rem; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; color: var(--brand-dark); }
h3 { font-size: .95rem; margin: 0 0 .5rem; }

/* ---------- bilingual labels ---------- */
.hi        { display: block; font-weight: 400; font-size: .86em; color: var(--muted); }
.hi-inline { font-weight: 400; opacity: .85; }

/* ---------- public layout ---------- */
.public-wrap { max-width: 580px; margin: 0 auto; padding: 0 14px; }
.public-header {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff; padding: 18px 0 16px; margin-bottom: 16px;
}
.public-header .brand { font-size: 1.4rem; font-weight: 800; letter-spacing: .3px; }
.public-header .brand-sub { font-size: .92rem; opacity: .95; }
.public-header .hi-inline { color: #eafff0; }
.public-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px 0 32px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 16px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.intro { color: var(--muted); margin: .2rem 0 .6rem; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin: 14px 0 4px; font-size: .95rem; }
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%; padding: 11px 12px; font-size: 16px; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 10px; background: #fff;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
input[readonly] { background: #f2f5f2; color: var(--muted); }
textarea { min-height: 110px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .55; }
.hint { color: var(--muted); font-size: .82rem; margin: 4px 0 0; }
.req { color: var(--danger); }

.btn {
  display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 16px;
  padding: 11px 18px; font-family: inherit; text-decoration: none; text-align: center;
}
.btn:hover { background: #15803d; }
.btn:disabled { background: #9fb8a7; cursor: not-allowed; }
.btn-outline {
  background: #fff; color: var(--brand-dark); border: 1.5px solid var(--brand);
}
.btn-outline:hover { background: var(--brand-soft); }
.btn-outline:disabled { color: var(--muted); border-color: var(--border); background: #fff; }
.btn-big { width: 100%; padding: 14px; font-size: 17px; margin-top: 16px; }
.btn-small { padding: 7px 12px; font-size: 14px; }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }

.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; min-width: 0; }
.otp-row .btn, .otp-row .btn-outline { white-space: nowrap; flex-shrink: 0; }

.badge-ok {
  display: inline-block; background: var(--ok-soft); color: var(--brand-dark);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .9rem;
}

.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: .95rem; }
.alert-error   { background: var(--danger-soft); color: #7f1d1d; border: 1px solid #fca5a5; }
.alert-success { background: var(--ok-soft); color: var(--brand-dark); border: 1px solid #86efac; }

/* ---------- ticket / success ---------- */
.ticket-big {
  font-size: 1.7rem; font-weight: 800; letter-spacing: 1px; color: var(--brand-dark);
  background: var(--brand-soft); border-radius: 12px; padding: 14px; text-align: center;
  margin: 10px 0;
}
.center { text-align: center; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; border-radius: 999px; padding: 3px 11px;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.st-New         { background: var(--info-soft);  color: #1e40af; }
.st-In.Progress, .st-InProgress { background: var(--warn-soft); color: #92400e; }
.st-On.Hold, .st-OnHold { background: #f3e8ff; color: #6b21a8; }
.st-Resolved    { background: var(--ok-soft);   color: var(--brand-dark); }
.st-Closed      { background: #e5e7eb;          color: #374151; }
.lv-L1 { background: #e5e7eb; color: #374151; }
.lv-L2 { background: var(--warn-soft); color: #92400e; }
.lv-L3 { background: var(--danger-soft); color: #991b1b; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li {
  position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--border);
  margin-left: 6px;
}
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--brand); border: 2px solid #fff;
}
.timeline .when  { color: var(--muted); font-size: .8rem; }
.timeline .what  { font-weight: 600; }
.timeline .who   { color: var(--muted); font-size: .85rem; }
.timeline .note  { background: #f6f8f6; border-radius: 8px; padding: 6px 10px;
                   margin-top: 4px; font-size: .9rem; white-space: pre-wrap; }

/* ---------- staff layout ---------- */
.topbar { background: var(--brand-dark); color: #fff; }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.topbar .brand { font-weight: 800; font-size: 1.1rem; }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar a { color: #d8f5e2; text-decoration: none; font-weight: 600; font-size: .95rem; }
.topbar a:hover { color: #fff; }
.topbar .who { color: #9fd9b4; font-size: .85rem; }
.container { max-width: 1200px; margin: 18px auto; padding: 0 16px 40px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
        padding: 12px 14px; }
.stat .n { font-size: 1.5rem; font-weight: 800; color: var(--brand-dark); }
.stat .t { color: var(--muted); font-size: .82rem; font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.filters .f { flex: 1 1 130px; min-width: 130px; }
.filters label { margin: 0 0 3px; font-size: .78rem; color: var(--muted); }
.filters input, .filters select { padding: 8px 10px; font-size: 14px; }
.filters .btn, .filters .btn-outline { padding: 9px 14px; font-size: 14px; }

.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border);
            border-radius: 12px; }
table.tbl { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tbl th { text-align: left; padding: 10px 12px; background: #f0f5f0; color: var(--muted);
          font-size: .78rem; text-transform: uppercase; letter-spacing: .4px;
          border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #edf2ed; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #f7faf7; }
.tbl a.ticket { font-weight: 700; }
.tbl .sub { color: var(--muted); font-size: .8rem; }

/* ---------- detail page ---------- */
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 3fr 2fr; } }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.desc-box { background: #f6f8f6; border-radius: 10px; padding: 10px 12px;
            white-space: pre-wrap; font-size: .95rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.thumbs img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px;
              border: 1px solid var(--border); }
.thumbs video { max-width: 100%; width: 320px; border-radius: 10px;
                border: 1px solid var(--border); }
.action-form { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.action-form:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.action-form .row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-form .row > * { flex: 1 1 140px; }
.action-form .row .btn { flex: 0 0 auto; }
.action-form label { margin-top: 0; font-size: .85rem; }

/* ---------- team/dept management rows ---------- */
.mrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
        padding: 10px 0; border-bottom: 1px solid #edf2ed; }
.mrow:last-child { border-bottom: 0; }
.mrow input, .mrow select { width: auto; flex: 1 1 120px; min-width: 110px;
                            padding: 8px 10px; font-size: 14px; }
.mrow .inactive { opacity: .5; }

.pill-inactive { background: #e5e7eb; color: #6b7280; border-radius: 999px;
                 padding: 2px 10px; font-size: .75rem; font-weight: 700; }

@media (max-width: 640px) {
  .kv { grid-template-columns: 110px 1fr; }
  .public-header { padding: 14px 0 12px; }
}
