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

/* Fundo geral */
.bg-sagace {
  background-color: #f4f6f9;
}

/* ===================== TEMA ESCURO (REVISADO) ===================== */
.theme-dark {
  background-color: #000000;
  color: #ffffff;
}

.theme-dark.bg-sagace {
  background-color: #000000 !important;
  color: #ffffff;
}

.theme-dark .card,
.theme-dark .modal-content {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #2b2b2b;
}

.theme-dark .table,
.theme-dark .table thead,
.theme-dark .table-light,
.theme-dark .table-light th {
  background-color: #151a21 !important;
  color: #ffffff;
}

.theme-dark .table-light th {
  background-color: #1b212b !important;
}

.theme-dark .navbar {
  background-color: #0b5ed7 !important;
  border-bottom: 1px solid #223043;
}

.theme-dark .form-control,
.theme-dark .form-select,
.theme-dark .input-group-text {
  background-color: #121821;
  color: #e6e8eb;
  border-color: #263244;
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
  border-color: #4d7cff;
  box-shadow: 0 0 0 0.2rem rgba(77, 124, 255, 0.25);
}

.theme-dark .form-control::placeholder {
  color: #8d98a6;
}
.theme-dark input[type="date"],
.theme-dark input[type="datetime-local"],
.theme-dark input[type="month"],
.theme-dark input[type="time"] {
  color-scheme: dark;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 16px 16px;
}

.theme-dark input[type="date"]::-webkit-calendar-picker-indicator,
.theme-dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.theme-dark input[type="month"]::-webkit-calendar-picker-indicator,
.theme-dark input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 1 !important;
  cursor: pointer;
  filter: invert(1) brightness(2.2) contrast(1.2);
}

.theme-dark input[type="date"]::-moz-calendar-picker-indicator,
.theme-dark input[type="datetime-local"]::-moz-calendar-picker-indicator,
.theme-dark input[type="month"]::-moz-calendar-picker-indicator,
.theme-dark input[type="time"]::-moz-calendar-picker-indicator {
  filter: invert(1) brightness(2.2) contrast(1.2) !important;
  opacity: 1 !important;
  background: transparent !important;
}


.theme-dark .table td,
.theme-dark .table th {
  border-color: #263244;
  color: #ffffff;
}

.theme-dark .table tbody tr,
.theme-dark .table tbody td {
  background-color: #000000 !important;
  color: #ffffff !important;
}

.theme-dark .text-muted {
  color: #8d98a6 !important;
}

.theme-dark .btn-outline-secondary {
  color: #cfd6de;
  border-color: #4b586a;
}

.theme-dark .btn-outline-secondary:hover {
  background-color: #212a36;
}

.theme-dark .btn-outline-light {
  color: #e6e8eb;
  border-color: rgba(255, 255, 255, 0.4);
}

.theme-dark .btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.theme-dark .btn-outline-success {
  color: #7ee0b8;
  border-color: #2b6b52;
}

.theme-dark .btn-outline-success:hover {
  background-color: #1b3a30;
}

.theme-dark .btn-primary {
  background-color: #2d6bff;
  border-color: #2d6bff;
}

.theme-dark .btn-primary:hover {
  background-color: #2458d0;
  border-color: #2458d0;
}

.theme-dark input[type="file"]::file-selector-button {
  background-color: #1b2230;
  color: #e6e8eb;
  border: 1px solid #2b3647;
}

.theme-dark .materials-table tr.mat-row {
  background: #151a21;
  border-color: #263244;
}

.theme-dark .table-warning {
  background-color: #3a2e14 !important;
}

.theme-dark .list-group-item {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #2b2b2b !important;
}
/* Cartões mais elegantes */
.card {
  border-radius: 12px;
}

/* Navbar */
.navbar-brand {
  font-size: 1.3rem;
  letter-spacing: 1px;
}

/* Inputs grandes (mobile friendly) */
.form-control-lg {
  font-size: 1rem;
  padding: 0.75rem 1rem;
}

/* Bot?es */
.btn {
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(16, 24, 40, 0.18);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.18);
}

.btn-primary {
  background: linear-gradient(180deg, #2f6bff 0%, #2257cf 100%);
  border-color: #2257cf;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #275fe4 0%, #1f4fb8 100%);
  border-color: #1f4fb8;
}

.btn-outline-light {
  background-color: rgba(255, 255, 255, 0.08);
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.18);
}

/* Botões do cabeçalho com mais destaque */
.nav-btn {
  border-color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 6px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.nav-btn:hover {
  border-color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.12) 100%);
  color: #ffffff;
}

.nav-btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.35);
}

/* Bot?o de tema meia-lua (aba Materiais) */
.theme-toggle-moon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #d0d7de;
  background: linear-gradient(90deg, #111 0 50%, #ffffff 50% 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.18);
  padding: 0;
  display: inline-block;
}


.theme-toggle-moon-sm {
  width: 20px;
  height: 20px;
}
.theme-toggle-moon:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 6px 14px rgba(0, 0, 0, 0.25);
}

.theme-toggle-moon:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(45, 107, 255, 0.35);
}

.theme-dark .theme-toggle-moon {
  border-color: #3b4657;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Tabelas roláveis (inventário e materiais) */
.table-scroll {
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sticky-header th {
  position: sticky;
  top: 64px;
  z-index: 50;
  background: #f8f9fa;
  box-shadow: inset 0 -1px 0 #d5d9e1;
}

.theme-dark .sticky-header th {
  background: #1b212b !important;
  box-shadow: inset 0 -1px 0 #263244;
}

/* ✅ Caixa do registro de movimentações (mostra ~5 últimas) */
.mv-box {
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}

/* ✅ Registro de movimentações por perfil */
.mv-assistencia { background: #d1e7dd; } /* verde claro */
.mv-entradas    { background: #ffda6a; } /* amarelo mais escuro */
.mv-supervisor  { background: #e2e3e5; } /* cinza */


/* =======================================================
   ✅ MATERIAIS: layout otimizado no celular (stack/card)
   ======================================================= */

/* Rótulos escondidos no desktop */
.mat-label { display: none; }

/* Ajustes gerais para ficar mais legível */
.materials-table td {
  vertical-align: top;
}
.materials-table .col-saldo {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Form de movimentação: bom no desktop */
.mat-form select { max-width: 140px; }
.mat-form input  { max-width: 120px; }

/* ✅ MOBILE: transforma cada linha em “card empilhado” */
@media (max-width: 576px) {
  /* remove header da tabela no mobile (vira cards) */
  .materials-table thead {
    display: none;
  }

  /* cada linha vira um bloco */
  .materials-table tr.mat-row {
    display: block;
    border: 1px solid #e6e9ef;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
  }

  .materials-table td {
    display: block;
    border: 0;
    padding: 6px 0;
  }

  /* mostra rótulos (Produto, Descrição, Saldo, Movimentar) */
  .mat-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 2px;
  }

  .mat-value {
    display: block;
    font-size: 0.98rem;
  }

  /* Saldo com destaque e alinhado à esquerda no mobile */
  .materials-table .col-saldo {
    text-align: left;
  }

  /* Form ocupa linha inteira e fica “gostoso” de usar */
  .mat-form {
    width: 100%;
    gap: 8px !important;
  }

  .mat-form select,
  .mat-form input,
  .mat-form button {
    width: 100%;
    max-width: none;
  }

  .mat-form button {
    padding: 10px 12px;
  }
}

/* =======================================================
   ✅ NOVO: Scroll horizontal no histórico (muitos campos)
   ======================================================= */

.mv-xscroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mv-minw {
  min-width: 980px; /* força rolagem horizontal no celular */
}

.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  background: linear-gradient(180deg, #1f9d4d 0%, #0f7a34 100%);
  border-color: #0f6d30;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 6px rgba(16, 24, 40, 0.16);
}

.export-btn:hover {
  background: linear-gradient(180deg, #21a553 0%, #11813a 100%);
  border-color: #117a37;
  color: #ffffff;
}

.export-btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.35);
}

.qr-btn {
  background: linear-gradient(180deg, #1f55cc 0%, #153a8a 100%);
  border-color: #13357f;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 6px rgba(16, 24, 40, 0.18);
}

.qr-btn:hover {
  background: linear-gradient(180deg, #245fdc 0%, #173f97 100%);
  border-color: #16408f;
  color: #ffffff;
}

.qr-btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(31, 85, 204, 0.35);
}

/* Botao Excluir com mais destaque e realismo */
.btn-outline-danger {
  color: #ffffff;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  border-color: #b91c1c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(16, 24, 40, 0.18);
}

.btn-outline-danger:hover {
  color: #ffffff;
  background: linear-gradient(180deg, #f04f4f 0%, #c81e1e 100%);
  border-color: #c81e1e;
}

.btn-outline-danger:focus {
  box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.35);
}

.export-icon {
  width: 14px;
  height: 14px;
  margin-right: 0;
  vertical-align: middle;
  flex: 0 0 14px;
  filter: brightness(0) invert(1);
}

.inventory-actions form {
  margin: 0;
}

.inv-row-actions .btn.btn-sm {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.inv-row-actions form {
  margin: 0;
}

.install-app-fab {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 1055;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.24);
}
