/* ============================================================
   INSPECTIO v1.1 — Design System
   Aesthetic: TÜV Rheinland "Bexel" — navy sidebar, blue/orange
   accents, clean cards. Crisp, fast, fully responsive.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Semi+Condensed:wght@600;700&display=swap');

:root {
  --navy:        #1f2d3d;
  --navy-2:      #2a3b4f;
  --navy-3:      #16212e;
  --blue:        #2f7fc1;
  --blue-d:      #2569a3;
  --blue-l:      #e8f2fb;
  --orange:      #f0a830;
  --orange-d:    #d8941d;
  --green:       #3aac6e;
  --green-d:     #2f9460;
  --red:         #d9534f;
  --red-d:       #c4413d;
  --amber:       #e0a225;
  --ink:         #2b3742;
  --muted:       #6b7886;
  --line:        #e4e8ec;
  --bg:          #eef1f4;
  --card:        #ffffff;
  --shadow:      0 1px 3px rgba(16,32,48,.08), 0 1px 2px rgba(16,32,48,.04);
  --shadow-lg:   0 8px 28px rgba(16,32,48,.14);
  --radius:      8px;
  --sidebar-w:   248px;

  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io:     cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Barlow', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
h1,h2,h3,h4 { font-family: 'Barlow Semi Condensed', 'Barlow', sans-serif; }

/* ---------------- Layout shell ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #c5cfda;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  transition: transform .32s var(--ease-drawer);
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.sidebar__brand .logo {
  width: 34px; height: 34px; flex-shrink: 0;
}
.sidebar__brand .bt { line-height: 1; }
.sidebar__brand .bt b { font-family:'Barlow Semi Condensed'; font-size: 19px; color: var(--navy); letter-spacing:.3px; }
.sidebar__brand .bt span { display:block; font-size: 10px; color: var(--blue); font-weight:600; letter-spacing:.4px; }

.nav { padding: 10px 0; overflow-y: auto; flex: 1; }
.nav__group { margin-bottom: 2px; }
.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px;
  color: #aab6c4;
  font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav__item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav__item:hover { background: var(--navy-2); color: #fff; }
.nav__item.active {
  background: var(--orange);
  color: #fff;
  border-left-color: var(--orange-d);
}
.nav__item.active svg { opacity: 1; }
.nav__sub { background: var(--navy-3); }
.nav__sub a {
  display:block; padding: 9px 22px 9px 52px;
  color:#90a0b0; font-size:13px; font-weight:500;
  border-left: 3px solid transparent;
  transition: color .15s ease, background .15s ease;
}
.nav__sub a:hover { color:#fff; }
.nav__sub a.active { color: var(--orange); }

/* ---------------- Main ---------------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 20px; gap: 14px;
  position: sticky; top: 0; z-index: 40;
}
.topbar__burger {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--navy); padding: 6px;
}
.topbar__burger svg { width: 24px; height: 24px; }
.topbar__client {
  margin-left: auto;
  background: #f2f5f8; border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 14px;
  font-size: 13px; color: var(--muted); font-weight: 500;
  max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__user {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  transition: background .15s ease;
}
.topbar__user:hover { background: #f2f5f8; }
.topbar__user .av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.topbar__user .nm { font-weight: 600; font-size: 13px; color: var(--ink); }
.topbar__user .rl { font-size: 11px; color: var(--muted); }

.content { padding: 22px; flex: 1; }

/* ---------------- Breadcrumb ---------------- */
.crumb {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 20px; font-size: 15px;
}
.crumb .dot {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--blue); color: var(--blue);
  display: grid; place-items: center;
}
.crumb .dot svg { width: 17px; height: 17px; }
.crumb a { color: var(--blue); font-weight: 600; }
.crumb .sep { color: #b6c0ca; }
.crumb .cur { color: var(--ink); font-weight: 700; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.card__head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.card__head h3 { font-size: 16px; color: var(--ink); }
.card__body { padding: 20px; }

.section-tab {
  display: inline-block;
  background: var(--blue);
  color: #fff; font-weight: 600; font-size: 13px;
  padding: 7px 16px; border-radius: 6px 6px 0 0;
  position: relative; top: 1px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; border-radius: 6px;
  padding: 9px 16px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; color: #fff;
  background: var(--blue);
  transition: background .15s ease, transform .12s var(--ease-out), box-shadow .15s ease;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--blue-d); }
.btn:active { transform: scale(.97); }
.btn--green { background: var(--green); } .btn--green:hover { background: var(--green-d); }
.btn--orange{ background: var(--orange); } .btn--orange:hover{ background: var(--orange-d); }
.btn--red   { background: var(--red); }    .btn--red:hover { background: var(--red-d); }
.btn--ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: #f4f6f8; }
.btn--sm { padding: 6px 11px; font-size: 12px; }
.btn--lg { padding: 12px 22px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------- Forms ---------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 18px;
}
.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field--2 { grid-column: span 2; }
.field label {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.field label .req { color: var(--red); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 13.5px;
  padding: 9px 11px;
  border: 1px solid #cfd6dd; border-radius: 6px;
  background: #fff; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,127,193,.15);
}
.field input[readonly] { background: #f2f4f6; color: var(--muted); }
.field textarea { resize: vertical; min-height: 84px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.radio-row { display: flex; gap: 18px; padding-top: 4px; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { width: 100%; border-collapse: collapse; min-width: 640px; }
table.grid thead th {
  background: linear-gradient(180deg, #f6b94a, var(--orange));
  color: #fff; font-weight: 600; font-size: 12.5px;
  text-align: left; padding: 12px 14px; white-space: nowrap;
}
table.grid tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 13px; vertical-align: middle;
}
table.grid tbody tr { transition: background .12s ease; }
table.grid tbody tr:nth-child(even) { background: #fafbfc; }
table.grid tbody tr:hover { background: var(--blue-l); }
table.grid .actions-cell { white-space: nowrap; text-align: right; }

.search-bar {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; margin-bottom: 16px;
}
.search-bar svg { width: 18px; height: 18px; color: var(--ink); }
.search-bar input {
  border: none; outline: none; font-family: inherit; font-size: 14px;
  flex: 1; background: transparent;
}

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .2px;
}
.badge--draft   { background: #eef1f4; color: #66747f; }
.badge--pending { background: #fff3e0; color: var(--orange-d); }
.badge--approved{ background: #e6f6ee; color: var(--green-d); }
.badge--rejected{ background: #fdecea; color: var(--red-d); }
.badge--assigned{ background: var(--blue-l); color: var(--blue-d); }
.badge--progress{ background: #fff3e0; color: var(--orange-d); }
.badge--completed{background: #e6f6ee; color: var(--green-d); }

/* ---------------- Stat cards ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; display: flex; align-items: center; gap: 16px;
  opacity: 0; transform: translateY(8px);
  animation: rise .4s var(--ease-out) forwards;
}
.stat:nth-child(1){animation-delay:.02s} .stat:nth-child(2){animation-delay:.08s}
.stat:nth-child(3){animation-delay:.14s} .stat:nth-child(4){animation-delay:.2s}
.stat__icon { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.stat__icon svg { width: 24px; height: 24px; color: #fff; }
.stat__icon.b { background: var(--blue); } .stat__icon.o { background: var(--orange); }
.stat__icon.g { background: var(--green); } .stat__icon.r { background: var(--red); }
.stat__n { font-size: 26px; font-weight: 700; font-family:'Barlow Semi Condensed'; color: var(--ink); line-height: 1; }
.stat__l { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ---------------- Icon action buttons ---------------- */
.iconbtn {
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff;
  display: inline-grid; place-items: center; cursor: pointer;
  color: var(--muted); transition: all .14s var(--ease-out); margin-left: 4px;
}
.iconbtn svg { width: 15px; height: 15px; }
.iconbtn:hover { color: #fff; transform: translateY(-1px); }
.iconbtn--view:hover  { background: var(--blue);  border-color: var(--blue); }
.iconbtn--edit:hover  { background: var(--orange);border-color: var(--orange); }
.iconbtn--del:hover   { background: var(--red);   border-color: var(--red); }
.iconbtn--ok:hover    { background: var(--green); border-color: var(--green); }

/* ---------------- Flash ---------------- */
.flash {
  padding: 13px 18px; border-radius: 8px; margin-bottom: 18px;
  font-weight: 500; display: flex; align-items: center; gap: 10px;
  animation: rise .35s var(--ease-out);
}
.flash svg { width: 18px; height: 18px; flex-shrink: 0; }
.flash--success { background: #e6f6ee; color: var(--green-d); border: 1px solid #b9e3cc; }
.flash--error   { background: #fdecea; color: var(--red-d);  border: 1px solid #f3c3c0; }
.flash--info    { background: var(--blue-l); color: var(--blue-d); border: 1px solid #bbd9f0; }

/* ---------------- Pagination ---------------- */
.pager { display: flex; align-items: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 6px;
  display: inline-grid; place-items: center; font-size: 13px; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  transition: all .14s ease;
}
.pager a:hover { background: var(--blue-l); border-color: var(--blue); }
.pager .cur { background: var(--orange); border-color: var(--orange); color: #fff; }
.pager .info { border: none; background: none; color: var(--muted); font-weight: 500; margin-right: auto; }

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(47,127,193,.18), transparent),
    radial-gradient(900px 500px at -10% 110%, rgba(240,168,48,.16), transparent),
    var(--navy);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 410px;
  background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 36px 34px;
  animation: rise .5s var(--ease-out);
}
.login-card .brand { display:flex; align-items:center; gap:11px; justify-content:center; margin-bottom: 6px; }
.login-card .brand b { font-family:'Barlow Semi Condensed'; font-size: 24px; color: var(--navy); }
.login-card .brand span { font-size: 11px; color: var(--blue); font-weight: 600; display:block; }
.login-card h2 { text-align: center; font-size: 18px; margin: 14px 0 4px; color: var(--ink); }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 15px; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }
.demo-creds {
  margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--muted);
}
.demo-creds b { color: var(--ink); }
.demo-creds .row { display:flex; justify-content:space-between; padding: 3px 0; cursor: pointer; border-radius:4px; }
.demo-creds .row:hover { background: #f4f6f8; }

/* ---------------- Mobile overlay ---------------- */
.scrim {
  position: fixed; inset: 0; background: rgba(16,24,34,.45);
  z-index: 55; opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease-out), visibility .3s;
}
.scrim.show { opacity: 1; visibility: visible; }

/* ---------------- Page title row ---------------- */
.page-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.page-actions .spacer { flex: 1; }

/* ---------------- Empty state ---------------- */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; opacity: .4; margin-bottom: 12px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .field--2 { grid-column: span 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar__burger { display: inline-grid; place-items: center; }
  .topbar__client { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 14px; }
  .form-grid, .form-grid--2 { grid-template-columns: 1fr; }
  .field--full, .field--2 { grid-column: 1; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 14px; }
  .stat__n { font-size: 22px; }
  .crumb { font-size: 14px; }
  .page-actions { gap: 8px; }
  .page-actions .btn { flex: 1; justify-content: center; }
  .card__body { padding: 16px; }
  .topbar__user .nm, .topbar__user .rl { display: none; }
}
@media (hover: none) {
  .iconbtn:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- Status pills (job order grid) ---------------- */
.pill{
  display:inline-block;padding:5px 14px;border-radius:6px;font-size:12.5px;font-weight:700;
  border:1.5px solid;background:#fff;white-space:nowrap;
}
.pill--assigned{ color:var(--orange-d); border-color:var(--orange); }     /* Open */
.pill--progress{ color:var(--orange-d); border-color:var(--orange); }     /* In Progress */
.pill--completed{ color:var(--green-d); border-color:var(--green); }      /* Closed / Approved */
.pill--pending{ color:var(--orange-d); border-color:var(--orange); }      /* Pending */

/* ---------------- Actions dropdown menu ---------------- */
.menu{ position:relative; display:inline-block; }
.menu__btn{
  width:34px;height:30px;border:1px solid var(--line);background:#fff;border-radius:6px;
  display:inline-grid;place-items:center;cursor:pointer;color:var(--muted);
  transition:background .14s var(--ease-out),border-color .14s ease;
}
.menu__btn svg{ width:20px;height:20px; }
.menu__btn:hover{ background:#f4f6f8;border-color:#cfd6dd; }
.menu__btn:active{ transform:scale(.96); }
.menu__pop{
  position:absolute;right:0;top:calc(100% + 6px);z-index:50;min-width:190px;
  background:#fff;border:1px solid var(--line);border-radius:12px;
  box-shadow:var(--shadow-lg);padding:6px;
  opacity:0;visibility:hidden;transform:translateY(-6px) scale(.97);transform-origin:top right;
  transition:opacity .16s var(--ease-out),transform .16s var(--ease-out),visibility .16s;
}
.menu__pop.show{ opacity:1;visibility:visible;transform:translateY(0) scale(1); }
.menu__pop--up{ top:auto;bottom:calc(100% + 6px);transform-origin:bottom right; }
.menu__item{
  display:flex;align-items:center;gap:11px;width:100%;
  padding:10px 12px;border:none;background:none;cursor:pointer;
  font-family:inherit;font-size:14px;font-weight:500;color:var(--ink);text-align:left;
  border-radius:8px;transition:background .12s ease;text-decoration:none;
}
.menu__item svg{ width:18px;height:18px;color:var(--muted);flex-shrink:0; }
.menu__item:hover{ background:#f2f5f8; }
.menu__item--cancel{ color:var(--red); }
.menu__item--cancel svg{ color:var(--red); }
.menu__sep{ height:1px;background:var(--line);margin:6px 4px; }
