/* ---------- área de administração ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy-deep); color: #c9d6ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { background: #fff; padding: 18px 20px; border-bottom: 4px solid var(--teal); }
.sidebar .brand img { height: 42px; display: block; }
.sidebar .brand small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); margin-top: 8px; }
.sidebar nav { padding: 18px 12px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 500; margin-bottom: 2px; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.on { background: rgba(26, 158, 154, .22); color: #fff; box-shadow: inset 3px 0 0 var(--lime); }
.sidebar .me { padding: 16px 20px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.sidebar .me b { color: #fff; display: block; }
.sidebar .me .row { margin-top: 10px; gap: 6px; }
.sidebar .me button { background: rgba(255, 255, 255, .07); color: #c9d6ea; border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.sidebar .me button:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.sidebar .me svg.i { width: 14px; height: 14px; }

.content { padding: 32px 40px 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: 34px; font-weight: 800; }
.page-head .who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; }
.page-head .who svg { width: 15px; height: 15px; }
.page-head .eyebrow { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--teal); }
.crumb { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 8px; cursor: pointer; background: none; border: 0; }
.crumb:hover { color: var(--navy); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--display); font-size: 38px; font-weight: 800; color: var(--navy-deep); line-height: 1.1; margin-top: 6px; }
.stat::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.stat.teal::after { background: var(--teal); }
.stat.lime::after { background: var(--lime); }
.stat.navy::after { background: var(--navy); }

.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-title h2 { font-size: 20px; }

.code-box { display: inline-flex; align-items: center; gap: 10px; background: var(--navy-deep); color: #fff; border-radius: 10px; padding: 8px 8px 8px 16px; }
.code-box .mono { font-size: 22px; font-weight: 700; letter-spacing: .22em; }
.code-box small { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #9fb5d6; display: block; }
.code-box button { background: rgba(255, 255, 255, .1); border: 0; color: #fff; border-radius: 6px; padding: 7px; cursor: pointer; display: grid; }
.code-box button:hover { background: rgba(255, 255, 255, .2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 16px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button:hover { color: var(--navy); }
.tabs button.on { color: var(--navy-deep); border-bottom-color: var(--teal); }
.tabs .count { font-family: var(--mono); font-size: 11px; background: #eef1f5; border-radius: 99px; padding: 1px 7px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; padding: 16px; margin-bottom: 16px; }
.filters label.field { min-width: 150px; }
.filters label.field.grow { flex: 1; min-width: 200px; }
.filters .input { padding: 9px 11px; }

select.mini { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; }

.slot-days { display: grid; gap: 12px; }
.slot-day { padding: 14px 16px; }
.slot-day h4 { font-size: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.slot-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 4px 4px 10px; font-family: var(--mono); font-size: 13px; background: #fff; }
.slot-pill.full { background: var(--teal-soft); border-color: #b5e2de; }
.slot-pill.past { opacity: .5; }
.slot-pill .cap { font-size: 11px; color: var(--muted); }
.slot-pill button { background: none; border: 0; cursor: pointer; color: var(--muted); display: grid; padding: 2px; border-radius: 4px; }
.slot-pill button:hover { color: var(--danger); background: var(--danger-soft); }
.slot-pill svg.i { width: 13px; height: 13px; }
.slot-pill.blocked { background: repeating-linear-gradient(-45deg, #f4f4f2 0 6px, #ebebe7 6px 12px); color: var(--muted); text-decoration: line-through; }
.slot-pill.blocked .cap, .slot-pill.blocked button { text-decoration: none; }
.slot-pill button[data-block]:hover { color: var(--navy, #12305f); background: var(--teal-soft); }
.block-row { display: grid; grid-template-columns: auto 70px 1fr; align-items: center; gap: 10px; font-size: 14px; }
.block-row.period { grid-template-columns: auto 48px minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
.block-row.period input[type=time] { min-width: 0; padding-left: 10px; padding-right: 6px; }
.block-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--teal); }

.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdays label { display: inline-flex; }
.weekdays input { display: none; }
.weekdays span { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 13px; font-weight: 600; background: #fff; }
.weekdays input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }

.two-col { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }

.dropzone { display: block; border: 2px dashed var(--line); border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: all .15s; background: #fbfcfd; }
.dropzone:hover, .dropzone.over { border-color: var(--teal); background: var(--teal-soft); color: var(--navy); }
.dropzone svg.i { width: 28px; height: 28px; color: var(--teal); margin-bottom: 6px; }

.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--navy-deep); position: relative; overflow: hidden; color: #c9d6ea; padding: 60px; display: flex; flex-direction: column; justify-content: end; }
.login-side::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid var(--teal); top: -160px; right: -180px; opacity: .5; }
.login-side::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: var(--lime); top: 120px; right: 140px; opacity: .25; filter: blur(4px); }
.login-side h2 { color: #fff; font-size: 44px; font-weight: 800; position: relative; z-index: 1; max-width: 460px; }
.login-side p { position: relative; z-index: 1; max-width: 420px; margin-top: 14px; }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form form { width: min(380px, 100%); }
.login-form img { height: 52px; margin-bottom: 28px; }

.mobile-bar { display: none; }

@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 30% 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
  .mobile-bar img { height: 34px; }
  .content { padding: 22px 16px 50px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { display: none; }
}
@media print {
  .sidebar, .mobile-bar, .filters, .page-head .row { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}

/* suspensão do gás para os ensaios de estanquidade */
.gas-cut { border-left: 4px solid #d97a00; }
.gas-cut h4 { display: flex; align-items: center; gap: 8px; margin: 0; }
.gas-cut h4 svg.i { width: 18px; height: 18px; color: #d97a00; }
.gas-cut-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.gas-cut-row .input { min-width: 0; }
.consent { color: var(--teal); font-weight: 600; }

/* registo de atividade */
.badge.actor-gasmed { background: var(--teal-soft); color: #0f6f6c; }
.badge.actor-gestor { background: #e6eefa; color: var(--navy); }
.badge.actor-condomino { background: var(--lime-soft); color: #4b7a14; }
.tbl.audit td { vertical-align: top; }
.tbl.audit tr.failed td { background: #fff8f7; }
.tbl.audit .err { color: var(--danger); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; display: grid; grid-template-columns: 128px 1fr; gap: 12px; padding: 0 0 16px 18px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--teal); }
.timeline li.read::before { background: #c9d2dc; box-shadow: 0 0 0 1px #c9d2dc; }
.timeline li.failed::before { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.timeline li[hidden] { display: none; }
.timeline .when { font-size: 12px; color: var(--muted); padding-top: 1px; }
.timeline .badge { font-size: 11px; padding: 1px 7px; margin-top: 3px; }
.timeline .err { color: var(--danger); }
