:root{
  --lugu-red:#d4003c;
  --lugu-red-dark:#a90030;
  --ink:#12151b;
  --muted:#69707d;
  --line:#e6e9ef;
  --soft:#f5f6f8;
  --panel:#ffffff;
  --black:#050505;
  --shadow:0 14px 34px rgba(18,21,27,.08);
  --shadow-soft:0 6px 18px rgba(18,21,27,.06);
  --radius:10px;
}
*{box-sizing:border-box}
html{min-height:100%}
body{
  min-height:100%;
  margin:0;
  background:
    linear-gradient(180deg,#fff 0,#f5f6f8 260px,#eef1f5 100%);
  color:var(--ink);
  font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;
  letter-spacing:0;
}
a{color:var(--lugu-red);text-decoration:none}
a:hover{color:var(--lugu-red-dark)}
.app-shell{max-width:1480px;margin:auto;padding-left:24px!important;padding-right:24px!important}

/* Admin app shell: Bootstrap + Bootstrap Icons */
.admin-layout{
  display:flex;
  min-height:100vh;
}
.app-sidebar{
  position:sticky;
  top:0;
  width:278px;
  height:100vh;
  flex:0 0 278px;
  flex-direction:column;
  padding:20px 14px;
  background:linear-gradient(180deg,#07080a 0%,#11151b 100%);
  border-right:1px solid rgba(255,255,255,.08);
  color:#fff;
}
.app-content{
  min-width:0;
  flex:1;
}
.sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:54px;
  padding:0 10px 18px;
  color:#fff!important;
  font-weight:950;
  font-size:1.24rem;
  letter-spacing:0;
}
.sidebar-brand img{
  width:48px;
  height:48px;
  object-fit:contain;
  filter:drop-shadow(0 0 2px rgba(255,255,255,.72)) drop-shadow(0 8px 14px rgba(0,0,0,.45));
}
.sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-height:0;
  overflow:auto;
  padding:2px 4px 12px;
}
.sidebar-group{
  display:grid;
  gap:5px;
}
.sidebar-group-title{
  padding:8px 10px 4px;
  color:rgba(255,255,255,.38);
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.sidebar-link{
  display:flex;
  align-items:center;
  gap:11px;
  min-height:42px;
  padding:10px 12px;
  color:rgba(255,255,255,.72);
  border-radius:10px;
  font-weight:820;
  line-height:1;
  transition:background .16s ease,color .16s ease,transform .16s ease;
}
.sidebar-link i{
  display:grid;
  place-items:center;
  width:22px;
  color:rgba(255,255,255,.54);
  font-size:1.08rem;
}
.sidebar-link:hover{
  color:#fff;
  background:rgba(255,255,255,.075);
  transform:translateX(2px);
}
.sidebar-link:hover i{color:#fff}
.sidebar-link.active{
  color:#fff;
  background:linear-gradient(135deg,var(--lugu-red),#b20035);
  box-shadow:0 12px 26px rgba(212,0,60,.25);
}
.sidebar-link.active i{color:#fff}
.sidebar-footer{
  margin-top:auto;
  padding:14px 4px 0;
  border-top:1px solid rgba(255,255,255,.08);
}
.portal-link{
  background:rgba(255,255,255,.045);
  outline:1px solid rgba(255,255,255,.08);
}
.app-topbar{
  position:sticky;
  top:0;
  z-index:1020;
  display:flex;
  align-items:center;
  gap:16px;
  min-height:76px;
  padding:14px 24px;
  background:rgba(255,255,255,.86);
  border-bottom:1px solid rgba(214,219,228,.84);
  backdrop-filter:blur(14px);
}
.mobile-menu-btn{
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  color:var(--ink);
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:var(--shadow-soft);
}
.mobile-menu-btn i{font-size:1.35rem}
.topbar-title{
  min-width:0;
}
.topbar-title small{
  display:block;
  color:var(--muted);
  font-size:.73rem;
  font-weight:900;
  text-transform:uppercase;
}
.topbar-title h1{
  margin:0;
  color:var(--ink);
  font-size:1.28rem;
  font-weight:950;
}
.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
}
.topbar-user{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  min-width:132px;
  line-height:1.08;
}
.topbar-user strong{
  max-width:180px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--ink);
  font-size:.9rem;
}
.topbar-user span{
  color:var(--muted);
  font-size:.72rem;
  font-weight:850;
  text-transform:uppercase;
}
.mobile-offcanvas{
  width:304px!important;
  color:#fff;
  background:#0b0d11;
}
.mobile-offcanvas .offcanvas-header{
  border-bottom:1px solid rgba(255,255,255,.08);
}
.mobile-offcanvas .offcanvas-body{
  display:flex;
  flex-direction:column;
  padding:12px;
}

/* Navigation */
.lugu-navbar{
  min-height:74px;
  background:linear-gradient(90deg,#050505 0%,#101217 58%,#1b2028 100%);
  border-bottom:1px solid rgba(255,255,255,.09);
}
.lugu-brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-width:174px;
  margin-right:22px;
  color:#fff!important;
  font-weight:900;
}
.brand-mark,.lugu-brand .brand-mark{
  width:44px;
  height:44px;
  object-fit:contain;
  background:transparent;
  border-radius:0;
  padding:0;
  filter:drop-shadow(0 0 2px rgba(255,255,255,.72)) drop-shadow(0 8px 14px rgba(0,0,0,.45));
}
.lugu-brand span{font-size:1.18rem;white-space:nowrap}
.lugu-nav{align-items:center;gap:5px}
.lugu-nav .nav-link{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:.5rem .74rem!important;
  color:rgba(255,255,255,.68)!important;
  border-radius:999px;
  font-size:.9rem;
  font-weight:750;
  line-height:1.05;
  white-space:nowrap;
}
.lugu-nav .nav-link:hover{color:#fff!important;background:rgba(255,255,255,.09)}
.lugu-nav .nav-link.active{color:#fff!important;background:var(--lugu-red);box-shadow:0 10px 22px rgba(212,0,60,.28)}
.user-area{display:flex;align-items:center;gap:10px;margin-left:auto;padding-left:14px;border-left:1px solid rgba(255,255,255,.12)}
.user-pill{display:flex;flex-direction:column;align-items:flex-end;gap:2px;max-width:190px;color:#fff!important;font-size:.88rem;font-weight:800;line-height:1.05;white-space:nowrap}
.user-pill span{color:rgba(255,255,255,.58);font-size:.72rem;font-weight:800;text-transform:uppercase}
.logout-btn{min-height:38px;padding:.45rem .9rem;color:var(--ink);background:#fff;border:0;border-radius:10px;font-weight:850}
.logout-btn:hover{color:#fff;background:var(--lugu-red)}
.lugu-toggler{border-color:rgba(255,255,255,.2);border-radius:10px}

/* Bootstrap polish */
.card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-soft);
  background:var(--panel);
}
.card-header{
  background:#fff;
  border-bottom:1px solid var(--line);
  padding:14px 18px;
}
.card-body{padding:18px}
.btn{
  min-height:38px;
  border-radius:10px;
  font-weight:800;
}
.btn-primary{background:var(--lugu-red);border-color:var(--lugu-red)}
.btn-primary:hover,.btn-primary:focus{background:var(--lugu-red-dark);border-color:var(--lugu-red-dark)}
.btn-outline-primary{color:var(--lugu-red);border-color:var(--lugu-red)}
.btn-outline-primary:hover,.btn-outline-primary:focus{background:var(--lugu-red);border-color:var(--lugu-red);color:#fff}
.btn-light{background:#f1f3f6;border-color:#e6e9ef}
.btn-icon{
  display:inline-grid;
  place-items:center;
  width:36px;
  height:36px;
  min-height:36px;
  padding:0;
  border-radius:10px;
}
.btn-icon i{
  margin:0;
  font-size:1rem;
  line-height:1;
}
.actions{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  white-space:nowrap;
}
.table th:last-child,
.table td:last-child{
  text-align:right;
}
.form-control,.form-select{
  border:1px solid #d9dee7;
  border-radius:10px;
  min-height:42px;
}
.form-control:focus,.form-select:focus{
  border-color:var(--lugu-red);
  box-shadow:0 0 0 .2rem rgba(212,0,60,.12);
}
label,.form-label{font-weight:800;color:#343944;margin-bottom:5px}
.badge{font-size:.78rem;border-radius:999px;padding:.42em .65em;font-weight:850}

/* Tables */
.table{margin-bottom:0}
.table th{
  color:#667080;
  font-size:.76rem;
  text-transform:uppercase;
  background:#f8f9fb;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}
.table td{border-color:#edf0f4;vertical-align:middle}
.table tbody tr:hover{background:#fbfcfd}
.table img.thumb,.thumb{width:64px;height:64px;object-fit:cover;border-radius:10px}
.table-responsive{border-radius:8px}

/* Dashboard */
.kpi{overflow:hidden;transition:transform .18s ease,box-shadow .18s ease}
.kpi:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.kpi .card-body{padding:18px 18px 16px}
.kpi small{display:block;color:var(--muted);text-transform:uppercase;font-weight:900;font-size:.74rem;margin-bottom:6px}
.kpi h3{margin:0;color:var(--lugu-red)!important;font-weight:950;font-size:2rem;line-height:1}
.overdue-kpi h3{color:#dc3545!important}

/* Login */
.login-bg{
  position:relative;
  min-height:100vh;
  background:
    linear-gradient(115deg,rgba(212,0,60,.22) 0 10%,transparent 10% 18%,rgba(255,255,255,.05) 18% 19%,transparent 19% 100%),
    radial-gradient(circle at 20% 18%,rgba(212,0,60,.34),transparent 26%),
    radial-gradient(circle at 78% 22%,rgba(255,255,255,.12),transparent 18%),
    linear-gradient(135deg,#050505 0%,#10141b 48%,#252a33 100%);
  overflow:hidden;
}
.login-bg::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px),
    linear-gradient(0deg,rgba(255,255,255,.035) 1px,transparent 1px);
  background-size:64px 64px;
  mask-image:linear-gradient(120deg,transparent 0%,#000 22%,#000 72%,transparent 100%);
}
.login-bg::after{
  content:"";
  position:fixed;
  right:-110px;
  bottom:-120px;
  width:min(520px,72vw);
  aspect-ratio:1;
  background:url("../brand/lugu-mark.png") center/contain no-repeat;
  opacity:.13;
  filter:drop-shadow(0 22px 44px rgba(0,0,0,.45));
  pointer-events:none;
}
.login-card{
  position:relative;
  z-index:1;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(255,255,255,.72);
  box-shadow:0 28px 80px rgba(0,0,0,.32);
  backdrop-filter:blur(18px);
}
.login-logo{display:block;width:126px;height:126px;object-fit:contain;margin:0 auto 14px}
.login-title{font-weight:950;color:var(--ink);text-align:center;margin-bottom:4px}
.login-subtitle{text-align:center;color:var(--muted);margin-bottom:22px}

/* Priority and status surfaces */
.priority-row.priority-urgente td,.priority-urgente{box-shadow:inset 4px 0 0 #dc3545}
.priority-row.priority-media td,.priority-media{box-shadow:inset 4px 0 0 #ffc107}
.priority-row.priority-normal td,.priority-normal{box-shadow:inset 4px 0 0 #adb5bd}
.delay-reason-box{
  margin:12px 0;
  padding:13px 14px;
  border:1px solid #f0c9d2;
  border-radius:10px;
  background:#fff7f9;
}
.delay-reason-box b{display:block;margin-bottom:4px;color:#9f1239}
.delay-reason-box p{margin:0}
.delay-reason-box.missing{border-color:#dc3545;background:#fff1f3}

/* Timeline and public tracking */
.timeline{position:relative;padding-left:0;list-style:none}
.timeline li{display:flex;gap:12px;margin-bottom:16px}
.dot{width:18px;height:18px;border-radius:50%;background:#ced4da;margin-top:3px;flex:0 0 auto}
.dot.done{background:#198754}
.dot.current{background:var(--lugu-red)}
.public-page{
  min-height:100vh;
  background:linear-gradient(180deg,#0a0b0f 0,#171b22 240px,#f4f5f7 240px,#eef1f5 100%);
}
.public-header{
  background:transparent;
  color:white;
  border-radius:0;
  padding:26px 0 18px;
}
.public-logo{width:96px;height:96px;object-fit:contain;background:white;border-radius:18px;padding:8px;box-shadow:0 18px 36px rgba(0,0,0,.25)}
.tracker{display:grid;grid-template-columns:repeat(8,1fr);gap:8px}
.tracker-step{border-top:4px solid #dee2e6;padding-top:8px;font-size:.85rem;color:var(--muted)}
.tracker-step.done{border-color:#198754;color:#198754}
.tracker-step.current{border-color:var(--lugu-red);color:var(--lugu-red);font-weight:900}
.evidence-img{max-height:220px;object-fit:cover;border-radius:10px}

/* Notifications */
.notification-row{display:flex;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid #eceff3}
.notification-row:last-child{border-bottom:0}
.notification-row.unread{background:#fff7f9;margin:0 -12px;padding:14px 12px;border-radius:10px}

/* Tablet workshop flow */
.tablet-header{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}
.workshop-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:18px}
.workshop-card{background:#fff;border:1px solid #e3e7ee;border-radius:12px;box-shadow:var(--shadow-soft);overflow:hidden}
.workshop-card.is-late{border-color:#f1a5b4;background:#fffafa}
.workshop-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:18px;border-bottom:1px solid #eef0f4}
.workshop-card h3{margin:4px 0 0;font-size:1.35rem;font-weight:950}
.order-code{color:var(--muted);font-size:.82rem;font-weight:900;text-transform:uppercase}
.badge-stack{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.workshop-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:16px 18px 4px}
.workshop-meta span{display:flex;flex-direction:column;min-height:58px;padding:10px;background:#f7f8fa;border-radius:10px;font-size:.96rem}
.workshop-meta b{color:var(--muted);font-size:.75rem;text-transform:uppercase}
.workshop-form{display:grid;gap:10px;padding:18px}
.workshop-form .form-control-lg,.workshop-form .form-select-lg,.workshop-form .btn-lg{min-height:52px;font-size:1rem;border-radius:10px}
.camera-preview{display:none;width:100%;max-height:260px;object-fit:cover;border-radius:10px;border:1px solid #e1e5eb}
.camera-preview.has-image{display:block}

/* Overdue executive view */
.overdue-list{display:grid;gap:14px}
.overdue-card{background:#fff;border:1px solid #e2e7ef;border-radius:12px;box-shadow:var(--shadow-soft);overflow:hidden}
.overdue-main{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;padding:18px}
.overdue-card h3{margin:0 0 12px;font-size:1.35rem;font-weight:950}
.overdue-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.overdue-meta span{display:flex;flex-direction:column;min-height:54px;padding:10px;background:#f7f8fa;border-radius:10px}
.overdue-meta b{color:var(--muted);font-size:.74rem;text-transform:uppercase}
.delay-form{display:grid;gap:10px;align-content:start}

@media(max-width:1390px){
  .lugu-brand{min-width:auto;margin-right:14px}
  .lugu-nav .nav-link{padding:.45rem .55rem!important;font-size:.84rem}
  .user-pill{max-width:150px}
}
@media(max-width:1199.98px){
  .app-shell{padding-left:14px!important;padding-right:14px!important}
  .lugu-navbar{min-height:70px}
  .lugu-brand .brand-mark{width:42px;height:42px}
  .lugu-nav-wrap{margin-top:14px;padding:12px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.08);border-radius:16px}
  .lugu-nav{align-items:stretch;gap:6px}
  .lugu-nav .nav-link{justify-content:space-between;border-radius:10px}
  .user-area{margin-left:0;margin-top:12px;padding:12px 0 0;border-left:0;border-top:1px solid rgba(255,255,255,.12)}
  .user-pill{align-items:flex-start;max-width:none}
}
@media(max-width:992px){
  .overdue-main{grid-template-columns:1fr}
  .overdue-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:768px){
  .tracker{grid-template-columns:repeat(2,1fr)}
  .notification-row{display:block}
  .table{font-size:.9rem}
  .tablet-header{align-items:stretch;flex-direction:column}
  .workshop-grid{grid-template-columns:1fr}
  .workshop-card-head{flex-direction:column}
  .badge-stack{align-items:flex-start;flex-direction:row;flex-wrap:wrap}
  .workshop-meta{grid-template-columns:1fr}
}
@media(max-width:576px){
  .overdue-meta{grid-template-columns:1fr}
  .card-body{padding:15px}
}
