:root {
  --sif-bg: #eef1f6;
  --sif-panel: #ffffff;
  --sif-text: #1f2733;
  --sif-muted: #6b7685;
  --sif-line: #dde3ec;
  --sif-brand: #1d4ed8;
  --sif-brand-2: #2563eb;
  --sif-green: #16a34a;
  --sif-red: #dc2626;
  --sif-amber: #d97706;
  --sif-radius: 8px;
  --sif-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.sif-page {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 14px;
  color: var(--sif-text);
  background: var(--sif-bg);
}

#loginOverlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(238, 241, 246, 0.98);
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 13px;
  color: var(--sif-text);
}
#loginOverlay[hidden] {
  display: none !important;
}
img.login-brand {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto 18px;
  object-fit: contain;
}
.login-content h1 {
  margin: 0 0 15px;
  color: #315f7f;
  font-size: 16px;
  font-weight: 700;
}
#loginUser {
  text-transform: capitalize;
}
.pass-wrap {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  align-items: stretch;
}
.pass-wrap input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  margin-top: 0 !important;
}
#passToggle {
  flex: 0 0 auto;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid #9faeb7;
  border-radius: 3px;
  background: linear-gradient(#fff, #e4eaed);
  color: #294b60;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#passToggle:hover {
  border-color: #5784a0;
}
#passToggle svg {
  display: block;
}
.remember-row {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: #46545d;
  cursor: pointer;
}
.remember-row input {
  width: auto !important;
  height: auto !important;
  min-height: 0;
  margin-top: 0 !important;
  accent-color: #3ca536;
}
.login-content > button.primary {
  border-color: #31852d;
  color: #fff;
  background: linear-gradient(#55ba4c, #34972e);
  text-shadow: 0 1px rgba(0,0,0,.18);
}
.login-content > button.primary:hover {
  border-color: #2a7326;
  background: linear-gradient(#5fc452, #3a9e33);
}
.login-content > button.primary:disabled { opacity: .72; cursor: wait; }
.login-content > button.primary.is-loading { display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-content > button.primary.is-loading::before { content: ""; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: login-spin .7s linear infinite; }
.login-status { position: relative; display: flex; align-items: center; gap: 8px; min-height: 29px; margin: 0 0 7px; padding-bottom: 6px; color: #526873; font-size: 10.5px; }
.login-status .login-spinner { display: none; width: 16px; height: 16px; flex: 0 0 16px; border: 3px solid #cad9df; border-top-color: #31852d; border-right-color: #31852d; border-radius: 50%; }
.login-status.active .login-spinner { display: inline-block; animation: login-spin .7s linear infinite; }
.login-status.active .login-status-text { animation: login-text-pulse 1.1s ease-in-out infinite alternate; }
.login-progress { position: absolute; right: 0; bottom: 0; left: 0; display: none; height: 3px; overflow: hidden; border-radius: 3px; background: #dce7e1; }
.login-status.active .login-progress { display: block; }
.login-progress i { position: absolute; inset: 0; width: 100%; border-radius: 3px; background: linear-gradient(90deg,#55ba4c,#258c36); transform: scaleX(0); transform-origin: left center; animation: login-progress-wait 12s cubic-bezier(.12,.72,.2,1) forwards; }
.login-status.complete .login-progress i { animation: login-progress-complete .25s ease-out forwards; }
@keyframes login-spin { to { transform: rotate(360deg); } }
@keyframes login-progress-wait { from { transform: scaleX(0); } to { transform: scaleX(.9); } }
@keyframes login-progress-complete { from { transform: scaleX(.9); } to { transform: scaleX(1); } }
@keyframes login-text-pulse { from { opacity: .58; } to { opacity: 1; } }

p { color: var(--sif-text); }

.sif-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  color: #fff;
  background: linear-gradient(90deg, #0f2a6e, #1d4ed8);
}
.sif-brand { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.sif-brand small { font-weight: 400; opacity: .8; font-size: 12px; margin-left: 8px; }
.sif-userchip { display: flex; align-items: center; gap: 8px; font-size: 12px; }

#menubar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 18px;
  background: #fff;
  border-bottom: 1px solid var(--sif-line);
  position: sticky;
  top: 0;
  z-index: 40;
}
#menubar button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--sif-muted);
}
#menubar button:hover { background: #eef2fb; color: var(--sif-brand); }
#menubar button.active { background: var(--sif-brand); color: #fff; }

.screen { display: none; padding: 18px; }
.screen.active { display: block; }

.sif-card {
  background: var(--sif-panel);
  border: 1px solid var(--sif-line);
  border-radius: var(--sif-radius);
  box-shadow: var(--sif-shadow);
  padding: 14px;
  margin-bottom: 16px;
}
.sif-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
.sif-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.sif-card-header h3 { margin: 0; }

.sif-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sif-kpi {
  background: var(--sif-panel);
  border: 1px solid var(--sif-line);
  border-radius: var(--sif-radius);
  padding: 14px;
  box-shadow: var(--sif-shadow);
}
.sif-kpi .k-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--sif-muted); }
.sif-kpi .k-value { display: block; font-size: 22px; font-weight: 700; margin-top: 4px; }

.sif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sif-equip-card {
  background: var(--sif-panel);
  border: 1px solid var(--sif-line);
  border-radius: var(--sif-radius);
  border-left: 4px solid var(--sif-green);
  padding: 12px;
  box-shadow: var(--sif-shadow);
  cursor: pointer;
}
.sif-equip-card:hover { border-color: var(--sif-brand-2); }
.sif-equip-card .e-name { font-weight: 700; font-size: 13.5px; }
.sif-equip-card .e-sub { font-size: 11.5px; color: var(--sif-muted); margin-top: 2px; }
.sif-equip-card .e-tot { font-size: 16px; font-weight: 700; margin-top: 8px; }
.sif-equip-card.e-alert { border-left-color: var(--sif-amber); }
.sif-equip-card.e-off { border-left-color: var(--sif-red); opacity: .75; }

.sif-alerts { display: grid; grid-template-columns: 1fr; gap: 4px; }
.sif-alert { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-left: 4px solid var(--sif-amber); background: #fff8ec; border-radius: 4px; font-size: 13px; }
.sif-alert.red { border-left-color: var(--sif-red); background: #fef2f2; }
.sif-alert.crit { border-left-color: var(--sif-red); background: #fef2f2; }

.sif-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.sif-toolbar label, .sif-toolbar b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }

.sif-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--sif-line); margin-bottom: 12px; }
.sif-tablink {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--sif-muted);
  border-bottom: 2px solid transparent;
}
.sif-tablink:hover { color: var(--sif-brand); }
.sif-tablink.active { color: var(--sif-brand); border-bottom-color: var(--sif-brand); font-weight: 600; }
.sif-tab-content { padding: 4px 0; }

.sif-table-wrap { overflow: auto; }
.sif-apontamentos-grid { min-width: 0; }
.sif-apontamentos-grid thead th { position: sticky; top: 0; z-index: 2; }
table.sif-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
table.sif-table th {
  background: #f1f5fb;
  color: #33415c;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--sif-line);
  white-space: nowrap;
}
table.sif-table td { padding: 7px 10px; border: 1px solid #edf0f5; }
table.sif-table tbody tr:hover { background: #f7faff; }
table.sif-table tfoot td { font-weight: 700; background: #f4f7fc; }
.sif-actions { white-space: nowrap; text-align: center; }
.sif-actions button {
  border: 1px solid var(--sif-line);
  background: #fff;
  border-radius: 4px;
  padding: 3px 6px;
  margin: 0 2px;
  cursor: pointer;
  font-size: 12px;
}
.sif-actions button:hover { border-color: var(--sif-brand); color: var(--sif-brand); }
.sif-actions button.danger:hover { border-color: var(--sif-red); color: var(--sif-red); }

button.sif-btn {
  border: 1px solid var(--sif-brand);
  background: var(--sif-brand);
  color: #fff;
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 12.5px;
}
button.sif-btn:hover { background: var(--sif-brand-2); }
button.sif-btn.ghost { background: #fff; color: var(--sif-brand); }
button.sif-btn.warn { background: var(--sif-amber); border-color: var(--sif-amber); }
button.sif-btn.danger { background: var(--sif-red); border-color: var(--sif-red); }
button.sif-btn:disabled { opacity: .5; cursor: not-allowed; }

input.sif-in, select.sif-in, textarea.sif-in {
  padding: 7px 9px;
  border: 1px solid var(--sif-line);
  border-radius: 6px;
  font-size: 12.5px;
  font-family: inherit;
  background: #fff;
}
input.sif-in:focus, select.sif-in:focus, textarea.sif-in:focus { outline: 2px solid #bfdbfe; border-color: var(--sif-brand); }

.sif-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.sif-field { display: flex; flex-direction: column; gap: 4px; }
.sif-field label { font-size: 11.5px; color: var(--sif-muted); font-weight: 600; }
.sif-field .sif-hint { font-size: 11px; color: var(--sif-muted); }

.sif-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow: auto;
  z-index: 100;
}
.sif-modal {
  background: #fff;
  border-radius: 10px;
  width: min(720px, 100%);
  padding: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.sif-modal.wide { width: min(960px, 100%); }
.sif-modal h3 { margin: 0 0 12px; font-size: 15px; }
.sif-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.sif-preview {
  background: #f2f7ff;
  border: 1px dashed #b6ccf5;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  margin-top: 8px;
}
.sif-preview b { color: var(--sif-brand); }

.sif-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

#toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #111827;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 200;
  max-width: 340px;
}
#toast.show { opacity: .95; }
#toast.success { background: var(--sif-green); }
#toast.error { background: var(--sif-red); }

.sif-pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 8px; font-size: 12px; color: var(--sif-muted); }

.sif-perm-table td { vertical-align: top; }

/* ---------------- permissões: layout árvore + matriz ---------------- */
.sif-perm-layout { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 14px; align-items: start; }
@media (max-width: 900px){ .sif-perm-layout { grid-template-columns: 1fr; } }
.sif-perm-side { border: 1px solid #bdc9d0; border-radius: 4px; background: #fff; overflow: hidden; box-shadow: 0 3px 8px rgba(31,58,77,.06); }
.sif-perm-side-head { min-height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 15px; border-bottom: 1px solid #c5d0d6; background: linear-gradient(#f8fafb,#e4eaed); box-shadow: inset 4px 0 0 var(--sif-green); }
.sif-perm-side-head b { color: #244f69; font-size: 12.5px; letter-spacing: 0; text-transform: none; }
.sif-perm-side-head button { font-size: 11.5px; padding: 4px 10px; }
.sif-perm-side-foot { padding: 7px 12px; font-size: 10.5px; color: var(--sif-muted, #5b6b76); border-top: 1px solid var(--sif-border, #eef2f4); background: #fafcfb; }
.sif-perm-tree { max-height: 60vh; overflow: auto; }
.sif-pt-root, .sif-pt-kids { list-style: none; margin: 0; padding: 0; }
.sif-pt-kids { display: none; margin-left: 22px; border-left: 1px solid #c9d6de; }
.sif-pt-sector.open > .sif-pt-kids { display: block; }
.sif-pt-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #f0f4f6; }
.sif-pt-row:hover { background: #f4f8f6; }
.sif-field-hint { display: block; font-size: 11px; color: #5b6b76; margin-top: 4px; }
.sc-coord-row { display: flex; gap: 8px; align-items: stretch; }
.sc-coord-row select { flex: 1; }
.sc-coord-row button { white-space: nowrap; font-size: 12px; }
.sif-pt-caret { width: 12px; color: #5b6b76; font-size: 11px; flex: none; }
.sif-pt-ico { flex: none; font-size: 14px; }
.sif-pt-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sif-pt-name > b, .sif-pt-sector > .sif-pt-row .sif-pt-name { font-size: 13px; color: #253746; }
.sif-pt-row .sif-pt-name { font-weight: 700; }
.sif-pt-name small { color: var(--sif-muted, #5b6b76); font-size: 10.5px; }
.sif-pt-actions { display: inline-flex; gap: 4px; flex: none; }
.sif-pt-actions button { font-size: 10.5px; padding: 2px 7px; line-height: 1.3; }
.sif-pt-actions .icon-danger { color: #b23b3b; }
/* zona de exclusão dentro do modal do setor */
.sc-danger-zone { margin-top: 18px; border: 1px solid #e3b7b7; background: #fdf4f4; border-radius: 6px; padding: 12px 14px; }
.sc-danger-zone b { color: #b23b3b; display: block; margin-bottom: 4px; }
.sc-danger-zone small { color: #7a5a5a; display: block; margin-bottom: 10px; }
.sc-danger-zone button { background: #b23b3b; color: #fff; border: none; border-radius: 4px; padding: 6px 14px; cursor: pointer; font-size: 12px; }
.sc-danger-zone button:hover { background: #963030; }
.sif-pt-member { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; cursor: pointer; border-bottom: 1px solid #f6f8fa; position: relative; }
.sif-pt-member:hover { background: #f4f8f6; }
.sif-pt-member.active { background: #e9f3ee; box-shadow: inset 3px 0 0 #3d7650; }
.sif-pt-branch { position: absolute; left: -11px; top: 50%; width: 11px; height: 1px; background: #c9d6de; }
.sif-pt-ava { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #e3ece7; color: #3d7650; font-weight: 600; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.sif-pt-ava.coord { background: #3d7650; color: #fff; }
.sif-pt-member .sif-pt-name { font-weight: 600; font-size: 12.5px; }
.sif-pt-empty { display: flex; align-items: center; gap: 8px; padding: 6px 10px; color: var(--sif-muted, #5b6b76); font-size: 11.5px; font-style: italic; position: relative; }
.pp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pp-head > div { display: flex; flex-direction: column; }
.pp-head b { font-size: 14.5px; color: #253746; }
.pp-head small { color: var(--sif-muted, #5b6b76); font-size: 11px; }
.pp-head-sec { font-size: 12px; color: #2f5c3e; background: #e9f3ee; border-radius: 9px; padding: 3px 10px; }
.pp-head-sec.muted { color: #5b6b76; background: #f1f4f6; }
.pp-head button { margin-left: auto; }
.sif-coord-tag { font-style: normal; font-size: 10px; background: #e7f0ea; color: #2f5c3e; border-radius: 9px; padding: 1px 7px; font-weight: 600; margin-left: 6px; }
.pp-row-apply { white-space: nowrap; }
.pp-row-apply button { font-size: 10.5px; padding: 2px 8px; }
.sif-perm-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--sif-muted, #5b6b76); }
.sif-perm-bulk b { color: #253746; font-size: 12.5px; }
.sif-role-tag { font-style: normal; font-size: 10.5px; margin-left: 6px; background: #eef2f7; color: #40607e; border-radius: 8px; padding: 1px 7px; }
.sif-perm-table .perm-mod { font-weight: 700; white-space: nowrap; }

/* árvore automática de áreas e ações */
.sif-perm-live { display:inline-flex; align-items:center; gap:7px; color:#416252; font-size:12px; font-weight:600; }
.sif-perm-live i { width:8px; height:8px; border-radius:50%; background:#42aa45; box-shadow:0 0 0 3px rgba(66,170,69,.14); }
.sif-access-editor { min-width:0; padding:14px; border:1px solid #bdc9d0; border-radius:4px; background:#fff; box-shadow:0 3px 10px rgba(31,58,77,.07); }
.sif-access-empty { padding:38px; text-align:center; color:#657784; }
.sif-access-tree { overflow:hidden; border:1px solid #c9d4da; border-radius:5px; background:#fbfcfc; }
.sif-access-root { min-height:54px; display:flex; align-items:center; gap:9px; padding:9px 12px; background:linear-gradient(100deg,#edf5f0,#f8fbf9); border-bottom:1px solid #cbd8cf; }
.sif-access-root-icon { width:28px; height:28px; display:grid; place-items:center; border-radius:50%; background:#2f6f48; color:#fff; font-size:13px; }
.sif-access-root label { display:flex; flex:1; min-width:0; flex-direction:column; cursor:pointer; }
.sif-access-root label b { color:#234c35; font-size:13.5px; }
.sif-access-root label small { color:#688074; font-size:10.5px; }
.sif-access-root-actions { display:flex; gap:5px; }
.sif-access-root-actions button,.sif-access-sector-apply { border:1px solid #aebdc4; border-radius:3px; background:linear-gradient(#fff,#e9eef0); color:#355467; padding:4px 8px; font:600 10.5px 'Segoe UI',sans-serif; cursor:pointer; }
.sif-access-modules { padding:5px 10px 10px 34px; position:relative; }
.sif-access-modules::before { content:''; position:absolute; left:19px; top:0; bottom:22px; width:1px; background:#aebfc7; }
.sif-access-module { position:relative; margin-top:5px; }
.sif-access-module::before { content:''; position:absolute; left:-15px; top:17px; width:15px; height:1px; background:#aebfc7; }
.sif-access-module-row { min-height:35px; display:flex; align-items:center; gap:7px; padding:3px 7px; border:1px solid #d4dde2; border-radius:4px; background:#fff; }
.sif-access-module-row:hover { background:#f4f8f6; border-color:#b9ccc0; }
.sif-access-caret { width:20px; height:20px; padding:0; border:0; background:transparent; color:#506a78; cursor:pointer; }
.sif-access-module-name { min-width:0; flex:1; display:flex; flex-direction:column; align-items:flex-start; border:0; background:transparent; cursor:pointer; text-align:left; }
.sif-access-module-name b { color:#25465a; font-size:12.5px; }
.sif-access-module-name small { color:#758690; font-size:10px; }
.sif-access-children { display:none; margin-left:25px; padding:3px 0 4px 16px; border-left:1px solid #bdcbd2; }
.sif-access-module.open .sif-access-children { display:block; }
.sif-access-action { min-height:29px; position:relative; display:flex; align-items:center; gap:8px; color:#334f60; font-size:12px; cursor:pointer; }
.sif-access-line { position:absolute; left:-16px; top:50%; width:12px; height:1px; background:#bdcbd2; }
.sif-access-action:hover span:last-child { color:#176a3a; text-decoration:underline; }
.sif-access-tree input[type="checkbox"] { width:15px; height:15px; accent-color:#348b45; cursor:pointer; }
@media (max-width:700px){ .sif-access-root-actions{display:none}.sif-access-sector-apply{font-size:0}.sif-access-sector-apply::after{content:'Setor';font-size:10px} }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow: auto; z-index: 100;
}
.modal-backdrop.open { display: flex; }
#modal {
  background: #fff; border-radius: 10px;
  width: min(720px,100%); padding: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
#modal.wide { width: min(960px,100%); }
#modal-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.modal-body { }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---------------- screens ---------------- */
.screen { display: none; padding: 18px; }
.screen.active { display: block; }
.screen-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.screen-title b { font-size: 18px; }
.screen-title span { font-size: 12.5px; color: var(--sif-muted); }

/* ---------------- toolbar legacy ---------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar-spacer { flex: 1; }
.toolbar button, .sif-toolbar button {
  border: 1px solid var(--sif-line); background: #fff; padding: 7px 12px;
  border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--sif-text);
}
.toolbar button:hover, .sif-toolbar button:hover { border-color: var(--sif-brand); color: var(--sif-brand); }
.toolbar button.primary, .sif-toolbar button.primary,
button.primary {
  background: var(--sif-brand); color: #fff; border-color: var(--sif-brand);
}
.toolbar button.danger, .sif-toolbar button.danger,
button.danger {
  background: var(--sif-red); color: #fff; border-color: var(--sif-red);
}
.sif-period { font-size: 12.5px; color: var(--sif-muted); }
.sif-tool-label { font-size: 12.5px; color: var(--sif-muted); font-weight: 600; }

/* Botão seletor de período/mês (abre o seletor de meses) */
.sif-period-select {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border: 1px solid var(--sif-line); border-radius: 6px;
  background: linear-gradient(#fff, #f3f6f8); cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--sif-text);
}
.sif-period-select:hover { border-color: var(--sif-brand-2); background: #f0f6ff; }
.sif-period-select small { font-weight: 500; color: var(--sif-muted); font-size: 11px; }

/* ---------------- panels ---------------- */
.sif-panel {
  background: var(--sif-panel); border: 1px solid var(--sif-line);
  border-radius: var(--sif-radius); box-shadow: var(--sif-shadow);
  padding: 14px; margin-bottom: 16px;
}
.panel-head {
  font-size: 14px; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.sif-muted { color: var(--sif-muted); }

/* ---------------- equipment grid/cards ---------------- */
.sif-equip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 12px; }
.sif-equip-card {
  background: var(--sif-panel); border: 1px solid var(--sif-line);
  border-radius: var(--sif-radius); border-left: 4px solid var(--sif-green);
  padding: 12px; box-shadow: var(--sif-shadow); cursor: pointer;
  transition: border-color .15s;
}
.sif-equip-card:hover { border-color: var(--sif-brand-2); }
.sif-equip-card.e-alert { border-left-color: var(--sif-amber); }
.sif-equip-card.e-off { border-left-color: var(--sif-red); opacity: .75; }
.sif-equip-head { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.sif-equip-head b { font-size: 14px; }
.sif-equip-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 12px; }
.sif-equip-stats span { color: var(--sif-muted); }
.sif-equip-stats b { color: var(--sif-text); }
.sif-go { display: block; margin-top: 8px; font-size: 11.5px; color: var(--sif-brand); }

/* ---------------- badges ---------------- */
.badge { font-size: 10px; padding: 2px 5px; border-radius: 4px; font-weight: 700; }
.badge-alert { background: #fde68a; color: #92400e; }
.badge.green { background: #dcfce7; color: #166534; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.blue { background: #dbeafe; color: #1e40af; }
.badge.gray { background: #e5e7eb; color: #374151; }
.danger-text { color: var(--sif-red); font-weight: 700; }

/* ---------------- info bar / calc preview ---------------- */
.sif-info-bar { background: #f1f5fb; border: 1px solid var(--sif-line); border-radius: 6px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 12px; }
.sif-calc { display: block; font-size: 11.5px; color: var(--sif-brand); margin-top: 3px; }

/* ---------------- select component (win-select) ---------------- */
.win-select { position: relative; display: inline-block; }
.win-select-button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--sif-line); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 12.5px; min-width: 180px;
}
.win-select-button:hover { border-color: var(--sif-brand); }
.win-select-button i { border:0 !important; margin:0 -2px 0 auto; width:20px; height:20px; align-self:center; display:flex; align-items:center; justify-content:center; background:transparent !important; }
.win-select-button i::after { content:""; display:block; width:13px; height:13px; margin:0; border:0; background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23294b60' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center/contain; }
.win-select-options {
  display: none; position: absolute; left: 0; top: 100%; z-index: 60;
  background: #fff; border: 1px solid var(--sif-line); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 240px; max-height: 300px; overflow-y: auto;
  padding: 4px;
}
.win-select:hover .win-select-options,
.win-select.open .win-select-options { display: block; }
.win-select-options button {
  display: block; width: 100%; text-align: left; padding: 7px 10px;
  border: 0; background: transparent; cursor: pointer; font-size: 12.5px; border-radius: 4px;
}
.win-select-options button:hover { background: #eef2fb; color: var(--sif-brand); }
.sif-plain-select { padding: 7px 9px; border: 1px solid var(--sif-line); border-radius: 6px; font-size: 12.5px; background: #fff; }

/* ---------------- data table ---------------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
table.data-table th {
  background: #f1f5fb; color: #33415c; text-align: left;
  padding: 8px 10px; border: 1px solid var(--sif-line); white-space: nowrap;
}
table.data-table thead th { position:relative; }
.sif-col-resizer { position:absolute; top:0; right:-4px; z-index:8; width:8px; height:100%; cursor:col-resize; touch-action:none; user-select:none; }
.sif-col-resizer::after { content:""; position:absolute; top:18%; right:3px; width:1px; height:64%; background:transparent; }
.sif-col-resizer:hover::after, th.sif-col-resizing > .sif-col-resizer::after { background:#3187b2; box-shadow:0 0 0 1px rgba(49,135,178,.18); }
body.sif-resizing-columns, body.sif-resizing-columns * { cursor:col-resize!important; user-select:none!important; }
table.data-table td { padding: 7px 10px; border: 1px solid #edf0f5; }
table.data-table tbody tr:hover { background: #f7faff; }
table.data-table tfoot td { font-weight: 700; background: #f4f7fc; }
td.muted, .muted { color: var(--sif-muted); }
.sif-unit { white-space: nowrap; }
.sif-check { width: 15px; height: 15px; cursor: pointer; }

/* ---------------- confirm dialog ---------------- */
.confirm-dialog { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.confirm-dialog-icon { font-size: 24px; color: var(--sif-amber); line-height: 1; }

/* ---------------- form grid legacy ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 10px; }
.form-grid.sif-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--sif-muted); font-weight: 600; }
.form-grid.sif-form input, .form-grid.sif-form select, .form-grid.sif-form textarea {
  margin-top: 4px;
}
.form-grid label.span2 { grid-column: span 2; }
.form-grid label.span-all { grid-column: 1 / -1; }
.form-grid label.span-all > .sif-time-row { display: flex !important; flex-direction: row !important; flex-wrap: nowrap; gap: 12px; }
.form-grid label.span-all > .sif-time-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.form-grid label.span-all > .sif-time-row > div small { font-size: 11px; color: #6b7f8a; font-weight: 600; }
.form-grid label.span-all > .sif-time-row > div input, .form-grid label.span-all > .sif-time-row > div select { width: 100%; box-sizing: border-box; }
.sif-total-auto { background: #f0f7f0 !important; border-color: #3ca536 !important; font-weight: 700; font-size: 14px !important; color: #1a5c1a !important; cursor: default; }
.sif-time-entries { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.sif-vinculo-hint { font-size: 11px; line-height: 1.45; color: #5a7a8a; background: #eef4f7; border: 1px solid #c8d2d9; border-radius: 4px; padding: 7px 10px; margin-bottom: 2px; }
/* Card de horário em 2 linhas: [Início | Fim | ações] / [Vínculo | Obra] */
.sif-time-entry { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px 10px; align-items: end; background: #f8fbfc; border: 1px solid #dfe7ec; border-radius: 6px; padding: 10px 10px 12px; }
/* Linha Início/Fim — regra única para principal e sub-horário (visuais idênticos) */
.sif-entry-start, .sif-sub-start { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sif-entry-end, .sif-sub-end { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sif-entry-actions, .sif-sub-actions { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 6px; margin-top: 18px; white-space: nowrap; }
.sif-entry-start small, .sif-entry-end small, .sif-sub-start small, .sif-sub-end small { font-size: 11px; color: #6b7f8a; font-weight: 600; }
.sif-entry-start input[type="time"], .sif-entry-end input[type="time"], .sif-sub-start input[type="time"], .sif-sub-end input[type="time"] { width: 100%; box-sizing: border-box; min-height: 34px; }
.sif-entry-vinculo { grid-column: 1; grid-row: 4; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sif-entry-obra { grid-column: 2 / 4; grid-row: 4; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sif-entry-op { grid-column: 1; grid-row: 5; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sif-entry-sienge { grid-column: 2 / 4; grid-row: 5; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
/* Sub-horários: mesmo visual do Início/Fim principal (somam ao horário) */
.sif-sub-list { grid-column: 1 / 4; grid-row: 2; display: flex; flex-direction: column; gap: 8px; }
.sif-sub-list:empty { display: none; }
.sif-sub-entry { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px 10px; align-items: end; }
.sif-add-sub-btn { grid-column: 1 / 4; grid-row: 3; justify-self: start; background: none; border: 0; color: #155d83; font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.sif-add-sub-btn:hover { text-decoration: underline; }
.sif-entry-start input[type="time"], .sif-entry-end input[type="time"], .sif-entry-sienge input[type="text"] { width: 100%; box-sizing: border-box; min-height: 34px; }
.sif-entry-sienge-preview { grid-column: 1 / 4; grid-row: 6; }
.sif-entry-sienge-preview:empty { display: none; }
.sif-entry-mkind { grid-column: 1; grid-row: 7; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sif-entry-meter-pair { grid-column: 2 / 4; grid-row: 7; display: flex; gap: 10px; min-width: 0; }
.sif-entry-meter-pair > label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sif-entry-ms, .sif-entry-me { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sif-entry-mkind select, .sif-entry-ms input, .sif-entry-me input { width: 100%; box-sizing: border-box; min-height: 34px; font-size: 12px; }
.sif-entry-mkind small, .sif-ms-lab, .sif-me-lab { font-size: 11px; color: #6b7f8a; font-weight: 600; }
/* Conta automática do horário — caixinhas por tipo, iguais às do Sienge */
.sif-entry-calc { grid-column: 1 / 4; grid-row: 8; }
.sif-entry-calc:empty { display: none; }
.sif-entry-calc .sienge-info-value { font-weight: 700; }
.sif-entry-calc .sif-calc-money { color: #1a5c1a; }
.sif-entry-calc .sif-calc-error { color: #9c251e; border-color: #d9aaa6; background: #fdf0f0; }
.sif-entry-sienge input:disabled { background: #edf0f2; color: #8a9aa5; cursor: not-allowed; }
.sif-entry-sienge-preview .sif-no-data { color: #8a5a12; font-size: 12px; }
.sif-entry-start small, .sif-entry-end small, .sif-entry-vinculo small, .sif-entry-obra small, .sif-entry-op small, .sif-entry-sienge small { font-size: 11px; color: #6b7f8a; font-weight: 600; }
.sif-entry-vinculo select, .sif-entry-obra select, .sif-entry-op select { width: 100%; box-sizing: border-box; font-size: 12px; min-height: 34px; }
@media (max-width: 560px) {
  .sif-time-entry { grid-template-columns: 1fr 1fr; }
  .sif-time-entry > .sif-entry-start { grid-column: 1; grid-row: 1; }
  .sif-time-entry > .sif-entry-end { grid-column: 2; grid-row: 1; }
  .sif-sub-list { grid-column: 1 / 3; grid-row: 2; }
  .sif-sub-entry { grid-template-columns: 1fr 1fr; }
  .sif-sub-entry .sif-sub-start { grid-column: 1; grid-row: 1; }
  .sif-sub-entry .sif-sub-end { grid-column: 2; grid-row: 1; }
  .sif-sub-entry .sif-sub-actions { grid-column: 1 / 3; grid-row: 2; justify-self: end; margin-top: 0; }
  .sif-add-sub-btn { grid-column: 1 / 3; grid-row: 3; }
  .sif-entry-vinculo { grid-column: 1 / 3; grid-row: 4; }
  .sif-entry-obra { grid-column: 1 / 3; grid-row: 5; }
  .sif-entry-op { grid-column: 1 / 3; grid-row: 6; }
  .sif-entry-sienge { grid-column: 1 / 3; grid-row: 7; }
  .sif-entry-sienge-preview { grid-column: 1 / 3; grid-row: 8; }
  .sif-entry-mkind { grid-column: 1 / 3; grid-row: 9; }
  .sif-entry-meter-pair { grid-column: 1 / 3; grid-row: 10; }
  .sif-entry-calc { grid-column: 1 / 3; grid-row: 11; }
  .sif-entry-actions { grid-column: 1 / 3; grid-row: 12; margin-top: 0; justify-content: flex-end; }
}
.sif-entry-actions { display: flex; align-items: center; gap: 4px; margin-top: 18px; }
.sif-btn-toggle-exclude, .sif-sub-exclude { background: #e8ecef; border: 1px solid #c5cdd2; color: #5a7a8a; border-radius: 4px; padding: 5px 10px; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sif-btn-toggle-exclude:hover, .sif-sub-exclude:hover { background: #dce3e8; }
.sif-btn-toggle-exclude.excluded, .sif-sub-exclude.excluded { background: #fdecea; border-color: #e67e22; color: #e67e22; }
.sif-btn-remove-right { background: none; border: 1px solid #e0c5c5; color: #c0392b; border-radius: 4px; cursor: pointer; font-size: 10px; padding: 3px 6px; line-height: 1; }
.sif-btn-remove-right:hover { background: #fdf0f0; border-color: #c0392b; }
.sif-confirm-group { display: flex; gap: 4px; align-items: center; }
.sif-btn-confirm-remove { background: #c0392b; border: 1px solid #c0392b; color: #fff; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600; padding: 5px 10px; white-space: nowrap; }
.sif-btn-confirm-remove:hover { background: #a93226; }
.sif-btn-cancel-remove { background: none; border: 1px solid #c5cdd2; color: #5a7a8a; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600; padding: 5px 10px; white-space: nowrap; }
.sif-btn-cancel-remove:hover { background: #e8ecef; }
.sif-add-time-btn { margin-top: 6px; background: none; border: 1px dashed #9faeb7; color: #5a7a8a; border-radius: 4px; padding: 6px 12px; cursor: pointer; font-size: 12px; font-weight: 600; }
.sif-add-time-btn:hover { border-color: #3ca536; color: #3ca536; }
.sif-time-remove { display: none; }
/* Vínculo na grade + acumulado por obra */
.sif-vinculo-cell { min-width: 90px; max-width: 240px; }
.sif-vinculo-cell .muted { color: #9aa7b0; }
.sif-vinc-list { display: flex; flex-direction: column; gap: 3px; }
.sif-vinc-tag { display: inline-block; font-size: 11px; background: #e8f3e8; border: 1px solid #b9d8b9; color: #1e5c1e; border-radius: 10px; padding: 2px 8px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sif-vinc-tag.other { background: #fff4e5; border-color: #e6c58a; color: #8a5a12; }
.sif-vinc-tag b { font-weight: 700; }
.sif-acumulado-panel { margin-top: 14px; }
.sif-acumulado-panel .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sif-acumulado-panel .panel-head small { display: block; font-weight: 400; font-size: 11px; color: #657784; margin-top: 2px; }
.sif-acumulado-table td:first-child { max-width: 320px; }
.sif-acumulado-details { margin-top: 10px; }
.sif-acumulado-details summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #155d83; padding: 6px 0; }
.sif-acumulado-panel .sif-note { margin-top: 10px; margin-bottom: 0; }
.sif-acumulado-sub { font-size: 12.5px; font-weight: 700; color: #244f69; margin: 14px 0 6px; }
.sif-acumulado-sub:first-of-type { margin-top: 0; }
.sif-acum-nav { display:flex; align-items:center; gap:4px; margin:0 0 9px; padding:0 0 7px; border-bottom:1px solid #b8c4cb; }
.sif-acum-nav>span { margin-right:5px; color:#526976; font-size:11.5px; font-weight:600; }
.sif-acum-nav>small { margin-left:auto; color:#70818b; font-size:10.5px; }
.sif-acum-nav button { min-height:28px; display:inline-flex; align-items:center; gap:7px; padding:4px 10px; border:1px solid #aebbc3; border-radius:3px; background:linear-gradient(#fff,#e5ebee); color:#294b60; cursor:pointer; font:600 11.5px 'Segoe UI',sans-serif; }
.sif-acum-nav button:hover { border-color:#6f8c9c; background:#f8fbfc; }
.sif-acum-nav button.active { border-color:#4b9251; background:#e0f0e2; color:#174f2a; box-shadow:inset 3px 0 #3ca536; }
.sif-acum-nav button b { min-width:18px; padding:1px 5px; border-radius:9px; background:#fff; color:#496371; font-size:9.5px; text-align:center; }
.sif-acum-nav button.active b { color:#286537; }
.sif-acum-view[hidden] { display:none!important; }
.sif-acum-view .sif-acumulado-sub { margin-top:0; padding:0 2px; }
@media(max-width:700px){.sif-acum-nav{flex-wrap:wrap}.sif-acum-nav>small{width:100%;margin:3px 0 0}.sif-acum-nav>span{width:100%}}
.sif-badge-atual { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #0e4d23; background: #dbf0dc; border: 1px solid #9ccc9e; border-radius: 10px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
tr.sif-row-current td { background: #f2f9f1; }
table.data-table tbody tr.sif-row-current:hover td { background: #e6f3e5; }
/* Grade de apontamentos: colunas legíveis, sem espremer */
#screen-apontamentos .sif-table-wrap { overflow: auto; }
table.data-table.sif-apontamentos-grid { min-width: 1960px; }
table.data-table.sif-apontamentos-grid thead th { white-space: nowrap; vertical-align: middle; padding: 12px; font-size: 12.5px; line-height: 1.4; }
table.data-table.sif-apontamentos-grid tbody td { vertical-align: middle; padding: 11px 12px; font-size: 13px; line-height: 1.5; }
table.data-table.sif-apontamentos-grid td.cell-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data-table.sif-apontamentos-grid td.cell-center { text-align: center; white-space: nowrap; }
table.data-table.sif-apontamentos-grid td.cell-ellipsis { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- toggle switch ---------------- */
.sif-toggle-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; cursor: pointer; user-select: none; margin-top: 2px; }
.sif-toggle-wrap input[type="checkbox"] { display: none; width: 0; height: 0; margin: 0; padding: 0; }
.sif-toggle-slider { position: relative; width: 44px; height: 24px; background: #ccc; border-radius: 12px; transition: background 0.25s; flex-shrink: 0; }
.sif-toggle-slider::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform 0.25s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.sif-toggle-wrap input:checked + .sif-toggle-slider { background: #3ca536; }
.sif-toggle-wrap input:checked + .sif-toggle-slider::after { transform: translateX(20px); }
.sif-toggle-label { font-size: 12px; font-weight: 600; }
.sif-toggle-wrap input:checked ~ .sif-toggle-label { color: #3ca536; }
.sif-toggle-wrap input:not(:checked) ~ .sif-toggle-label { color: #999; }

/* ---------------- notes ---------------- */
.sif-note { background: #fff8ec; border-left: 4px solid var(--sif-amber); padding: 8px 12px; font-size: 12px; border-radius: 4px; margin-bottom: 10px; }

/* ---------------- month list ---------------- */
.sif-month-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 8px; }
.sif-month-list button {
  display: flex; flex-direction: column; align-items: flex-start;
  border: 1px solid var(--sif-line); border-radius: 6px; padding: 10px 12px;
  background: #fff; cursor: pointer; font-size: 13px; gap: 3px;
}
.sif-month-list button i { font-size: 11px; color: var(--sif-muted); }
.sif-month-list button:hover { border-color: var(--sif-brand); color: var(--sif-brand); }
.sif-month-list button.active { border-color: var(--sif-brand); background: #eef2fb; color: var(--sif-brand); font-weight: 600; }
.sif-month-list .sif-custom-tag { color: var(--sif-muted); font-weight: 400; font-style: normal; }

/* ---------------- período personalizado (opcional) ---------------- */
.sif-custom-period {
  border: 1px dashed var(--sif-line); border-radius: 6px; background: #fafbfd;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 12px;
}
.sif-custom-period > b { font-size: 12px; color: var(--sif-ink, #1f2937); }
.sif-custom-period > span { color: var(--sif-muted); }
.sif-custom-period-dates { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.sif-custom-period-dates label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; color: var(--sif-muted); }
.sif-custom-period-dates input[type="date"] {
  border: 1px solid var(--sif-line); border-radius: 6px; padding: 8px 10px; font-size: 13px;
  background: #fff; color: var(--sif-ink, #1f2937); min-width: 150px; font-family: inherit;
}
.sif-custom-period-dates input[type="date"]:focus { outline: none; border-color: var(--sif-brand); box-shadow: 0 0 0 2px rgba(29,78,216,.12); }
.sif-custom-period-actions { display: flex; gap: 8px; }
.sif-custom-period-actions button {
  border: 1px solid var(--sif-line); background: #fff; border-radius: 6px; padding: 8px 14px;
  font-size: 12px; cursor: pointer; font-family: inherit;
}
.sif-custom-period-actions button:hover { border-color: var(--sif-brand); color: var(--sif-brand); }
.sif-custom-period-actions button.primary { background: var(--sif-brand); border-color: var(--sif-brand); color: #fff; }
.sif-custom-period-actions button.primary:hover { background: var(--sif-brand-2); color: #fff; }

/* ---------------- permission tree ---------------- */
.sif-perm-tree { }
.sif-perm-tree .perm-mod { font-weight: 700; padding: 4px 0; font-size: 13px; }
.sif-perm-tree .perm-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 14px; margin-bottom: 6px; }
.sif-perm-tree .perm-ck { display: flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border: 1px solid var(--sif-line); border-radius: 4px; cursor: pointer; background: #fff; }

/* ==========================================================
   Conquista Frota — shell desktop profissional
   ========================================================== */
:root {
  --sif-brand: #1268a8; --sif-brand-2: #0d568d; --sif-green: #3ca536;
  --sif-bg: #e9eef2; --sif-panel: #fff; --sif-text: #243746;
  --sif-muted: #657784; --sif-line: #c8d2d9; --sif-radius: 4px;
  --sif-shadow: 0 4px 14px rgba(31,58,77,.09);
}
body.sif-page { min-height:100vh; background:linear-gradient(135deg,#e6edf1 0,#f6f8f9 55%,#e4ecef 100%); color:var(--sif-text); overflow-x:clip; }
#app { min-height:100vh; }
.sif-topbar { height:44px; padding:0 16px 0 14px; flex-wrap:nowrap; background:linear-gradient(90deg,#123c58,#155d83 58%,#1d6d91); border-bottom:1px solid #0c344c; box-shadow:0 1px 6px rgba(8,35,52,.3); }
.sif-brand { display:flex; align-items:center; gap:10px; font-size:14px; letter-spacing:.7px; }
.sif-brand img { width:25px; height:25px; object-fit:contain; filter:drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.sif-brand span { display:flex; align-items:baseline; gap:10px; }
.sif-brand small { font-size:11px; letter-spacing:.2px; color:#d2e2ec; }
.sif-userchip { height:44px; gap:10px; }
.sif-userchip #storageStatus { padding:4px 9px 4px 22px; border:1px solid rgba(255,255,255,.2); border-radius:12px; background:rgba(0,0,0,.12); position:relative; font-size:11px; }
.sif-userchip #storageStatus::before { content:''; position:absolute; left:9px; top:50%; width:7px; height:7px; margin-top:-3px; border-radius:50%; background:#65d25c; box-shadow:0 0 0 2px rgba(101,210,92,.18); }
#logoutButton { height:27px; padding:0 11px; color:#fff; border:1px solid rgba(255,255,255,.3); border-radius:3px; background:rgba(255,255,255,.1); }
#logoutButton:hover { background:rgba(255,255,255,.2); }
.sif-userchip>i { width:42px; height:44px; display:grid; place-items:center; font-style:normal; font-size:15px; color:#eaf3f7; }
.sif-userchip>i.window-close { font-size:21px; }
.sif-userchip>i:hover { background:rgba(255,255,255,.12); }.sif-userchip>i.window-close:hover{background:#c42b1c}
#menubar { top:0; gap:0; padding:0 12px; min-height:43px; align-items:stretch; background:linear-gradient(#fff,#edf2f4); border-bottom:1px solid #aebbc3; box-shadow:0 2px 6px rgba(31,58,77,.08); }
#menubar button { position:relative; border-radius:0; padding:0 13px; min-height:42px; color:#405767; font-size:12.5px; font-weight:600; }
#menubar button:hover { color:#105c8f; background:linear-gradient(#f9fcfd,#dce9ef); }
  #menubar button.active { color:#0e4d23; background:linear-gradient(#f4faf3,#dbf0dc); box-shadow:inset 0 -4px 0 var(--sif-green); }
main { padding:14px 16px 24px; max-width:1800px; margin:auto; }
.screen { padding:0; animation:sifReveal .18s ease-out; }
/* Respiro interno uniforme: cartões, barras, abas, painéis e tabelas não
   encostam mais na moldura da janela. O título continua ocupando toda a
   largura, como uma barra de janela. */
.screen > :not(.screen-title) {
  width: auto;
  max-width: calc(100% - 24px);
  margin-left: 12px;
  margin-right: 12px;
  box-sizing: border-box;
}
@keyframes sifReveal { from{opacity:.35;transform:translateY(3px)} to{opacity:1;transform:none} }
.screen-title { min-height:58px; padding:12px 15px 11px 18px; display:flex; flex-direction:column; justify-content:center; gap:3px; border:1px solid #bdc9d0; border-left:0; border-top:0; border-radius:0 4px 0 0; background:linear-gradient(100deg,#fff,#eef5f6); box-shadow:inset 4px 0 0 var(--sif-green),0 2px 8px rgba(31,58,77,.07); }
.screen-title b { color:#174f70; font-size:18px; letter-spacing:.1px; }.screen-title span{color:#6c7c87;font-size:12px}
.sif-status-link { cursor:pointer; }
.data-table tbody tr.sif-target-row td { background:#fff4d6!important; box-shadow:inset 0 1px #dfb64b,inset 0 -1px #dfb64b; }
.data-table tbody tr.sif-target-row td:first-child { border-left:3px solid #d49b16; }
.sif-select.sif-target-equipment .win-select-button { border-color:#d49b16!important; background:#fff4d6!important; box-shadow:inset 3px 0 #d49b16,0 0 0 1px rgba(212,155,22,.16)!important; color:#173f58!important; font-weight:700!important; }
.toolbar { min-height:48px; margin:0 0 12px; padding:8px 10px; display:flex; align-items:center; gap:7px; border:1px solid #bdc9d0; border-top:0; background:linear-gradient(#fdfefe,#e7edef); box-shadow:0 3px 8px rgba(31,58,77,.06); }
.toolbar button,.modal-actions button { min-height:30px; padding:5px 12px; border:1px solid #9daab2; border-radius:3px; color:#294b60; background:linear-gradient(#fff,#e4eaed); box-shadow:inset 0 1px #fff,0 1px 2px rgba(0,0,0,.07); font:600 12px 'Segoe UI',sans-serif; }
.toolbar button { display:inline-flex; align-items:center; gap:6px; }
.toolbar button .btn-ico { width:14px; height:14px; flex:0 0 auto; }
.sif-actions button .btn-ico { display:block; width:14px; height:14px; }
.sif-actions button.icon-danger { color:#ad2d25; border-color:#d9aaa6; background:linear-gradient(#fff,#f8e5e3); }
.sif-actions button.icon-danger:hover { color:#861d17; border-color:#bd625b; background:linear-gradient(#fff4f3,#efd0cd); }
.toolbar button:hover,.modal-actions button:hover { border-color:#5784a0; background:linear-gradient(#fff,#dceaf0); }
.toolbar button.primary,.modal-actions button.primary { border-color:#31852d; color:#fff; background:linear-gradient(#55ba4c,#34972e); text-shadow:0 1px rgba(0,0,0,.18); }
.toolbar button.danger,.modal-actions button.danger { border-color:#b7463d; color:#9c251e; background:linear-gradient(#fff,#f4dddd); }
.sif-kpis { gap:10px; }
.sif-kpis>div { position:relative; overflow:hidden; min-height:92px; padding:15px 16px 13px; border:1px solid #c4ced4; border-radius:4px; background:linear-gradient(145deg,#fff,#f4f7f8); box-shadow:var(--sif-shadow); }
.sif-kpis>div::after { content:''; position:absolute; left:0; right:0; bottom:0; height:3px; background:linear-gradient(90deg,var(--sif-green),#68bd60); }
.sif-kpis>div>b { display:block; color:#173f58; font-size:23px; letter-spacing:-.4px; margin-bottom:5px; }.sif-kpis>div>small{display:block;color:#627683;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.35px}
.sif-panel { margin:0 0 14px; padding:12px; border:1px solid #c5d0d6; border-radius:4px; background:#fff; box-shadow:var(--sif-shadow); }
.sif-panel>.panel-head { margin:-12px -12px 11px; padding:9px 12px; border-bottom:1px solid #c5d0d6; color:#244f69; font-weight:700; background:linear-gradient(#f8fafb,#e4eaed); }
.sif-equip-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(255px,1fr)); gap:10px; }
.sif-card { border-color:#c5d0d6; border-radius:4px; box-shadow:var(--sif-shadow); }
.sif-card-header { margin:-14px -14px 12px; padding:9px 12px; border-bottom:1px solid #c5d0d6; background:linear-gradient(#f8fafb,#e4eaed); }
.sif-card-header h3 { color:#244f69; font-size:13px; }
.sif-alert { min-height:38px; border:1px solid #ead29c; border-left:4px solid #d89924; border-radius:3px; background:linear-gradient(90deg,#fff9ea,#fffdf7); }
.sif-alert.red { border-color:#e2b5b2; border-left-color:#c84b42; background:linear-gradient(90deg,#fff1f0,#fffafa); }
.sif-alert b { min-width:210px; color:#304e60; }.sif-alert span{color:#5f6e77}
.sif-equip-card { border:1px solid #c5d0d6; border-left:4px solid var(--sif-green); border-radius:4px; background:linear-gradient(145deg,#fff,#f2f6f7); box-shadow:0 3px 10px rgba(31,58,77,.08); transition:.16s ease; }
.sif-equip-card:hover { transform:translateY(-2px); border-color:#83a4b7; box-shadow:0 7px 18px rgba(31,58,77,.14); }
.sif-dashboard-section-title { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:16px 2px 7px; padding:0 2px; }
.sif-dashboard-section-title b { color:#244f69; font-size:14px; }
.sif-dashboard-section-title span { color:#71828c; font-size:11px; }
.sif-dashboard-alert-panel { margin-bottom:0; }
.sif-dashboard-alert-panel .panel-head > b,
.sif-dashboard-fleet-panel .panel-head > b { min-width:24px; padding:2px 7px; border:1px solid #b7cad4; border-radius:10px; color:#245a77; background:#fff; font-size:10.5px; text-align:center; }
.sif-dashboard-fleet-panel { padding:0; }
.sif-dashboard-fleet-panel > .panel-head { margin:0; }
.sif-dashboard-fleet-panel .sif-table-wrap { max-height:390px; border:0; border-radius:0; box-shadow:none; }
.sif-dashboard-table th { position:sticky; top:0; z-index:3; }
.sif-status-heading { width:100%; min-width:92px; display:flex; align-items:center; justify-content:space-between; gap:10px; white-space:nowrap; }
.sif-filter-icon { position:relative; flex:0 0 19px; width:19px; height:19px; margin-left:auto; display:grid; place-items:center; border:1px solid transparent; border-radius:3px; color:#628091; background:transparent; cursor:pointer; }
.sif-filter-icon:hover { border-color:#9fb3bf; color:#245b78; background:rgba(255,255,255,.65); }
.sif-filter-icon.active { border-color:#6e98ad; color:#1d6588; background:#e7f2f7; }
.sif-filter-icon svg { width:12px; height:12px; pointer-events:none; }
.sif-filter-icon select { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.sif-dashboard-equipment[hidden] { display:none !important; }
.sif-dashboard-equipment { cursor:pointer; }
.sif-dashboard-equipment:hover .sif-dashboard-open { color:#19723a; font-weight:800; }
.sif-dashboard-status { white-space:nowrap; }
.sif-dashboard-status .badge + .badge { margin-left:4px; }
.sif-dashboard-open { color:#39728f!important; white-space:nowrap; font-size:11px; }
.sif-dashboard-content { flex:1 1 auto; min-height:0; display:grid; grid-template-columns:minmax(260px,30%) minmax(0,70%); gap:12px; }
#screen-painel.active { display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden; }
#screen-painel > .screen-title,
#screen-painel > .toolbar,
#screen-painel > .sif-kpis { flex:0 0 auto; }
#screen-painel > .screen-title { height:38px; min-height:38px; max-height:38px; box-sizing:border-box; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; padding:4px 12px 4px 18px; gap:10px; }
#screen-painel > .screen-title b { font-size:13px; line-height:1.15; }
#screen-painel > .screen-title span { grid-column:2; font-size:10.5px; line-height:1.15; text-align:center; white-space:nowrap; }
#screen-painel .sif-kpis { margin-bottom:12px; }
#screen-painel .sif-dashboard-content > .sif-panel { min-height:0; height:100%; margin:0; overflow:hidden; }
.sif-dashboard-content .panel-head span { display:flex; flex-direction:column; gap:2px; }
.sif-dashboard-content .panel-head small { color:#75858f; font-size:10px; font-weight:400; }
.sif-alert-filters { display:flex; align-items:center; gap:3px; margin-left:auto; }
.sif-alert-filters select { height:24px; max-width:142px; padding:2px 22px 2px 6px; border:1px solid #bdc9d0; border-radius:3px; color:#405d6d; background:#fff; font:600 10.5px 'Segoe UI',sans-serif; }
.sif-alert-filters button { min-height:24px; padding:3px 7px; border:1px solid #bdc9d0; border-radius:3px; color:#526a78; background:#fff; font:600 10.5px 'Segoe UI',sans-serif; cursor:pointer; }
.sif-alert-filters button:hover { border-color:#7895a5; background:#f2f7f9; }
.sif-alert-filters button.active { border-color:#397b9d; color:#fff; background:#397b9d; }
.sif-dashboard-alert-panel { display:flex; flex-direction:column; }
.sif-dashboard-alert-panel > .panel-head { flex:0 0 auto; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:7px 8px; }
.sif-dashboard-alert-panel > .panel-head > span { grid-column:1; min-width:0; }
.sif-dashboard-alert-panel > .panel-head > b { grid-column:2; grid-row:1; }
.sif-dashboard-alert-panel > .panel-head > .sif-alert-filters { grid-column:1 / -1; grid-row:2; width:100%; margin-left:0; flex-wrap:wrap; }
.sif-dashboard-alert-panel > .sif-alerts { flex:1 1 auto; min-height:0; overflow:auto; padding:1px 4px 4px 0; align-content:start; grid-auto-rows:max-content; gap:6px; }
.sif-dashboard-alert-panel .sif-alert { display:block; min-height:0; height:auto; padding:9px 10px 10px; overflow:visible; line-height:1.4; }
.sif-dashboard-alert-panel .sif-alert[hidden] { display:none !important; }
.sif-dashboard-alert-panel .sif-alert b { display:block; min-width:0; margin:0 0 4px; line-height:1.3; }
.sif-dashboard-alert-panel .sif-alert span { display:block; line-height:1.4; white-space:normal; overflow-wrap:anywhere; }
.sif-dashboard-fleet-panel { display:flex; flex-direction:column; }
.sif-dashboard-fleet-panel > .panel-head { flex:0 0 auto; }
.sif-dashboard-fleet-panel .sif-table-wrap { flex:1 1 auto; height:auto; min-height:0; max-height:none; }
@media(max-width:1000px){#screen-painel.active{overflow:auto}.sif-dashboard-content{display:block;flex:none}.sif-dashboard-content>.sif-panel{height:auto!important;margin-bottom:12px!important}.sif-dashboard-alert-panel>.sif-alerts{max-height:260px}.sif-dashboard-fleet-panel .sif-table-wrap{max-height:420px}}
.sif-table-wrap { border:1px solid #b8c4cb; border-radius:3px; background:#fff; box-shadow:0 3px 12px rgba(31,58,77,.07); max-height:calc(100vh - 210px); max-width:100%; overflow:auto; }
#app:has(#screen-apontamentos.active) { height:100dvh; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
body:has(#screen-apontamentos.active) { height:100dvh; overflow:hidden; }
#app:has(#screen-apontamentos.active) > .sif-topbar,
#app:has(#screen-apontamentos.active) > #menubar { flex:0 0 auto; }
body:has(#screen-apontamentos.active) #menubar { position:relative; top:auto; scrollbar-width:none; }
body:has(#screen-apontamentos.active) #menubar::-webkit-scrollbar { display:none; }
main:has(#screen-apontamentos.active) { flex:1 1 auto; width:100%; height:auto; min-height:0; padding-bottom:10px; overflow:hidden; box-sizing:border-box; }
#screen-apontamentos.active { display:flex; flex-direction:column; height:100%; min-height:0; }
#screen-apontamentos .screen-title, #screen-apontamentos .toolbar { flex:0 0 auto; }
#screen-apontamentos .screen-title { min-height:42px; padding:7px 14px 6px 18px; }
#screen-apontamentos .screen-title b { font-size:14px; }
#screen-apontamentos .screen-title span { font-size:11px; }
#screen-equipamentos .screen-title { min-height:42px; padding:7px 14px 6px 18px; }
#screen-equipamentos .screen-title b { font-size:14px; }
#screen-equipamentos .screen-title span { font-size:11px; }
#screen-tacografo .screen-title { height:42px; min-height:42px; max-height:42px; box-sizing:border-box; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; padding:5px 14px 4px 18px; gap:12px; box-shadow:inset 4px 0 0 var(--sif-green),0 2px 8px rgba(31,58,77,.07); }
#screen-tacografo .screen-title b { font-size:14px; }
#screen-tacografo .screen-title span { grid-column:2; font-size:11px; text-align:center; white-space:nowrap; }
#screen-base .screen-title { height:42px; min-height:42px; max-height:42px; box-sizing:border-box; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; padding:5px 14px 4px 18px; gap:12px; box-shadow:inset 4px 0 0 var(--sif-green),0 2px 8px rgba(31,58,77,.07); }
#screen-base .screen-title b { font-size:14px; }
#screen-base .screen-title span { grid-column:2; font-size:11px; text-align:center; white-space:nowrap; }
#screen-orc .screen-title { height:42px; min-height:42px; max-height:42px; box-sizing:border-box; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; padding:5px 14px 4px 18px; gap:12px; box-shadow:inset 4px 0 0 var(--sif-green),0 2px 8px rgba(31,58,77,.07); }
#screen-orc .screen-title b { font-size:14px; }
#screen-orc .screen-title span { grid-column:2; font-size:11px; text-align:center; white-space:nowrap; }
#screen-relatorios .screen-title { height:42px; min-height:42px; max-height:42px; box-sizing:border-box; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; padding:5px 14px 4px 18px; gap:12px; box-shadow:inset 4px 0 0 var(--sif-green),0 2px 8px rgba(31,58,77,.07); }
#screen-relatorios .screen-title b { font-size:14px; }
#screen-relatorios .screen-title span { grid-column:2; font-size:11px; text-align:center; white-space:nowrap; }
#screen-usuarios .screen-title { min-height:42px; padding:7px 14px 6px 18px; }
#screen-usuarios .screen-title b { font-size:14px; }
#screen-usuarios .screen-title span { font-size:11px; }
#screen-permissoes .screen-title { min-height:42px; padding:7px 14px 6px 18px; }
#screen-permissoes .screen-title b { font-size:14px; }
#screen-permissoes .screen-title span { font-size:11px; }
#screen-auditoria .screen-title { min-height:42px; padding:7px 14px 6px 18px; }
#screen-auditoria .screen-title b { font-size:14px; }
#screen-auditoria .screen-title span { font-size:11px; }
#screen-apontamentos .sif-table-wrap { flex:1 1 auto; height:auto; min-height:0; }
table.data-table,table.sif-table { font-size:12px; }
table.data-table th,table.sif-table th { padding:8px 9px; color:#284c62; background:linear-gradient(#f7f9fa,#dfe6e9); border-color:#bfc9cf; text-shadow:0 1px #fff; }
table.data-table td,table.sif-table td { padding:7px 9px; border-color:#dce2e6; color:#354b59; }
table.data-table tbody tr:nth-child(even),table.sif-table tbody tr:nth-child(even){background:#f6f8f9}
table.data-table tbody tr:hover,table.sif-table tbody tr:hover{background:#eaf4f8;box-shadow:none}
.data-table tbody tr.sif-selectable-row { cursor:pointer; }
.data-table tbody tr.sif-selectable-row.selected,
.data-table tbody tr.sif-selectable-row.selected:hover { background:#d8efd9!important; box-shadow:inset 4px 0 #3ca536; }
.data-table tbody tr.sif-selectable-row.selected td { background:#d8efd9!important; color:#173f2a; border-color:#b8d7bc; }
.data-table tbody tr.sif-selectable-row.selected td:first-child { box-shadow:inset 4px 0 #3ca536; }
.sif-table-wrap { scrollbar-width:thin; scrollbar-color:#9fb2bd #ffffff; }
.sif-table-wrap::-webkit-scrollbar { height:10px; width:10px; }
.sif-table-wrap::-webkit-scrollbar-track { background:#fff; }
.sif-table-wrap::-webkit-scrollbar-thumb { background:#9fb2bd; border-radius:5px; border:2px solid #fff; }
.sif-table-wrap::-webkit-scrollbar-thumb:hover { background:#7d94a3; }
table.data-table tfoot td,table.data-table tfoot th { position:sticky; bottom:0; z-index:5; background:#edf1f4; border-top:1px solid #aeb9c0; border-bottom:0; color:#284c62; font-weight:700; box-shadow:0 -2px 5px rgba(31,58,77,.10); }
table.data-table tfoot td:first-child,table.data-table tfoot th:first-child,
table.data-table tfoot td:last-child,table.data-table tfoot th:last-child { box-shadow:0 -2px 5px rgba(31,58,77,.10); }
table.data-table tfoot td b,table.data-table tfoot th b { color:#173f58; font-size:13px; }
table.data-table.sif-apontamentos-grid tfoot td {
  bottom:0;
  padding-top:9px;
  padding-bottom:9px;
  background:linear-gradient(#d5e7f0,#b7cfdd);
  border-top:3px solid #315f7a;
  border-bottom:2px solid #315f7a;
  border-left:1px solid #9fb3bf;
  border-right:1px solid #9fb3bf;
  color:#0d3853;
  font-size:12.5px;
  font-weight:800;
  text-shadow:0 1px #fff;
  box-shadow:0 -3px 7px rgba(31,58,77,.16);
}
#screen-apontamentos .sif-table-wrap { overflow-x:hidden; overflow-y:auto; scrollbar-gutter:auto; }
#screen-apontamentos .sif-table-wrap::after { display:none; }
.sif-horizontal-scroll{display:block!important;position:relative;flex:0 0 6px;width:100%;height:6px;min-height:6px;box-sizing:border-box;border-left:1px solid #b8c4cb;border-right:1px solid #b8c4cb;background:#dfe7eb;cursor:default;overflow:hidden}
.sif-horizontal-scroll[hidden]{display:none!important}
/* Filtro funil por coluna (todas as tabelas) */
th[data-filter] { position: relative; }
.sif-col-filter-btn { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 5px; padding: 0; vertical-align: middle; color: #7d94a3; background: transparent; border: 1px solid transparent; border-radius: 3px; cursor: pointer; }
.sif-col-filter-btn svg { width: 12px; height: 12px; }
.sif-col-filter-btn:hover { color: #105c8f; border-color: #9fb3bf; background: #fff; }
.sif-col-filter-btn.active { color: #0e4d23; border-color: #9ccc9e; background: #dbf0dc; }
.sif-col-filter-menu { position: absolute; top: calc(100% + 2px); left: 0; z-index: 60; min-width: 230px; max-width: 300px; background: #fff; border: 1px solid #9fb3bf; border-radius: 4px; box-shadow: 0 10px 28px rgba(7,25,37,.25); padding: 8px; font-weight: 400; }
.sif-col-filter-menu > input[type="search"] { width: 100%; box-sizing: border-box; min-height: 28px; margin-bottom: 6px; border: 1px solid #9faeb7; border-radius: 3px; background: #fff; font-size: 12px; padding: 3px 8px; color: #243746; }
.sif-col-filter-list { display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow: auto; margin-bottom: 8px; background: #fff; }
.sif-col-filter-list label { display: flex; align-items: center; gap: 7px; font-size: 12px; line-height: 1.4; color: #354b59; background: #fff; padding: 3px 4px; border-radius: 3px; cursor: pointer; min-width: 0; }
.sif-col-filter-list label:hover { background: #eaf4f8; }
.sif-col-filter-list input[type="checkbox"] { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; padding: 0; }
.sif-col-filter-list label span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sif-col-filter-date { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.sif-col-filter-date label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: #354b59; }
.sif-col-filter-num { display: flex; gap: 8px; margin-bottom: 8px; }
.sif-col-filter-num label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: #657784; }
.sif-col-filter-num input[type="number"] { width: 100%; box-sizing: border-box; min-height: 30px; border: 1px solid #9faeb7; border-radius: 3px; background: #fff; font-size: 12px; padding: 3px 6px; color: #243746; }
.sif-col-filter-date input[type="date"] { min-height: 30px; border: 1px solid #9faeb7; border-radius: 3px; background: #fff; font-size: 12px; padding: 3px 6px; color: #243746; }
.sif-col-filter-foot { display: flex; gap: 6px; justify-content: flex-end; }
.sif-col-filter-foot button { font-size: 11px; font-weight: 600; border: 1px solid #9daab2; border-radius: 3px; background: linear-gradient(#fff,#e4eaed); color: #294b60; padding: 3px 10px; cursor: pointer; }
.sif-col-filter-foot button:hover { border-color: #5784a0; }
/* Abas Lançamentos | Acumulado — cada visão usa a altura cheia */
.sif-subtabs { display: flex; gap: 0; margin: 0 0 12px; border-bottom: 2px solid #b8c4cb; align-items: flex-end; }
.sif-subtabs button { border: 1px solid #b8c4cb; border-bottom: 0; border-radius: 5px 5px 0 0; background: linear-gradient(#f4f7f8, #e2e9ed); color: #405767; font: 600 12.5px 'Segoe UI', sans-serif; padding: 8px 18px; cursor: pointer; margin-bottom: -2px; margin-right: 4px; }
.sif-subtabs button:hover { color: #105c8f; background: linear-gradient(#fff, #dceaf0); }
.sif-subtabs button.active { background: #fff; color: #174f70; border-bottom: 2px solid #fff; box-shadow: inset 0 3px 0 var(--sif-green); }
.sif-subtabs-spacer { flex: 1; }
.sif-acum-filter { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding-left:8px; flex-wrap: wrap; }
.sif-day-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #405767; margin-bottom: 6px; margin-left: 8px; }
.sif-acum-filter .sif-day-filter { margin-bottom: 0; margin-left: 0; }
.sif-acum-filter-hint { font-size: 11.5px; color: #657784; }
.sif-day-filter input[type="date"] { min-height: 30px; border: 1px solid #9faeb7; border-radius: 3px; background: #fff; font-size: 12.5px; padding: 3px 8px; }
.sif-day-clear { border: 1px solid #b7463d !important; border-radius: 12px !important; background: #fdecea !important; color: #9c251e !important; font-size: 11.5px !important; padding: 3px 10px !important; margin-bottom: 6px !important; margin-right: 0 !important; }
#screen-apontamentos .sif-subtabs { flex:0 0 auto; }
#aponto-tab-lanc:not([hidden]) { display:flex; flex:1 1 auto; flex-direction:column; min-height:0; overflow:hidden; }
#aponto-tab-lanc .sif-table-wrap { flex:1 1 auto; height:auto; min-height:0; max-height:none; }
#aponto-tab-lanc .sif-apontamentos-totals { flex:0 0 auto; }
#aponto-tab-acum:not([hidden]) { display:block; flex:1 1 auto; min-height:0; overflow:auto; }
#aponto-tab-acum .sif-table-wrap { max-height:calc(100vh - 300px); min-height:220px; }
.sif-acumulado-panel { margin-top: 0; }
@media print {
  #aponto-tab-lanc[hidden], #aponto-tab-acum[hidden] { display: block !important; }
  .sif-subtabs { display: none !important; }
}
.sif-horizontal-scroll-thumb{position:absolute;left:0;top:1px;height:4px;min-width:36px;border-radius:3px;background:#6f8794;cursor:default;will-change:transform}
.sif-horizontal-scroll-thumb:hover{background:#536e7d}
.sif-apontamentos-totals { flex:0 0 auto; margin:0; min-height:30px; padding:5px 10px; border:1px solid #7892a1; border-left:3px solid #315f7a; border-radius:0 0 3px 3px; background:linear-gradient(#e4eff4,#cfdee6); color:#173f58; box-shadow:0 -1px 3px rgba(31,58,77,.10); }
.sif-apontamentos-totals span { padding-right:18px; }
.sif-apontamentos-totals span:first-child { min-width:110px; font-size:12px; }
.sif-apontamentos-totals b { font-size:12.5px; }
.sif-apontamentos-totals .sif-totals-count { margin-left:auto; padding-right:0; color:#4c6574; }
table.data-table.sif-apontamentos-grid tfoot td:first-child { border-left:2px solid #315f7a; }
table.data-table.sif-apontamentos-grid tfoot td:last-child { border-right:2px solid #315f7a; }
table.data-table.sif-apontamentos-grid tfoot td b { color:#0e3853; font-size:14px; }
.sif-alert-topic { margin: 7px 0 12px; }
.sif-alert-topic > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; padding: 5px 8px; border-bottom: 1px solid #c7d3d9; background: #edf2f4; color: #315f7a; font-size: 11px; text-transform: uppercase; letter-spacing: .35px; }
.sif-alert-topic > header span { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: #d7e4ea; color: #315f7a; text-align: center; font-size: 10px; }
.sif-totals-bar { display:flex; flex-wrap:wrap; gap:8px 22px; align-items:center; margin-top:8px; padding:9px 12px; border:1px solid #b8c4cb; border-left:4px solid var(--sif-green); border-radius:3px; background:linear-gradient(#f7f9fa,#e8edef); font-size:12.5px; color:#354b59; box-shadow:0 3px 12px rgba(31,58,77,.07); }
.sif-totals-bar span:first-child { font-weight:800; letter-spacing:.4px; color:#244f69; }
.sif-totals-bar b { color:#173f58; }
.badge { border-radius:3px!important; font-weight:700; letter-spacing:.1px; }
.modal-backdrop { backdrop-filter:blur(2px); background:rgba(18,39,53,.5); }
.modal { width:min(820px,calc(100vw - 32px)); border:1px solid #617b8a; border-radius:5px; overflow:hidden; box-shadow:0 22px 60px rgba(7,25,37,.35); }
.modal>header { min-height:42px; padding:0 8px 0 14px; display:flex!important; align-items:center; justify-content:space-between; color:#fff; background:linear-gradient(90deg,#174d6d,#1d698f); }.modal>header h2{margin:0;font-size:14px}.modal>header button{width:38px;height:38px;color:#fff;background:transparent;border:0;font-size:23px}
#modal-body { padding:18px; background:#f4f7f8; }.modal-actions{padding:10px 14px;border-top:1px solid #c5d0d6;background:linear-gradient(#fff,#e7edef)}
.form-grid.sif-form label { color:#3d5665; font-size:12px; }.form-grid.sif-form input,.form-grid.sif-form select,.form-grid.sif-form textarea,.sif-plain-select{min-height:34px;border:1px solid #9faeb7;border-radius:3px;background:#fff;box-shadow:inset 0 1px 2px rgba(25,54,72,.08);font-size:13px}
.form-grid.sif-form select { appearance:none; -webkit-appearance:none; padding-right:30px; cursor:pointer; background-color:#fff; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23294b60' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; background-size:13px; }
.form-grid.sif-form input:focus,.form-grid.sif-form select:focus,.form-grid.sif-form textarea:focus{outline:2px solid rgba(60,165,54,.25);border-color:#3ca536}
.sif-fraction-control{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:34px}.sif-fraction-percent{display:flex!important;align-items:center!important;gap:5px!important;color:#607582!important;font-size:10px!important}.sif-fraction-percent input{width:70px!important;min-height:28px!important;padding:3px 5px!important}
.form-grid.sif-form > label.sif-vehicle-field-hidden{display:none!important}
.sif-field-warning{display:block;margin-top:4px;color:#a52a22;font-size:10.5px;line-height:1.25}.sif-field-warning[hidden]{display:none}.form-grid.sif-form input.sif-input-invalid{border-color:#c8453c!important;background:#fff2f1!important;outline:2px solid rgba(200,69,60,.12)!important}
.sif-cc-category-tabs{display:flex;gap:3px;margin-left:8px}.sif-cc-category-tabs button{min-height:27px!important;padding:3px 10px!important;font-size:11.5px!important}.sif-cc-category-tabs button.active{border-color:#3b7d4c!important;background:#e2f0e5!important;color:#205b30!important;box-shadow:inset 0 -2px #3b8f4d!important}
.win-select-button { min-height:32px!important; border-radius:3px!important; border-color:#9faeb7!important; background:linear-gradient(#fff,#e7edef)!important; }
.sif-toolbar .sif-select { width:240px; height:32px; flex:0 0 240px; }
.sif-toolbar .sif-select .win-select-button { width:100%; min-width:0; border:1px solid #8fa0ab !important; border-radius:3px !important; background:linear-gradient(#fff,#e7edef) !important; box-shadow:inset 0 1px 2px rgba(25,54,72,.08) !important; }
.sif-info-bar { margin:-1px 0 12px; padding:10px 12px; border:1px solid #c4d1d8; border-left:4px solid #4d91b7; border-radius:3px; color:#536b79; background:#f3f8fa; line-height:1.45; }
.sif-plan-summary { display:grid; grid-template-columns:minmax(230px,1fr) 150px minmax(360px,2fr); gap:0; margin:-1px 0 12px; border:1px solid #b9c9d2; border-left:4px solid #438db5; background:#fff; box-shadow:0 2px 8px rgba(31,58,77,.08); }
.sif-plan-summary > div { min-width:0; padding:11px 14px; }
.sif-plan-summary > div + div { border-left:1px solid #d5dfe4; }
.sif-plan-summary-label { display:block; margin-bottom:4px; color:#657986; font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.45px; }
.sif-plan-summary-main b { display:block; color:#174f70; font-size:15px; }
.sif-plan-summary-main small { display:block; margin-top:3px; overflow:hidden; color:#768792; font-size:10.5px; text-overflow:ellipsis; white-space:nowrap; }
.sif-plan-stat { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; background:#f3f8fa; }
.sif-plan-stat b { color:#174f70; font-size:22px; line-height:1; }
.sif-plan-stat span { margin-top:4px; color:#667b88; font-size:11px; }
.sif-plan-links > div { display:flex; flex-wrap:wrap; gap:5px; max-height:58px; overflow:auto; }
.sif-plan-chip { display:inline-flex; gap:5px; align-items:center; padding:4px 7px; border:1px solid #bed2dd; border-radius:3px; color:#415d6d; background:#f3f8fa; font-size:11px; }
.sif-plan-chip b { color:#185a7c; }
.sif-plan-empty { color:#7a8890; font-size:12px; font-style:italic; }
@media(max-width:900px){.sif-plan-summary{grid-template-columns:1fr 120px}.sif-plan-links{grid-column:1/-1;border-left:0!important;border-top:1px solid #d5dfe4}}
.sif-equipment-notice { display:flex; align-items:center; gap:11px; margin:-1px 0 0; padding:10px 13px; border:1px solid #d5b66c; border-left:4px solid #d58a12; background:linear-gradient(90deg,#fff5d9,#fffaf0); color:#5f4a20; box-shadow:0 2px 7px rgba(89,66,17,.10); }
.sif-equipment-notice-icon { flex:0 0 24px; width:24px; height:24px; display:grid; place-items:center; border-radius:50%; color:#fff; background:#d58a12; font-weight:800; font-size:15px; }
.sif-equipment-notice div { display:flex; flex-direction:column; gap:2px; }
.sif-equipment-notice b { color:#67470d; font-size:12.5px; }
.sif-equipment-notice span:last-child { font-size:12px; line-height:1.35; }
body:has(#screen-equipamentos.active), main:has(#screen-equipamentos.active), #screen-equipamentos.active { background:#fff; }
body:has(#screen-equipamentos.active) { height:100dvh; overflow:hidden; }
#app:has(#screen-equipamentos.active) { height:100dvh; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
#app:has(#screen-equipamentos.active) > .sif-topbar,
#app:has(#screen-equipamentos.active) > #menubar { flex:0 0 auto; }
body:has(#screen-equipamentos.active) #menubar { position:relative; top:auto; }
main:has(#screen-equipamentos.active) { flex:1 1 auto; width:100%; height:auto; min-height:0; padding-bottom:10px; overflow:hidden; box-sizing:border-box; }
#screen-equipamentos.active { display:flex; flex-direction:column; height:100%; min-height:0; }
#screen-equipamentos .screen-title,
#screen-equipamentos .sif-equipment-notice,
#screen-equipamentos .toolbar { flex:0 0 auto; }
#screen-equipamentos .sif-equipment-table-panel { flex:1 1 auto; display:flex; flex-direction:column; min-height:0; overflow:hidden; border:1px solid #b9c7cf; background:#fff; box-shadow:0 3px 10px rgba(31,58,77,.07); }
#screen-equipamentos .sif-table-wrap { flex:1 1 auto; height:auto; min-height:0; max-height:none; overflow:auto; }
.sif-equipment-table-title{display:flex;justify-content:space-between;align-items:center;flex:0 0 34px;padding:0 11px;border-bottom:1px solid #b9c7cf;background:linear-gradient(#f7fafb,#e4ebee);color:#244f69}.sif-equipment-table-title b{font-size:12px}.sif-equipment-table-title span{font-size:11px;color:#6b7c86}
:is(body:has(#screen-manutencao.active),body:has(#screen-estoque.active)) { height:100dvh; overflow:hidden; background:#fff; }
:is(#app:has(#screen-manutencao.active),#app:has(#screen-estoque.active)) { height:100dvh; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
:is(#app:has(#screen-manutencao.active),#app:has(#screen-estoque.active)) > .sif-topbar,
:is(#app:has(#screen-manutencao.active),#app:has(#screen-estoque.active)) > #menubar { flex:0 0 auto; }
:is(body:has(#screen-manutencao.active),body:has(#screen-estoque.active)) #menubar { position:relative; top:auto; }
:is(main:has(#screen-manutencao.active),main:has(#screen-estoque.active)) { flex:1 1 auto; width:100%; height:auto; min-height:0; padding-bottom:10px; overflow:hidden; box-sizing:border-box; background:#fff; }
:is(#screen-manutencao,#screen-estoque).active { display:flex; flex-direction:column; height:100%; min-height:0; background:#fff; }
:is(#screen-manutencao,#screen-estoque) .screen-title,
:is(#screen-manutencao,#screen-estoque) .toolbar { flex:0 0 auto; }
:is(#screen-manutencao,#screen-estoque) .screen-title { min-height:42px; padding:7px 14px 6px 18px; box-shadow:inset 4px 0 0 var(--sif-green),0 2px 8px rgba(31,58,77,.07); }
:is(#screen-manutencao,#screen-estoque) .screen-title b { font-size:14px; }
:is(#screen-manutencao,#screen-estoque) .screen-title span { font-size:11px; }
:is(#screen-manutencao,#screen-estoque) .sif-table-wrap { flex:1 1 auto; height:auto; min-height:0; max-height:none; overflow:auto; }
#screen-estoque .data-table thead th { position:sticky; top:0; z-index:6; background:linear-gradient(#f7f9fa,#dfe6e9); box-shadow:0 1px 0 #aebbc3; }
:is(#screen-manutencao,#screen-estoque) .maint-tabs { display:flex; flex:0 0 auto; flex-wrap:wrap; gap:0; margin:0; padding:0 16px; border-bottom:1px solid #aebbc3; background:#f4f6f7; }
:is(#screen-manutencao,#screen-estoque) .maint-tab-link { min-height:31px; margin:0 2px -1px 0; padding:5px 13px; border:1px solid #b7c3ca; border-bottom-color:#aebbc3; border-radius:3px 3px 0 0; color:#294b60; background:linear-gradient(#f8fafb,#e3e9ec); font-size:11.5px; cursor:pointer; box-shadow:none; }
:is(#screen-manutencao,#screen-estoque) .maint-tab-link:hover { border-color:#91a4af; background:linear-gradient(#fff,#edf2f4); }
:is(#screen-manutencao,#screen-estoque) .maint-tab-link.active { position:relative; z-index:1; border-top:3px solid var(--sif-green); border-bottom-color:#fff; padding-top:3px; color:#173f58; background:#fff; font-weight:700; box-shadow:none; }
:is(#screen-manutencao,#screen-estoque) .maint-tab-panel { display:none; flex-direction:column; flex:1 1 auto; min-height:0; }
:is(#screen-manutencao,#screen-estoque) .maint-tab-panel.active { display:flex; }
#screen-manutencao .maint-section-head { display:flex; flex:0 0 34px; align-items:center; justify-content:space-between; gap:14px; padding:0 12px; border-bottom:1px solid #c2cdd3; color:#244f69; background:linear-gradient(#f8fafb,#e7edef); }
#screen-manutencao .maint-section-head b { font-size:12px; }
#screen-manutencao .maint-section-head span { color:#6b7c86; font-size:10.5px; }
#screen-manutencao .maint-secondary-tabs { padding:7px 12px 0; border-bottom-color:#bcc8cf; background:#fff; }
#screen-manutencao .maint-secondary-tabs .maint-tab-link { min-height:29px; padding:4px 12px; font-size:11px; }
:is(#screen-manutencao,#screen-estoque) .maint-status-strip { display:grid; flex:0 0 auto; grid-template-columns:repeat(4,minmax(130px,1fr)); margin:8px 12px 0; border:1px solid #b8c5cc; border-left:4px solid var(--sif-green); background:#fff; }
:is(#screen-manutencao,#screen-estoque) .maint-status-strip>div { display:flex; min-width:0; align-items:center; justify-content:space-between; gap:10px; min-height:34px; padding:5px 11px; color:#526875; }
:is(#screen-manutencao,#screen-estoque) .maint-status-strip>div+div { border-left:1px solid #d2dbe0; }
:is(#screen-manutencao,#screen-estoque) .maint-status-strip span { overflow:hidden; font-size:10.5px; text-overflow:ellipsis; white-space:nowrap; }
:is(#screen-manutencao,#screen-estoque) .maint-status-strip b { color:#1f6f31; font-size:15px; }
:is(#screen-manutencao,#screen-estoque) .maint-auto-state { align-self:center; color:#617582; font-size:10.5px; white-space:nowrap; }
:is(#screen-manutencao,#screen-estoque) .maint-auto-state:before { content:""; display:inline-block; width:7px; height:7px; margin-right:5px; border-radius:50%; background:var(--sif-green); box-shadow:0 0 0 2px rgba(60,165,54,.14); vertical-align:1px; }
#screen-manutencao [data-maint-panel="compra"]>.maint-tab-panel>.toolbar { margin-top:7px; }
#screen-manutencao [data-maint-panel="compra"]>.maint-tab-panel>.sif-table-wrap { margin-top:0; }
.os-management{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;background:#f7f9fa}.os-nav{display:flex;flex:0 0 auto;gap:0;padding:7px 12px 0;border-bottom:1px solid #b9c7cf;background:#fff;overflow-x:auto}.os-nav button{min-height:31px;padding:5px 12px;border:1px solid #bcc7cd;border-bottom:0;border-radius:3px 3px 0 0;background:linear-gradient(#fafcfd,#e5ebee);color:#395669;font-size:11px;white-space:nowrap}.os-nav button.active{border-top:3px solid var(--sif-green);padding-top:3px;background:#fff;color:#17445d;font-weight:800}.os-nav .os-refresh{margin-left:auto;border:0;background:transparent;color:#287b35}.os-content{flex:1 1 auto;min-height:0;padding:12px;overflow:auto}.os-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;padding:9px 12px;border:1px solid #b9c7cf;border-left:4px solid var(--sif-green);background:linear-gradient(#f9fbfc,#e8eef1)}.os-section-head>div{display:flex;flex-direction:column;gap:2px}.os-section-head b{color:#194d69;font-size:14px}.os-section-head span{color:#6a7d88;font-size:11px}.os-kpis{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:9px;margin-bottom:10px}.os-kpis>div{min-height:78px;padding:11px 13px;border:1px solid #bac8cf;border-top:3px solid var(--sif-green);background:#fff;box-shadow:0 2px 6px #1f3a4d12}.os-kpis small,.os-kpis span{display:block;color:#647985;font-size:10.5px}.os-kpis b{display:block;margin:5px 0;color:#1b6d2b;font-size:22px}.os-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.os-grid section{padding:12px;border:1px solid #bcc9d0;background:#fff}.os-grid h3{margin:0 0 12px;color:#204f6a;font-size:13px}.os-grid section>p{display:flex;gap:12px;justify-content:space-between;margin:0;padding:7px;border-bottom:1px solid #e2e8eb;font-size:11px}.os-grid section>p span{color:#687b86}.os-bar{display:grid;grid-template-columns:105px 1fr 28px;align-items:center;gap:8px;margin:10px 0;color:#506874;font-size:11px}.os-bar:after{content:"";grid-column:2;grid-row:1;height:7px;background:#e4ece7;z-index:0}.os-bar i{grid-column:2;grid-row:1;height:7px;background:var(--sif-green);z-index:1}.os-bar b{text-align:right;color:#1c5d2b}.os-error{margin:20px;padding:18px;border:1px solid #d99;background:#fff2f2;color:#8b2727}.os-error button{margin-left:12px}.os-content>.sif-table-wrap{height:auto;max-height:none;border:1px solid #b8c5cc}.os-content .data-table button{padding:3px 7px;font-size:10.5px}
@media(max-width:900px){.os-kpis{grid-template-columns:repeat(2,minmax(140px,1fr))}.os-grid{grid-template-columns:1fr}.os-nav .os-refresh{margin-left:0}}
@media(max-width:900px){:is(#screen-manutencao,#screen-estoque) .maint-status-strip{grid-template-columns:repeat(2,minmax(130px,1fr))}:is(#screen-manutencao,#screen-estoque) .maint-status-strip>div:nth-child(3){border-left:0;border-top:1px solid #d2dbe0}:is(#screen-manutencao,#screen-estoque) .maint-status-strip>div:nth-child(4){border-top:1px solid #d2dbe0}:is(#screen-manutencao,#screen-estoque) .maint-auto-state{display:none}}
/* Materiais devidos no modal de registro de manutenção */
#modal .qm-mat-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:3px 0; border-bottom:1px solid #eef2f4; }
#modal .qm-mat-row:last-child { border-bottom:0; }
#modal .qm-mat-item { display:flex; align-items:center; gap:6px; font-size:11.5px; color:#294b60; cursor:pointer; }
#modal .qm-mat-item small { color:#6b7a84; font-size:10px; font-weight:400; }
#modal .qm-mat-qty { width:70px; padding:3px 6px; text-align:right; }

/* Todas as abas ficam contidas na área útil da janela. */
body:has(main > .screen.active) { height:100dvh; overflow:hidden; background:#fff; }
#app:has(main > .screen.active) { height:100dvh; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
#app:has(main > .screen.active) > .sif-topbar,
#app:has(main > .screen.active) > #menubar { flex:0 0 auto; }
body:has(main > .screen.active) #menubar { position:relative; top:auto; }
main:has(> .screen.active) { flex:1 1 auto; width:100%; height:auto; min-height:0; padding-bottom:10px; overflow:hidden; box-sizing:border-box; background:#fff; }
main > .screen.active { height:100%; min-height:0; overflow:auto; background:#fff; }

/* Abas baseadas em uma tabela: cabeçalho fixo e rolagem somente nos registros. */
#screen-tacografo.active,
#screen-usuarios.active,
#screen-permissoes.active,
#screen-auditoria.active { display:flex; flex-direction:column; }
#screen-tacografo .screen-title,
#screen-tacografo .toolbar,
#screen-usuarios .screen-title,
#screen-usuarios .toolbar,
#screen-permissoes .screen-title,
#screen-permissoes .toolbar,
#screen-auditoria .screen-title,
#screen-auditoria .toolbar { flex:0 0 auto; }
#screen-tacografo .sif-table-wrap,
#screen-usuarios .sif-table-wrap,
#screen-permissoes .sif-perm-tree,
#screen-auditoria .sif-table-wrap { flex:1 1 auto; height:auto; min-height:0; max-height:none; overflow:auto; }
.sif-topbar button:focus-visible,#menubar button:focus-visible,.toolbar button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #3ca536!important;outline-offset:2px}
@media(max-width:900px){.sif-brand small,.sif-userchip>i,#storageStatus{display:none}.sif-topbar{padding-left:10px}#menubar{overflow-x:auto;flex-wrap:nowrap;min-height:36px;padding:0 6px}#menubar button{min-height:35px;padding:0 8px;font-size:11px;white-space:nowrap}main{padding:10px}.screen>:not(.screen-title){max-width:calc(100% - 16px);margin-left:8px;margin-right:8px}.sif-alert{display:block}.sif-alert b{display:block;min-width:0}.screen-title b{font-size:16px}.toolbar{flex-wrap:wrap}.sif-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.sif-toolbar .toolbar-spacer{display:none}}
@media(max-width:560px){.sif-toolbar .sif-tool-label{flex:0 0 100%}.sif-toolbar .sif-select{width:100%;flex:1 0 100%}.sif-toolbar>button{flex:1 1 auto}}
@media(max-width:520px){.sif-userchip b{display:none}.sif-kpis{grid-template-columns:1fr}.sif-brand span{font-size:12px}}
.sif-perm-tree .perm-ck:hover { border-color: var(--sif-brand); }
.sif-perm-tree .perm-ck.on { background: var(--sif-brand); color: #fff; border-color: var(--sif-brand); }

.pp-user { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--sif-line); }
.pp-user b { font-size: 13px; }
.pp-user span { font-size: 11.5px; color: var(--sif-muted); }
.pp-user button { margin-left: auto; }

/* ---------------- empty state ---------------- */
.empty { padding: 24px; text-align: center; color: var(--sif-muted); font-size: 13px; }

/* ---------------- report section ---------------- */
.sif-report-sec { margin-bottom: 16px; }
.sif-report-sec h4 { margin: 0 0 8px; font-size: 13.5px; }
.sif-report-actions-label { color:#607582; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.35px; }
.toolbar .sif-import-button { border-color:#6f8795; background:linear-gradient(#f8fbfc,#dce8ed); }
.sif-report-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; align-items:start; padding-bottom:4px; }
.sif-report-sec { min-width:0; margin:0; overflow:hidden; border:1px solid #bcc9d0; border-radius:4px; background:#fff; box-shadow:0 3px 10px rgba(31,58,77,.08); }
.sif-report-wide { grid-column:1/-1; }
.sif-report-heading { min-height:54px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 12px; border-bottom:1px solid #c7d2d8; background:linear-gradient(#f9fbfc,#e7edef); }
.sif-report-heading h3 { margin:0 0 2px; color:#204f6a; font-size:13.5px; }
.sif-report-heading span { color:#6b7c86; font-size:11px; }
.sif-report-heading > b { flex:0 0 auto; padding:4px 7px; border:1px solid #bad0db; border-radius:3px; color:#235d7b; background:#f1f7fa; font-size:10.5px; }
.sif-report-sec .sif-table-wrap { margin:0; border:0; border-radius:0; box-shadow:none; max-height:260px; }
.sif-report-wide .sif-table-wrap { max-height:310px; }
.sif-report-units { grid-column:auto; }
.sif-report-units .sif-table-wrap { max-height:220px; }
@media(max-width:900px){.sif-report-grid{grid-template-columns:1fr}.sif-report-wide,.sif-report-units{grid-column:auto}.sif-report-actions-label{display:none}}

/* ---------------- toast ---------------- */
#toast {
  position: fixed; right: 16px; bottom: 16px;
  background: #111827; color: #fff; padding: 10px 16px;
  border-radius: 8px; font-size: 13px; opacity: 0;
  pointer-events: none; transition: opacity .2s;
  z-index: 200; max-width: 340px;
}
#toast.show { opacity: .95; }
#toast.success { background: var(--sif-green); }
#toast.error { background: var(--sif-red); }

/* ---------------- print ---------------- */
@media print {
  body.sif-page { background: #fff; }
  .sif-topbar, #menubar, .sif-toolbar, .toolbar, button, .sif-actions, #toast, .win-select-options { display: none !important; }
  .screen { display: block !important; padding: 10px; }
  .sif-card, .sif-panel { border: 1px solid #afafaf; box-shadow: none; break-inside: avoid; }
}

/* ============ Gestão de Manutenção (OS do Checklist) ============ */
.os-content { min-width: 0; }
.os-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; border: 1px solid #d8e0e4; border-radius: 6px; background: #f5f8fa; }
.os-period label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #51626d; }
.os-period input[type="date"] { border: 1px solid #c3ced5; border-radius: 4px; padding: 4px 6px; font: inherit; background: #fff; }
.os-period span { color: #74838c; font-size: 11.5px; margin-left: auto; }
.os-period-presets{display:flex;gap:3px;margin-right:4px}.os-period-presets button{padding:4px 8px}
.os-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
.os-section-head b { display: block; color: #253746; font-size: 14.5px; }
.os-section-head span { color: #74838c; font-size: 12px; }
.os-kpis { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.os-kpi { border: 1px solid #d8e0e4; border-radius: 6px; background: #fff; padding: 9px 11px; display: grid; gap: 2px; }
.os-kpi small { color: #6b7a84; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }
.os-kpi b { color: #17384f; font-size: 16.5px; line-height: 1.2; }
.os-kpi span { color: #8b99a2; font-size: 10.5px; }
.os-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.os-grid section { border: 1px solid #d8e0e4; border-radius: 6px; background: #fff; padding: 10px 12px; }
.os-grid h3 { margin: 0 0 8px; font-size: 12px; color: #51626d; text-transform: uppercase; letter-spacing: .4px; }
.os-grid p { margin: 0 0 6px; display: grid; grid-template-columns: 130px 1fr; gap: 8px; font-size: 12px; }
.os-grid p b { color: #17384f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-grid p span { color: #5c6d77; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-grid section.os-oldest > p { display: grid; grid-template-columns: minmax(105px, 145px) minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 5px 2px; line-height: 1.25; }
.os-oldest p b, .os-oldest p span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-oldest p time { color: #87959d; font-size: 10px; white-space: nowrap; }
.os-bar { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; color: #5c6d77; }
.os-bar i { display: block; height: 8px; border-radius: 4px; background: #4d8a4e; min-width: 2px; }
.os-bar b { text-align: right; color: #253746; }
.os-detail { display: grid; gap: 10px; }
.os-detail-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; border: 1px solid #d8e0e4; border-radius: 6px; background: #f5f8fa; padding: 10px; }
.os-detail-head small { display: block; color: #6b7a84; font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; }
.os-detail-head b { color: #17384f; font-size: 12.5px; }
.os-detail-problem { border-left: 3px solid #b3552e; background: #fdf7f4; border-radius: 4px; padding: 9px 11px; }
.os-detail-problem small { color: #8a6a58; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }
.os-detail-problem p { margin: 4px 0 0; color: #253746; font-size: 13px; }
.os-detail-problem .os-detail-obs { color: #5c6d77; font-size: 12px; }
.os-detail-att { border: 1px solid #d8e0e4; border-radius: 6px; padding: 10px; display: grid; gap: 8px; }
.os-detail-att > b { color: #253746; font-size: 12.5px; }
.os-content button{min-height:27px;padding:4px 10px;border:1px solid #9daab2;border-radius:3px;color:#294b60;background:linear-gradient(#fff,#e4eaed);box-shadow:inset 0 1px #fff,0 1px 2px rgba(0,0,0,.07);font:600 11px 'Segoe UI',sans-serif;cursor:pointer}.os-content button:hover{border-color:#5784a0;background:linear-gradient(#fff,#dceaf0)}.os-content button.primary{border-color:#31852d;color:#fff;background:linear-gradient(#55ba4c,#34972e);text-shadow:0 1px rgba(0,0,0,.18)}.os-content button.danger{border-color:#b7463d;color:#9c251e;background:linear-gradient(#fff,#f4dddd)}
.os-content button.sif-col-filter-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;min-width:24px;height:24px;min-height:24px;margin:0 0 0 6px;padding:0;border:1px solid transparent;border-radius:3px;background:transparent;box-shadow:none;color:#617b8b;vertical-align:middle}.os-content button.sif-col-filter-btn svg{display:block;width:13px;height:13px}.os-content button.sif-col-filter-btn:hover{border-color:#8fa8b6;background:#fff;color:#175d83}.os-content button.sif-col-filter-btn.active{border-color:#77aa79;background:#e1f1e2;color:#26702c}
.os-tools{display:flex;gap:8px;margin:0 0 10px;padding:9px;border:1px solid #d8e0e4;background:#f5f8fa}.os-tools input{flex:1;min-width:180px}.os-tools select{min-width:180px}.os-problem-groups{display:grid;gap:10px}.os-problem-group{border:1px solid #bdcbd2;background:#fff}.os-problem-group>header{display:flex;justify-content:space-between;gap:10px;padding:8px 11px;border-bottom:1px solid #cad5da;background:linear-gradient(#f5f8fa,#e5ecef);color:#194d69}.os-problem-group>header span{color:#6a7d88;font-size:11px}.os-problem-group article{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid #e1e8eb}.os-problem-group article:last-child{border-bottom:0}.os-problem-group article>div:first-child{display:grid;gap:3px;min-width:0}.os-problem-group article small{color:#6c7f89;font-size:10px}.os-problem-group article b{color:#263e4c;font-size:12px}.os-problem-group article span{color:#687b86;font-size:11px}.os-row-actions,.os-head-actions{display:flex;gap:5px;flex-wrap:wrap}.os-row-actions{justify-content:flex-end;min-width:245px}.os-report-presets{display:flex;gap:5px;margin-bottom:8px}.os-report-filters{display:grid;grid-template-columns:repeat(5,minmax(130px,1fr));gap:8px;padding:9px;border:1px solid #d8e0e4;background:#f5f8fa}.os-report-filters label{display:grid;gap:4px;color:#60727d;font-size:10px}.os-report-summary{display:flex;gap:22px;margin:8px 0;padding:8px 11px;border:1px solid #c6d2d8;background:#fff;color:#667a85;font-size:11px}.os-report-summary b{margin-left:4px;color:#17384f;font-size:13px}
@media(max-width:1100px){.os-kpis{grid-template-columns:repeat(3,minmax(160px,1fr))}}
@media(max-width:900px){.os-kpis{grid-template-columns:repeat(2,minmax(150px,1fr))}.os-problem-group article{align-items:flex-start;flex-direction:column}.os-row-actions{justify-content:flex-start;min-width:0}.os-report-filters{grid-template-columns:repeat(2,minmax(130px,1fr))}.os-report-summary{flex-wrap:wrap}.os-tools{flex-wrap:wrap}.os-tools input,.os-tools select{width:100%}}
.checkbox-line { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #253746; }
.checkbox-line input { width: 16px; height: 16px; }

/* ============ Reserva de peças no Controle de Manutenção ============ */
.res-sec { border: 1px solid var(--sif-border, #d8e0e4); border-radius: 6px; background: #fff; padding: 10px; }
.res-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.res-sec-head b { font-size: 13px; color: #174f70; }
.res-sec-head span { font-size: 11px; color: #526875; }
.res-add { display: grid; grid-template-columns: 1fr 90px auto; gap: 6px; margin-bottom: 8px; }
.res-add select, .res-add input { min-width: 0; padding: 6px 8px; border: 1px solid var(--sif-border, #cbd5db); border-radius: 4px; font-size: 12px; background: #fff; }
.res-add button { padding: 6px 12px; border: 1px solid #174f70; background: #174f70; color: #fff; border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer; }
.res-add button:hover { background: #0b3043; }
.res-empty { font-size: 12px; color: #526875; padding: 8px; background: #f5f8fa; border: 1px dashed #cbd5db; border-radius: 4px; }
.res-row { display: grid; grid-template-columns: minmax(140px, 1.6fr) 64px 64px 44px auto minmax(110px, 1fr) 26px; gap: 6px; align-items: center; padding: 6px 8px; border: 1px solid #e3eaee; border-radius: 4px; margin-top: 6px; background: #f8fbfc; }
.res-item b { display: block; font-size: 12px; color: #253746; }
.res-item small { font-size: 10px; color: #6b7f8c; }
.res-avail { font-size: 11px; font-weight: 700; color: #174f70; text-align: center; }
.res-qty, .res-obs { min-width: 0; padding: 5px 6px; border: 1px solid #cbd5db; border-radius: 4px; font-size: 12px; }
.res-unit { font-size: 11px; color: #526875; }
.res-del { width: 24px; height: 24px; border: 1px solid #dc2626; background: #fee2e2; color: #991b1b; border-radius: 4px; font-size: 12px; cursor: pointer; }
.res-del:hover { background: #dc2626; color: #fff; }
.qm-mat-row.res-rsv-row { background: #eef5fb; border: 1px solid #cfe0ee; border-radius: 4px; padding: 4px 6px; }
.qm-rsv-qty { width: 64px; padding: 4px 6px; border: 1px solid #cbd5db; border-radius: 4px; font-size: 12px; }
.res-atts { display: flex; flex-direction: column; gap: 6px; }
.res-att-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 6px 8px; border: 1px solid #e3eaee; border-radius: 4px; }
.res-att-row small { color: #526875; }
.res-att-row a { margin-left: auto; color: #174f70; font-weight: 600; text-decoration: none; }
