/* ═══════════════════════════════════════════
   RAB IRRIGATION PORTAL — MAIN STYLESHEET
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #1a5c2a;
  --green-mid:   #2e8b40;
  --green-light: #4caf50;
  --gold:        #f0a500;
  --blue:        #1565c0;
  --blue-light:  #1e88e5;
  --purple:      #6a1b9a;
  --bg:          #f4f7f4;
  --white:       #ffffff;
  --text-dark:   #1b2e1b;
  --text-mid:    #3a5c3a;
  --shadow:      0 8px 32px rgba(30,90,40,.15);
}

/* ─── FONT DEFINITIONS ───────────────────────────── */
/* Body / UI text  → Source Sans 3 (humanist, highly legible)   */
/* Headings/Labels → Libre Baskerville (classic serif authority) */

body {
  font-family: 'Source Sans 3', 'Georgia', serif;
  letter-spacing: 0.01em;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── TYPOGRAPHY — heading elements use serif ────── */
h1, h2, h3, h4, h5, h6,
.org-name, .dept-name,
.login-title,
.phase-panel-title,
.proc-section-title, .proc-edit-section-title,
.cat-group-label, .cat-label-text,
.site-win-name, .actor-view-title,
.study-overall-label,
.gantt-cat-label, .gantt-cat-full,
.exec-subpanel-label,
.fund-title,
.proj-section-title {
  font-family: 'Libre Baskerville', 'Georgia', serif;
}

/* ─── LOGIN OVERLAY ─────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,40,15,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: var(--white);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  text-align: center;
}
.login-logo { margin-bottom: 14px; }
.login-title {
  font-size: 1.4rem; font-weight: 700;
  color: var(--green-dark); margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.login-sub {
  font-size: .78rem; color: #666; margin-bottom: 24px; line-height: 1.5;
}
.login-error {
  background: #fdecea; color: #c62828;
  border-radius: 8px; padding: 10px 14px;
  font-size: .82rem; margin-bottom: 14px;
  text-align: left;
}
.form-group { text-align: left; margin-bottom: 14px; }
.form-group label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-dark); margin-bottom: 5px;
}
.form-group input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #ddd; border-radius: 9px;
  font-family: 'Source Sans 3', 'Georgia', serif; font-size: .88rem;
  outline: none; transition: border-color .2s;
}
.form-group input:focus { border-color: var(--green-mid); }
.btn-login {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white; border: none; border-radius: 50px;
  font-family: 'Libre Baskerville', 'Georgia', serif; font-size: .95rem; font-weight: 700;
  cursor: pointer; margin-top: 6px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 6px 20px rgba(30,90,40,.3);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(30,90,40,.4); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-hint { font-size: .73rem; color: #888; margin-top: 14px; }

/* ─── LOGIN DIVIDER & GUEST BUTTON ──────────────── */
.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 12px;
  color: #bbb; font-size: .78rem;
}
.login-divider::before,
.login-divider::after {
  content: ''; flex: 1; height: 1px; background: #e0e0e0;
}
.btn-guest {
  width: 100%; padding: 10px;
  background: #f5f5f5; color: #555;
  border: 1.5px solid #ddd; border-radius: 50px;
  font-family: 'Source Sans 3', sans-serif; font-size: .88rem;
  cursor: pointer; transition: background .2s, border-color .2s;
}
.btn-guest:hover { background: #eeeeee; border-color: #bbb; color: #333; }

/* ─── HEADER GUEST SIGN-IN BUTTON ───────────────── */
.btn-header-signin {
  background: rgba(255,255,255,0.18);
  color: #fff; border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 20px; padding: 6px 16px;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.btn-header-signin:hover { background: rgba(255,255,255,0.30); }

/* ─── HEADER ────────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, #3aa34a 100%);
  color: var(--white); position: relative; overflow: hidden;
}
header::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.header-inner {
  position: relative; display: flex; align-items: center;
  gap: 20px; padding: 20px 40px; flex-wrap: wrap;
}
.logo-circle {
  width: 72px; height: 72px; background: var(--white);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.logo-circle svg { width: 48px; height: 48px; }
.header-text { flex: 1; min-width: 200px; }
.header-text .org-name { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.header-text .dept-name { font-size: .85rem; font-weight: 400; opacity: .88; margin-top: 3px; }
.header-user { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.user-info { text-align: right; }
.user-name { display: block; font-size: .88rem; font-weight: 600; }
.user-role {
  display: inline-block; font-size: .7rem; font-weight: 600;
  background: rgba(255,255,255,.25); padding: 1px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 1px; margin-top: 3px;
}
.header-actions { display: flex; gap: 8px; }
.btn-admin {
  background: var(--gold); color: var(--text-dark);
  padding: 7px 16px; border-radius: 20px; font-size: .78rem; font-weight: 700;
  text-decoration: none; transition: transform .2s;
}
.btn-admin:hover { transform: translateY(-1px); }
.btn-manual {
  background: rgba(255,255,255,.18); color: #fff;
  padding: 7px 14px; border-radius: 20px; font-size: .78rem; font-weight: 600;
  text-decoration: none; border: 1px solid rgba(255,255,255,.4);
  transition: background .2s, transform .2s;
}
.btn-manual:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }
.btn-catchup {
  background: rgba(198,40,40,.22); color: #ffcdd2;
  padding: 7px 14px; border-radius: 20px; font-size: .78rem; font-weight: 600;
  text-decoration: none; border: 1px solid rgba(255,100,100,.5);
  transition: background .2s, transform .2s;
}
.btn-catchup:hover { background: rgba(198,40,40,.40); color: #fff; transform: translateY(-1px); }
.btn-logout {
  background: rgba(255,255,255,.18); color: white;
  padding: 7px 16px; border-radius: 20px; font-size: .78rem; font-weight: 600;
  border: 1px solid rgba(255,255,255,.4); cursor: pointer; transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.3); }
.btn-header-login {
  background: rgba(255,255,255,.15); color: white;
  padding: 8px 20px; border-radius: 20px; font-size: .82rem; font-weight: 600;
  border: 1px solid rgba(255,255,255,.4); cursor: pointer; transition: background .2s;
  flex-shrink: 0;
}
.btn-header-login:hover { background: rgba(255,255,255,.28); }
.flag-strip { display: flex; height: 8px; }
.flag-strip div { flex: 1; }
.flag-strip .c1 { background: #20603d; }
.flag-strip .c2 { background: #fad201; }
.flag-strip .c3 { background: #1f75fe; }

/* ─── HERO ──────────────────────────────────────── */
.hero {
  background: linear-gradient(120deg, #e8f5e9 0%, #e3f2fd 100%);
  border-bottom: 3px solid var(--gold);
  padding: 36px 40px 32px; text-align: center;
}
.hero-badge {
  display: inline-block; background: var(--gold); color: var(--text-dark);
  font-size: .75rem; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; padding: 5px 18px; border-radius: 20px; margin-bottom: 14px;
}
.hero h1 { font-size: 2rem; font-weight: 800; color: var(--green-dark); line-height: 1.25; margin-bottom: 10px; }
.hero h1 span { color: var(--gold); }
.hero p { color: var(--text-mid); font-size: .97rem; max-width: 620px; margin: 0 auto 20px; }
.hero-stats { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.stat-box {
  background: var(--white); border-radius: 12px; padding: 14px 28px;
  box-shadow: var(--shadow); min-width: 120px; border-top: 4px solid var(--green-light);
}
.stat-box .stat-num { font-size: 1.5rem; font-weight: 800; color: var(--green-dark); }
.stat-box .stat-label { font-size: .72rem; font-weight: 500; color: var(--text-mid); margin-top: 2px; }

/* ─── MAIN ──────────────────────────────────────── */
main { flex: 1; padding: 40px; max-width: 1200px; width: 100%; margin: 0 auto; }
.section-title {
  font-size: 1.1rem; font-weight: 700; color: var(--green-dark);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after {
  content: ''; flex: 1; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ─── TOP CATEGORY CARDS ────────────────────────── */
.top-category-card {
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 28px;
}
.top-cat-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 26px;
}
.top-cat-num {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; flex-shrink: 0;
  background: rgba(255,255,255,.22); color: white;
}
.top-cat-text h2 { font-size: 1.15rem; font-weight: 700; color: white; line-height: 1.2; }
.top-cat-text span { font-size: .78rem; font-weight: 400; opacity: .85; color: white; }

.spiu-top .top-cat-header { background: linear-gradient(135deg, #1565c0, #1e88e5); }
.gov-top .top-cat-header { background: linear-gradient(135deg, var(--green-dark), var(--green-mid)); }
.existing-top .top-cat-header { background: linear-gradient(135deg, #6a1b9a, #9c27b0); }

.top-cat-body { background: var(--white); padding: 16px 20px 20px; }

/* ─── FUND SOURCE ACCORDION ─────────────────────── */
.fund-source { border-radius: 10px; overflow: hidden; margin-bottom: 8px; border: 1px solid #e8eee8; }
.fund-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer;
  background: #f8fcf8; transition: background .2s;
  user-select: none;
}
.fund-header:hover { background: #f0f7f0; }

/* ── Contractor locked sections ───────────────────────────────
   Applied by applyContractorVisibility() to every project
   section the logged-in contractor is NOT assigned to.
   The section remains visible in the DOM (so the page is not
   blank) but is clearly greyed-out and non-interactive.
──────────────────────────────────────────────────────────── */
.section-locked {
  opacity: .45;
  pointer-events: none;       /* blocks all clicks (toggle, buttons) */
  user-select: none;
  filter: grayscale(60%);
  position: relative;
}
/* Subtle "🔒 No Access" ribbon on the header */
.section-locked .fund-header {
  cursor: not-allowed;
  background: #f5f5f5;
}
.section-locked .fund-header::after {
  content: '🔒 No Access';
  margin-left: auto;
  font-size: .68rem;
  font-weight: 700;
  color: #9e9e9e;
  background: #eeeeee;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Collapse any accidentally-open body inside a locked section */
.section-locked [id^="body-"] {
  display: none !important;
}
.fund-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.blue-dot { background: var(--blue-light); }
.green-dot { background: var(--green-light); }
.purple-dot { background: #9c27b0; }
.fund-name { flex: 1; font-size: .88rem; font-weight: 600; color: var(--text-dark); }
.fund-tag {
  font-size: .68rem; font-weight: 700; padding: 2px 10px; border-radius: 20px;
  background: #e3f2fd; color: var(--blue); white-space: nowrap;
}
.tag-rehab { background: #e8f5e9; color: var(--green-dark); }
.tag-op    { background: #fff8e1; color: #e65100; }
.tag-tech  { background: #fce4ec; color: #880e4f; }
.tag-scheme{ background: #f3e5f5; color: var(--purple); }
.toggle-icon { font-size: 1.1rem; font-weight: 700; color: #888; margin-left: 4px; }
.fund-body { border-top: 1px solid #e8eee8; }
.fund-content { padding: 16px; }
.loading-text { color: #aaa; font-size: .82rem; font-style: italic; }

/* ─── EDIT BUTTON IN FUND HEADER ────────────────── */
.edit-btn-wrap { display: inline-flex; align-items: center; }
.btn-edit-cat {
  background: var(--gold); color: #333;
  border: none; border-radius: 16px; padding: 3px 12px;
  font-size: .7rem; font-weight: 700; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(240,165,0,.3);
}
.btn-edit-cat:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(240,165,0,.4); }

/* ─── CONTENT DISPLAY ───────────────────────────── */
.proj-list { list-style: none; }
.proj-item {
  padding: 10px 14px; border-radius: 9px; margin-bottom: 6px;
  background: #f8fcf8; border: 1px solid #e0ede0; font-size: .88rem; color: var(--text-dark);
}
.proj-notes { font-size: .78rem; color: #666; margin-top: 4px; }

/* ─── WB PROJECT NAV BAR ─────────────────────────── */
.wb-proj-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  background: #fff;
  border-bottom: 2px solid #dce8f8;
  padding: 10px 14px 10px;
  margin: -16px -16px 18px;   /* bleed to edges of .fund-content */
  box-shadow: 0 3px 14px rgba(21,101,192,.09);
}
.wb-proj-nav-label {
  font-family: 'Libre Baskerville', 'Georgia', serif;
  font-size: .7rem; font-weight: 700;
  color: #7a99c0; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 8px;
}
.wb-proj-nav-pills {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.wb-proj-nav-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px 6px 10px;
  border: 1.5px solid #c8ddf5;
  border-radius: 24px;
  background: #f4f8ff;
  color: #1a5276;
  font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: .78rem; font-weight: 500;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
  text-align: left;
  line-height: 1.3;
  max-width: 340px;
}
.wb-proj-nav-pill:hover {
  background: #dceeff;
  border-color: #5b9bd5;
  color: #0d3c6e;
  box-shadow: 0 2px 8px rgba(21,101,192,.13);
}
.wb-proj-nav-pill.active {
  background: #1565c0;
  border-color: #1565c0;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(21,101,192,.30);
}

.wb-pill-tag {
  background: rgba(255,255,255,.25);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: .66rem; font-weight: 800;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.wb-proj-nav-pill:not(.active) .wb-pill-tag {
  background: #1565c018;
  color: #1565c0;
}
.wb-pill-name {
  font-size: .76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── PROJECT SECTION (WB) ──────────────────────── */
.proj-section { margin-bottom: 22px; }
.wb-proj-section {
  scroll-margin-top: 80px;   /* offset for sticky nav */
}
.proj-section-title {
  font-size: .95rem; font-weight: 700; color: var(--blue);
  padding: 10px 14px; background: #e8f1fc; border-radius: 10px;
  border-left: 4px solid var(--blue-light); margin-bottom: 12px;
}
.wb-proj-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(135deg, #e8f1fc, #dceeff);
  border-left: 5px solid #1565c0;
  border-radius: 10px;
  margin-bottom: 14px;
}

.wb-proj-title-tag {
  background: #1565c0;
  color: #fff;
  font-size: .68rem; font-weight: 800;
  padding: 2px 9px;
  border-radius: 12px;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.wb-proj-title-name {
  font-family: 'Libre Baskerville', 'Georgia', serif;
  font-size: .9rem; font-weight: 700;
  color: #0d3c6e;
  line-height: 1.35;
}
/* Empty state for non-CDAT projects */
.wb-proj-empty {
  text-align: center;
  padding: 28px 20px;
  background: #f8fbff;
  border: 2px dashed #c8ddf5;
  border-radius: 12px;
  color: #7a99c0;
}
.wb-proj-empty-icon { font-size: 2rem; margin-bottom: 8px; }
.wb-proj-empty-msg  { font-size: .82rem; font-style: italic; }
.cat-group { margin-bottom: 18px; padding-left: 8px; border-left: 3px solid #bbdefb; }
.cat-group-label {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .83rem; font-weight: 700; color: #1565c0;
  background: #e3f2fd; padding: 8px 14px; border-radius: 8px;
  margin-bottom: 12px;
}
.cat-label-text {
  flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.btn-edit-label {
  font-size: .68rem; background: rgba(21,101,192,.12); color: var(--blue);
  border: 1px solid var(--blue-light); border-radius: 12px;
  padding: 2px 10px; cursor: pointer; font-family: 'Source Sans 3', 'Georgia', serif;
  font-weight: 600; transition: background .2s;
}
.btn-edit-label:hover { background: rgba(21,101,192,.22); }

/* ── Inline category label editor ── */
.btn-edit-cat-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .65rem; font-weight: 700;
  background: rgba(21,101,192,.1); color: var(--blue);
  border: 1px solid rgba(21,101,192,.25); border-radius: 10px;
  padding: 2px 9px; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .18s, border-color .18s;
  white-space: nowrap;
}
.btn-edit-cat-label:hover { background: rgba(21,101,192,.2); border-color: rgba(21,101,192,.45); }

.cat-label-edit-wrap {
  flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  animation: fadeInDown .15s ease;
}
.cat-label-inp {
  flex: 1; min-width: 0;
  font-size: .8rem; font-weight: 600; color: #1a237e;
  background: #fff; border: 1.5px solid var(--blue);
  border-radius: 8px; padding: 4px 10px;
  font-family: 'Source Sans 3', 'Georgia', serif;
  outline: none; transition: box-shadow .18s;
}
.cat-label-inp:focus { box-shadow: 0 0 0 3px rgba(21,101,192,.18); }

.cat-label-save-btn {
  white-space: nowrap; font-size: .7rem; font-weight: 700;
  background: var(--blue); color: #fff;
  border: none; border-radius: 8px; padding: 4px 12px;
  cursor: pointer; font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .18s, transform .1s;
}
.cat-label-save-btn:hover { background: #0d47a1; transform: translateY(-1px); }
.cat-label-save-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.cat-label-cancel-btn {
  white-space: nowrap; font-size: .78rem; font-weight: 700;
  background: rgba(0,0,0,.06); color: #555;
  border: 1px solid #ccc; border-radius: 8px; padding: 4px 10px;
  cursor: pointer; font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .15s;
}
.cat-label-cancel-btn:hover { background: rgba(0,0,0,.12); }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Delete Category button ── */
.btn-delete-category {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .68rem; font-weight: 700;
  background: rgba(183,28,28,.08); color: #b71c1c;
  border: 1px solid rgba(183,28,28,.25); border-radius: 12px;
  padding: 3px 11px; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .18s, border-color .18s, transform .1s;
  margin-left: auto;
}
.btn-delete-category:hover {
  background: rgba(183,28,28,.16); border-color: rgba(183,28,28,.45);
  transform: translateY(-1px);
}
.btn-delete-category:active { transform: translateY(0); }

/* ─── GENERIC DESCRIPTION BOX ───────────────────── */
.desc-box {
  font-size: .87rem; color: var(--text-mid); background: #f5f8f5;
  border-left: 4px solid var(--green-light); padding: 12px 16px;
  border-radius: 8px; margin-bottom: 12px; line-height: 1.6;
}
.existing-desc { border-left-color: #9c27b0; background: #faf5ff; }
.items-list { list-style: none; }
.items-list li {
  padding: 8px 12px; background: #f5f8f5; border-radius: 8px;
  margin-bottom: 5px; font-size: .85rem; color: var(--text-dark);
  border-left: 3px solid var(--green-light);
}
.items-list.purple-list li { border-left-color: #9c27b0; background: #faf5ff; }

/* ════════════════════════════════════════════════════
   CDAT — TWO PHASE TAB DESIGN
════════════════════════════════════════════════════ */
.phase-container {
  margin-top: 10px;
}

/* Phase tab buttons row */
.phase-tabs {
  display: flex; gap: 0;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.phase-tab {
  flex: 1; padding: 14px 20px;
  border: none; cursor: pointer;
  font-family: 'Libre Baskerville', 'Georgia', serif;
  font-size: .88rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, color .2s;
  background: #e8edf5; color: #667;
  border-bottom: 3px solid transparent;
}
.phase-tab:hover { background: #dde4f0; }
.phase-tab.active {
  background: #ffffff; color: var(--text-dark);
  border-bottom: 3px solid transparent;
  box-shadow: 0 -2px 0 0 inset var(--gold);
}
/* Procurement tab active */
#tab-btn-procurement.active { border-top: 3px solid #1565c0; }
/* Execution tab active */
#tab-btn-execution.active   { border-top: 3px solid #2e8b40; }
/* Gantt tab active */
#tab-btn-gantt.active        { border-top: 3px solid #e65100; }
#tab-btn-gantt .phase-tab-icon.gantt-icon { color: #e65100; }
#tab-btn-gantt.active .phase-tab-icon.gantt-icon { color: #e65100; }

/* Gantt panel header */
.gantt-header {
  background: linear-gradient(135deg, #bf360c, #e64a19, #ff7043);
  color: white;
}

/* ════════════════════════════════════════════════════════
   GANTT CHART STYLES
════════════════════════════════════════════════════════ */
.gantt-wrapper {
  display: flex; flex-direction: column;
  font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: .78rem;
}

/* Controls bar */
.gantt-controls {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 10px 16px;
  background: #f8fbff;
  border-bottom: 1.5px solid #e0e8f5;
}
.gantt-controls-left  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gantt-controls-right { display: flex; align-items: center; }
.gantt-ctrl-label { font-size: .72rem; font-weight: 700; color: #445; white-space: nowrap; }
.gantt-ctrl-select {
  padding: 5px 10px; border-radius: 7px;
  border: 1.5px solid #c5d5ea; font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: .74rem; background: #fff; color: #333; cursor: pointer;
  outline: none;
}
.gantt-ctrl-select:focus { border-color: #1565c0; }
.gantt-ctrl-search {
  padding: 5px 10px; border-radius: 7px;
  border: 1.5px solid #c5d5ea; font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: .74rem; background: #fff; color: #333;
  outline: none; min-width: 160px;
  transition: border-color .15s;
}
.gantt-ctrl-search:focus { border-color: #1565c0; box-shadow: 0 0 0 3px rgba(21,101,192,.08); }
.gantt-ctrl-reset {
  padding: 5px 12px; border-radius: 7px;
  border: 1.5px solid #e0e8f5; background: #f0f4f8;
  font-family: 'Source Sans 3', 'Georgia', serif; font-size: .72rem;
  color: #c62828; font-weight: 700; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.gantt-ctrl-reset:hover { background: #fdecea; border-color: #ef9a9a; }
.gantt-row-count {
  font-size: .7rem; font-weight: 700; color: #556;
  padding: 3px 10px; border-radius: 10px;
  background: #e8f0fb; border: 1px solid #c8d8ee;
  margin-right: 10px; white-space: nowrap;
}
.gantt-row-count-filtered { background: #fff3e0; border-color: #ffcc80; color: #e65100; }
.gantt-row-count-zero     { background: #fdecea; border-color: #ef9a9a; color: #c62828; }
.gantt-no-results {
  padding: 24px 16px; text-align: center;
  font-size: .82rem; color: #888;
  background: #fafcff; border-top: 1px solid #edf2f8;
}

/* Legend */
.gantt-legend {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: .7rem; color: #556;
}
.gantt-legend-item { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.gantt-legend-bar {
  display: inline-block; width: 22px; height: 12px;
  border-radius: 3px;
}
.gantt-legend-diamond {
  display: inline-block; width: 10px; height: 10px;
  transform: rotate(45deg); border-radius: 2px;
}
.gantt-today-line-demo {
  display: inline-block; width: 2px; height: 14px;
  background: #e65100; border-radius: 1px;
}

/* Scroll container */
.gantt-scroll-outer {
  overflow-x: auto; overflow-y: visible;
  border-bottom: 1.5px solid #e0e8f5;
}
.gantt-inner { min-width: 900px; }

/* Gantt header row */
.gantt-head-row {
  display: flex; align-items: stretch;
  background: #f0f4fa;
  border-bottom: 2px solid #c8d8ee;
  position: sticky; top: 0; z-index: 10;
}
.gantt-head-label {
  flex: 0 0 220px; width: 220px;
  padding: 8px 12px;
  font-weight: 800; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .5px;
  color: #2c3e50; border-right: 2px solid #c8d8ee;
  display: flex; align-items: center;
  background: #eaf0fa;
}
.gantt-head-chart {
  flex: 1; position: relative; overflow: hidden;
  min-height: 50px;
}

/* Quarter strip */
.gantt-quarter-strip {
  position: relative; height: 20px;
  border-bottom: 1px solid #c8d8ee;
  background: #e8edf8;
}
.gantt-quarter-cell {
  position: absolute; top: 0; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: .64rem; font-weight: 800; color: #3949ab;
  border-right: 1px solid #c5cae9;
  letter-spacing: .4px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden;
}

/* Month strip */
.gantt-month-strip {
  position: relative; height: 24px;
  border-bottom: 1px solid #c8d8ee;
  background: #eef2fb;
}
.gantt-month-cell {
  position: absolute; top: 0; height: 100%;
  display: flex; align-items: center; padding-left: 6px;
  font-size: .65rem; font-weight: 700; color: #445;
  border-right: 1px solid #dde6f5;
  white-space: nowrap; overflow: hidden;
}

/* Gantt body */
.gantt-body { background: #fff; }

/* Category divider */
.gantt-cat-divider {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  background: linear-gradient(90deg, #37474f, #455a64);
  color: #fff;
}
.gantt-cat-label {
  font-size: .68rem; font-weight: 800;
  letter-spacing: .5px; text-transform: uppercase;
  background: rgba(255,255,255,.18); border-radius: 4px;
  padding: 2px 8px; white-space: nowrap;
}
.gantt-cat-full {
  font-size: .65rem; opacity: .75; font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Gantt row */
.gantt-row {
  display: flex; align-items: stretch;
  border-bottom: 1px solid #edf2f8;
  transition: background .12s;
  min-height: 44px;
}
.gantt-row:hover { background: #f7faff; }

/* Label column */
.gantt-label {
  flex: 0 0 220px; width: 220px;
  padding: 7px 10px;
  border-right: 1.5px solid #dde6f5;
  display: flex; flex-direction: column; gap: 3px;
  justify-content: center;
  background: #fafcff;
}
.gantt-site-name {
  font-size: .76rem; font-weight: 700; color: #1a2340;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 196px; display: block;
}
.gantt-site-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.gantt-sp-badge {
  font-size: .6rem; font-weight: 700; padding: 1px 6px;
  border-radius: 10px; border: 1px solid; white-space: nowrap;
}
.gantt-status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.gantt-status-text { font-size: .65rem; color: #666; }
.gantt-ms-count { font-size: .62rem; color: #e65100; font-weight: 700; }

/* Chart column */
.gantt-chart-col {
  flex: 1; position: relative;
  min-height: 44px; overflow: hidden;
}

/* Grid lines (monthly) — via repeating background on the body */
.gantt-chart-col::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent calc(8.333% - 1px),
    #eef2f8 calc(8.333% - 1px),
    #eef2f8 8.333%
  );
  pointer-events: none; z-index: 0;
}

/* Today line */
.gantt-today-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #e65100; z-index: 4; pointer-events: none;
}
.gantt-today-head {
  top: 0; height: 100%;
}

/* Site bar */
.gantt-bar-wrap {
  position: absolute; top: 8px; bottom: 8px;
  z-index: 2; cursor: pointer;
}
.gantt-bar {
  width: 100%; height: 100%;
  border-radius: 5px; overflow: hidden;
  position: relative;
  transition: opacity .15s;
}
.gantt-bar:hover { opacity: .85; }
.gantt-bar-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  border-radius: 5px 0 0 5px;
  transition: width .4s;
}
.gantt-bar-label {
  position: absolute; top: 50%; left: 6px; transform: translateY(-50%);
  font-size: .64rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: calc(100% - 10px);
  z-index: 1; pointer-events: none;
}

/* Milestone diamond */
.gantt-milestone {
  position: absolute; top: 50%; transform: translate(-50%, -50%) rotate(45deg);
  width: 10px; height: 10px; border-radius: 2px;
  z-index: 5; cursor: pointer;
  transition: transform .15s;
}
.gantt-milestone:hover { transform: translate(-50%, -50%) rotate(45deg) scale(1.5); }
.gantt-milestone-tooltip {
  display: none; position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  background: #1a2340; color: #fff;
  font-size: .68rem; font-weight: 600;
  padding: 5px 9px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
  z-index: 20;
}
.gantt-milestone:hover .gantt-milestone-tooltip { display: block; }

/* No-date placeholder */
.gantt-no-date {
  position: absolute; top: 50%; left: 8px; transform: translateY(-50%);
  font-size: .65rem; color: #bbb; font-style: italic;
  pointer-events: none; z-index: 1;
}

/* Footer */
.gantt-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px;
  padding: 8px 14px;
  background: #f8fbff; border-top: 1px solid #e0e8f5;
  font-size: .72rem; color: #667;
}

/* Empty state */
.gantt-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px; text-align: center; gap: 10px;
}
.gantt-empty-icon { font-size: 2.5rem; }
.gantt-empty-title { font-size: 1rem; font-weight: 800; color: #445; }
.gantt-empty-sub { font-size: .8rem; color: #888; max-width: 380px; line-height: 1.6; }

.phase-tab-icon { font-size: .65rem; }
#tab-btn-procurement .phase-tab-icon { color: #1565c0; }
#tab-btn-execution   .phase-tab-icon { color: #2e8b40; }
#tab-btn-procurement.active .phase-tab-icon { color: #1565c0; }
#tab-btn-execution.active   .phase-tab-icon { color: #2e8b40; }

/* Phase panel */
.phase-panel {
  background: #ffffff;
  border: 1.5px solid #e0e8f5;
  border-top: none;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}

/* Phase panel header bar */
.phase-panel-header {
  padding: 16px 22px 14px;
  display: flex; flex-direction: column; gap: 3px;
}
.procurement-header {
  background: linear-gradient(135deg, #0d47a1, #1565c0, #1976d2);
  color: white;
}
.execution-header {
  background: linear-gradient(135deg, #1a5c2a, #2e8b40, #388e3c);
  color: white;
}
.phase-panel-title {
  font-size: 1.05rem; font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.phase-number {
  background: rgba(255,255,255,.22);
  font-size: .72rem; font-weight: 800;
  padding: 2px 10px; border-radius: 20px;
  letter-spacing: .5px;
}
.phase-panel-subtitle {
  font-size: .78rem; opacity: .85; font-weight: 400;
}

/* Category group inside phase */
.phase-cat-group {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid #eef2f8;
}
.phase-cat-group:last-child { border-bottom: none; }

/* Site count badge */
.site-count-badge {
  font-size: .68rem; font-weight: 700;
  background: rgba(21,101,192,.12); color: var(--blue);
  padding: 2px 9px; border-radius: 20px;
  border: 1px solid rgba(21,101,192,.2);
}

/* ── Construction category header — tinted blue to distinguish from Study ── */
.cat-group-label-construction {
  background: #e8f0fe;
  border-left: 3px solid #1565c0;
  color: #0d47a1;
}



/* Procurement window card colour */
.procurement-window {
  border-color: #bbdefb;
}
.procurement-window:hover { box-shadow: 0 6px 24px rgba(21,101,192,.14); }
.procurement-win-header {
  background: linear-gradient(90deg, #e3f2fd, #f0f8ff);
  border-bottom-color: #bbdefb;
}
.procurement-num { background: #1565c0; }

/* Execution window card colour */
.execution-window {
  border-color: #c8e6c9;
}
.execution-window:hover { box-shadow: 0 6px 24px rgba(46,139,64,.14); }
.execution-win-header {
  background: linear-gradient(90deg, #e8f5e9, #f4fbf4);
  border-bottom-color: #c8e6c9;
}
.execution-num { background: #2e8b40; }

/* Execution status badge */
.exec-status-badge,
.exec-subphase-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 700; letter-spacing: .4px;
  padding: 3px 10px; border-radius: 12px;
  border: 1.5px solid; white-space: nowrap;
}

/* ── Phase 2 execution sub-tabs (Study / Physical Construction) ── */
.exec-subtabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px 0;
  border-bottom: 2px solid #e0e8f0;
  background: #f8fbff;
}
.exec-subtab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 20px;
  font-size: .8rem; font-weight: 700;
  font-family: 'Source Sans 3', 'Georgia', serif;
  color: #666;
  background: #f0f4f8;
  border: 1.5px solid #dde6f0;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  transition: background .18s, color .18s;
  position: relative; bottom: -2px;
}
.exec-subtab:hover {
  background: #e6eef8; color: #333;
}
.exec-subtab.active {
  background: #ffffff;
  color: #0d3c7a;
  border-color: #b0c8e8;
  border-bottom-color: #ffffff;
  box-shadow: 0 -2px 8px rgba(21,101,192,.08);
}
.exec-subtab-dot {
  font-size: .65rem;
}

/* ── Sub-panel description header ── */
.exec-subpanel-header {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 18px;
  margin: 0 0 12px;
  background: #f9fbff;
  border-radius: 0 0 8px 8px;
  border-left: 4px solid #1565c0;
}
.exec-subpanel-label {
  font-size: .78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .6px;
}
.exec-subpanel-desc {
  font-size: .73rem; color: #556; font-style: italic;
}

/* ════════════════════════════════════════════════════════
   ETI (EXIM Bank of India) — 4-Component Layout
════════════════════════════════════════════════════════ */

/* Project banner at top of phase view */
.eti-project-banner {
  background: linear-gradient(135deg, #fff8e1 0%, #e8f5e9 50%, #e3f2fd 100%);
  border: 1px solid #c8e6c9;
  border-radius: 10px 10px 0 0;
  padding: 14px 20px 12px;
  margin-bottom: 0;
}
.eti-banner-title {
  font-size: .82rem; font-weight: 800;
  color: #1a3a2a; letter-spacing: .3px;
  margin-bottom: 10px;
}
.eti-banner-components {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.eti-comp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700;
  border: 1.5px solid currentColor;
  border-radius: 20px;
  padding: 4px 12px;
  background: #fff;
  white-space: nowrap;
}

/* Component tab bar */
.eti-comp-subtabs {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 2px solid #e0e8f0;
  background: #f5f8fc;
  padding: 8px 12px 0;
  margin-bottom: 0;
}
.eti-comp-subtab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px 11px;
  font-size: .78rem; font-weight: 700;
  border: none; background: none; cursor: pointer;
  color: #556; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all .15s;
  border-radius: 6px 6px 0 0;
}
.eti-comp-subtab:hover { background: #eaf0fb; }
.eti-comp-subtab.active { background: #fff; }

/* Per-component inner subphase tabs */
.exec-comp-subtabs {
  display: flex; gap: 0;
  border-bottom: 1px solid #dde5ee;
  background: #f9fbff;
  padding: 6px 12px 0;
  margin: 0 0 0;
}

/* Component subpanel header (coloured) */
.eti-comp-header {
  display: flex; align-items: center; gap: 8px;
  flex-direction: row !important;
  padding: 10px 18px;
  margin: 0 0 0;
  border-radius: 0;
}
.eti-comp-header .exec-subpanel-label {
  flex: 1;
}
.eti-comp-header .exec-subpanel-desc {
  font-size: .7rem; color: #667; font-style: italic; margin-left: auto;
}

/* ════════════════════════════════════════════════════════
   INSPECTIONS PANEL  (EXIM India)
════════════════════════════════════════════════════════ */
.exec-subtab-inspections { }        /* inherits all .exec-subtab rules */
.exec-subtab-contract-monitoring { } /* inherits all .exec-subtab rules */

/* ════════════════════════════════════════════════════════
   CONTRACT MONITORING PANEL  (ETI)
════════════════════════════════════════════════════════ */
.cm-panel {
  padding: 14px 18px 28px;
}

/* Toolbar */
.cm-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px;
}
.cm-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cm-count-badge {
  font-size: .72rem; font-weight: 700;
  background: rgba(0,105,92,.1); color: #00695c;
  border: 1px solid rgba(0,105,92,.25); border-radius: 20px;
  padding: 3px 12px;
}
.cm-comp-label {
  font-size: .73rem; color: #667; font-style: italic;
}
.btn-cm-add {
  padding: 7px 16px; font-size: .78rem; font-weight: 700;
  background: #00695c; color: #fff; border: none;
  border-radius: 6px; cursor: pointer; transition: background .15s;
}
.btn-cm-add:hover { background: #004d40; }

/* Add / Edit form */
.cm-form-wrap {
  background: #f0faf8;
  border: 1.5px solid #80cbc4;
  border-radius: 10px;
  padding: 18px 20px 16px;
  margin-bottom: 20px;
}
.cm-form-title {
  font-size: .82rem; font-weight: 800; color: #00695c;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 14px;
}
.cm-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 16px;
  margin-bottom: 14px;
}
.cm-field-full { grid-column: 1 / -1; }
.cm-form-field label {
  display: block; font-size: .72rem; font-weight: 700;
  color: #445; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px;
}
.cm-form-field input,
.cm-form-field select,
.cm-form-field textarea {
  width: 100%; padding: 7px 10px; font-size: .82rem;
  border: 1.5px solid #b2dfdb; border-radius: 6px;
  background: #fff; color: #223; box-sizing: border-box;
  transition: border-color .15s;
}
.cm-form-field input:focus,
.cm-form-field select:focus,
.cm-form-field textarea:focus {
  outline: none; border-color: #00695c; box-shadow: 0 0 0 3px rgba(0,105,92,.1);
}
.cm-form-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.btn-cm-save {
  padding: 8px 20px; font-size: .8rem; font-weight: 700;
  background: #00695c; color: #fff; border: none;
  border-radius: 6px; cursor: pointer; transition: background .15s;
}
.btn-cm-save:hover { background: #004d40; }
.btn-cm-cancel {
  padding: 8px 16px; font-size: .8rem; font-weight: 600;
  background: #fff; color: #667; border: 1.5px solid #ccc;
  border-radius: 6px; cursor: pointer; transition: all .15s;
}
.btn-cm-cancel:hover { background: #f5f5f5; }

/* Empty state */
.cm-empty {
  text-align: center; padding: 44px 20px;
  color: #778; background: #f9fbfa;
  border: 1.5px dashed #b2dfdb; border-radius: 10px;
  margin-top: 8px;
}
.cm-empty-icon { font-size: 2.2rem; margin-bottom: 10px; }
.cm-empty-title { font-size: .9rem; font-weight: 700; color: #445; margin-bottom: 6px; }
.cm-empty-sub   { font-size: .78rem; color: #778; }

/* Contract cards */
.cm-records-list { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.cm-record-card {
  background: #fff;
  border: 1.5px solid #e0f2f1;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,105,92,.06);
  overflow: hidden;
  transition: box-shadow .15s;
}
.cm-record-card:hover { box-shadow: 0 4px 16px rgba(0,105,92,.12); }

.cm-card-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 10px;
  background: linear-gradient(135deg, #e0f2f1, #f9fbfa);
  border-bottom: 1px solid #e0f2f1;
}
.cm-card-title {
  font-size: .85rem; font-weight: 800; color: #00695c; flex: 1;
}
.cm-card-header-right {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cm-status-badge {
  font-size: .7rem; font-weight: 700;
  border: 1.5px solid; border-radius: 20px;
  padding: 3px 10px;
}
.btn-cm-edit, .btn-cm-del {
  padding: 4px 9px; font-size: .78rem; border-radius: 5px;
  border: 1.5px solid #ccc; background: #fff; cursor: pointer;
  transition: all .15s;
}
.btn-cm-edit:hover { background: #e3f2fd; border-color: #90caf9; color: #1565c0; }
.btn-cm-del:hover  { background: #ffebee; border-color: #ef9a9a; color: #c62828; }

.cm-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0;
  padding: 12px 16px 8px;
}
.cm-card-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 8px 6px 0;
  border-right: 1px solid #f0f4f4;
}
.cm-card-row:last-child { border-right: none; }
.cm-field-label {
  font-size: .66rem; font-weight: 700; color: #889;
  text-transform: uppercase; letter-spacing: .5px;
}
.cm-field-val {
  font-size: .8rem; font-weight: 600; color: #223;
}

/* Progress bar */
.cm-card-progress {
  padding: 8px 16px 12px;
  border-top: 1px solid #f0f4f4;
}
.cm-progress-label {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: #556; margin-bottom: 5px; font-weight: 600;
}
.cm-progress-track {
  height: 8px; background: #e0f2f1; border-radius: 8px; overflow: hidden;
}
.cm-progress-fill {
  height: 100%; border-radius: 8px;
  transition: width .4s ease;
}

/* Remarks */
.cm-card-remarks {
  font-size: .76rem; color: #556;
  padding: 8px 16px 12px;
  border-top: 1px solid #f0f4f4;
  background: #fafffe;
}
.cm-remarks-label { font-weight: 700; color: #00695c; }

@media (max-width: 600px) {
  .cm-form-grid { grid-template-columns: 1fr; }
  .cm-card-body { grid-template-columns: 1fr 1fr; }
}

.insp-panel {
  padding: 14px 18px 24px;
}

/* Toolbar */
.insp-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px;
}
.insp-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.insp-count-badge {
  font-size: .72rem; font-weight: 700;
  background: rgba(230,81,0,.1); color: #e65100;
  border: 1px solid rgba(230,81,0,.25); border-radius: 20px;
  padding: 3px 12px;
}
.insp-open-badge {
  font-size: .72rem; font-weight: 700;
  background: rgba(183,28,28,.08); color: #b71c1c;
  border: 1px solid rgba(183,28,28,.2); border-radius: 20px;
  padding: 3px 12px;
}
.btn-insp-add {
  font-size: .78rem; font-weight: 700;
  background: #e65100; color: #fff;
  border: none; border-radius: 8px; padding: 7px 18px;
  cursor: pointer; font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .18s, transform .1s;
}
.btn-insp-add:hover { background: #bf360c; transform: translateY(-1px); }

/* Add / Edit form */
.insp-form-wrap {
  background: #fff8f5;
  border: 1.5px solid #ffccbc;
  border-radius: 12px;
  padding: 18px 20px 14px;
  margin-bottom: 20px;
  animation: fadeInDown .18s ease;
}
.insp-form-title {
  font-size: .88rem; font-weight: 800; color: #bf360c;
  margin-bottom: 14px; letter-spacing: .2px;
}
.insp-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.insp-form-field { display: flex; flex-direction: column; gap: 4px; }
.insp-form-field label {
  font-size: .7rem; font-weight: 700; color: #555;
  text-transform: uppercase; letter-spacing: .4px;
}
.insp-form-field input,
.insp-form-field select,
.insp-form-field textarea {
  font-size: .82rem; color: #222;
  background: #fff; border: 1.5px solid #ddd;
  border-radius: 7px; padding: 6px 10px;
  font-family: 'Source Sans 3', 'Georgia', serif;
  outline: none; transition: border-color .18s, box-shadow .18s;
  resize: vertical;
}
.insp-form-field input:focus,
.insp-form-field select:focus,
.insp-form-field textarea:focus {
  border-color: #e65100;
  box-shadow: 0 0 0 3px rgba(230,81,0,.12);
}
.insp-full-width { grid-column: 1 / -1; }
.insp-form-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding-top: 4px;
}
.btn-insp-save {
  font-size: .78rem; font-weight: 700;
  background: #e65100; color: #fff;
  border: none; border-radius: 8px; padding: 7px 20px;
  cursor: pointer; font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .18s;
}
.btn-insp-save:hover { background: #bf360c; }
.btn-insp-save:disabled { opacity: .6; cursor: not-allowed; }
.btn-insp-cancel {
  font-size: .78rem; font-weight: 700;
  background: #f5f5f5; color: #555;
  border: 1px solid #ccc; border-radius: 8px; padding: 7px 16px;
  cursor: pointer; font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .15s;
}
.btn-insp-cancel:hover { background: #e0e0e0; }

/* Empty state */
.insp-empty {
  text-align: center; padding: 40px 20px; color: #888;
}
.insp-empty-icon { font-size: 2.4rem; margin-bottom: 10px; }
.insp-empty-msg  { font-size: .85rem; }

/* Record cards */
.insp-records-list { display: flex; flex-direction: column; gap: 14px; }
.insp-record-card {
  background: #fff;
  border: 1.5px solid #ffe0cc;
  border-left: 5px solid #e65100;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .18s;
}
.insp-record-card:hover { box-shadow: 0 4px 18px rgba(230,81,0,.12); }

.insp-record-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 10px 14px 8px;
  background: #fff8f5;
  border-bottom: 1px solid #ffe0cc;
}
.insp-record-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
}
.insp-record-date {
  font-size: .76rem; font-weight: 700; color: #555;
}
.insp-type-badge, .insp-status-badge {
  font-size: .67rem; font-weight: 700;
  border-radius: 20px; padding: 2px 10px;
  border: 1px solid;
}
.insp-followup-pill {
  font-size: .67rem; font-weight: 700;
  background: #fff3e0; color: #e65100;
  border: 1px solid #ffcc80; border-radius: 20px;
  padding: 2px 9px;
}
.insp-record-actions { display: flex; gap: 6px; }
.btn-insp-edit {
  font-size: .68rem; font-weight: 700;
  background: rgba(21,101,192,.1); color: #1565c0;
  border: 1px solid rgba(21,101,192,.25); border-radius: 8px;
  padding: 3px 11px; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .15s;
}
.btn-insp-edit:hover { background: rgba(21,101,192,.2); }
.btn-insp-delete {
  font-size: .78rem; font-weight: 700;
  background: rgba(183,28,28,.08); color: #b71c1c;
  border: 1px solid rgba(183,28,28,.2); border-radius: 8px;
  padding: 3px 9px; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .15s;
}
.btn-insp-delete:hover { background: rgba(183,28,28,.18); }

.insp-record-body {
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.insp-record-site {
  font-size: .82rem; color: #333;
}
.insp-record-inspector {
  font-size: .78rem; color: #555;
}
.insp-section-block {
  background: #fafafa;
  border-left: 3px solid #ffab76;
  border-radius: 0 6px 6px 0;
  padding: 7px 10px;
}
.insp-section-label {
  font-size: .67rem; font-weight: 800; color: #e65100;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 3px;
}
.insp-section-text {
  font-size: .8rem; color: #333; line-height: 1.55;
  white-space: pre-line;
}
.insp-attachments {
  font-size: .74rem; color: #7b1fa2;
  font-style: italic;
}
.insp-last-edited {
  font-size: .67rem; color: #999;
  border-top: 1px solid #f0e8e0;
  padding-top: 6px; margin-top: 2px;
}

/* ── Execution progress bars ── */
.exec-progress-block {
  margin-top: 8px; margin-bottom: 4px;
  display: flex; flex-direction: column; gap: 5px;
}
.exec-progress-row {
  display: flex; align-items: center; gap: 7px;
}
.exec-progress-label {
  font-size: .67rem; font-weight: 700; min-width: 130px;
  white-space: nowrap;
}
.exec-progress-track {
  flex: 1; height: 8px; background: #e8e8e8;
  border-radius: 6px; overflow: hidden;
}
.exec-progress-fill {
  height: 100%; border-radius: 6px;
  transition: width .5s ease;
}
.exec-progress-pct {
  font-size: .7rem; font-weight: 800; min-width: 36px;
  text-align: right;
}

/* ── Procurement summary cards (Phase 1 outcomes) ── */
.exec-proc-summary-section { background: #fafffe; }
.exec-proc-summary-card {
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-left: 4px solid #1565c0;
  box-shadow: 0 1px 6px rgba(21,101,192,.07);
}
.exec-proc-summary-title {
  font-size: .75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px;
}
.exec-proc-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 12px;
}
.exec-proc-summary-grid > div {
  display: flex; flex-direction: column; gap: 2px;
}

/* ── Milestones list ── */
.exec-milestones-list,
.exec-issues-list {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 6px;
}
.exec-milestone-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  background: #fafffe;
  border: 1px solid #d0e8d8;
  border-radius: 8px;
  font-size: .8rem;
}
.exec-milestone-check {
  font-size: 1rem; font-weight: 700; min-width: 18px;
}
.exec-milestone-text { flex: 1; }
.exec-milestone-date {
  font-size: .72rem; color: #666;
  background: #f0f7f2; padding: 2px 7px;
  border-radius: 10px; border: 1px solid #d0e8d8;
  white-space: nowrap;
}
.exec-milestone-empty {
  font-size: .78rem; color: #888;
  font-style: italic; padding: 6px 2px;
}

/* ── Issues / Risks ── */
.exec-issue-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 5px 8px;
  background: #fffaf9;
  border: 1px solid #f5c6b0;
  border-radius: 8px;
  font-size: .8rem;
}
.exec-issue-sev {
  font-size: .65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
  border: 1.5px solid; white-space: nowrap;
  flex-shrink: 0;
}
.exec-issue-text { flex: 1; }

/* ════════════════════════════════════════════════════════
   STUDY PHASE CARDS  (Phase 2A – Study sub-phase)
════════════════════════════════════════════════════════ */

/* ── Overall Study Progress card ── */
.study-overall-progress-card {
  background: #fff;
  border: 1.5px solid #d0c4e8;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(123,31,162,.08);
}
.study-overall-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.study-overall-label {
  font-size: .75rem;
  font-weight: 800;
  color: #4a148c;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.study-overall-pct {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -.5px;
}
.study-overall-track {
  height: 10px;
  background: #ede7f6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.study-overall-fill {
  height: 100%;
  border-radius: 6px;
  transition: width .5s ease;
}

/* Per-phase breakdown rows */
.study-overall-breakdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid #ede7f6;
  padding-top: 8px;
}
.study-breakdown-item {
  display: flex;
  align-items: center;
  gap: 7px;
}
.study-breakdown-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.study-breakdown-name {
  font-size: .68rem;
  font-weight: 700;
  color: #555;
  min-width: 28px;
}
.study-breakdown-track {
  flex: 1;
  height: 7px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}
.study-breakdown-pct {
  font-size: .7rem;
  font-weight: 800;
  min-width: 42px;
  text-align: right;
}

/* ════════════════════════════════════════════════════════
   DELIVERABLE TICK CONTROL  (attempt tracking + lock)
════════════════════════════════════════════════════════ */

/* Warning row — 2nd tick reached */
.study-del-warn-row {
  background: #fff8e1 !important;
  border-color: #ffe082 !important;
}

/* Locked row */
.study-del-locked-row {
  background: #fafafa !important;
  border-color: #e0e0e0 !important;
  opacity: .92;
  cursor: not-allowed;
}

/* Lock badge inside edit row */
.study-del-lock-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 800;
  color: #b71c1c; background: #ffebee;
  border: 1.5px solid #ef9a9a;
  border-radius: 10px; padding: 2px 9px;
  white-space: nowrap; flex-shrink: 0;
}

/* Lock info block inside locked row */
.study-del-lock-info {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
}
.study-del-lock-info-inline {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px; flex-wrap: wrap;
}
.study-del-lock-sub {
  font-size: .68rem; color: #b71c1c; font-style: italic;
}

/* Admin unlock button */
.study-del-admin-unlock {
  font-size: .68rem; font-weight: 700;
  padding: 3px 10px; border-radius: 10px;
  border: 1.5px solid #1565c0;
  background: #e3f2fd; color: #1565c0;
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.study-del-admin-unlock:hover {
  background: #1565c0; color: #fff;
}

/* Contact admin hint (non-admin) */
.study-del-locked-hint {
  font-size: .68rem; color: #888; font-style: italic;
}

/* Attempts badge inside edit row */
.study-del-attempts-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .63rem; font-weight: 800;
  padding: 2px 7px; border-radius: 10px;
  border: 1.5px solid; margin-left: 6px;
  white-space: nowrap;
}
.study-del-attempts-badge.warn {
  color: #e65100; background: #fff3e0; border-color: #ffcc80;
}

/* ── View mode lock / warn badges ── */
.study-view-lock-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .62rem; font-weight: 800;
  color: #b71c1c; background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: 8px; padding: 1px 7px;
  margin-left: 6px; vertical-align: middle;
  white-space: nowrap;
}
.study-view-warn-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .62rem; font-weight: 800;
  color: #e65100; background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 8px; padding: 1px 7px;
  margin-left: 6px; vertical-align: middle;
  white-space: nowrap;
}
.study-deliverable-locked {
  background: #fafafa;
  border-bottom-color: #f0f0f0 !important;
  opacity: .85;
}

/* ── Applicable / Not Applicable badge (view mode) ── */
.study-applicable-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 700;
  padding: 2px 10px; border-radius: 12px;
  border: 1.5px solid; white-space: nowrap;
}
.study-applicable-badge.applicable {
  background: #1b5e2015; color: #1b5e20; border-color: #1b5e2040;
}
.study-applicable-badge.not-applicable {
  background: #61616115; color: #616161; border-color: #bdbdbd;
}

/* ── N/A strip (view mode) ── */
.study-phase-na-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-size: .78rem; color: #757575;
}
.study-na-icon {
  font-size: 1.1rem; font-weight: 900; color: #bdbdbd;
}

/* ── Greyed-out card when N/A ── */
.study-phase-na .study-phase-card-body { opacity: .45; pointer-events: none; }

/* ── Applicable toggle row (edit mode) ── */
.study-applicable-toggle-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; padding: 8px 0 10px;
  border-bottom: 1px dashed #e0e0e0; margin-bottom: 10px;
}
.study-applicable-toggle-label {
  font-size: .75rem; font-weight: 700; color: #444;
  white-space: nowrap;
}
.study-applicable-toggle-btns {
  display: flex; gap: 6px;
}
.study-toggle-btn {
  font-size: .72rem; font-weight: 700;
  padding: 4px 14px; border-radius: 20px;
  border: 1.5px solid #ccc; background: #f5f5f5;
  color: #777; cursor: pointer; transition: all .18s;
}
.study-toggle-btn:hover { border-color: #aaa; background: #eee; }
.study-toggle-btn.active-yes {
  background: #1b5e2015; color: #1b5e20;
  border-color: #1b5e2060; font-weight: 800;
}
.study-toggle-btn.active-no {
  background: #61616115; color: #424242;
  border-color: #bdbdbd; font-weight: 800;
}

/* ── Percentage input row (edit mode) ── */
.study-pct-input-row {
  background: #fafafa; border: 1.5px solid #e8e8e8;
  border-radius: 9px; padding: 10px 12px; margin-bottom: 8px;
}
.study-pct-label {
  font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .4px;
  display: block; margin-bottom: 6px;
}
.study-pct-input-wrap {
  display: flex; align-items: center; gap: 8px;
}
.study-pct-input-wrap input[type="range"] {
  flex: 1; height: 6px; cursor: pointer;
}
.study-pct-number {
  width: 60px; text-align: center;
  font-size: .85rem; font-weight: 800;
  padding: 4px 6px; border-radius: 7px;
  border: 1.5px solid;
}
.study-pct-unit {
  font-size: .85rem; font-weight: 800; min-width: 14px;
}

/* ── Live % display in edit mode (replaces manual slider) ── */
.study-pct-live-display {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  background: #f8faff;
  border: 1.5px solid;
  border-radius: 9px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.study-pct-live-left {
  display: flex; flex-direction: column; gap: 2px;
}
.study-pct-live-label {
  font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .4px;
}
.study-pct-live-hint {
  font-size: .64rem; color: #777; font-style: italic;
}
.study-pct-live-right {
  display: flex; flex-direction: column; align-items: flex-end;
}
.study-pct-live-val {
  font-size: 1.5rem; font-weight: 900; line-height: 1;
  letter-spacing: -1px;
}
.study-pct-live-sub {
  font-size: .64rem; font-weight: 600; margin-top: 2px;
}

/* ── Per-phase progress bar inside each card ── */
.study-phase-progress-bar-wrap { }
.study-phase-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.study-phase-progress-track {
  height: 8px;
  background: rgba(0,0,0,.1);
  border-radius: 5px;
  overflow: hidden;
}
.study-phase-progress-fill {
  height: 100%;
  border-radius: 5px;
  transition: width .5s ease;
}

/* Weight tag pill */
.study-phase-weight-tag {
  font-size: .64rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1.5px solid;
  white-space: nowrap;
  letter-spacing: .3px;
}

/* Container holding all 3 phase cards */
.study-phases-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

/* Individual phase card */
.study-phase-card {
  border-radius: 10px;
  border: 1.5px solid #e0e0e0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* Card header strip */
.study-phase-card-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}
.study-phase-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.study-phase-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.study-phase-title-text {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1px;
}
.study-phase-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.study-phase-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
  border: 1.5px solid;
  white-space: nowrap;
}
.study-phase-date-pill {
  font-size: .68rem;
  color: #555;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Card body */
.study-phase-card-body {
  padding: 10px 14px;
  background: #fff;
}
.study-deliverables-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.study-deliverable-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
}
.study-deliverable-row:last-child { border-bottom: none; }
.study-deliverable-check {
  font-size: 1rem;
  font-weight: 700;
  min-width: 18px;
  flex-shrink: 0;
  line-height: 1.4;
}
.study-deliverable-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.study-deliverable-label {
  font-size: .8rem;
  font-weight: 600;
  color: #1b2e1b;
}
.study-deliverable-date {
  font-size: .7rem;
  color: #1565c0;
  font-weight: 600;
}
.study-deliverable-note {
  font-size: .7rem;
  color: #666;
  font-style: italic;
}
.study-phase-remarks {
  margin-top: 8px;
  padding: 6px 10px;
  background: #fafafa;
  border-radius: 7px;
  border: 1px solid #e8e8e8;
  font-size: .78rem;
  color: #444;
}

/* ── Study phase EDIT sections ── */
.study-phase-edit-section {
  padding-left: 12px !important;
}
.study-phase-number-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 14px;
  font-size: .67rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .4px;
  white-space: nowrap;
  margin-right: 4px;
}

/* Deliverables edit list */
.study-deliverables-edit-list {
  margin-top: 10px;
  border: 1.5px solid #e8e8e8;
  border-radius: 9px;
  overflow: hidden;
}
.study-del-edit-header {
  font-size: .71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #555;
  padding: 7px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #e8e8e8;
}
.study-del-edit-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}
.study-del-edit-row:last-child { border-bottom: none; }
.study-del-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.study-del-check-label input[type="checkbox"] {
  width: 15px; height: 15px;
  flex-shrink: 0;
  accent-color: #2e8b40;
}
.study-del-label-text {
  font-size: .8rem;
  font-weight: 600;
  color: #1b2e1b;
}
.study-del-edit-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: 23px;
}
.study-del-edit-meta input[type="date"],
.study-del-edit-meta input[type="text"] {
  font-size: .75rem;
  padding: 4px 9px;
  border: 1.5px solid #d0d8e8;
  border-radius: 7px;
  background: #f8faff;
  color: #222;
}
.study-del-edit-meta input[type="date"] { min-width: 140px; }
.study-del-edit-meta input[type="text"] { flex: 1; min-width: 180px; }

/* ── Execution edit rows (milestones / issues) ── */
.exec-edit-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  background: #f7fbff;
  border: 1.5px solid #d0dff5;
  border-radius: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.exec-ms-label,
.exec-iss-desc {
  flex: 1; min-width: 150px;
  padding: 5px 10px;
  border: 1.5px solid #c8d8f0;
  border-radius: 7px;
  font-size: .8rem;
  background: #fff;
}
.exec-ms-date {
  padding: 5px 10px;
  border: 1.5px solid #c8d8f0;
  border-radius: 7px;
  font-size: .8rem;
  background: #fff;
  min-width: 140px;
}
.exec-iss-sev {
  padding: 5px 10px;
  border: 1.5px solid #c8d8f0;
  border-radius: 7px;
  font-size: .8rem;
  background: #fff;
  min-width: 110px;
}
.exec-ms-done-label {
  display: flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 600; color: #2e7d32;
  white-space: nowrap;
}
.btn-exec-add-row {
  margin-top: 6px;
  padding: 5px 14px;
  background: #e8f5e9;
  color: #1b5e20;
  border: 1.5px solid #a5d6a7;
  border-radius: 8px;
  font-size: .78rem; font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.btn-exec-add-row:hover { background: #c8e6c9; }
.btn-exec-del-row {
  padding: 4px 8px;
  background: #fdecea; color: #c62828;
  border: 1.5px solid #ef9a9a;
  border-radius: 7px;
  font-size: .75rem; font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-exec-del-row:hover { background: #ffcdd2; }

/* ════════════════════════════════════════════════════
   BILL OF QUANTITIES (BOQ) — Physical Construction
════════════════════════════════════════════════════ */
/* ════════════════════════════════════════
   BOQ — Bill of Quantities
════════════════════════════════════════ */
.boq-view-wrap,
.boq-edit-wrap {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 4px;
}

/* Meta strip */
.boq-meta-strip {
  display: flex; flex-wrap: wrap; gap: 8px;
  background: #f0f4ff; border: 1px solid #c8d8f4;
  border-radius: 10px; padding: 10px 14px;
  margin-bottom: 4px;
}
.boq-meta-item {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-width: 160px;
}
.boq-meta-label {
  font-size: .64rem; font-weight: 700; color: #7a8ab0;
  text-transform: uppercase; letter-spacing: .5px;
}
.boq-meta-val {
  font-size: .8rem; font-weight: 700; color: #1a2a5c;
}
.boq-grand-amt  { color: #1565c0 !important; font-size: .88rem !important; }
.boq-earned-amt { color: #1b5e20 !important; font-size: .88rem !important; }

/* Section blocks */
.boq-section-block,
.boq-edit-section {
  border: 1.5px solid #e0e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.boq-section-header,
.boq-edit-sec-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  flex-wrap: wrap;
}
.boq-section-key {
  font-size: .72rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: .6px;
  background: rgba(255,255,255,.6);
  padding: 2px 8px; border-radius: 8px;
  flex-shrink: 0;
}
.boq-section-label { font-size: .8rem; font-weight: 700; flex: 1; }
.boq-section-total,
.boq-edit-sec-total {
  font-size: .78rem; font-weight: 800;
  margin-left: auto; white-space: nowrap;
}
.boq-default-badge {
  font-size: .62rem; color: #888; font-style: italic;
  background: rgba(255,255,255,.7); padding: 1px 6px;
  border-radius: 6px; white-space: nowrap;
}
.boq-add-btn {
  margin-left: 8px; padding: 3px 12px;
  font-size: .72rem; flex-shrink: 0;
}

/* Horizontally scrollable table wrapper */
.boq-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* BOQ table */
.boq-table {
  width: 100%; min-width: 900px;
  border-collapse: collapse;
  font-size: .74rem;
}
.boq-table thead tr { background: #f0f4fa; }
.boq-table th {
  padding: 5px 7px;
  text-align: left;
  font-weight: 700;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #446;
  border-bottom: 2px solid #d8e4f4;
  white-space: nowrap;
}
.boq-th-group-prog {
  background: #e8f0fe !important;
  text-align: center !important;
  color: #1565c0 !important;
  border-bottom: 2px solid #b8cffc !important;
}
.boq-th-row-2 th {
  background: #f4f8ff;
  font-size: .62rem;
  color: #1565c0;
}
.boq-table td {
  padding: 5px 7px;
  border-bottom: 1px solid #eef2f8;
  vertical-align: middle;
}
.boq-row:hover td   { background: #f6faff; }
.boq-row-alt td     { background: #fafbff; }
.boq-table tfoot td {
  background: #f4f8ff;
  border-top: 2px solid #c8d8f0;
}
.boq-subtotal-row td { font-size: .73rem; }

/* Column widths */
.boq-th-wbs,    .boq-td-wbs    { width: 62px;  white-space: nowrap; }
.boq-th-unit,   .boq-td-unit   { width: 52px;  text-align: center; }
.boq-th-qty,    .boq-td-qty    { width: 64px;  text-align: right; }
.boq-th-rate,   .boq-td-rate   { width: 100px; text-align: right; }
.boq-th-amt,    .boq-td-amt    { width: 110px; text-align: right; font-weight: 700; color: #1565c0; }
.boq-th-desc,   .boq-td-desc   { min-width: 180px; }
.boq-th-asgn,   .boq-td-asgn   { width: 68px;  text-align: center; }
.boq-th-prev,   .boq-td-prev   { width: 60px;  text-align: center; color: #555; }
.boq-th-added,  .boq-td-added  { width: 64px;  text-align: center; color: #1565c0; }
.boq-th-curr,   .boq-td-curr   { width: 90px;  text-align: center; }
.boq-th-contrib,.boq-td-contrib{ width: 82px;  text-align: center; font-weight: 700; }
.boq-th-remarks,.boq-td-remarks{ min-width: 120px; font-size:.7rem; color:#666; }

/* Current % mini progress bar */
.boq-curr-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.boq-mini-bar {
  height: 4px; border-radius: 3px;
  transition: width .3s;
  max-width: 80px; min-width: 4px;
}

/* Grand total bar */
.boq-grand-total-bar {
  display: flex; flex-wrap: wrap; gap: 14px;
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  color: #fff;
  font-size: .8rem;
  padding: 12px 18px;
  border-radius: 10px;
  margin-top: 2px;
}
.boq-grand-item {
  display: flex; flex-direction: column; gap: 1px;
  flex: 1; min-width: 140px;
}
.boq-grand-item span  { font-size: .65rem; opacity: .8; text-transform: uppercase; letter-spacing: .4px; }
.boq-grand-item strong{ font-size: .9rem; }

/* Edit legend */
.boq-edit-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  background: #f8faff; border: 1px dashed #c0d0f0;
  border-radius: 8px; padding: 8px 12px;
  font-size: .64rem; color: #555;
}
.boq-legend-item strong { color: #1565c0; }

/* BOQ edit table inputs */
.boq-edit-table { background: #fafcff; }
.boq-inp {
  width: 100%;
  padding: 3px 6px;
  border: 1.5px solid #c8d8f0;
  border-radius: 5px;
  font-size: .72rem;
  font-family: 'Source Sans 3', 'Georgia', serif;
  background: #fff;
  box-sizing: border-box;
}
.boq-inp:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 2px rgba(21,101,192,.12);
}
.boq-inp-qty,
.boq-inp-rate,
.boq-inp-asgn,
.boq-inp-prev,
.boq-inp-added { text-align: right; width: 100%; }
.boq-del-btn {
  background: #ffebee !important; color: #c62828 !important;
  border: 1px solid #ffcdd2 !important;
  padding: 3px 7px !important; font-size: .7rem !important;
}
.boq-del-btn:hover { background: #ffcdd2 !important; }

/* Export button */
.boq-export-btn {
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  color: #fff;
  border: none; border-radius: 8px;
  padding: 5px 14px; font-size: .73rem; font-weight: 700;
  cursor: pointer; letter-spacing: .3px;
  display: flex; align-items: center; gap: 5px;
  transition: opacity .2s;
  white-space: nowrap;
}
.boq-export-btn:hover { opacity: .88; }

/* BOQ — CSV Import button */
.boq-import-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, #e65100, #f57c00);
  color: #fff;
  border: none; border-radius: 8px;
  padding: 5px 13px; font-size: .73rem; font-weight: 700;
  cursor: pointer; letter-spacing: .3px;
  white-space: nowrap; transition: opacity .2s;
  font-family: 'Source Sans 3', 'Georgia', serif;
}
.boq-import-btn:hover { opacity: .88; }

.boq-template-link {
  font-size: .7rem; font-weight: 600;
  color: #1565c0; text-decoration: none;
  border: 1.5px solid #90caf9;
  background: #e3f2fd;
  padding: 4px 10px; border-radius: 8px;
  white-space: nowrap; transition: background .2s;
}
.boq-template-link:hover { background: #bbdefb; }

.boq-import-hint {
  font-size: .68rem; color: #888;
  background: #fffde7; border: 1px dashed #ffe082;
  border-radius: 7px; padding: 6px 12px;
  margin-bottom: 8px;
}

/* ════════════════════════════════════════
   BOQ — Validation Modal
════════════════════════════════════════ */
.bvm-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn .15s ease;
}
.bvm-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  width: 100%; max-width: 680px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.bvm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  flex-shrink: 0;
}
.bvm-header-err  { background: #b71c1c; color: #fff; }
.bvm-header-warn { background: #e65100; color: #fff; }
.bvm-title { font-size: .9rem; font-weight: 800; letter-spacing: .2px; }
.bvm-close {
  background: rgba(255,255,255,.2); border: none;
  color: #fff; border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer;
  font-size: .85rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.bvm-close:hover { background: rgba(255,255,255,.35); }

.bvm-body {
  padding: 16px 20px;
  overflow-y: auto; flex: 1;
}
.bvm-section-label {
  font-size: .65rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .7px;
  padding: 4px 10px; border-radius: 6px;
  margin-bottom: 8px;
}
.bvm-err-label  { background: #ffebee; color: #b71c1c; }
.bvm-warn-label { background: #fff3e0; color: #e65100; }

.bvm-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.bvm-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .76rem; line-height: 1.5;
  padding: 8px 12px; border-radius: 8px;
}
.bvm-error  { background: #fff5f5; border: 1px solid #ffcdd2; color: #c62828; }
.bvm-warn   { background: #fffbf0; border: 1px solid #ffe082; color: #bf360c; }
.bvm-ok     { background: #f1f8e9; border: 1px solid #aed581; color: #1b5e20;
              font-weight: 700; font-size: .8rem; }
.bvm-icon   { font-size: .9rem; flex-shrink: 0; margin-top: 1px; }

.bvm-summary {
  margin-top: 12px;
  font-size: .75rem; color: #555;
  background: #f8f9fa; border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
}
.bvm-summary-err { background: #fff5f5; border-color: #ffcdd2; color: #b71c1c; }

.bvm-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.bvm-btn-cancel {
  background: #f5f5f5; color: #555;
  border: 1.5px solid #ddd;
  border-radius: 9px; padding: 8px 20px;
  font-size: .78rem; font-weight: 700;
  cursor: pointer; transition: background .15s;
  font-family: 'Source Sans 3', 'Georgia', serif;
}
.bvm-btn-cancel:hover { background: #eeeeee; }
.bvm-btn-confirm {
  background: linear-gradient(135deg, #1a5c2a, #2e7d32);
  color: #fff; border: none;
  border-radius: 9px; padding: 8px 22px;
  font-size: .78rem; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
  font-family: 'Source Sans 3', 'Georgia', serif;
}
.bvm-btn-confirm:hover { opacity: .88; }

/* BOQ — Procurement tracking columns */
.boq-th-group-proc {
  background: #fff8e1 !important;
  text-align: center !important;
  color: #e65100 !important;
  border-bottom: 2px solid #ffe082 !important;
}
.boq-th-proc-divider,
.boq-td-proc-divider {
  width: 6px !important;
  padding: 0 2px !important;
  background: #e8eaf6 !important;
  border-left: 2px dashed #c5cae9 !important;
  border-right: 2px dashed #c5cae9 !important;
  color: #9fa8da;
  font-size: .65rem;
  text-align: center;
}
.boq-th-row-2 .boq-th-procurable,
.boq-th-row-2 .boq-th-supplier,
.boq-th-row-2 .boq-th-leadtime,
.boq-th-row-2 .boq-th-reqdate,
.boq-th-row-2 .boq-th-orderdate,
.boq-th-row-2 .boq-th-delivery,
.boq-th-row-2 .boq-th-procstatus {
  background: #fffde7;
  color: #e65100;
  font-size: .61rem;
}
.boq-th-procurable,  .boq-td-procurable  { width: 72px;  text-align: center; }
.boq-th-supplier,    .boq-td-supplier    { min-width: 130px; }
.boq-th-leadtime,    .boq-td-leadtime    { width: 64px;  text-align: center; }
.boq-th-reqdate,     .boq-td-reqdate,
.boq-th-orderdate,   .boq-td-orderdate,
.boq-th-delivery,    .boq-td-delivery    { width: 96px;  text-align: center; font-size: .7rem; }
.boq-th-procstatus,  .boq-td-procstatus  { width: 100px; text-align: center; }

/* Procurable badge */
.boq-proc-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 8px;
  font-size: .68rem; font-weight: 700;
}
.boq-proc-yes { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.boq-proc-no  { background: #ffebee; color: #b71c1c; border: 1px solid #ef9a9a; }

/* Procurement status badge */
.boq-procstatus-badge {
  display: inline-block;
  padding: 2px 7px; border-radius: 8px;
  font-size: .66rem; font-weight: 700;
  white-space: nowrap;
}
.boq-procstatus-notrequired { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
.boq-procstatus-pending     { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.boq-procstatus-ordered     { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.boq-procstatus-delivered   { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.boq-procstatus-installed   { background: #1b5e20; color: #fff;    border: 1px solid #1b5e20; }

/* Phase-specific save button colours */
.procurement-save-btn {
  background: linear-gradient(135deg, #0d47a1, #1565c0) !important;
}
.execution-save-btn {
  background: linear-gradient(135deg, #1a5c2a, #2e8b40) !important;
}

/* ════════════════════════════════════════════════════
   SITE WINDOW CARD — Inline editable design
════════════════════════════════════════════════════ */
.site-window {
  background: #ffffff;
  border: 1.5px solid #d7e8fd;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 3px 14px rgba(21,101,192,.07);
  overflow: hidden;
  transition: box-shadow .25s, border-color .25s;
}
.site-window:hover { box-shadow: 0 6px 24px rgba(21,101,192,.13); }
.site-window.editing {
  border-color: var(--gold);
  box-shadow: 0 6px 28px rgba(240,165,0,.2);
}

/* Window header bar */
.site-win-header {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 80px 11px 16px; /* right padding reserves space for the absolute buttons */
  background: linear-gradient(90deg, #f0f6ff 0%, #f8fbff 100%);
  border-bottom: 1px solid #e0ecfc;
  position: relative;
}
.site-win-num {
  min-width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue-light); color: white;
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 3px;
}
.site-win-name {
  font-size: .9rem; font-weight: 700; color: #0d3c7a;
  display: block;
}
.site-win-actions {
  display: flex; gap: 6px; align-items: center;
  position: absolute;
  top: 11px;
  right: 14px;
}

/* Edit / Delete buttons on header */
.btn-win-edit {
  background: var(--gold); color: #333;
  border: none; border-radius: 14px; padding: 4px 14px;
  font-size: .72rem; font-weight: 700; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(240,165,0,.25);
}
.btn-win-edit:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(240,165,0,.4); }
.btn-win-delete {
  background: #fdecea; color: #c62828;
  border: 1px solid #ffcdd2; border-radius: 14px; padding: 4px 12px;
  font-size: .72rem; font-weight: 700; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif; transition: background .15s;
}
.btn-win-delete:hover { background: #ffcdd2; }

/* View mode fields grid */
.site-win-view { padding: 14px 16px; }
.site-win-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.site-win-field { display: flex; flex-direction: column; gap: 2px; }
.site-win-field.full-width { grid-column: 1 / -1; }
.field-label {
  font-size: .68rem; font-weight: 700; color: #8aaac8;
  text-transform: uppercase; letter-spacing: .5px;
}
.field-value {
  font-size: .83rem; color: #1a3560; font-weight: 500;
  line-height: 1.5;
}
.site-win-notes {
  font-size: .84rem; color: #3a5c3a; line-height: 1.6; padding: 2px 0;
}
.site-win-notes.empty-note { color: #bbb; font-style: italic; }

/* Edit mode */
.site-win-edit {
  padding: 16px 16px 0;
  background: #fffdf5;
  border-top: 2px solid var(--gold);
}
.site-win-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 0;
}
.win-edit-field { display: flex; flex-direction: column; gap: 4px; }
.win-edit-field.full-width { grid-column: 1 / -1; }
.win-edit-field label {
  font-size: .72rem; font-weight: 700; color: #555;
  text-transform: uppercase; letter-spacing: .4px;
}
.win-edit-field input,
.win-edit-field textarea {
  padding: 8px 11px;
  border: 1.5px solid #ddd; border-radius: 8px;
  font-family: 'Source Sans 3', 'Georgia', serif; font-size: .83rem;
  outline: none; transition: border-color .2s, box-shadow .2s;
  background: white; resize: vertical;
}
.win-edit-field input:focus,
.win-edit-field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,165,0,.12);
}
.win-edit-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 0 14px;
}
.btn-win-cancel {
  padding: 8px 20px; border-radius: 20px;
  border: 1.5px solid #ccc; background: white;
  font-family: 'Source Sans 3', 'Georgia', serif; font-size: .82rem; cursor: pointer;
  transition: background .15s;
}
.btn-win-cancel:hover { background: #f5f5f5; }
.btn-win-save {
  padding: 8px 22px; border-radius: 20px; border: none;
  background: linear-gradient(135deg, #1a5c2a, #2e8b40);
  color: white; font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(30,90,40,.3);
  transition: transform .15s, box-shadow .15s;
  display: flex; align-items: center; gap: 6px;
}
.btn-win-save:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30,90,40,.4); }
.btn-win-save:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.save-icon { font-size: 1rem; }

/* Add site/project button */
.btn-add-site {
  background: #e8f5e9; color: var(--green-dark);
  border: 1.5px dashed var(--green-mid); border-radius: 20px;
  padding: 6px 18px; font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: .78rem; font-weight: 700; cursor: pointer;
  transition: background .2s;
}
.btn-add-site:hover { background: #d0ebd4; }

/* Edit access badge (replaces old "Edit" button in header) */
.edit-access-badge {
  font-size: .66rem; font-weight: 700; background: #e8f5e9;
  color: var(--green-dark); padding: 2px 10px; border-radius: 20px;
  border: 1px solid #a5d6a7; letter-spacing: .4px;
}

/* Existing Schemes info block */
.schemes-info {
  background: #faf5ff; border: 1px solid #e1bee7; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 14px;
}
.schemes-info-row { display: flex; gap: 24px; flex-wrap: wrap; }
.schemes-info-col { flex: 1; min-width: 160px; }
.schemes-info-title {
  font-size: .75rem; font-weight: 700; color: #6a1b9a;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 7px;
}
.schemes-info ul { list-style: none; }
.schemes-info ul li {
  font-size: .8rem; color: #555; padding: 3px 0;
  border-bottom: 1px solid #ede0f5;
}
.schemes-info ul li:last-child { border-bottom: none; }

/* Scheme window tweaks */
.scheme-window { border-color: #e1bee7; }
.scheme-window:hover { box-shadow: 0 6px 24px rgba(106,27,154,.1); }
.scheme-window.editing { border-color: var(--gold); }
.scheme-header { background: linear-gradient(90deg, #f8f0ff, #fdf8ff); border-bottom-color: #e1bee7; }
.scheme-num { background: #9c27b0; }
.scheme-title-block { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scheme-type-badge {
  font-size: .68rem; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  background: #f3e5f5; color: #6a1b9a;
}
.scheme-grid { grid-template-columns: 1fr 1fr; }

/* ════════════════════════════════════════════════════
   IRRIGATION SCHEMES — MAP PANEL
════════════════════════════════════════════════════ */
.schemes-map-section {
  background: #fff;
  border: 1px solid #d1c4e9;
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(106,27,154,.07);
}
.schemes-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(90deg, #ede7f6, #f8f0ff);
  border-bottom: 1px solid #d1c4e9;
  gap: 10px;
  flex-wrap: wrap;
}
.schemes-map-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  font-weight: 700;
  color: #4a148c;
}
.schemes-map-icon { font-size: 1.15rem; }
.schemes-map-count {
  font-size: .72rem;
  font-weight: 600;
  background: #9c27b0;
  color: #fff;
  padding: 2px 9px;
  border-radius: 20px;
  margin-left: 4px;
}
.schemes-map-count-empty {
  background: #9e9e9e;
}
.btn-schemes-map-toggle {
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid #9c27b0;
  background: #fff;
  color: #7b1fa2;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-schemes-map-toggle:hover {
  background: #9c27b0;
  color: #fff;
}
.schemes-map-body {
  padding: 14px 16px 16px;
}
.schemes-map-hint {
  font-size: .78rem;
  color: #666;
  background: #f5f0fb;
  border-left: 3px solid #ce93d8;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.schemes-map-hint-icon {
  font-size: 1rem;
  color: #9c27b0;
  flex-shrink: 0;
  margin-top: 1px;
}

/* The Leaflet map container */
.schemes-leaflet-map {
  width: 100%;
  height: 420px;
  border-radius: 8px;
  border: 1px solid #d1c4e9;
  position: relative;
  background: #e8e0f5;
  z-index: 0;
}
@media (max-width: 600px) {
  .schemes-leaflet-map { height: 280px; }
}

/* No-data overlay inside the map div */
.schemes-map-no-data {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: .83rem;
  color: #6a1b9a;
  background: rgba(255,255,255,.85);
  border-radius: 8px;
  gap: 6px;
  pointer-events: none;
  line-height: 1.6;
  z-index: 500;
}

/* Custom map marker pin */
.scheme-marker-pin {
  width: 28px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.scheme-marker-dot {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,.85);
  border-radius: 50%;
  transform: rotate(45deg);
}

/* Leaflet popup customisation */
.scheme-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
}
.scheme-popup-wrap .leaflet-popup-content { margin: 0; }
.scheme-map-popup { font-family: inherit; }
.smp-header {
  background: linear-gradient(90deg, #7b1fa2, #9c27b0);
  color: #fff;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.smp-num {
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.smp-name { font-size: .88rem; font-weight: 700; flex: 1; }
.smp-type {
  font-size: .67rem;
  background: rgba(255,255,255,.2);
  padding: 2px 7px;
  border-radius: 10px;
}
.smp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}
.smp-table td {
  padding: 5px 10px;
  border-bottom: 1px solid #f0eaf8;
  color: #333;
  vertical-align: top;
}
.smp-table td:first-child {
  font-weight: 600;
  color: #6a1b9a;
  white-space: nowrap;
  width: 90px;
}
.smp-table tr:last-child td { border-bottom: none; }
.smp-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

/* Map legend */
.schemes-map-legend {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.schemes-legend-title {
  font-size: .72rem;
  font-weight: 700;
  color: #6a1b9a;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-right: 4px;
}
.schemes-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.schemes-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .74rem;
  color: #444;
}
.schemes-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,.15);
}

/* Coordinate fields in scheme edit form */
.scheme-coord-field { border-left: 3px solid #ce93d8 !important; }
.coord-hint { font-size: .7rem; color: #888; font-weight: 400; }
.scheme-coords { color: #7b1fa2; font-size: .82rem; }

/* ════════════════════════════════════════════════════
   PROCUREMENT PHASE — Site Window Fields
════════════════════════════════════════════════════ */

/* Status & method badges in procurement header */
.proc-status-badge {
  font-size: .68rem; font-weight: 700; padding: 2px 10px;
  border-radius: 20px; border: 1px solid; display: inline-block;
}
.proc-method-badge {
  font-size: .66rem; font-weight: 600; padding: 2px 9px;
  border-radius: 20px; background: rgba(21,101,192,.1);
  color: #1565c0; border: 1px solid rgba(21,101,192,.2);
  display: inline-block; max-width: 260px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Procurement section dividers inside view/edit */
.proc-sections { display: flex; flex-direction: column; gap: 0; }
.proc-section {
  padding: 12px 16px;
  border-bottom: 1px solid #eef3fb;
}
.proc-section:last-child { border-bottom: none; }
.proc-section-title {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; color: #1565c0;
  margin-bottom: 10px; padding-bottom: 4px;
  border-bottom: 2px solid #e3f2fd;
  display: flex; align-items: center; gap: 6px;
}

/* Edit section dividers */
.proc-edit-section {
  padding: 14px 16px;
  border-bottom: 1px solid #f0ead0;
  background: #fffdf5;
}
.proc-edit-section:first-child { border-top: none; }
.proc-edit-section-title {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; color: #b8860b;
  margin-bottom: 10px; padding-bottom: 4px;
  border-bottom: 2px solid #fde68a;
}

/* Select dropdown in edit mode */
.win-edit-select {
  width: 100%; padding: 8px 11px;
  border: 1.5px solid #ddd; border-radius: 8px;
  font-family: 'Source Sans 3', 'Georgia', serif; font-size: .83rem;
  outline: none; background: white;
  transition: border-color .2s;
  cursor: pointer;
}
.win-edit-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,165,0,.12);
}

/* ─── MODAL ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 40px 16px;
}
.modal-box {
  background: var(--white); border-radius: 18px;
  width: 100%; max-width: 860px;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: rgba(255,255,255,.18); border: none; color: white;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,.3); }
.modal-body { padding: 20px 24px; max-height: 68vh; overflow-y: auto; }
.modal-hint { font-size: .8rem; color: #666; margin-bottom: 14px; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid #e8e8e8;
  display: flex; justify-content: flex-end; gap: 10px;
}
.btn-cancel {
  padding: 9px 22px; border-radius: 20px; border: 1.5px solid #ccc;
  background: white; font-family: 'Source Sans 3', 'Georgia', serif; font-size: .85rem; cursor: pointer;
}
.btn-save {
  padding: 9px 24px; border-radius: 20px; border: none;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white; font-family: 'Source Sans 3', 'Georgia', serif; font-size: .85rem;
  font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(30,90,40,.3);
}
.btn-save:hover { box-shadow: 0 6px 20px rgba(30,90,40,.4); }

/* Edit form inside modal */
.edit-form-section { margin-bottom: 20px; }
.edit-form-section h4 {
  font-size: .85rem; font-weight: 700; color: var(--green-dark);
  margin-bottom: 10px; padding-bottom: 5px;
  border-bottom: 2px solid var(--gold);
}
.edit-field { margin-bottom: 12px; }
.edit-field label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--text-dark); margin-bottom: 4px;
}
.edit-field input, .edit-field textarea {
  width: 100%; padding: 8px 12px;
  border: 1.5px solid #ddd; border-radius: 8px;
  font-family: 'Source Sans 3', 'Georgia', serif; font-size: .83rem;
  outline: none; transition: border-color .2s; resize: vertical;
}
.edit-field input:focus, .edit-field textarea:focus { border-color: var(--green-mid); }
.edit-site-block {
  background: #f8f8f8; border-radius: 10px;
  padding: 14px; margin-bottom: 10px; border: 1px solid #e8e8e8;
}
.edit-site-block h5 {
  font-size: .82rem; font-weight: 700; color: #114a87; margin-bottom: 10px;
}
.edit-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-add-item {
  width: 100%; padding: 8px; background: #e8f5e9;
  border: 1.5px dashed var(--green-mid); color: var(--green-dark);
  border-radius: 8px; font-family: 'Source Sans 3', 'Georgia', serif; font-size: .8rem;
  font-weight: 600; cursor: pointer; margin-top: 8px; transition: background .2s;
}
.btn-add-item:hover { background: #d0ebd4; }
.btn-remove-item {
  background: #fdecea; color: #c62828; border: none; border-radius: 6px;
  padding: 4px 10px; font-size: .72rem; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif; font-weight: 600;
  margin-top: 4px;
}
.success-toast {
  position: fixed; bottom: 30px; right: 30px; z-index: 10000;
  background: var(--green-dark); color: white;
  padding: 12px 24px; border-radius: 50px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  font-size: .85rem; font-weight: 600;
  animation: slideInUp .3s ease;
}
@keyframes slideInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.last-edited {
  font-size: .72rem; color: #aaa; text-align: right;
  margin-top: 8px; font-style: italic;
}

/* ─── PER-SITE LAST UPDATED BADGE ───────────────── */
.site-last-updated {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px 4px 7px;
  background: #f0f7ff;
  border: 1px solid #c8ddf5;
  border-radius: 20px;
  font-size: .72rem;
  color: #1a5276;
  line-height: 1.3;
  max-width: 100%;
  flex-wrap: wrap;
}
.site-last-updated.site-lu-never {
  background: #fafafa;
  border-color: #e0e0e0;
  color: #aaa;
}
.site-lu-icon {
  font-size: .8rem;
  flex-shrink: 0;
  opacity: .75;
}
.site-lu-text {
  font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: .72rem;
}
.site-lu-text strong {
  font-weight: 700;
  color: #1565c0;
}
.site-lu-text em {
  font-style: normal;
  font-weight: 600;
  color: #2e7d32;
}

/* ─── FOOTER ────────────────────────────────────── */
footer {
  background: var(--green-dark); color: rgba(255,255,255,.75);
  text-align: center; font-size: .78rem; padding: 14px 20px;
}
footer strong { color: var(--gold); }

/* ════════════════════════════════════════════════════
   DUAL-ACTOR PROCUREMENT — Contractor & Consultant
════════════════════════════════════════════════════ */

/* ── Site-level info bar (view mode) ── */
.site-info-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-bottom: 2px solid #e3f2fd;
  background: #f8fbff;
  padding: 10px 16px;
}
.site-info-bar .full-info { grid-column: 1 / -1; }
.site-info-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 8px;
}

/* ── Actor view tabs (view mode) ── */
.actor-view-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid #e0e0e0;
  margin: 0; background: #f5f5f5;
}
.actor-view-tab-btn {
  padding: 10px 22px; border: none; background: none;
  font-family: 'Source Sans 3', 'Georgia', serif; font-size: .82rem; font-weight: 600;
  cursor: pointer; color: #777; border-bottom: 3px solid transparent;
  transition: all .2s; display: flex; align-items: center; gap: 7px;
}
.actor-view-tab-btn:hover { background: #efefef; color: #333; }
.contractor-tab-btn.actor-tab-active {
  color: #0d47a1; border-bottom-color: #1565c0;
  background: #e3f2fd;
}
.consultant-tab-btn.actor-tab-active {
  color: #1b5e20; border-bottom-color: #2e8b40;
  background: #e8f5e9;
}
.tab-status-pill {
  font-size: .64rem; font-weight: 700; padding: 1px 7px;
  border-radius: 20px; border: 1px solid transparent;
}

/* ── Actor VIEW panels ── */
.actor-view-panel {
  padding: 0;
}
.actor-view-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid #eee;
}

.actor-view-title {
  font-size: .85rem; font-weight: 700;
}
.contractor-panel .actor-view-header { background: #f0f7ff; border-color: #d0e4fb; }
.contractor-panel .actor-view-title  { color: #0d47a1; }
.consultant-panel .actor-view-header { background: #f0faf2; border-color: #c8e6c9; }
.consultant-panel .actor-view-title  { color: #1b5e20; }

/* ── Actor mini-badges in site header ── */
.actor-mini-badge {
  font-size: .65rem; font-weight: 700; padding: 2px 9px;
  border-radius: 20px; display: inline-flex; align-items: center; gap: 4px;
}
.contractor-badge { background: rgba(21,101,192,.1); color: #0d47a1; border: 1px solid rgba(21,101,192,.25); }
.consultant-badge { background: rgba(46,139,64,.1);  color: #1b5e20; border: 1px solid rgba(46,139,64,.25); }

/* ── Actor edit tabs bar ── */
.actor-tabs-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: #fffbf0;
  border-bottom: 2px solid #fde68a;
  border-top: 2px solid #fde68a;
}
.actor-tabs-label {
  font-size: .75rem; font-weight: 700; color: #b8860b;
  white-space: nowrap;
}
.actor-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.actor-tab-btn {
  padding: 7px 18px; border-radius: 20px;
  border: 2px solid transparent; font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: all .2s; background: #f5f5f5; color: #777;
}
.actor-tab-btn:hover { background: #ebebeb; }
.contractor-tab-btn.actor-tab-active {
  background: #e3f2fd; color: #0d47a1;
  border-color: #1565c0;
}
.consultant-tab-btn.actor-tab-active {
  background: #e8f5e9; color: #1b5e20;
  border-color: #2e8b40;
}

/* ── Actor edit form containers ── */
.actor-edit-form {
  border-left: 4px solid #ccc;
  margin: 0;
}
.actor-edit-form[style*="display: none"] { display: none; }

.contractor-edit { border-left-color: #1565c0; }
.consultant-edit { border-left-color: #2e8b40; }

.actor-edit-form-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 9px;
  font-size: .82rem; font-weight: 700;
}
.contractor-edit-header { background: #e8f0fe; color: #0d47a1; border-bottom: 1px solid #c5d8f8; }
.consultant-edit-header { background: #e6f4ea; color: #1b5e20; border-bottom: 1px solid #b8dfc0; }
.actor-edit-law-note {
  margin-left: auto; font-size: .65rem; font-weight: 600;
  color: #888; white-space: nowrap;
}

/* ── Site-level edit section highlight ── */
.site-level-edit {
  background: #fefaf0 !important;
  border-left: 4px solid var(--gold) !important;
}

/* ── Required star ── */
.req-star { color: #c62828; font-weight: 800; }

/* ════════════════════════════════════════════════════
   NON-OBJECTION BLOCKS — View Mode
════════════════════════════════════════════════════ */
.nobj-body {
  border: 1.5px solid #ddd;
  border-radius: 9px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.nobj-body-title {
  font-size: .78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.nobj-not-required {
  background: #fafafa;
  opacity: .75;
}
.nobj-required {
  background: #fdfeff;
}
.nobj-tag {
  display: inline-block;
  font-size: .64rem; font-weight: 700;
  padding: 2px 9px; border-radius: 20px;
  border: 1px solid transparent;
  text-transform: none; letter-spacing: 0;
}
.nobj-na {
  background: #f0f0f0; color: #888; border-color: #ddd;
}
.days-running {
  font-weight: 700; color: #b8860b;
  background: #fffde7; border-radius: 6px;
  padding: 2px 8px; display: inline-block;
}

/* ════════════════════════════════════════════════════
   NON-OBJECTION BLOCKS — Edit Mode
════════════════════════════════════════════════════ */
.nobj-edit-section {
  background: #fafcff !important;
  border-left: 4px solid #9c27b0 !important;
}
.nobj-bodies-list {
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 0 6px;
}
.nobj-body-edit {
  border: 1.5px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
}
.nobj-body-edit-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #e8e8e8;
}
.nobj-body-edit-title {
  font-size: .8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
}
.nobj-required-toggle {
  display: flex; align-items: center; gap: 8px;
}
.nobj-required-label {
  font-size: .74rem; font-weight: 600; color: #555;
  white-space: nowrap;
}
.nobj-required-select {
  width: auto !important; min-width: 80px !important;
  padding: 4px 10px !important; font-size: .78rem !important;
}
.nobj-fields {
  padding: 0;
  animation: hintFadeIn .2s ease;
}
.days-elapsed-display {
  padding: 8px 11px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: .83rem;
  background: #f9f9f9;
  color: #555;
  min-height: 38px;
  display: flex; align-items: center;
}

/* ── Auto-filled fields — admin editable view ── */
.win-edit-field input.autofilled,
.win-edit-field textarea.autofilled {
  background: #f0f7ff;
  border-color: #90bef5 !important;
  color: #1a3a6e;
  font-style: italic;
}
.win-edit-field input.autofilled:focus,
.win-edit-field textarea.autofilled:focus {
  background: #fff;
  font-style: normal;
  border-color: var(--gold) !important;
}

/* ── Locked field display — non-admin read-only view ── */
.locked-field-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f4f6fb;
  border: 1.5px solid #d0d9ee;
  border-radius: 8px;
  padding: 8px 11px;
  min-height: 38px;
}
.locked-field-text {
  font-size: .82rem;
  color: #2a3a5e;
  line-height: 1.5;
  font-style: italic;
}
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .62rem;
  font-weight: 700;
  color: #6b7a99;
  background: #e8ecf7;
  border: 1px solid #c8d0e8;
  border-radius: 10px;
  padding: 1px 7px;
  width: fit-content;
  letter-spacing: .3px;
}
.lock-inline {
  font-size: .72rem;
  opacity: .55;
  margin-left: 3px;
}

/* ── Admin-only note strip above locked fields ── */
.admin-only-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .71rem;
  font-weight: 600;
  color: #7a5500;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 5px 10px;
  margin-top: 8px;
}
.admin-edit-note {
  color: #1b5e20;
  background: #f0faf2;
  border-color: #a5d6a7;
}

/* ════════════════════════════════════════════════════
   PROCUREMENT VALIDATION — Inline warnings & hints
════════════════════════════════════════════════════ */

/* Per-field inline hint shown below inputs */
.proc-validation-hint {
  font-size: .68rem;
  font-weight: 600;
  margin-top: 4px;
  padding: 5px 9px;
  border-radius: 6px;
  line-height: 1.45;
  animation: hintFadeIn .25s ease;
}
@keyframes hintFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Field border states set by showFieldValidation() */
.win-edit-field input.field-ok,
.win-edit-field textarea.field-ok,
.win-edit-select.field-ok {
  border-color: #2e8b40 !important;
  box-shadow: 0 0 0 2px rgba(46,139,64,.15) !important;
}
.win-edit-field input.field-warning,
.win-edit-field textarea.field-warning,
.win-edit-select.field-warning {
  border-color: #f0a500 !important;
  box-shadow: 0 0 0 2px rgba(240,165,0,.18) !important;
}
.win-edit-field input.field-error,
.win-edit-field textarea.field-error,
.win-edit-select.field-error {
  border-color: #c62828 !important;
  box-shadow: 0 0 0 2px rgba(198,40,40,.16) !important;
}
.win-edit-field input.field-info,
.win-edit-field textarea.field-info,
.win-edit-select.field-info {
  border-color: #1565c0 !important;
  box-shadow: 0 0 0 2px rgba(21,101,192,.14) !important;
}

/* Validation summary banner at top of procurement edit form */
#proc_validation_summary_cdat_procurement_0_0,
[id^="proc_validation_summary_cdat_procurement_"] {
  margin: 0 0 0 0;
  animation: hintFadeIn .3s ease;
}

/* Save button warning state */
.btn-win-save.has-errors {
  background: linear-gradient(135deg, #c62828, #e53935) !important;
  color: #fff !important;
}
.btn-win-save.has-warnings {
  background: linear-gradient(135deg, #b8860b, #f0a500) !important;
  color: #fff !important;
}

/* Legal reference pill inside hints */
.legal-ref-pill {
  display: inline-block;
  background: rgba(21,101,192,.08);
  color: #1565c0;
  font-size: .62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid rgba(21,101,192,.2);
  margin-left: 4px;
  vertical-align: middle;
}

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { padding: 16px 18px; }
  .header-text .org-name { font-size: 1rem; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 1.4rem; }
  main { padding: 22px 14px; }
  .edit-grid-2 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════
   INSPECTION NOMINATION FORM — ETI Component Panel
   Adapted from INSPECTIONS.html into portal subwindow
════════════════════════════════════════════════════ */

.insp-nom-panel {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 0 0 24px;
}

/* Banner */
.insp-nom-banner {
  color: #fff;
  text-align: center;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: bold;
  border-radius: 4px;
  margin: 12px 14px 14px;
}

/* ── Site tab bar ── */
.insp-site-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #f0f4f8;
  border-bottom: 2px solid #d8e4ef;
  padding: 0 12px;
  flex-wrap: wrap;
}
.insp-site-tab {
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .18s, border-color .18s, background .18s;
  white-space: nowrap;
  border-radius: 4px 4px 0 0;
}
.insp-site-tab:hover {
  background: rgba(0,0,0,0.05);
  color: #333;
}
.insp-site-tab-active {
  background: #fff;
  font-weight: 700;
  /* color and border-bottom set inline via JS from site.color */
}
.insp-site-panel {
  background: #fff;
  border-radius: 0 0 6px 6px;
}

/* ── Sub-tab bar (Inspection Call / Confirmation) ── */
.insp-subtab-bar {
  display: flex;
  align-items: stretch;
  background: #fafafa;
  border-bottom: 2px solid #e0e0e0;
  padding: 0 14px;
  flex-wrap: wrap;
  gap: 0;
}
.insp-subtab {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .18s, border-color .18s, background .18s;
  white-space: nowrap;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.insp-subtab:hover {
  background: rgba(0,0,0,0.04);
  color: #333;
}
.insp-subtab-active {
  font-weight: 700;
  /* color/border set inline by JS */
}
.insp-subtab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* ── Inspection Call intro banner ── */
.insp-call-intro {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fff8f0 0%, #fff3e0 100%);
  border-bottom: 1px solid #ffe0b2;
  margin: 0;
}
.insp-call-intro-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.insp-call-intro-title {
  font-size: 14px;
  font-weight: 700;
  color: #bf360c;
  margin-bottom: 3px;
}
.insp-call-intro-sub {
  font-size: 12px;
  color: #795548;
  line-height: 1.5;
}

/* ── Submitted call cards ── */
.insp-call-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}
.insp-call-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}
.insp-call-card-ref {
  font-weight: 700;
  font-size: 13px;
  color: #333;
}
.insp-call-status-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.insp-call-card-body {
  padding: 10px 14px;
  font-size: 13px;
  color: #444;
  line-height: 1.6;
}
.insp-call-card-actions {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}

/* Toolbar */
.insp-nom-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 4px;
}
.insp-nom-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.insp-nom-stat-badge {
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 12px;
}
.insp-nom-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons */
.insp-nom-btn {
  padding: 7px 13px; border: none; border-radius: 4px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
}
.insp-nom-btn:hover { opacity: .88; transform: translateY(-1px); }
.insp-nom-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.insp-btn-save    { background: #2196F3; color: #fff; }
.insp-btn-cancel  { background: #9E9E9E; color: #fff; }
.insp-btn-export  { background: #1565C0; color: #fff; }
.insp-btn-report  { background: #4CAF50; color: #fff; }
.insp-btn-print   { background: #FF9800; color: #fff; }
.insp-nom-hdr-btn {
  float: right; padding: 4px 10px;
  background: rgba(255,255,255,.25); color: #1F4E78;
  border: 1px solid rgba(31,78,120,.25); border-radius: 4px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.insp-nom-hdr-btn:hover { background: rgba(255,255,255,.5); }
.insp-nom-mini-btn {
  padding: 3px 8px; border: 1px solid #ddd; border-radius: 3px;
  background: #f5f5f5; color: #333; font-size: 12px; cursor: pointer;
  transition: background .15s; margin-right: 2px;
}
.insp-nom-mini-btn:hover { background: #e3f2fd; }
.insp-mini-danger { color: #c62828; border-color: #ef9a9a; }
.insp-mini-danger:hover { background: #ffebee; }

/* Sections */
.insp-nom-section {
  background: #fff;
  margin: 12px 14px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.insp-nom-section-header {
  padding: 10px 16px;
  font-weight: bold;
  font-size: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.insp-nom-section-footer {
  padding: 10px 14px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

/* Table */
.insp-nom-table-wrap {
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
}
.insp-nom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.insp-nom-table thead { position: sticky; top: 0; z-index: 5; }
.insp-nom-table th {
  padding: 9px 8px; text-align: left; font-weight: bold;
  border: 1px solid #ddd; background: #BDD7EE; color: #1F4E78;
  font-size: 12px;
}
.insp-nom-table td {
  padding: 5px 6px; border: 1px solid #eee;
  vertical-align: middle;
}
.insp-nom-table tbody tr:nth-child(even) { background: #f9f9f9; }
.insp-nom-table tbody tr:hover { background: #f0f4ff; }

/* Inputs inside table */
.insp-nom-input {
  width: 100%; padding: 5px 7px;
  border: 1px solid #ddd; border-radius: 3px;
  font-size: 13px; font-family: inherit;
  box-sizing: border-box;
}
.insp-nom-input:disabled { background: #f5f5f5; color: #888; cursor: not-allowed; }
.insp-nom-input:focus { border-color: #90caf9; outline: none; }

/* Inline add/edit form */
.insp-nom-form-wrap {
  background: #e8f0f8;
  border-top: 2px solid #90caf9;
  padding: 14px;
}
.insp-nom-form-title {
  font-size: 14px; font-weight: bold; color: #1F4E78;
  margin-bottom: 12px;
}
.insp-nom-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.insp-nom-form-field { display: flex; flex-direction: column; gap: 4px; }
.insp-nom-form-field label {
  font-size: 12px; font-weight: 600; color: #333;
}
.insp-nom-form-field input,
.insp-nom-form-field select,
.insp-nom-form-field textarea {
  padding: 6px 8px; border: 1px solid #ddd; border-radius: 3px;
  font-size: 13px; font-family: inherit;
}
.insp-nom-form-field input:focus,
.insp-nom-form-field select:focus,
.insp-nom-form-field textarea:focus { border-color: #90caf9; outline: none; }
.insp-nom-full-width { grid-column: 1 / -1; }
.insp-nom-form-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* Textarea */
.insp-nom-textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid #ddd; border-radius: 3px;
  font-size: 14px; font-family: inherit;
  resize: vertical; min-height: 80px;
  box-sizing: border-box;
}
.insp-nom-textarea:disabled { background: #f5f5f5; color: #888; cursor: not-allowed; }

/* Authorization grid */
.insp-nom-auth-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px 18px;
}
.insp-nom-auth-field { display: flex; flex-direction: column; gap: 5px; }
.insp-nom-auth-field label {
  font-weight: bold; color: #1F4E78; font-size: 13px;
}

/* Inline report modal */
.insp-nom-report-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.insp-nom-report-inner {
  background: #fff; border-radius: 8px;
  padding: 24px; width: 100%; max-width: 800px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.insp-nom-report-header {
  font-size: 17px; font-weight: bold; color: #1F4E78;
  text-align: center; margin-bottom: 14px;
}
.insp-nom-report-content {
  background: #f9f9f9; padding: 16px; border: 1px solid #ddd;
  border-radius: 4px; font-family: 'Courier New', monospace;
  font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; max-height: 55vh; overflow-y: auto;
  margin-bottom: 14px;
}
.insp-nom-report-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: flex-end;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .insp-nom-auth-grid { grid-template-columns: 1fr; padding: 12px; }
  .insp-nom-form-grid { grid-template-columns: 1fr; }
  .insp-nom-toolbar   { flex-direction: column; align-items: flex-start; }
  .insp-nom-table-wrap { max-height: none; }
  .insp-nom-section   { margin: 8px 6px; }
  .insp-nom-banner    { margin: 8px 6px 10px; font-size: 13px; }
}

/* ════════════════════════════════════════════════════════
   CONTRACT MONITORING DASHBOARD  (.cmd-*)
════════════════════════════════════════════════════════ */

/* Outer wrapper */
.cmd-panel { padding: 0 0 28px; }

/* Header banner */
.cmd-banner {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  background: linear-gradient(135deg, #004d40 0%, #00695c 100%);
  color: #fff; padding: 16px 20px; border-radius: 0;
}
.cmd-banner-title { font-size: 1rem; font-weight: 700; letter-spacing: .3px; }
.cmd-banner-subtitle { font-size: .78rem; opacity: .85; margin-top: 3px; }
.cmd-banner-right { text-align: right; }
.cmd-banner-date { font-size: .78rem; opacity: .9; }

/* KPI strip */
.cmd-kpis {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 1px solid #e0e0e0;
}
.cmd-kpi {
  flex: 1 1 120px;
  padding: 12px 16px;
  border-right: 1px solid #e0e0e0;
  text-align: center;
}
.cmd-kpi:last-child { border-right: none; }
.cmd-kpi-val { font-size: 1.15rem; font-weight: 700; color: #263238; }
.cmd-kpi-lbl { font-size: .72rem; color: #888; margin-top: 2px; }

/* Tab bar */
.cmd-tabbar {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 2px solid #e0e0e0;
  background: #fafafa;
  padding: 0 12px;
}
.cmd-tab {
  padding: 10px 16px; border: none; background: none;
  font-size: .82rem; font-weight: 600; color: #666;
  cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.cmd-tab:hover { color: #00695c; }
.cmd-tab-active { color: #00695c !important; border-bottom-color: #00695c !important; }

/* Tab panels */
.cmd-tabpanel { padding: 20px 20px 10px; }

/* Section titles */
.cmd-section-title {
  font-size: .8rem; font-weight: 700; color: #00695c;
  text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid #e0e0e0; padding-bottom: 6px; margin-bottom: 12px;
}

/* Info grid (summary) */
.cmd-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.cmd-info-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 7px 10px; background: #f9f9f9; border-radius: 4px;
  border-left: 3px solid #e0e0e0;
}
.cmd-info-lbl { font-size: .7rem; color: #888; font-weight: 600; text-transform: uppercase; }
.cmd-info-val { font-size: .85rem; color: #222; }

/* Timeline (key dates) */
.cmd-timeline { display: flex; flex-wrap: wrap; gap: 12px; }
.cmd-timeline-node {
  display: flex; align-items: flex-start; gap: 8px;
  flex: 1 1 160px;
  background: #f9f9f9; border-radius: 6px; padding: 8px 10px;
}
.cmd-timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; margin-top: 3px;
}
.cmd-timeline-lbl { font-size: .72rem; color: #777; font-weight: 600; }
.cmd-timeline-val { font-size: .85rem; font-weight: 700; }

/* Financial table */
.cmd-fin-table { border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; max-width: 520px; }
.cmd-fin-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid #f0f0f0; font-size: .85rem;
}
.cmd-fin-row:last-child { border-bottom: none; }
.cmd-fin-header { background: #e8f5e9; font-weight: 700; font-size: .75rem; color: #2e7d32; }
.cmd-fin-total  { background: #004d40; color: #fff; font-weight: 700; }

/* Milestone list */
.cmd-ms-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cmd-ms-stat {
  font-size: .75rem; font-weight: 700; padding: 4px 12px;
  border-radius: 20px;
}
.cmd-ms-list { display: flex; flex-direction: column; gap: 8px; }
.cmd-ms-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff; border: 1px solid #e8e8e8; border-radius: 6px;
  padding: 10px 12px; transition: box-shadow .15s;
}
.cmd-ms-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cmd-ms-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: #00695c; color: #fff;
  font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cmd-ms-body { flex: 1; min-width: 0; }
.cmd-ms-desc { font-size: .88rem; font-weight: 600; color: #222; margin-bottom: 4px; }
.cmd-ms-dates { font-size: .75rem; color: #777; display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.cmd-ms-payment { background: #e3f2fd; color: #1565c0; padding: 1px 8px; border-radius: 10px; font-weight: 600; }
.cmd-ms-progress-row { display: flex; align-items: center; gap: 8px; }
.cmd-ms-bar-track { flex: 1; height: 6px; background: #eee; border-radius: 3px; }
.cmd-ms-bar-fill  { height: 6px; border-radius: 3px; transition: width .4s; }
.cmd-ms-status-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.cmd-ms-badge { font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.cmd-ms-edit-btn {
  font-size: .72rem; padding: 3px 9px; border-radius: 4px;
  border: 1px solid #b0bec5; background: #fff; color: #555; cursor: pointer;
}
.cmd-ms-edit-btn:hover { background: #f5f5f5; }

/* IPC reconciliation bar */
.cmd-ipc-recon {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid #e0e0e0; border-radius: 6px;
  overflow: hidden; margin-bottom: 18px;
}
.cmd-recon-item {
  flex: 1 1 130px; padding: 10px 14px; border-right: 1px solid #e0e0e0;
  text-align: center;
}
.cmd-recon-item:last-child { border-right: none; }
.cmd-recon-item span { display: block; font-size: .7rem; color: #888; margin-bottom: 3px; }
.cmd-recon-item strong { font-size: .9rem; }

/* IPC table */
.cmd-ipc-wrap { overflow-x: auto; }
.cmd-ipc-table {
  width: 100%; border-collapse: collapse;
  font-size: .8rem;
}
.cmd-ipc-table th {
  background: #e8f5e9; color: #2e7d32; font-weight: 700;
  padding: 9px 10px; text-align: left; white-space: nowrap;
  border-bottom: 2px solid #c8e6c9;
}
.cmd-ipc-table td {
  padding: 8px 10px; border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.cmd-ipc-table tbody tr:hover { background: #f9f9f9; }
.cmd-num { text-align: right; font-family: monospace; }
.cmd-ipc-badge { font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 12px; white-space: nowrap; }
.cmd-ipc-edit-btn {
  font-size: .72rem; padding: 3px 8px; border-radius: 3px;
  border: 1px solid #b0bec5; background: #fff; cursor: pointer;
}
.cmd-ipc-edit-btn:hover { background: #f5f5f5; }

/* Risk register */
.cmd-risk-list { display: flex; flex-direction: column; gap: 8px; }
.cmd-risk-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff; border: 1px solid #e8e8e8; border-radius: 6px;
  padding: 10px 12px;
}
.cmd-risk-ref { font-size: .78rem; font-weight: 700; min-width: 42px; padding-top: 2px; }
.cmd-risk-body { flex: 1; }
.cmd-risk-desc { font-size: .88rem; font-weight: 600; color: #222; margin-bottom: 4px; }
.cmd-risk-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .75rem; color: #666; }
.cmd-risk-cat { background: #f3e5f5; color: #6a1b9a; padding: 1px 8px; border-radius: 10px; font-weight: 600; }
.cmd-risk-mitigation { font-size: .78rem; color: #555; margin-top: 4px; font-style: italic; }
.cmd-risk-score {
  min-width: 36px; height: 36px; border-radius: 50%;
  color: #fff; font-size: .9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Contacts */
.cmd-contacts-group { margin-bottom: 20px; }
.cmd-contacts-group-title {
  font-size: .78rem; font-weight: 700; color: #00695c;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid #e0e0e0; padding-bottom: 5px; margin-bottom: 10px;
}
.cmd-contacts-list { display: flex; flex-wrap: wrap; gap: 10px; }
.cmd-contact-card {
  flex: 1 1 200px; max-width: 260px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 6px;
  padding: 10px 12px;
}
.cmd-contact-empty { border-style: dashed; background: #fafafa; }
.cmd-contact-role { font-size: .7rem; color: #888; font-weight: 600; text-transform: uppercase; margin-bottom: 3px; }
.cmd-contact-name { font-size: .88rem; font-weight: 600; color: #222; margin-bottom: 4px; }
.cmd-contact-detail { font-size: .78rem; color: #555; }
.cmd-contact-detail a { color: #00695c; text-decoration: none; }
.cmd-contact-detail a:hover { text-decoration: underline; }
.cmd-contact-edit-btn {
  margin-top: 8px; font-size: .72rem; padding: 3px 9px;
  border-radius: 4px; border: 1px solid #b0bec5;
  background: #fff; cursor: pointer;
}
.cmd-contact-edit-btn:hover { background: #f5f5f5; }

/* Generic edit button */
.cmd-edit-btn {
  padding: 7px 14px; border-radius: 4px;
  border: 1px solid #00695c; background: #fff; color: #00695c;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.cmd-edit-btn:hover { background: #e8f5e9; }

/* Empty state */
.cmd-empty {
  text-align: center; padding: 30px; color: #aaa;
  font-size: .88rem;
}

/* Responsive */
@media (max-width: 680px) {
  .cmd-kpis        { flex-direction: column; }
  .cmd-kpi         { border-right: none; border-bottom: 1px solid #e0e0e0; }
  .cmd-info-grid   { grid-template-columns: 1fr; }
  .cmd-ipc-recon   { flex-direction: column; }
  .cmd-recon-item  { border-right: none; border-bottom: 1px solid #e0e0e0; }
  .cmd-tabbar      { overflow-x: auto; flex-wrap: nowrap; }
  .cmd-tab         { font-size: .75rem; padding: 8px 10px; }
  .cmd-ms-row      { flex-wrap: wrap; }
  .cmd-timeline    { flex-direction: column; }
}

/* ── BoQ Import Tab ─────────────────────────────────────── */
.cmd-tab-boq { border-bottom-color: #4a148c !important; }
.cmd-tab-boq.cmd-tab-active { color: #4a148c !important; border-bottom-color: #4a148c !important; }

.cmd-boq-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.cmd-boq-hint {
  font-size: .8rem; color: #666; margin-top: 4px; max-width: 600px;
}
.cmd-boq-actions { flex-shrink: 0; }

/* Import button */
.cmd-boq-import-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 5px; cursor: pointer;
  background: #4a148c; color: #fff; font-size: .82rem; font-weight: 700;
  border: none; transition: background .15s; white-space: nowrap;
}
.cmd-boq-import-btn:hover { background: #6a1b9a; }

/* Error / idle */
.cmd-boq-error {
  background: #ffebee; color: #c62828; border: 1px solid #ef9a9a;
  border-radius: 5px; padding: 12px 16px; font-size: .85rem; font-weight: 600;
}
.cmd-boq-idle {
  text-align: center; padding: 48px 20px; color: #aaa;
}
.cmd-boq-idle-icon  { font-size: 2.5rem; margin-bottom: 10px; }
.cmd-boq-idle-title { font-size: 1rem; font-weight: 700; color: #777; margin-bottom: 6px; }
.cmd-boq-idle-sub   { font-size: .82rem; }

/* Metadata strip */
.cmd-boq-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  background: #f3e5f5; border-left: 3px solid #7b1fa2;
  padding: 10px 14px; border-radius: 4px; margin-bottom: 14px;
  font-size: .78rem; color: #333;
}
.cmd-boq-meta strong { color: #4a148c; }

/* Progress strip */
.cmd-boq-progress-strip {
  background: #fafafa; border: 1px solid #e0e0e0; border-radius: 6px;
  padding: 12px 16px; margin-bottom: 18px;
}
.cmd-boq-prog-item {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.cmd-boq-prog-lbl  { font-size: .75rem; font-weight: 700; color: #555; min-width: 130px; }
.cmd-boq-prog-bar  { flex: 1; height: 10px; background: #e0e0e0; border-radius: 5px; overflow: hidden; }
.cmd-boq-prog-fill { height: 10px; border-radius: 5px; transition: width .5s; }
.cmd-boq-prog-val  { font-size: .82rem; font-weight: 700; min-width: 44px; text-align: right; }
.cmd-boq-prog-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.cmd-boq-badge {
  font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 12px;
}

/* Section blocks */
.cmd-boq-section { margin-bottom: 20px; border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; }
.cmd-boq-section-hdr {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, #4a148c11, #4a148c06);
  padding: 9px 14px; border-bottom: 1px solid #e0e0e0;
}
.cmd-boq-sec-num {
  width: 26px; height: 26px; background: #4a148c; color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.cmd-boq-sec-label { flex: 1; font-size: .85rem; font-weight: 700; color: #222; }
.cmd-boq-sec-total { font-size: .85rem; font-weight: 800; color: #4a148c; font-family: monospace; }

/* BoQ table */
.cmd-boq-table-wrap { overflow-x: auto; }
.cmd-boq-table {
  width: 100%; border-collapse: collapse; font-size: .75rem;
}
.cmd-boq-table th {
  background: #ede7f6; color: #4a148c; font-weight: 700;
  padding: 7px 8px; text-align: left; white-space: nowrap;
  border-bottom: 2px solid #d1c4e9; position: sticky; top: 0;
}
.cmd-boq-table td {
  padding: 6px 8px; border-bottom: 1px solid #f5f5f5;
  vertical-align: middle; white-space: nowrap;
}
.cmd-boq-table tbody tr:hover { background: #faf7ff; }
.cmd-boq-num    { text-align: right; font-family: monospace; }
.cmd-boq-wbs    { font-weight: 700; color: #4a148c; }
.cmd-boq-desc   { white-space: normal; min-width: 160px; max-width: 260px; }
.cmd-boq-amount { font-weight: 700; }
.cmd-boq-remarks{ max-width: 120px; white-space: normal; color: #666; font-size: .72rem; }
.cmd-boq-status { font-size: .72rem; font-weight: 700; }

/* Section footer */
.cmd-boq-sec-footer td {
  background: #ede7f6; padding: 6px 8px;
  border-top: 2px solid #d1c4e9; font-size: .78rem;
}

/* Grand total */
.cmd-boq-grand-total {
  display: flex; justify-content: space-between; align-items: center;
  background: #4a148c; color: #fff; padding: 12px 18px;
  font-size: .95rem; font-weight: 800; border-radius: 5px;
  margin-top: 4px; font-family: monospace;
}

@media (max-width: 680px) {
  .cmd-boq-header { flex-direction: column; }
  .cmd-boq-prog-item { flex-wrap: wrap; }
  .cmd-boq-meta { font-size: .72rem; }
}
