:root{
  --bg:#f6f8fb;
  --text:#222;
  --muted:#6b7280;
  --brand:#1a3d6d;
  --accent:#2b66c9;
  --ok:#2e7d32;
  --warn:#f57c00;
  --card:#ffffff;

  --radius:12px;
  --shadow-sm:0 2px 8px rgba(26,61,109,.07);
  --shadow-md:0 8px 24px rgba(16,24,40,.08);
  --border:#e6e8ec;
}

/* Base */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font: 15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,Arial,"Helvetica Neue",sans-serif;
  color:var(--text);
  background:var(--bg);
}
.container{max-width:1200px;margin:0 auto;padding:22px}

/* Brand + nav */
.nav-bar{
  background:var(--brand);
  color:#fff;
  position:sticky; top:0; z-index:10;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.nav-inner{
  max-width:1200px; margin:0 auto;
  display:flex; gap:16px; align-items:center; padding:12px 20px;
}
.brand{display:flex; align-items:center; gap:10px; font-weight:700; color:#fff; text-decoration:none}
.brand img{width:22px; height:22px}
.nav-bar a{
  color:#fff; text-decoration:none; padding:8px 12px; border-radius:8px;
  transition:background .2s;
}
.nav-bar a:hover{background:rgba(255,255,255,.12)}
.nav-bar a.active{background:rgba(255,255,255,.2)}

/* Headings / cards */
h1,h2,h3{color:var(--brand); margin:0 0 12px}
.card{
  background:var(--card); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); padding:18px; border:1px solid var(--border);
}
.section-title{font-size:1.25rem; margin-bottom:12px; border-bottom:2px solid #eef1f6; padding-bottom:6px}

/* Buttons */
.btn{appearance:none; border:none; border-radius:10px; padding:10px 16px; font-weight:700; cursor:pointer}
.btn.primary{background:var(--ok); color:#fff}
.btn.secondary{background:#eef1f6; color:#333}
.btn.primary:hover{filter:brightness(.96)}
.btn.secondary:hover{background:#e6ebf3}

/* Inputs */
label.block{display:block; font-weight:600; color:var(--brand); margin:0 0 6px}
input[type="text"],input[type="date"],select,textarea{
  width:100%; padding:10px 12px;
  border:1px solid var(--border); border-radius:10px; background:#fff;
  transition:border-color .15s, box-shadow .15s;
}
input:focus,select:focus,textarea:focus{
  outline:none; border-color:#b8cdf5;
  box-shadow:0 0 0 3px rgba(43,102,201,.15);
}
textarea{min-height:170px; resize:vertical}
.small{font-size:.9rem; color:var(--muted)}

/* Filters / table (list page) */
.filters{margin-bottom:18px}
.filters .row{display:flex; gap:12px; flex-wrap:wrap}
.filters .group{display:flex; flex-direction:column; gap:6px}
.filters input,.filters select{min-width:200px}

.inspection-table{
  background:#fff;border-radius:var(--radius);box-shadow:var(--shadow-sm);
  /* allow action menus to overflow */
  overflow:visible;
  border:1px solid var(--border)
}
table{width:100%;border-collapse:collapse}
th,td{padding:12px;border-bottom:1px solid #eef1f6;text-align:left;vertical-align:middle}
th{background:#f7f8fb;color:var(--brand);font-weight:700}
tr:hover{background:#fafcff}

/* Status chips */
.status{padding:5px 10px;border-radius:999px;font-size:.85em;font-weight:700;text-transform:capitalize;display:inline-block}
.status.completed{background:#e8f5e8;color:#2e7d32}
.status.pending{background:#fff3e0;color:var(--warn)}
.status.in-progress{background:#e3f2fd;color:#2b66c9}

/* Row action menu (list page) */
.wrap-menu{position:relative; display:inline-block}
.menu-btn{appearance:none; border:1px solid #e5e7eb; background:#fff; border-radius:8px; padding:6px 10px; cursor:pointer; font-weight:700}
.menu-btn:after{content:"…"; font-size:18px; line-height:1; vertical-align:middle}
.row-menu{position:absolute; right:0; top:36px; width:200px; background:#fff; box-shadow:var(--shadow-md);
  border:1px solid #e5e7eb; border-radius:12px; padding:6px; display:none; z-index:20}
.row-menu.show{display:block}
.row-menu button{width:100%; text-align:left; border:none; background:transparent; padding:10px 12px; border-radius:8px;
  cursor:pointer; display:block; font-weight:600; color:#111827}
.row-menu button:hover{background:#f3f4f6}
.row-menu .danger{color:#b91c1c}

/* Subsections on form */
.subsection{margin-top:16px;border:1px solid #eef1f6;border-radius:12px;overflow:hidden}
.subsection-header{
  display:flex;justify-content:space-between;align-items:center;
  padding:12px 14px;background:#f4f7fb;cursor:pointer
}
.subsection-header:hover{background:#edf2fb}
.subsection-content{padding:14px;display:none;background:#fff;border-top:1px solid #eef1f6}
.checklist-item{
  padding:14px;border:1px solid #eef1f6;border-radius:12px;background:#fafafa;margin-bottom:12px
}
.response-options{margin:8px 0 10px}
.response-options label{margin-right:14px;font-weight:500;cursor:pointer}

/* Improved Drop Zone */
.drop-zone{
  position:relative;
  border:2px dashed #bcd3ff;
  border-radius:14px;
  background:linear-gradient(180deg,#fbfdff 0%, #f6f9ff 100%);
  padding:18px;
  text-align:center;
  color:#2b66c9;
  transition:background .2s, border-color .2s, box-shadow .2s;
  min-height:120px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.drop-zone:hover{border-color:#8db5ff; background:#f2f7ff}
.drop-zone.dragover{background:#e7f0ff; border-color:#2b66c9; box-shadow:0 0 0 3px rgba(43,102,201,.15)}
.dz-hint{font-size:14px; color:#294f89}
.dz-thumbs{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; justify-content:center}
.dz-thumb{
  position:relative; width:96px; height:96px; border:1px solid #e5e7eb; border-radius:10px; overflow:hidden; background:#fff;
  box-shadow:0 1px 4px rgba(0,0,0,.04)
}
.dz-thumb img{width:100%; height:100%; object-fit:cover; display:block}
.dz-del{
  position:absolute; top:4px; right:4px; width:22px; height:22px; line-height:20px; border:none; border-radius:999px;
  background:rgba(0,0,0,.55); color:#fff; font-weight:700; cursor:pointer
}
.dz-del:hover{ background:rgba(0,0,0,.75) }

/* Submit bar */
.submit-bar{position:sticky; bottom:0; background:#fff; border-top:1px solid var(--border); padding:12px; display:flex; gap:10px; justify-content:flex-end}

/* Empty state */
.empty{text-align:center;padding:40px 16px;color:#666}
.empty h3{margin:0 0 8px;color:var(--brand)}

/* Details page */
.details-card{background:#fff; border-radius:12px; box-shadow:var(--shadow-sm); padding:18px; border:1px solid var(--border)}
.photos{display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:12px}
.photos img{width:100%; height:120px; object-fit:cover; border-radius:10px; border:1px solid #eef1f6}

/* Responsive */
@media (max-width:600px){
  .container{padding:16px 12px}
  .filters input,.filters select{min-width:160px}
}

/* Print: hide sticky nav & polish cards */
@media print{
  .nav-bar, .submit-bar { display:none !important; }
  body { background:#fff !important; }
  .card, .details-card, .inspection-table { box-shadow:none !important; border:1px solid #ddd; }
}




