:root {
  --cor-topcar: #DC2626;
  --cor-mmj:    #F97316;

  --cor-parque: #6B7280;
  --cor-entrada: #0284C7;
  --cor-diagnostico: #DC2626;
  --cor-intervencao: #EA580C;
  --cor-material: #FACC15;
  --cor-pronta: #16A34A;
  --cor-aprovacao: #EAB308;

  --texto-primario: #F9FAFB;
  --texto-secundario: #9CA3AF;
  --cinza-bg: #111827;
  --cinza-borda: #1F2937;

  --radius: 10px;
  --shadow: 0 3px 8px rgba(0,0,0,0.45);
  font-family: "Segoe UI", Arial, sans-serif;
}

/* GLOBAL */
body {
  margin: 0;
  background: var(--cinza-bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: #F9FAFB;
}

/* BOTÃO MODO TV */
.btn-tv {
  border: 1.5px solid rgba(255,255,255,0.85);
  background: transparent;
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn-tv:hover {
  background: rgba(255,255,255,0.10);
  box-shadow: 0 3px 8px rgba(0,0,0,0.45);
  transform: translateY(-1px);
}

/* BANNER SUPERIOR */
.banner-bar {
  background: linear-gradient(90deg, #b31217, #ff8c00);
  color: #F9FAFB;
  padding: 6px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 2px solid #ff8c00;
}
.banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.banner-left{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
}
.banner-title {
  font-size: 19px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.badges{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  background:rgba(2,6,23,.55);
  border:1px solid rgba(255,255,255,.18);
  font-weight:900; font-size:12px;
}
.dot{width:10px;height:10px;border-radius:50%}
.dot-ok{background:#16A34A}
.dot-off{background:#DC2626}
.dot-warn{background:#EAB308}

/* SCROLL */
.banner-scroll-wrapper { overflow: hidden; height: 24px; position: relative; }
.banner-scroll {
  position: absolute;
  white-space: nowrap;
  font-size: 17px;
  line-height: 24px;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.85);
  animation: scrollBanner 24s linear infinite;
  padding-left: 100%;
}
@keyframes scrollBanner { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* LAYOUT */
.container { display: flex; height: calc(100vh - 92px); }

/* SIDEBAR */
.sidebar {
  width: 370px;
  background: #0F172A;
  border-right: 1px solid #1F2937;
  padding: 16px;
  overflow-y: auto;
}
.sidebar h2 { margin: 0 0 4px 0; color: #F97316; font-size: 18px; }
.sidebar small { font-size: 11px; color: var(--texto-secundario); }
.campo { margin-top: 10px; display: flex; flex-direction: column; }
label { font-size: 13px; font-weight: 600; margin-bottom: 3px; }

input, select, textarea {
  padding: 7px;
  background: #030712;
  color: #F9FAFB;
  border-radius: 6px;
  border: 1px solid #374151;
  font-size: 13px;
}
textarea { resize: none; }

.btn-red { background: var(--cor-topcar); color: #fff; }
.btn-gray { background: #E5E7EB; color: #111827; }
.btn-gray:disabled { opacity: .5; cursor: default; }
.btn-chrono { background: linear-gradient(90deg, var(--cor-topcar), var(--cor-mmj)); color: #fff; }
.btn-chrono:disabled { opacity: .5; cursor: default; }
.btn-entregue { background: #111827; color: #F9FAFB; }

/* ÁREA DO QUADRO */
.board-wrapper { flex: 1; display: flex; flex-direction: column; }
.board {
  padding: 14px;
  overflow-y: auto;
  background: radial-gradient(circle at top left, #1F2937 0%, #111827 40%, #0F172A 100%);
}

/* COLUNAS */
.colunas {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  max-width: 1700px;
  margin: 0 auto;
}
.coluna {
  background: #0B1120;
  border: 1px solid #1F2937;
  border-radius: 10px;
  padding: 10px;
}
.coluna-header {
  text-align: center;
  margin-bottom: 6px;
  height: 64px;                 /* altura fixa para alinhar títulos 1/2 linhas */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
}
.coluna-titulo {
  color: #F97316;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.15;
  text-wrap: balance;
}
.coluna-subtitulo { color: #94A3B8; font-size: 11px; }

/* CARTÕES */
.card {
  position: relative;
  background: #FFFFFF;
  border-radius: 10px;
  padding: 10px 10px 10px 16px;
  box-shadow: 0 5px 14px rgba(0,0,0,0.4);
  margin-bottom: 10px;
  cursor: pointer;
  transition: 0.15s ease;
  min-height: 140px;
  padding-bottom: 42px;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,0.6); }
.card-chaveta { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; border-radius: 10px 0 0 10px; }

.btnHorasCard{
  position:absolute;
  right:8px;
  bottom:8px;
  width:28px;
  height:28px;
  cursor:pointer;
  opacity:0.85;
  transition: transform .15s ease, opacity .15s ease;
  background-repeat:no-repeat;
  background-size:contain;
  background-position:center;
  border-radius:50%;
  border:none;
}

.btnHorasCard:hover{
  opacity:1;
  transform: scale(1.08);
}

/* Ícone de cronómetro em SVG */
.btnHorasCard{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='50' r='46' fill='%23f3f4f6' stroke='%23374151' stroke-width='4'/><g stroke='%236b7280' stroke-width='3'><line x1='50' y1='8' x2='50' y2='16'/><line x1='50' y1='84' x2='50' y2='92'/><line x1='8' y1='50' x2='16' y2='50'/><line x1='84' y1='50' x2='92' y2='50'/><line x1='20' y1='20' x2='26' y2='26'/><line x1='74' y1='74' x2='80' y2='80'/><line x1='74' y1='26' x2='80' y2='20'/><line x1='20' y1='80' x2='26' y2='74'/></g><line x1='50' y1='50' x2='50' y2='22' stroke='%23dc2626' stroke-width='5' stroke-linecap='round'/><circle cx='50' cy='50' r='4' fill='%23dc2626'/></svg>");
}

/* MATRÍCULA */
.matricula {
  display: inline-flex;
  align-items: stretch;
  background: #F4F4F5;
  border-radius: 6px;
  box-shadow: 0 0 0 1px #d1d5db, 0 5px 12px rgba(0,0,0,0.6);
  overflow: hidden;
  font-weight: 900;
  height: 29px;
  margin-bottom: 8px;
}
.matricula-pt-eu {
  width: 18px;
  background: #003399;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0 4px 0;
}
.matricula-pt-eu svg { width: 14px; height: 14px; display: block; margin-top: 1px; }
.matricula-pt-p { color: #ffffff; font-weight: 800; font-size: 11px; margin-top: 2px; line-height: 1; }
.matricula-main { padding: 3px 10px; font-size: 19px; letter-spacing: 3px; color: #111827; white-space: nowrap; }

.servico-row { margin-top: 6px; }
.servico { font-size: 17px; color: #111827; font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.viatura { font-size: 15px; color: #374151; font-weight: 600; margin-top: 8px;
  white-space: normal;
}

.mecanico-nome {
  font-size: 14px;
  font-weight: 800;
  color: #1D4ED8;   /* azul */
  margin-top: 2px;
}


.entrada { font-size: 11px; color: #6B7280; margin-top: 4px; }

.obs {
  font-size: 12px;
  color: #4B5563;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid #E5E7EB;
}
.notas-info { font-size: 11px; color: #1D4ED8; font-weight: 700; margin-top: 4px; }
.ultima-nota {
  font-size: 11px;
  color: #4B5563;
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px dashed #E5E7EB;
}


/* CORES POR TIPO (borda do cartão) — igual à TV */
.card.tipo-ayvens{border:2px solid #DC2626;}
.card.tipo-fidelidade{border:2px solid #9CA3AF;}
.card.tipo-cliente{border:2px solid #C9A227;}

/* HISTÓRICO DE NOTAS LATERAL */
.notas-lista {
  margin-top: 4px;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #020617;
  max-height: 180px;
  overflow-y: auto;
  padding: 6px;
  font-size: 11px;
  color: #E5E7EB;
  font-family: "Consolas","Fira Code","Courier New", monospace;
}
.nota-item { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px dashed #1F2937; }
.nota-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

/* COPIAR NOTAS (mecânicos) */
.notas-actions{
  display:flex;
  gap:8px;
  margin-top:6px;
  flex-wrap:wrap;
}
.btn-copy{
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #374151;
  background:#111827;
  color:#fff;
  cursor:pointer;
  font-weight:900;
  font-size:12px;
}
.btn-copy:hover{opacity:.92}
.btn-copy:disabled{opacity:.5;cursor:default}
.nota-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.nota-head .nota-meta{margin:0}
.btn-copy-mini{
  padding:4px 8px;
  border-radius:8px;
  border:1px solid #374151;
  background:#111827;
  color:#fff;
  cursor:pointer;
  font-weight:900;
  font-size:11px;
  white-space:nowrap;
}
.btn-copy-mini:hover{opacity:.92}

.nota-meta { font-weight: 600; color: #E5E7EB; }
.nota-texto { color: #E5E7EB; }
#notaNova { background: #020617; color: #E5E7EB; border: 1px solid #374151; font-family: "Consolas","Fira Code","Courier New", monospace; }

/* HISTÓRICO DE VIATURAS */
.historico {
  background: #0B1120;
  padding: 8px 18px 10px;
  border-top: 1px solid #1F2937;
  overflow-x: auto;
}
.historico-top{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:6px;}
.historico-titulo { font-size: 13px; font-weight: 700; }
.historico-titulo small { color: #94A3B8; }
.historico-search{display:flex; gap:8px; align-items:center; flex-wrap:wrap;}
.historico-search input{width:240px}
.historico-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.historico-table th {
  background: #111827;
  color: #fff;
  padding: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.historico-table td { border: 1px solid #374151; padding: 4px 6px; }

.btn-ordem{
  padding:4px 8px;border-radius:8px;border:1px solid #374151;background:#020617;color:#fff;
  cursor:pointer;font-weight:800
}


/* NAV (Gestão | Histórico) */
.banner-right{display:flex;gap:10px;align-items:center}
.nav-btn{
  border:1.5px solid rgba(255,255,255,0.85);
  background:rgba(0,0,0,0.15);
  color:#fff;
  padding:6px 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:900;
  font-size:12px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  transition:transform .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
  box-shadow:0 1px 4px rgba(0,0,0,0.35);
}
.nav-btn:hover{background:rgba(255,255,255,0.12);transform:translateY(-1px)}
.nav-btn.nav-active{background:rgba(255,255,255,0.18);box-shadow:0 3px 10px rgba(0,0,0,0.45)}
/* VISTA HISTÓRICO (cartões) */
.historico-view{
  padding:14px;
  overflow-y:auto;
  background:radial-gradient(circle at top left, #0B1120 0%, #0A1224 40%, #061022 100%);
  border-top:1px solid #1F2937;
}
.historico-view .historico-top{
  margin:0 auto 10px;
  max-width:1700px;
}
.hist-grid{
  max-width:1700px;
  margin:0 auto;
  display:grid;
  grid-template-columns:repeat(2, minmax(280px, 1fr));
  gap:12px;
}
@media (max-width: 900px){
  .hist-grid{grid-template-columns:1fr;}
}
.hist-card{
  position:relative;
  background:#FFFFFF;
  border-radius:12px;
  padding:10px 10px 10px 16px;
  box-shadow:0 5px 14px rgba(0,0,0,0.45);
  border:2px solid transparent;
}
.hist-card:hover{transform:translateY(-1px);box-shadow:0 10px 22px rgba(0,0,0,0.60)}
.hist-card .card-chaveta{border-radius:12px 0 0 12px}
.hist-meta{margin-top:6px;font-size:11px;color:#6B7280;font-weight:700;display:flex;gap:10px;flex-wrap:wrap}
.hist-row{margin-top:6px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.btn-mini{
  padding:6px 10px;border-radius:10px;border:1px solid #374151;background:#111827;color:#fff;
  cursor:pointer;font-weight:900;font-size:12px;
}

@media (max-width: 1600px) { .colunas { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .container { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--cinza-borda); }
  .colunas { grid-template-columns: 1fr; }
}

/* ---- FIX: Sidebar acompanha o scroll, mantendo scroll à direita ---- */
.container{
  align-items:flex-start;
}
.sidebar{
  position: sticky;
  top: 0;
  max-height: calc(100vh - 92px); /* 92px = banner */
  overflow-y: auto;
}
.board-wrapper{
  height: calc(100vh - 92px);
  overflow-y: auto; /* scroll à direita */
}
#viewGestao .board,
#viewHistorico.historico-view{
  height: auto;
  overflow: visible;
}

/* Mobile: mantém comportamento natural */
@media (max-width: 900px){
  .sidebar{ position: relative; top:auto; max-height:none; }
  .board-wrapper{ height:auto; overflow:visible; }
}


/* ---- FIX: garantir colunas com largura exatamente igual ---- */
.colunas{
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}
.coluna{
  min-width: 0;
}

/* Evitar que a scrollbar altere larguras visuais */
.board-wrapper{
  scrollbar-gutter: stable both-edges;
}


  50% { box-shadow: 0 0 0 6px rgba(22,163,74,0.55); }
}
.card.blink{
  animation: blinkPronta 1s infinite;
}




/* === CORES POR MECÂNICO === */
:root{
  --mec-marco:  34,197,94;  /* verde (Sporting) */
  --mec-vanderlei: 59,130,246; /* azul */
  --mec-jorge: 239,68,68;  /* vermelho */
  --mec-mario: 249,115,22; /* laranja */
  --mec-paulo: 168,85,247; /* roxo */
  --mec-joao: 20,184,166;  /* teal */
  --mec-helio: 236,72,153; /* rosa */
  --mec-default: 22,163,74; /* verde default */
}
.mecDot{
  width:10px;height:10px;border-radius:50%;
  display:inline-block; flex:0 0 auto;
  box-shadow:0 0 0 2px rgba(0,0,0,0.10);
}
.meta{gap:8px}

/* === BLINK PRONTA (10 minutos após terminar) — LIMITADO + COR POR MECÂNICO === */
@keyframes blinkProntaCard {
  0%, 100% {
    background: #FFFFFF;
    box-shadow: 0 8px 22px rgba(0,0,0,0.55);
    transform: scale(1);
    filter: none;
  }
  50% {
    background: #DCFCE7;
    box-shadow: 0 0 0 10px rgba(var(--blinkGlow, 22,163,74),0.70), 0 12px 28px rgba(0,0,0,0.65);
    transform: scale(1.01);
    filter: saturate(1.2);
  }
}
.card.blink{
  animation: blinkProntaCard 0.85s infinite;
  border-width: 4px !important;
  border-color: rgba(var(--blinkGlow, 22,163,74),1) !important;
}
.card.prontaMark{
  border-width: 3px !important;
  border-color: rgba(var(--blinkGlow, 22,163,74),1) !important;
}



/* === PESQUISA RÁPIDA (GESTÃO) === */
.gestao-searchbar{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  margin:0 auto 12px;
  max-width:1700px;
  border-radius:12px;
  background: rgba(2,6,23,.55);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.gestao-searchbar input{
  flex:1;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.25);
  color:#fff;
  font-weight:800;
  letter-spacing:.02em;
}
.gestao-searchbar input::placeholder{ color: rgba(255,255,255,.55); }
.gestao-searchbar .btn-clear{
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.25);
  color:#fff;
  cursor:pointer;
  font-weight:900;
}
.gestao-searchbar .btn-clear:hover{ opacity:.92; }
.gestao-searchbar .search-info{
  font-size:12px;
  color: rgba(255,255,255,.78);
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
  min-width:170px;
  text-align:right;
}
.hiddenBySearch{ display:none !important; }


/* ===== MMJ AUTO CHECK (Gestão) ===== */
#mmjAutoCheck{
  position:fixed;
  right:12px;
  bottom:10px;
  z-index:999999;
  background:rgba(2,6,23,.78);
  border:1px solid rgba(255,255,255,.14);
  border-radius:12px;
  padding:6px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color:#E5E7EB;
  box-shadow:0 6px 18px rgba(0,0,0,.35);
min-width: 220px;
}
#mmjAutoCheck .row{display:flex;justify-content:space-between;gap:10px;font-size:11px;line-height:1.35}
#mmjAutoCheck .t{font-weight:900;letter-spacing:.08em;text-transform:uppercase;font-size:10px;opacity:.9;margin-bottom:4px}
#mmjAutoCheck .ok{color:#16A34A;font-weight:900}
#mmjAutoCheck .bad{color:#DC2626;font-weight:900}
#mmjAutoCheck .warn{color:#EAB308;font-weight:900}
#mmjAutoCheck button{
  margin-top:6px;
  width:100%;
  padding:6px 8px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.20);
  color:#fff;
  cursor:pointer;
  font-weight:900;
  font-size:11px;
}
#mmjAutoCheck button:hover{opacity:.92}


/* ===== MMJ RELOAD PREMIUM ===== */
.mmj-update-toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(16px);
  z-index: 1000000;
  min-width: 320px;
  max-width: min(92vw, 560px);
  background: rgba(2,6,23,.92);
  color: #F9FAFB;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
padding: 12px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.mmj-update-toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.mmj-update-toast .tit{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: #F97316;
}
.mmj-update-toast .msg{
  font-size: 13px;
  font-weight: 700;
  color: #E5E7EB;
}



/* === CLIENTE NA LATERAL (apenas Gestão/Receção) === */
.cliente-box-mmj{
  margin-top:10px;
  padding:10px;
  border-radius:12px;
  background:#020617;
  border:1px solid rgba(249,115,22,.35);
}
.cliente-box-mmj .cliente-title{
  color:#F97316;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:8px;
}
.cliente-box-mmj .cliente-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}
.cliente-box-mmj label{
  font-size:12px;
  color:#CBD5E1;
}
.cliente-box-mmj input{
  font-weight:800;
}
.cliente-box-mmj .hint{
  margin-top:8px;
  font-size:11px;
  color:#94A3B8;
  font-weight:700;
}

/* === MODO LEITURA / EDIÇÃO MMJ === */
.edit-status-mmj{
  margin-top:8px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.14);
  background:#020617;
  color:#94A3B8;
  font-size:12px;
  font-weight:900;
}
.edit-status-mmj.on{
  color:#FACC15;
  border-color:rgba(250,204,21,.45);
}
.btn-edit-mmj{
  background:#2563EB;
  color:#fff;
}
.btn-edit-mmj.on{
  background:#F97316;
  color:#fff;
}
#formViatura.mmj-readonly input,
#formViatura.mmj-readonly textarea,
#formViatura.mmj-readonly select{
  opacity:.72;
}
#formViatura.mmj-readonly #notaNova{
  opacity:.45;
}


.btnCardActionsMMJ{
  position:absolute;
  left:7px;
  right:4px;
  bottom:7px;
  display:flex;
  gap:2px;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:space-between;
  padding-top:4px;
  border-top:1px solid rgba(17,24,39,.10);
  overflow:hidden;
  max-width:calc(100% - 11px);
  box-sizing:border-box;
}
.btnEntradaCard,
.btnAnexarCard,
.btnDossierCard{
  border:none;
  background:transparent;
  padding:2px 0;
  font-size:8.4px;
  line-height:1.05;
  font-weight:900;
  cursor:pointer;
  box-shadow:none;
  white-space:nowrap;
  text-align:left;
  min-width:0;
  max-width:33%;
  overflow:hidden;
  text-overflow:clip;
  flex:0 1 auto;
}
.btnEntradaCard{color:#1D4ED8;}
.btnAnexarCard{color:#EA580C;}
.btnDossierCard{color:#15803D;}
.btnEntradaCard:hover,.btnAnexarCard:hover,.btnDossierCard:hover{opacity:.82; transform:translateY(-1px); text-decoration:underline;}
.entradas-digitais-box{
  max-width:1700px;
  margin:0 auto 12px;
  padding:10px 12px;
  border:1px solid #374151;
  border-radius:12px;
  background:#020617;
}
.entradas-digitais-box .tit{font-weight:900;color:#F97316;text-transform:uppercase;letter-spacing:.08em;font-size:12px;margin-bottom:8px}
.entradas-digitais-box table{width:100%;border-collapse:collapse;font-size:12px}
.entradas-digitais-box th,.entradas-digitais-box td{border:1px solid #1F2937;padding:6px;text-align:left}
.entradas-digitais-box th{background:#111827;color:#fff;text-transform:uppercase;font-size:11px}



/* =========================================================
   MMJ V8 — MODO TABLET / iPAD (não altera PCs grandes)
   Ativo apenas em ecrãs táteis com largura até 1366px.
   Objetivo: manter as 7 colunas visíveis e permitir recolher
   a lateral quando for preciso mais espaço.
   ========================================================= */
@media (pointer: coarse) and (max-width: 1366px){
  body.mmj-tablet-mode{
    overflow:hidden;
  }

  body.mmj-tablet-mode .banner-bar{
    padding:5px 10px 6px;
  }
  body.mmj-tablet-mode .banner-title{
    font-size:14px;
    letter-spacing:.08em;
  }
  body.mmj-tablet-mode .badges .badge{
    padding:4px 7px;
    font-size:10px;
  }
  body.mmj-tablet-mode .banner-scroll-wrapper{
    height:18px;
  }
  body.mmj-tablet-mode .banner-scroll{
    font-size:12px;
    line-height:18px;
  }

  body.mmj-tablet-mode .container{
    flex-direction:row !important;
    height:calc(100vh - 74px) !important;
    align-items:flex-start;
  }

  body.mmj-tablet-mode .sidebar{
    width:300px;
    min-width:300px;
    max-width:300px;
    position:sticky !important;
    top:0;
    max-height:calc(100vh - 74px) !important;
    overflow-y:auto;
    padding:10px;
    border-right:1px solid #1F2937;
    border-bottom:none;
    transition:transform .18s ease, width .18s ease, min-width .18s ease, max-width .18s ease, padding .18s ease;
  }

  body.mmj-tablet-mode.mmj-sidebar-closed .sidebar{
    transform:translateX(-100%);
    width:0 !important;
    min-width:0 !important;
    max-width:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
    border-right:none;
    overflow:hidden;
  }

  body.mmj-tablet-mode .sidebar h2{
    font-size:14px;
  }
  body.mmj-tablet-mode .sidebar small,
  body.mmj-tablet-mode label{
    font-size:10px;
  }
  body.mmj-tablet-mode input,
  body.mmj-tablet-mode select,
  body.mmj-tablet-mode textarea{
    padding:5px 6px;
    font-size:12px;
  }

  body.mmj-tablet-mode .board-wrapper{
    height:calc(100vh - 74px) !important;
    overflow:auto !important;
    flex:1 1 auto;
    min-width:0;
  }
  body.mmj-tablet-mode #viewGestao .board,
  body.mmj-tablet-mode #viewHistorico.historico-view{
    overflow:visible !important;
  }
  body.mmj-tablet-mode .board{
    padding:8px;
  }

  body.mmj-tablet-mode .gestao-searchbar{
    padding:6px 8px;
    margin-bottom:8px;
    gap:6px;
  }
  body.mmj-tablet-mode .gestao-searchbar input{
    padding:7px 8px;
    font-size:12px;
  }
  body.mmj-tablet-mode .gestao-searchbar .search-info{
    min-width:80px;
    font-size:10px;
  }

  body.mmj-tablet-mode .colunas{
    grid-template-columns:repeat(7, minmax(88px, 1fr)) !important;
    gap:5px !important;
    max-width:none !important;
    width:100% !important;
    min-width:670px !important;
  }
  body.mmj-tablet-mode.mmj-sidebar-closed .colunas{
    grid-template-columns:repeat(7, minmax(118px, 1fr)) !important;
    min-width:860px !important;
  }

  body.mmj-tablet-mode .coluna{
    padding:5px;
    border-radius:8px;
    min-width:0;
  }
  body.mmj-tablet-mode .coluna-header{
    height:42px;
    margin-bottom:4px;
  }
  body.mmj-tablet-mode .coluna-titulo{
    font-size:10px;
    letter-spacing:.04em;
    line-height:1.1;
  }
  body.mmj-tablet-mode .coluna-subtitulo{
    font-size:9px;
  }

  body.mmj-tablet-mode .card{
    min-height:116px;
    padding:7px 6px 7px 10px;
    margin-bottom:7px;
    border-radius:8px;
  }
  body.mmj-tablet-mode .matricula{
    height:24px;
    margin-bottom:5px;
  }
  body.mmj-tablet-mode .matricula-pt-eu{
    width:15px;
  }
  body.mmj-tablet-mode .matricula-pt-eu svg{
    width:11px;
    height:11px;
  }
  body.mmj-tablet-mode .matricula-pt-p{
    font-size:9px;
  }
  body.mmj-tablet-mode .matricula-main{
    font-size:14px;
    letter-spacing:2px;
    padding:3px 6px;
  }
  body.mmj-tablet-mode .servico{
    font-size:12px;
    -webkit-line-clamp:2;
  }
  body.mmj-tablet-mode .viatura{
    font-size:11px;
    margin-top:4px;
  }
  body.mmj-tablet-mode .mecanico-nome{
    font-size:11px;
  }
  body.mmj-tablet-mode .entrada,
  body.mmj-tablet-mode .obs,
  body.mmj-tablet-mode .notas-info,
  body.mmj-tablet-mode .ultima-nota{
    font-size:9px;
  }
  body.mmj-tablet-mode .btnHorasCard{
    width:22px;
    height:22px;
    right:5px;
    bottom:5px;
  }
  body.mmj-tablet-mode .btnCardActionsMMJ{
    left:6px;
    right:4px;
    bottom:5px;
    gap:2px;
    justify-content:space-between;
    overflow:hidden;
    max-width:calc(100% - 10px);
  }
  body.mmj-tablet-mode .btnEntradaCard,
  body.mmj-tablet-mode .btnAnexarCard,
  body.mmj-tablet-mode .btnDossierCard{
    padding:2px 0;
    font-size:7.8px;
  }

  #mmjTabletToggle{
    display:flex !important;
  }
}

#mmjTabletToggle{
  display:none;
  position:fixed;
  left:10px;
  bottom:12px;
  z-index:1000001;
  border:none;
  border-radius:999px;
  padding:10px 12px;
  background:linear-gradient(90deg,#DC2626,#F97316);
  color:#fff;
  font-weight:900;
  font-size:13px;
  box-shadow:0 8px 24px rgba(0,0,0,.45);
  cursor:pointer;
}

@media (pointer: coarse) and (max-width: 700px){
  body.mmj-tablet-mode .container{
    flex-direction:column !important;
    height:auto !important;
    overflow:auto;
  }
  body.mmj-tablet-mode .sidebar{
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    position:relative !important;
    max-height:none !important;
    transform:none !important;
  }
  body.mmj-tablet-mode .board-wrapper{
    height:auto !important;
    overflow:visible !important;
  }
  body.mmj-tablet-mode .colunas,
  body.mmj-tablet-mode.mmj-sidebar-closed .colunas{
    grid-template-columns:1fr !important;
    min-width:0 !important;
  }
  #mmjTabletToggle{display:none !important;}
}

/* ===== MMJ APAGADOS / LIXEIRA V1 ===== */
.mmj-apagado-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 9px;
  border-radius:999px;
  background:#FEE2E2;
  color:#7F1D1D;
  border:1px solid #FCA5A5;
  font-size:11px;
  font-weight:900;
  letter-spacing:.05em;
  margin:6px 0;
}
.mmj-apagado-card{
  border-color:#DC2626!important;
}
.mmj-restaurar-btn{
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #15803D;
  background:#16A34A;
  color:#fff;
  cursor:pointer;
  font-weight:900;
  font-size:12px;
  margin-left:6px;
}
.mmj-restaurar-btn:hover{opacity:.92}


/* ===== MMJ LOGIN PIN DIÁRIO — Auditoria por utilizador ===== */
.mmj-login-overlay{
  position:fixed; inset:0; z-index:2000000;
  display:none; align-items:center; justify-content:center;
  background:rgba(2,6,23,.92); backdrop-filter: blur(3px);
}
.mmj-login-card{
  width:min(92vw,420px); background:#fff; color:#111827;
  border-radius:18px; padding:24px; box-shadow:0 18px 50px rgba(0,0,0,.55);
  border-top:6px solid #F97316;
}
.mmj-login-card h2{margin:0;color:#b91c1c;font-size:22px;font-weight:900}
.mmj-login-card p{margin:8px 0 14px;color:#374151;font-size:13px;font-weight:700}
.mmj-pin-input{
  width:100%; box-sizing:border-box; padding:14px 16px; border-radius:12px;
  border:1px solid #D1D5DB; font-size:26px; font-weight:900; letter-spacing:.35em;
  text-align:center; background:#F9FAFB; color:#111827;
}
.mmj-login-actions{display:flex; gap:10px; margin-top:14px}
.mmj-login-actions button{
  flex:1; border:0; border-radius:12px; padding:12px 14px; cursor:pointer;
  font-weight:900; font-size:14px;
}
.mmj-login-primary{background:linear-gradient(90deg,#DC2626,#F97316);color:#fff}
.mmj-login-secondary{background:#E5E7EB;color:#111827}
.mmj-login-error{display:none;margin-top:10px;color:#b91c1c;font-weight:900;font-size:13px}
.mmj-login-users{margin-top:12px;color:#6B7280;font-size:11px;line-height:1.35}
#btnMMJUser{background:rgba(2,6,23,.55)}


.btnOrcamentoCard{
  margin-top:8px;border:0;border-radius:8px;padding:7px 10px;
  background:linear-gradient(90deg,#b31217,#ff8c00);color:#fff;
  font-weight:800;font-size:11px;cursor:pointer;align-self:flex-start;
}
.btnOrcamentoCard:hover{filter:brightness(1.08)}

/* Cartão selecionado para orçamento — RC1.4 */
.card.cartaoSelecionado{
  outline:3px solid #ff8c00;
  outline-offset:-2px;
  box-shadow:0 0 0 5px rgba(255,140,0,.25), 0 4px 14px rgba(0,0,0,.25);
}
#btnOrcamentoSelecionado{
  background:linear-gradient(90deg,#b31217,#ff8c00);color:#fff;font-weight:800;
}
