:root {
  --green: #0f5132;
  --green-2: #198754;
  --green-soft: #e8f5ee;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f4f6f5;
  --card: #fff;
  --red: #b42318;
  --red-soft: #fef3f2;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --blue: #175cd3;
  --blue-soft: #eff8ff;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Noto Sans Bengali', 'Hind Siliguri', system-ui, sans-serif;
  font-size: 16px; line-height: 1.6;
}
a { color: var(--green-2); }
h1, h2, h3 { line-height: 1.35; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.warn { color: var(--red); }

/* header & nav */
.topbar {
  background: var(--green); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.who { font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav {
  display: flex; gap: 4px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line);
  padding: 6px 10px; position: sticky; top: 0; z-index: 10; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  white-space: nowrap; text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 8px; font-size: 15px;
}
.nav a.active { background: var(--green-soft); color: var(--green); font-weight: 600; }
.badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; margin-left: 2px; }

.wrap { max-width: 900px; margin: 0 auto; padding: 16px 12px 110px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 17px; margin: 0 0 12px; color: var(--green); }
.page-title { font-size: 20px; margin: 0 0 4px; }
.card p { margin: 4px 0; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

/* alerts */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 15px; }
.alert.success { background: var(--green-soft); color: var(--green); }
.alert.error { background: var(--red-soft); color: var(--red); }
.inline-form { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.todo {
  display: block; background: var(--amber-soft); color: var(--amber); border: 1px solid #fedf89;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; text-decoration: none; font-weight: 600;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 11px 18px; border-radius: 10px; font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer; min-height: 46px;
}
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: #0b3d26; }
.btn.ghost:hover { background: #f9fafb; }
.btn.danger { background: #fff; border-color: #fda29b; color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
form.inline { display: contents; }
.btn.block { width: 100%; border-style: dashed; color: var(--green); }
.btn[disabled] { opacity: .6; cursor: wait; }
.small-btn { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.google { width: 100%; margin: 16px 0 8px; }

/* forms */
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=date], input[type=month], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  border: 1px solid #d0d5dd; border-radius: 10px; padding: 10px 12px; background: #fff;
}
textarea { resize: vertical; min-height: 60px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #a6d8bf; border-color: var(--green-2); }
input[type=file] { width: 100%; font-size: 15px; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.check input { width: 20px; height: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.row-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: #fcfdfc; }
.row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.row-title { font-weight: 600; color: var(--green); }
.row-del { border: 0; background: var(--red-soft); color: var(--red); width: 34px; height: 34px; border-radius: 8px; font-size: 16px; cursor: pointer; }

.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 10px; justify-content: flex-end;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.action-bar .btn { flex: 0 1 auto; }

.att-edit { list-style: none; padding: 0; margin: 0 0 12px; }
.att-edit li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }

/* filters & tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 15px; }
.tabs a.active { background: var(--green); color: #fff; border-color: var(--green); }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); flex: 1 1 140px; }

/* list */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  text-decoration: none; color: var(--ink);
}
a.list-item:hover { border-color: #a6d8bf; }
.list-item.unread { border-left: 4px solid var(--green-2); background: #fbfefc; }
.list-item.inactive { opacity: .55; }
.li-main { min-width: 0; }
.li-title { font-weight: 600; }
.li-meta { font-size: 13.5px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-2); flex: none; }
.chev { font-size: 24px; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: #f2f4f7; color: #344054; vertical-align: middle; }
.tag.off { background: var(--red-soft); color: var(--red); }

.status { flex: none; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.s-draft { background: #f2f4f7; color: #475467; }
.s-supervisor_review { background: var(--amber-soft); color: var(--amber); }
.s-boss_review { background: var(--blue-soft); color: var(--blue); }
.s-done { background: var(--green-soft); color: var(--green); }
.s-failed { background: var(--red-soft); color: var(--red); }

/* report view */
.report-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 15px; }
.rtable th { background: var(--green); color: #fff; text-align: left; padding: 9px 10px; font-weight: 600; }
.rtable td { border-bottom: 1px solid var(--line); padding: 9px 10px; vertical-align: top; }
.rtable tbody tr:nth-child(even) td { background: #f9fafb; }
.sn-cell { width: 60px; }

.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.att { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-decoration: none; color: var(--ink); }
.att img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: #f2f4f7; }
.att-icon { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 40px; background: #f9fafb; border-radius: 6px; }
.att-name { font-size: 13.5px; word-break: break-all; }

.comment { border-left: 4px solid var(--amber); background: var(--amber-soft); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.comment.c-boss { border-color: var(--blue); background: var(--blue-soft); }
.c-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.comment-form { margin-top: 14px; }

.login-card { max-width: 420px; margin: 40px auto; text-align: center; }
.login-card h1 { font-size: 22px; color: var(--green); }

/* মোবাইল */
@media (max-width: 700px) {
  .grid2 { grid-template-columns: 1fr; }
  .action-bar .btn { flex: 1 1 0; padding: 11px 8px; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
  .rtable td { border: 0; border-bottom: 1px dashed var(--line); background: #fff !important; }
  .rtable td:last-child { border-bottom: 0; }
  .rtable td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--green); }
  .rtable td.sn-cell { width: 100%; background: var(--green-soft) !important; font-weight: 700; }
  .rtable td.sn-cell::before { display: inline; margin-right: 6px; }
  .head-side { align-items: flex-start; flex-direction: row; }
}

@media print {
  .topbar, .nav, .action-bar, .no-print, .comment-form, .inline-form { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
  .card { border: 0; padding: 0 0 10px; }
  .rtable th { background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
