:root{--bg:#f3f5f8;--card:#fff;--text:#1f2937;--muted:#6b7280;--accent:#0f4c81;--accent2:#1f6fb2;--danger:#b91c1c;--ok:#166534;--border:#dbe3ea;--shadow:0 10px 28px rgba(15,31,56,.08)}
*{box-sizing:border-box}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
body.menu-open{overflow:hidden}
a{color:var(--accent2);text-decoration:none}
a:hover{text-decoration:underline}
.wrap{max-width:980px;margin:0 auto;padding:16px}
.auth-wrap{max-width:460px;margin:5vh auto;padding:16px}
.card{background:var(--card);border:1px solid var(--border);border-radius:18px;padding:18px;box-shadow:var(--shadow);margin-bottom:16px}
.topbar{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);border-bottom:1px solid var(--border)}
.topbar-inner{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:76px}
.brand{min-width:0;flex:1 1 auto}
.brand-link{display:flex !important;flex-direction:column;align-items:flex-start;gap:2px;white-space:normal;overflow:visible}
.brand-logo{display:block;width:150px;max-width:100%;height:auto}
.brand-text{display:block;font-weight:700;color:var(--accent);line-height:1.1;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.brand a{font-weight:700;color:var(--accent);text-decoration:none;display:block;padding-right:10px}
.burger{appearance:none;-webkit-appearance:none;width:46px;height:46px;min-width:46px;max-width:46px;padding:0;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;background:#fff;color:var(--text);border:1px solid var(--border);border-radius:12px;flex:0 0 46px;overflow:hidden;box-shadow:none}
.burger span{display:block;width:20px;height:2px;background:var(--text);border-radius:2px}
.menu-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.34);opacity:0;transition:opacity .22s ease;z-index:60}
.menu-backdrop.visible{opacity:1}
.menu-backdrop[hidden]{display:none !important}
.menu-panel{position:fixed;top:0;right:0;height:100vh;width:min(84vw,340px);background:#fff;border-left:1px solid var(--border);box-shadow:var(--shadow);padding:16px;display:flex;flex-direction:column;gap:6px;transform:translateX(100%);transition:transform .24s ease;z-index:70;visibility:hidden;pointer-events:none}
.menu-panel.open{transform:translateX(0);visibility:visible;pointer-events:auto}
.menu-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--border)}
.menu-title{font-size:18px;font-weight:700;color:var(--accent)}
.menu-close{width:40px;height:40px;padding:0;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--text);font-size:28px;line-height:1;display:inline-flex;align-items:center;justify-content:center}
.menu-link{display:block;padding:14px;border-radius:12px;color:var(--text);font-weight:700}
.menu-link:hover{text-decoration:none;background:#f5f8fb}
.btn,.btn-link,button{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:12px;padding:11px 15px;background:var(--accent);color:#fff;font:inherit;font-size:18px;font-weight:700;cursor:pointer;line-height:1.2;text-decoration:none}
.btn.secondary{background:#eef4f8;color:var(--text);border:1px solid var(--border)}
.btn.danger,button.btn.danger{background:var(--danger);color:#fff}
.btn.danger:hover,button.btn.danger:hover{filter:brightness(.95)}
.btn.ok{background:var(--ok)}
.btn.full,button.full{width:100%}
.btn:hover,.btn-link:hover{text-decoration:none}
button{margin:0}
label{display:block;font-weight:700;margin-bottom:6px}
input[type=text],input[type=email],input[type=password],textarea,select,input[type=file]{width:100%;padding:12px;border:1px solid #c9d3dd;border-radius:12px;font-size:16px;background:#fff}
textarea{min-height:110px;resize:vertical}
.grid{display:grid;gap:12px}
.grid.two{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.flash{padding:12px 14px;border-radius:12px;margin-bottom:12px}
.flash.error{background:#fee2e2;color:#991b1b}
.flash.success{background:#dcfce7;color:#166534}
.muted{color:var(--muted)}
.list{display:grid;gap:10px}
.item{padding:14px;border:1px solid var(--border);border-radius:14px;background:#fff}
.page-head{display:block}
.row-split{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:16px;align-items:start}
.row-main{min-width:0}
.row-actions{justify-self:end;align-self:start}
.row-actions .btn{min-width:110px;white-space:nowrap}
.door-list{gap:14px}
.door-row{align-items:center}
.door-actions{align-self:center}
.door-actions .btn{min-width:120px}
.note-row{align-items:start}
.note-text{margin-top:10px}
.note-image-wrap{margin-top:10px}
.note-image,.door-image{max-width:100%;border-radius:14px;border:1px solid var(--border)}
.note-image{width:120px;height:90px;max-width:none;object-fit:cover;display:block;cursor:pointer}
.note-image:hover{transform:scale(1.03);transition:.15s}
.small{font-size:13px}
.inline{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.code{font-family:Consolas,monospace;background:#eef4f8;padding:2px 6px;border-radius:6px}
.empty{padding:14px;border:1px dashed var(--border);border-radius:14px;color:var(--muted)}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;justify-content:flex-start;align-items:center}
.actions > .btn,.actions > .inline-form,.actions > form{flex:0 0 auto}
.actions .btn,.actions button{width:auto;min-width:160px;text-align:center;min-height:54px;padding:14px 18px;appearance:none;-webkit-appearance:none;font:inherit !important;font-size:18px !important;font-weight:700 !important;line-height:1.2}
.inline-form{display:inline-flex;margin:0;align-items:center;width:auto}
.inline-form .btn,.inline-form button{width:auto;min-width:160px}
.delete-btn{min-width:160px}

.compact-scan{padding:14px}.scan-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;flex-wrap:wrap}.scan-head h1{margin:0;font-size:28px}.scan-back-btn{min-width:0;width:auto !important;flex:0 0 auto !important;padding:10px 14px !important;min-height:46px !important}.scan-box #scan-status{margin:0 0 10px}.scan-box #qr-reader{margin:0 auto}.scan-box{padding-top:14px}.scan-box h2{display:none}
.scan-box #qr-reader{width:100%;max-width:420px;border-radius:14px;overflow:hidden;border:1px solid var(--border);background:#fff}
.scan-box video{width:100%;border-radius:12px;background:#000}
.scan-box section{border:0 !important}
.scan-box section div{border:0 !important;box-shadow:none !important}
.hr{height:1px;background:var(--border);margin:14px 0}
.right{text-align:right}
h1,h2,h3{margin-top:0}
@media (max-width:640px){.wrap{padding:12px}.card{padding:14px}.compact-scan{padding:12px}.scan-head h1{font-size:24px}.scan-back-btn{width:100% !important;flex:1 1 100% !important}.menu-panel{width:min(88vw,320px)}.topbar-inner{position:relative;min-height:68px}.burger{flex:0 0 46px}.brand-logo{width:118px}.brand-text{font-size:13px}.row-split{grid-template-columns:minmax(0,1fr) auto;column-gap:12px}.row-actions{justify-self:end}.actions{justify-content:flex-start}.actions > .btn,.actions > .inline-form,.actions > form{flex:0 0 auto}.actions .btn,.actions button,.inline-form .btn,.inline-form button{min-width:110px;width:auto !important}.note-image{width:96px;height:72px}}

.status-dot{display:inline-block;width:12px;height:12px;border-radius:999px;vertical-align:middle;flex:0 0 12px;box-shadow:0 0 0 3px rgba(15,23,42,.06)}.status-dot.ok{background:#16a34a}.status-dot.late{background:#dc2626}

.burger{font-size:16px}
.menu-close{font-size:28px}


.note-action {
  margin-top: .6rem;
  padding: .65rem .8rem;
  background: #f4f7fb;
  border-left: 4px solid #2d6cdf;
  border-radius: 8px;
}

.note-action strong {
  font-size: 14px;
}

.note-action .small {
  margin-top: .25rem;
}


.door-image-link {
  display: inline-block;
  text-decoration: none;
}

.door-image {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 12px;
  margin-top: .75rem;
  cursor: zoom-in;
}

@media (max-width: 640px) {
  .door-image {
    max-width: 220px;
  }
}


.door-image-wrap {
  width: 240px !important;
  max-width: 100% !important;
  margin-top: .75rem;
}

.door-image-link {
  display: block !important;
  width: 240px !important;
  max-width: 100% !important;
  text-decoration: none;
}

img.door-image {
  display: block !important;
  width: 240px !important;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 12px;
  cursor: zoom-in;
}

@media (max-width: 640px) {
  .door-image-wrap,
  .door-image-link,
  img.door-image {
    width: 220px !important;
  }
}


.inline-form.inline-fit,
.inline-fit {
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
}

.btn-auto {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  white-space: nowrap;
}

.row-actions {
  align-items: center;
}

.row-actions .inline-form,
.row-actions form {
  width: auto;
  flex: 0 0 auto;
}

.row-actions .btn,
.actions .btn-auto {
  width: auto;
  flex: 0 0 auto;
}



/* Compact helpers for share-link buttons */
.inline-form.inline-fit,
form.inline-fit {
  display: inline-flex !important;
  width: auto !important;
  flex: 0 0 auto !important;
  align-items: center;
}

.btn-auto,
a.btn.btn-auto,
button.btn.btn-auto,
.inline-fit .btn,
.inline-fit button {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  align-items: center;
  justify-content: center;
}

.row-actions .inline-form,
.row-actions form {
  width: auto;
  flex: 0 0 auto;
}

.row-actions .btn {
  width: auto;
}


.actions-left{
  justify-content:flex-start !important;
  align-items:center !important;
}


/* Delningslänkar – knappar till höger för kompaktare rad */
.item[id^="share-"] {
  align-items: center;
}

.item[id^="share-"] .row-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
  align-items: center;
}

.item[id^="share-"] .row-actions .btn,
.item[id^="share-"] .row-actions button {
  min-width: auto;
  padding: 10px 12px;
}




/* Delningslänkar: använd samma tvåkolumnslayout som dokumentrader */
.item[id^="share-"] {
  align-items: center;
}

.item[id^="share-"] .row-actions {
  justify-self: end !important;
  display: flex;
  gap: 8px;
  align-items: center;
}

.item[id^="share-"] .row-actions .btn,
.item[id^="share-"] .row-actions button {
  min-width: auto;
  width: auto !important;
  padding: 10px 12px;
  white-space: nowrap;
}


.status-dot{display:inline-block;width:12px;height:12px;border-radius:999px;vertical-align:middle;margin-right:8px}
.status-dot.ok{background:#16a34a}
.status-dot.warn{background:#eab308}
.status-dot.late{background:#dc2626}


.check-section,
.service-section{
  border:1px solid #dbe3ea;
  border-radius:16px;
  padding:14px;
  margin-bottom:14px;
  background:#fff;
}
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.compact-list .item{
  padding:10px 0;
}
.check-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:8px 0;
}
.check-row input{
  margin-top:3px;
}
.history-list{
  margin:6px 0 0 18px;
  padding:0;
}
.history-list li{
  margin:4px 0;
}


.status-check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  font-weight:700;
}
.status-check.yes{color:#16a34a;}
.status-check.no{color:#dc2626;}
.active-filter{outline:2px solid #cbd5e1;}


.report-checklist{
  margin:8px 0 0 0;
  padding-left:0;
  list-style:none;
}
.report-checklist li{
  margin:4px 0;
}


.doc-name a{
  font-weight:600;
  text-decoration:none;
}
.doc-name a:hover{
  text-decoration:underline;
}
.note-service{
  border-left: 5px solid #dc2626;
  background: rgb(244,247,251);
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 8px;
}
.note-done{
  border-left: 5px solid #16a34a;
  background: rgb(244,247,251);
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 8px;
}



.note-service{
  border-left: 5px solid #dc2626;
  background: rgb(244,247,251);
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 8px;
}

.note-done{
  border-left: 5px solid #16a34a;
  background: rgb(244,247,251);
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 8px;
}

.object-meta-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:16px;
  margin-top:12px;
}

.object-meta-card{
  border:1px solid #dbe3ea;
  border-radius:16px;
  background:#fff;
  padding:16px;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}

.object-info{
  display:grid;
  gap:6px;
}

.object-muted-title{
  color:#6b7280;
  font-size:.92rem;
}

.object-service-card{
  border:1px solid #dbe3ea;
  border-radius:16px;
  background:#fff;
  padding:16px;
  margin-bottom:14px;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}

.object-section-title{
  margin:14px 0 8px;
  font-size:1rem;
  font-weight:700;
}

.object-check-list{
  list-style:none;
  padding-left:0;
  margin:8px 0 0;
}

.object-check-list li{
  margin:5px 0;
}


