/* Centrimotion - Layout ERP (menu lateral com flyout) */

:root{
  --cm-sidebar-w: 244px;
  --cm-sidebar-bg: #4a4a4a;
  --cm-sidebar-bg-2: #3d3d3d;
  --cm-sidebar-text: #f5f5f5;
  --cm-sidebar-muted: rgba(245,245,245,.60);

  --cm-hover: #f5a623;
  --cm-active: #e09516;

  --cm-surface: #ffffff;
  --cm-border: rgba(0,0,0,.10);
  --cm-primary: #0a6ed1;
  --cm-primary-hover: #085caf;
}

/* ===== GLOBAL ===== */

.cm-body{
  min-height: 100vh;
  background: #f6f7fb;
  font-size: .95rem;
  overflow-x: hidden; /* evita scroll fantasma */
}

.cm-app{
  min-height: 100vh;
  display: flex;
}

/* ===== SIDEBAR ===== */

.cm-sidebar{
  width: var(--cm-sidebar-w);
  background: linear-gradient(180deg, var(--cm-sidebar-bg), var(--cm-sidebar-bg-2));
  color: var(--cm-sidebar-text);
  position: relative;
  min-height: 100vh;   /* altura mínima da tela */
  height: auto;        /* permite crescer com a página */
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
}

/* BRAND */

.cm-brand{
  padding: 16px 16px 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.cm-brand-link{
  color: var(--cm-sidebar-text);
  text-decoration: none;
  display: block;
}

.cm-brand-title{
  display: block;
  font-weight: 800;
  letter-spacing: .7px;
  font-size: 1.05rem;
  line-height: 1.1;
}

.cm-brand-sub{
  display: block;
  font-size: .78rem;
  color: var(--cm-sidebar-muted);
  margin-top: 3px;
}

.cm-logo{
  width: 100%;
  height: auto;
  display: block;
}

/* NAV */

.cm-nav{
  padding: 10px;
  overflow-y: auto;
  overflow-x: visible;
  flex: 1;
}

/* ===== MENU ===== */

.cm-menu{
  list-style: none;
  padding: 0;
  margin: 0;
}

.cm-menu-item{
  position: relative;
}

.cm-menu-link{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--cm-sidebar-text);
  text-decoration: none;
  user-select: none;
  transition: background .15s ease;
}

.cm-menu-link:hover{
  background: var(--cm-hover);
}

.cm-menu-link-static{
  cursor: default;
}

.cm-menu-text{
  font-weight: 600;
  font-size: .92rem;
  white-space: nowrap;
}

.cm-menu-item.active > .cm-menu-link{
  background: var(--cm-active);
}

/* caret */

.cm-menu-caret{
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid rgba(229,231,235,.85);
  opacity: .9;
}

/* ===== FLYOUT ===== */

.cm-flyout{
  position: fixed;     /* o JS define top/left */
  top: 0;
  left: 0;
  min-width: 260px;
  background: #0b1224;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px;
  display: none;
  box-shadow: 0 12px 35px rgba(0,0,0,.35);
  z-index: 9999;
  pointer-events: auto;
}

/* submenu */

.cm-menu-l2 .cm-menu-link,
.cm-menu-l3 .cm-menu-link{
  padding: 9px 10px;
  border-radius: 10px;
  font-weight: 600;
}

/* remove gap invisível */

.cm-menu-item.has-children::after{
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  width: 8px;
  height: 100%;
}

/* ===== FOOTER ===== */

.cm-sidebar-footer{
  padding: 12px 16px 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ===== CONTENT ===== */

.cm-content{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cm-header{
  height: 56px;
  background: #FCA311 !important;   /* força laranja */
  border-bottom: 1px solid rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.cm-header-title{
  font-weight: 800;
  letter-spacing: .2px;
  color: #0f172a;
}

.cm-main{
  min-width: 0;
}

/* ===== RESPONSIVO ===== */

@media (max-width: 992px){
  .cm-sidebar{
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 100;
  }

  .cm-content{
    margin-left: 0;
  }
}

/* BOTÃO LOGOUT CENTRIMOTION */
.cm-header .btn-outline-secondary{
  background: #4a4a4a;
  color: #ffffff;
  border: none;
}

.cm-header .btn-outline-secondary:hover{
  background: #3d3d3d;
  color: #ffffff;
}

/* Tabela de apontamento: converte em cards no celular */
@media (max-width: 768px) {
  .table-mobile-cards,
  .table-mobile-cards thead,
  .table-mobile-cards th,
  .table-mobile-cards td,
  .table-mobile-cards tr {
    display: block;
  }
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards tr {
    border: 1px solid var(--cm-border);
    margin-bottom: 8px;
    border-radius: 2px;
    background: #fff;
    padding: 4px;
  }
  .table-mobile-cards td {
    text-align: right;
    padding-left: 50% !important;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  .table-mobile-cards td:before {
    content: attr(data-label);
    position: absolute;
    left: 8px;
    width: 46%;
    text-align: left;
    font-weight: 600;
    color: var(--cm-text, #223548);
    font-size: .78rem;
  }
}




/* =========================================================
   Centrimotion — tema atual
   ========================================================= */

:root{
  --cm-sidebar-w: 244px;
  --cm-sidebar-bg: #4a4a4a;
  --cm-sidebar-bg-2: #3d3d3d;
  --cm-sidebar-text: #f5f5f5;
  --cm-sidebar-muted: rgba(245,245,245,.60);

  --cm-hover: #f5a623;
  --cm-active: #e09516;

  --cm-surface: #ffffff;
  --cm-surface-soft: #f6f8fa;
  --cm-shell: #f0f2f5;
  --cm-border: #d0d7de;
  --cm-border-strong: #b6bfc8;
  --cm-text: #1f2328;
  --cm-text-soft: #57606a;
  --cm-primary: #0a6ed1;
  --cm-primary-hover: #085caf;
  --cm-header-bg: #ffffff;
  --cm-header-border: #d0d7de;
}

html, body{
  background: var(--cm-shell);
  color: var(--cm-text);
}

.cm-body{
  background: var(--cm-shell);
  font-size: .84rem;
  color: var(--cm-text);
}

.cm-app{
  background: var(--cm-shell);
}

.cm-sidebar{
  width: var(--cm-sidebar-w);
  background: linear-gradient(180deg, var(--cm-sidebar-bg), var(--cm-sidebar-bg-2));
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.04);
}

.cm-brand{
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.cm-nav{
  padding: 8px;
}

.cm-menu-link{
  padding: 8px 10px;
  border-radius: 2px;
  min-height: 34px;
}

.cm-menu-link:hover{
  background: var(--cm-hover);
}

.cm-menu-item.active > .cm-menu-link{
  background: var(--cm-active);
}

.cm-menu-text{
  font-weight: 600;
  font-size: .84rem;
  letter-spacing: 0;
}

.cm-menu-caret{
  border-left: 5px solid rgba(255,255,255,.92);
}

.cm-flyout{
  min-width: 230px;
  background: #3a3a3a;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 6px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}

.cm-menu-l2 .cm-menu-link,
.cm-menu-l3 .cm-menu-link{
  padding: 7px 9px;
  border-radius: 2px;
  font-weight: 600;
}

.cm-sidebar-footer{
  padding: 10px 14px 12px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Accordion — submenus dentro do offcanvas (mobile) ──── */
.offcanvas .cm-flyout {
  position: static !important;
  display: none;
  box-shadow: none !important;
  border: none !important;
  border-left: 3px solid var(--cm-hover, #f97316) !important;
  border-radius: 0 !important;
  background: rgba(255,255,255,.06) !important;
  padding: 4px 0 4px 10px !important;
  min-width: 0 !important;
  z-index: auto !important;
  margin: 2px 0 4px 8px;
  border-radius: 0 4px 4px 0 !important;
}
.offcanvas .cm-menu-item.cm-open > .cm-flyout {
  display: block !important;
}
.offcanvas .cm-menu-item.has-children::after {
  display: none !important;
}
.offcanvas .cm-menu-link .cm-menu-caret {
  transition: transform .2s ease;
}
.offcanvas .cm-menu-item.cm-open > .cm-menu-link .cm-menu-caret,
.offcanvas .cm-menu-item.cm-open > .cm-menu-link-static .cm-menu-caret {
  transform: rotate(90deg);
}

.cm-content{
  background: var(--cm-shell);
}

.cm-header{
  height: 54px;
  background: var(--cm-header-bg) !important;
  border-bottom: 1px solid var(--cm-header-border);
  padding: 0 16px;
  box-shadow: none;
}

.cm-header-right{
  display: flex;
  align-items: center;
  gap: 3mm;
}

.cm-header-right form{
  display: contents;
}

/* ── Chip de usuário ─────────────────────────────────────── */
.cm-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f7f7f7;
  border: 1px solid #b6bdc5 !important;
  border-radius: 20px !important;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  color: var(--cm-text);
  line-height: 1;
}
.cm-user-chip:hover,
.cm-user-chip:focus {
  background: #eef1f4;
  color: var(--cm-text);
  box-shadow: none;
  outline: none;
}
.cm-user-chip::after {
  margin-left: 2px;
}
.cm-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cm-hover, #f97316);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .03em;
}
.cm-user-info {
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}
.cm-user-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--cm-text);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.cm-user-role {
  font-size: .62rem;
  color: #6b7280;
  letter-spacing: .05em;
  display: block;
}

.cm-header-title{
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cm-text);
}

.cm-shell-main{
  background: var(--cm-shell);
}

.cm-main.container-fluid{
  padding-left: 16px;
  padding-right: 16px;
}

.container, .container-fluid{
  --bs-gutter-x: 1rem;
}

.card,
.table-responsive,
.modal-content,
.offcanvas,
.dropdown-menu{
  border-radius: 2px !important;
}

.card,
.table-responsive{
  border: 1px solid var(--cm-border);
  box-shadow: none !important;
  background: #fff;
}

.card-header{
  background: #f7f7f7;
  border-bottom: 1px solid var(--cm-border);
  font-size: .84rem;
  font-weight: 600;
}

.btn-primary{
  background: var(--cm-primary);
  border-color: var(--cm-primary);
}

.btn-primary:hover,
.btn-primary:focus{
  background: var(--cm-primary-hover);
  border-color: var(--cm-primary-hover);
}

.btn-outline-primary{
  color: var(--cm-primary);
  border-color: #85b6e8;
}

.btn-outline-primary:hover{
  background: #eaf3fc;
  color: var(--cm-primary-hover);
  border-color: #6fa6dd;
}

.btn-outline-secondary,
.cm-toolbar-btn{
  color: var(--cm-text);
  background: #f7f7f7;
  border: 1px solid #b6bdc5 !important;
}

.btn-outline-secondary:hover,
.cm-toolbar-btn:hover{
  background: #eef1f4;
  color: var(--cm-text);
  border-color: #9ea8b2 !important;
}

.cm-menu-btn {
  color: var(--cm-text);
  background: #f7f7f7;
  border: 1px solid #b6bdc5 !important;
  font-size: .82rem;
  font-weight: 600;
  padding: 6px 14px;
  line-height: 1.2;
  border-radius: 3px;
  letter-spacing: .02em;
}

.form-control,
.form-select,
textarea{
  border-radius: 2px !important;
  font-size: .83rem;
  min-height: 34px;
  border-color: #bfc6cd;
  box-shadow: none !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus{
  border-color: var(--cm-primary);
  box-shadow: 0 0 0 1px rgba(10,110,209,.15) !important;
}

.input-group-text{
  border-radius: 2px !important;
  font-size: .82rem;
  background: #f7f7f7;
}

.table{
  --bs-table-bg: #fff;
  --bs-table-striped-bg: #fafafa;
  font-size: .83rem;
  margin-bottom: 0;
}

.table th{
  font-size: .8rem;
  font-weight: 700;
  background: #f7f7f7;
  color: var(--cm-text);
  border-bottom: 1px solid var(--cm-border-strong);
  padding: .55rem .6rem;
  white-space: nowrap;
}

.table td{
  padding: .5rem .6rem;
  border-color: #e5e7ea;
  vertical-align: middle;
}

.table-hover tbody tr:hover{
  background: #f5f9ff;
}

.status-badge{
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  min-width: 78px;
  text-align: center;
}

.status-rascunho{
  background: #6f7d8c;
}

.status-aguardando{
  background: #d97706;
}

.status-aprovado{
  background: #e9730c;
}

.status-finalizado{
  background: #30914c;
}

h1, h2, h3, h4, h5{
  color: var(--cm-text);
  letter-spacing: 0;
}

h1{ font-size: 1.45rem; }
h2{ font-size: 1.3rem; }
h3{ font-size: 1.15rem; }
h4{ font-size: 1rem; }
h5{ font-size: .92rem; }

.small, small{
  font-size: .76rem !important;
}

.nav-tabs{
  border-bottom-color: var(--cm-border);
}

.nav-tabs .nav-link{
  border-radius: 2px 2px 0 0;
  color: var(--cm-text-soft);
  font-size: .82rem;
  padding: .45rem .8rem;
}

.nav-tabs .nav-link.active{
  color: var(--cm-text);
  font-weight: 600;
  border-color: var(--cm-border) var(--cm-border) #fff;
  background: #fff;
}

/* ===== BOTÕES — ESTILO SAP FIORI ===== */
.btn {
  border-radius: 3px !important;
  font-size: .8125rem !important;
  font-weight: 600 !important;
  letter-spacing: .01em;
  box-shadow: none !important;
  transition: filter .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover  { filter: brightness(.93); }
.btn:active { filter: brightness(.86); }

/* Botão de adicionar com ícone SVG */
.rw-btn-add {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  min-width: 122px;
  justify-content: center;
  white-space: nowrap !important;
}

/* Padding uniforme — ignora distinção btn-sm / btn-lg */
.btn:not(.p-0) {
  padding: .3rem .75rem !important;
  line-height: 1.4 !important;
}
.btn-sm:not(.p-0),
.btn-lg:not(.p-0) {
  font-size: .8125rem !important;
  padding: .3rem .75rem !important;
}

/* Botões de ícone (✕ ✓ ✏) — compactos mas altura consistente */
.btn-icon {
  padding: .2rem .4rem !important;
  line-height: 1.2 !important;
  font-size: .8rem !important;
}

/* btn-close (×) do Bootstrap — não interfere */
.btn-close {
  padding: .25rem !important;
  border-radius: 2px !important;
}

.badge{
  border-radius: 2px;
  font-weight: 600;
}

.alert{
  border-radius: 2px;
  font-size: .82rem;
}

.offcanvas{
  background: linear-gradient(180deg, var(--cm-sidebar-bg, #0f172a), var(--cm-sidebar-bg-2, #111827));
  color: var(--cm-sidebar-text, #e5e7eb);
}

.offcanvas-header {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.offcanvas-header .offcanvas-title {
  color: var(--cm-sidebar-text, #e5e7eb);
}

.offcanvas-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.offcanvas .cm-sidebar{
  min-height: auto;
  height: auto;
}

.cm-header .btn-outline-secondary{
  background: #f7f7f7;
  color: var(--cm-text);
  border: 1px solid #b6bdc5;
}

.cm-header .btn-outline-secondary:hover{
  background: #eef1f4;
  color: var(--cm-text);
}

@media (max-width: 768px){
  .cm-body{
    font-size: .82rem;
  }

  .cm-header{
    height: 50px;
    padding: 0 10px;
  }

  .cm-header-title{
    font-size: .96rem;
  }

  .cm-main.container-fluid{
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 12px !important;
  }

  .table-mobile-cards tr{
    border-radius: 2px;
    box-shadow: none;
  }

  .table-mobile-cards td{
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }
}


/* =========================================================
   LOGIN — TWO-PANEL ENTERPRISE LAYOUT
   ========================================================= */

.cm-app-guest .cm-content{
  width: 100%;
}

/* Remove container/padding do layout principal na página de login */
.cm-app-guest main{
  max-width: none !important;
  padding: 0 !important;
}

/* Página inteira ocupa a viewport */
.login-page{
  display: flex;
  min-height: 100vh;
}

/* ── Painel esquerdo (marca) ─────────────────────────────── */
.login-left{
  flex: 0 0 58%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #1a2d44 0%, #162438 55%, #0f1c2e 100%);
}

.login-left::before{
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/static/img/bg-login.png");
  background-size: cover;
  background-position: center;
  opacity: .08;
  filter: grayscale(100%);
}

.login-left::after{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 500px at 30% 20%, rgba(255,255,255,.06), transparent 65%),
    radial-gradient(600px 400px at 80% 80%, rgba(255,255,255,.04), transparent 60%);
}

.login-left-content{
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.login-logo{
  width: min(300px, 72%);
  height: auto;
  display: block;
  margin-bottom: 36px;
}

.login-left-name{
  font-size: 1.45rem;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  letter-spacing: .3px;
  margin-bottom: 10px;
}

.login-left-sub{
  font-size: .95rem;
  color: rgba(255,255,255,.52);
  letter-spacing: .1px;
}

.login-left-footer{
  position: relative;
  z-index: 1;
  font-size: .78rem;
  color: rgba(255,255,255,.28);
  text-align: center;
}

/* ── Painel direito (formulário) ─────────────────────────── */
.login-right{
  flex: 0 0 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 48px 40px;
  border-left: 1px solid #e4e9ee;
}

.login-form-wrap{
  width: 100%;
  max-width: 360px;
}

.login-form-head{
  margin-bottom: 28px;
}

.login-form-title{
  font-size: 1.35rem;
  font-weight: 700;
  color: #1d2d3e;
  margin-bottom: 6px;
}

.login-form-sub{
  font-size: .85rem;
  color: #6b7f92;
}

.login-field{
  margin-bottom: 20px;
}

.login-label{
  display: block;
  margin-bottom: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: #4a5f74;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.login-input{
  min-height: 46px !important;
  font-size: .9375rem !important;
  border-radius: 3px !important;
  border-color: #c8d3dc !important;
  background: #f8fafc !important;
  transition: border-color .15s, box-shadow .15s;
}

.login-input:focus{
  border-color: #2f5ea8 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(47,94,168,.12) !important;
}

/* Wrapper do campo de senha com botão interno */
.login-pwd-wrap{
  position: relative;
}

.login-pwd-wrap .login-input{
  padding-right: 48px !important;
}

.login-eye-btn{
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 46px;
  background: transparent !important;
  border: none !important;
  color: #7a8fa3 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 !important;
  border-radius: 0 3px 3px 0 !important;
  transition: color .15s;
}

.login-eye-btn:hover{
  color: #2f5ea8 !important;
}

.login-submit-btn{
  margin-top: 8px;
  min-height: 46px;
  border-radius: 3px !important;
  border: 1px solid #2c5ea8 !important;
  background: #2f5ea8 !important;
  color: #ffffff !important;
  font-size: .9375rem !important;
  font-weight: 700 !important;
  letter-spacing: .2px;
  transition: background .15s, border-color .15s;
}

.login-submit-btn:hover{
  background: #254e8e !important;
  border-color: #254e8e !important;
}

.login-hint{
  margin-top: 20px;
  font-size: .8rem;
  color: #8a9aaa;
  text-align: center;
  line-height: 1.5;
}

/* ── Responsivo: mobile empilha verticalmente ─────────────── */
@media (max-width: 768px){
  .login-page{
    flex-direction: column;
  }

  .login-left{
    flex: none;
    padding: 36px 24px 30px;
    min-height: 220px;
  }

  .login-logo{
    width: min(220px, 60%);
    margin-bottom: 20px;
  }

  .login-left-name{
    font-size: 1.15rem;
  }

  .login-left-sub{
    font-size: .85rem;
  }

  .login-left-footer{
    display: none;
  }

  .login-right{
    flex: 1;
    padding: 32px 20px 40px;
    border-left: none;
    border-top: 1px solid #e4e9ee;
  }
}


/* =========================================================
   MODULO DESPESAS - RELATORIOS_WEB
   ========================================================= */

.despesas-container{
}

.despesas-resumo{
  display:flex;
  gap:12px;
  margin-bottom:14px;
  flex-wrap:wrap;
}

.resumo-card{
  background:#fff;
  border:1px solid var(--cm-border);
  padding:10px 14px;
  border-radius:4px;
  min-width:160px;
}

.resumo-card .titulo{
  font-size:.75rem;
  color:var(--cm-text-soft);
  font-weight:600;
}

.resumo-card .valor{
  font-size:1rem;
  font-weight:700;
}

.resumo-card.verde{
  border-left:4px solid #2e9e5b;
}

.resumo-card.vermelho{
  border-left:4px solid #d64545;
}

.resumo-card.azul{
  border-left:4px solid #2f6db6;
}

.despesas-toolbar{
  margin-bottom:8px;
}

.despesas-tabela-wrapper{
  overflow-x:auto;
}

.despesas-tabela{
  width:100%;
  border-collapse:collapse;
  font-size:.83rem;
}

.despesas-tabela th{
  background:#f7f7f7;
  border:1px solid var(--cm-border);
  padding:6px;
  text-align:center;
}

.despesas-tabela td{
  border:1px solid var(--cm-border);
  padding:6px;
  text-align:center;
  cursor:pointer;
}

.col-categoria{
  text-align:left;
  min-width:180px;
}

.col-dia{
  min-width:120px;
}

.total-dia{
  font-size:.72rem;
  color:var(--cm-text-soft);
}

.categoria{
  font-weight:600;
  background:#fafafa;
}

.celula-despesa:hover{
  background:#f1f7ff;
}

.despesa-ok{
  background:#e8f7ed;
}

.despesa-sem-comprovante{
  background:#fdeaea;
}

/* MODAL DESPESA */

.modal-despesa{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,.35);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

/* Garante que o modal de confirmação global fique acima de modais customizados */
#rwConfirmModal { z-index: 10500 !important; }

.modal-conteudo{
  background:#fff;
  border-radius:4px;
  width:420px;
  border:1px solid var(--cm-border);
}

.modal-header{
  padding:10px 14px;
  border-bottom:1px solid var(--cm-border);
  display:flex;
  justify-content:space-between;
}

.modal-header h3{
  margin:0;
  font-size:1rem;
}

.modal-header .fechar{
  background:none;
  border:none;
  font-size:20px;
  cursor:pointer;
}

.modal-body{
  padding:14px;
}

.modal-body .campo{
  margin-bottom:10px;
}

.modal-footer{
  padding:10px 14px;
  border-top:1px solid var(--cm-border);
  text-align:right;
}


/* =========================================================
   MOBILE — MELHORIAS GERAIS
   ========================================================= */

/* Agrupamento de campos de apontamento */
.ap-group {
  background: #f8f9fa;
  border-left: 3px solid #dee2e6;
  border-radius: 0 4px 4px 0;
  padding: 8px 10px 4px 10px;
}
.ap-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin-bottom: 6px;
}



/* =========================================================
   DENSIDADE COMPACTA — Desktop
   Reduz padding global de cards, tabelas, forms e cabeçalhos
   sem afetar mobile (media query separada acima já cuida disso)
   ========================================================= */

/* Card body mais enxuto */
.card-body{
  padding: .6rem .75rem;
}

/* Card header mais justo */
.card-header{
  padding: .45rem .75rem;
}

/* Tabelas: linhas mais finas */
.table th{
  padding: .38rem .6rem;
}
.table td{
  padding: .34rem .6rem;
}

/* Labels de formulário: menos espaço abaixo */
.form-label{
  margin-bottom: .18rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--cm-text-soft);
}

/* Formulários em grid: gap padrão menor */
.row.g-3{ --bs-gutter-y: .6rem; }

/* Títulos de seção dentro de cards */
h5.mb-0, h6.mb-0{
  line-height: 1.2;
}

/* Subtítulo cinza abaixo de títulos de seção */
.card-body > .d-flex > div > .text-muted.small,
.d-flex > div > .text-muted.small{
  line-height: 1.2;
  margin-top: 1px;
}

/* Separador hr mais discreto */
hr.my-2{
  margin-top: .4rem !important;
  margin-bottom: .4rem !important;
  opacity: .1;
}

/* Alerta: padding mais justo */
.alert{
  padding: .5rem .75rem;
}

/* Page heading + botões: margem inferior menor */
.d-flex.justify-content-between.align-items-center.mb-3{
  margin-bottom: .6rem !important;
}

/* Espaço entre cards na tela de atendimento */
.d-flex.flex-column.gap-3{
  gap: .6rem !important;
}

/* =========================================================
   BOTÕES DE AÇÃO EM LINHA — .rw-actions
   Garante alinhamento uniforme mesmo quando o botão está
   dentro de um <form>, evitando desalinhamento vertical
   ========================================================= */

.rw-actions{
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

/* Remove margens do form para não quebrar o flex */
.rw-actions form{
  margin: 0;
  padding: 0;
  display: contents;
}

/* Todos os botões dentro de .rw-actions: tamanho e padding uniformes */
.rw-actions .btn{
  font-size: .78rem;
  padding: .22rem .55rem;
  white-space: nowrap;
}

/* =========================================================
   GRID DE INFORMAÇÕES INLINE (label: valor)
   Usado no card de dados do atendimento
   ========================================================= */

.rw-info-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .3rem .75rem;
}

.rw-info-full{
  grid-column: 1 / -1;
}

.rw-info-item{
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rw-info-label{
  font-size: .72rem;
  font-weight: 600;
  color: var(--cm-text-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.1;
}

.rw-info-value{
  font-size: .88rem;
  font-weight: 500;
  color: var(--cm-text);
  line-height: 1.4;
  word-break: break-word;
}

/* Rótulo discreto de sub-seção dentro do card */
.rw-section-label{
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--cm-text-soft);
  margin-bottom: .5rem;
}

/* Meta-info de equipamento (S/N, Ident.) */
.rw-eq-meta{
  font-size: .78rem;
  color: var(--cm-text-soft);
}


/* =========================================================
   PARTE 2 — FIORI: CABEÇALHO DE PÁGINA, SEÇÕES, LISTAS, MODAIS
   ========================================================= */

/* ── Área de título de página ─────────────────────────────
   Envolve o <h5> + botão de ação principal de cada tela.
   Adicione a classe .rw-page-header na div de topo. */
.rw-page-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: .55rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--cm-border);
  flex-wrap: wrap;
  gap: .4rem;
}

.rw-page-header h5{
  font-size: .94rem;
  font-weight: 700;
  color: var(--cm-text);
  margin: 0;
  letter-spacing: .01em;
}

.rw-page-header .rw-page-sub{
  font-size: .75rem;
  color: var(--cm-text-soft);
  margin-top: 1px;
}

/* ── Cabeçalhos de seção colapsável ──────────────────────
   O cursor e borda de indicação de seção ativa/hover       */
.rw-sec-header{
  cursor: pointer;
  user-select: none;
  transition: background .12s ease;
  min-height: 44px;
}

.rw-sec-header:hover{
  background: #f0f2f4 !important;
}

/* Título padronizado de seção (colapsável ou não) */
.rw-sec-title{
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Chevron de seção colapsável */
.rw-sec-chevron{
  font-size: .85rem;
  width: 18px;
  flex-shrink: 0;
  transition: transform .2s;
}

/* Estado vazio padronizado */
.rw-empty-state{
  color: #6c757d;
  font-size: .84rem;
  text-align: center;
  padding: .75rem;
}

/* Badge compacto — status em linhas de lista */
.badge-xs{ font-size: .68rem; }

/* ── List-group Fiori ─────────────────────────────────────
   Itens mais compactos, sem border-radius desnecessário    */
.list-group-item{
  border-color: var(--cm-border);
  font-size: .83rem;
  padding: .45rem .75rem;
}

.list-group-flush > .list-group-item{
  border-left: none;
  border-right: none;
}

.list-group-flush > .list-group-item:first-child{
  border-top: none;
}

/* ── Modais Fiori ─────────────────────────────────────────
   Header limpo, footer sem borda separada excessiva        */
.modal-content{
  border: 1px solid var(--cm-border) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.14) !important;
}

.modal-header{
  background: #f7f7f7;
  border-bottom: 1px solid var(--cm-border);
  padding: .6rem .9rem;
}

.modal-header .modal-title{
  font-size: .9rem;
  font-weight: 700;
  color: var(--cm-text);
}

.modal-body{
  padding: .85rem .9rem;
  font-size: .83rem;
}

.modal-footer{
  background: #f7f7f7;
  border-top: 1px solid var(--cm-border);
  padding: .5rem .9rem;
  gap: .4rem;
}

/* ── Cards KPI / resumo ───────────────────────────────────
   Os cards de contagem numérica no topo das listas         */
.rw-kpi-card{
  background: #fff;
  border: 1px solid var(--cm-border);
  border-radius: 2px;
  padding: .55rem .75rem;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background .12s ease;
}

.rw-kpi-card:hover{
  background: #f5f6f7;
}

.rw-kpi-num{
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--cm-text);
}

.rw-kpi-label{
  font-size: .72rem;
  font-weight: 600;
  color: var(--cm-text-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}

/* ── Formulários: form-check ──────────────────────────────*/
.form-check-input{
  border-radius: 2px !important;
  border-color: #bfc6cd;
}

.form-check-input:checked{
  background-color: var(--cm-primary);
  border-color: var(--cm-primary);
}

/* ── Dropdown menus ──────────────────────────────────────*/
.dropdown-menu{
  border: 1px solid var(--cm-border) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.1) !important;
  font-size: .83rem;
  padding: .25rem 0;
}

.dropdown-item{
  padding: .38rem .75rem;
  font-size: .83rem;
}

.dropdown-item:hover{
  background: #eef3fa;
  color: var(--cm-primary);
}

/* ── Scrollbar discreta (Webkit) ─────────────────────────*/
::-webkit-scrollbar{ width: 6px; height: 6px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: #c8cdd3; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover{ background: #a8b0b8; }


/* =========================================================
   ANDROID MOBILE — Melhorias de usabilidade (≤ 768px)
   Foco em toque, leitura e navegação em campo.
   Nenhuma regra aqui afeta breakpoints maiores.
   ========================================================= */

@media (max-width: 768px) {

  /* ── Oculta "Minha senha" do header (disponível no menu) ── */
  .btn-minha-senha { display: none !important; }

  /* ── Touch targets: mínimo 44 px (Google Material) ─────── */
  .btn:not(.p-0):not(.btn-icon):not(.btn-close) {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  /* Tabs de atendimento ficam menores propositalmente */
  .rw-tab-btn {
    min-height: 42px !important;
  }

  /* ── Inputs maiores para dedos ──────────────────────────── */
  .form-control,
  .form-select {
    min-height: 44px !important;
    font-size: .95rem !important;
  }
  textarea.form-control {
    min-height: 80px !important;
  }

  /* ── Card body: padding menor para ganhar espaço ────────── */
  .card-body {
    padding: .55rem .65rem !important;
  }
  .card-header {
    padding: .42rem .65rem !important;
  }

  /* ── rw-page-header: botão vai abaixo do título ─────────── */
  .rw-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .rw-page-header > a.btn,
  .rw-page-header > button.btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* ── Topo da tela de atendimento (ID + status + cliente) ── */
  .rw-at-top {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .rw-at-top > .text-muted.small {
    width: 100%;
    margin-top: 2px;
    line-height: 1.45;
  }

  /* ── Barra de ações do atendimento ─────────────────────── */
  .rw-at-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .rw-at-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
    gap: 6px !important;
  }
  /* forms dentro do grid viram transparentes para o layout */
  .rw-at-actions form {
    display: contents !important;
  }
  .rw-at-actions form > .btn,
  .rw-at-actions > .btn,
  .rw-at-actions > a.btn {
    width: 100% !important;
  }

  /* ── Equipamentos: botões em coluna no card ─────────────── */
  .rw-eq-btns {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 4px !important;
  }
  .rw-eq-btns form { display: contents !important; }
  .rw-eq-btns form > .btn,
  .rw-eq-btns > .btn,
  .rw-eq-btns > a.btn {
    width: 100% !important;
    text-align: center !important;
  }
  /* Card de equipamento: empilha verticalmente */
  .rw-eq-card {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* ── Contatos: scroll horizontal ───────────────────────── */
  #sec-body-contatos {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* ── Apontamento: destaque de grupo ─────────────────────── */
  .ap-group {
    border-left-color: var(--cm-primary, #0a6ed1) !important;
    margin-bottom: 8px !important;
    padding: 8px 10px 6px 10px !important;
  }

  /* ── Rota de deslocamento: salvar vai embaixo ───────────── */
  .ap-rota-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .ap-rota-row > [class*="col-auto"] {
    grid-column: 1 / -1 !important;
  }
  .ap-rota-row > [class*="col-auto"] .btn {
    width: 100% !important;
  }

  /* ── Formulário novo/editar atendimento ─────────────────── */
  .rw-form-footer {
    flex-direction: column !important;
  }
  .rw-form-footer .btn {
    width: 100% !important;
  }

  /* ── Gap entre cards de conteúdo ───────────────────────── */
  .d-flex.flex-column.gap-3 {
    gap: .5rem !important;
  }

  /* ── Alert no topo: padding menor ──────────────────────── */
  .alert {
    padding: .45rem .65rem !important;
    font-size: .82rem !important;
  }

  /* ── Tabela de tarefas: margens ─────────────────────────── */
  .rw-tarefas-table thead th {
    font-size: .75rem !important;
    padding: .3rem .4rem !important;
  }
  .rw-tarefas-table tbody td {
    padding: .5rem .4rem !important;
    vertical-align: top !important;
  }

  /* ── Prospeccao list: status + custo em linha ───────────── */
  .rw-prosp-row td {
    font-size: .8rem !important;
  }

  /* ── Header: ajuste fino do espaço ─────────────────────── */
  .cm-header {
    padding: 0 8px !important;
    position: relative !important;
  }
  .cm-header-title {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: .88rem !important;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
  }

  /* ── Tabs de atendimento: maiores e mais fáceis ─────────── */
  .rw-tab-btn {
    padding: .55rem .85rem !important;
    font-size: .84rem !important;
  }

  /* ── Modais: ocupam mais da tela ────────────────────────── */
  .modal-dialog {
    margin: .5rem !important;
    max-width: calc(100vw - 1rem) !important;
  }
  .modal-body {
    padding: .75rem !important;
  }

  /* ── Home técnico: cards de resumo mais compactos ────────── */
  .rw-home-kpi .card-body {
    padding: .45rem .4rem !important;
  }
  .rw-home-kpi .fw-bold.fs-4 {
    font-size: 1.3rem !important;
  }

  /* ── Botão de foto no mobile: destaca com ícone câmera ───── */
  .btn-foto-mobile {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
  }
  .btn-foto-mobile::before {
    content: "📷";
    font-size: .95rem;
  }

}

/* ════════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR — Mobile App Feel (≤ 991px)
   Barra fixa na parte inferior — principal affordance de app.
   ════════════════════════════════════════════════════════════════ */

/* Base: oculta em telas largas */
.cm-bottom-nav { display: none; }

@media (max-width: 991.98px) {

  /* ── Barra em si ──────────────────────────────────────────── */
  .cm-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* altura base + recuo para gesture bar (Android 10+) */
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--cm-header-bg, #fff);
    border-top: 1px solid var(--cm-border, #d0d7de);
    box-shadow: 0 -2px 12px rgba(0,0,0,.09);
    z-index: 1039; /* abaixo de modais (1050) e offcanvas (1045) */
  }

  /* ── Item individual ──────────────────────────────────────── */
  .cm-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #6c757d;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px 2px;
    position: relative;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    transition: color .12s ease;
  }

  .cm-bottom-nav-item.active {
    color: var(--cm-hover, #f97316);
  }

  .cm-bottom-nav-item:active {
    background: rgba(249, 115, 22, .10);
    border-radius: 8px;
  }

  .cm-bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .cm-bottom-nav-label {
    font-size: .59rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    line-height: 1;
  }

  /* ── Badge de tarefas no bottom nav ─────────────────────── */
  .cm-bottom-nav-badge {
    position: absolute;
    top: 3px;
    right: calc(50% - 20px);
    font-size: .5rem;
    padding: 2px 4px;
    line-height: 1.2;
    min-width: 14px;
    border-radius: 10px;
  }

  /* ── Conteúdo principal recua para não esconder sob a barra ─ */
  .cm-shell-main {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + .75rem) !important;
  }

  /* ── Oculta botão "Tarefas" no header (está no bottom nav) ── */
  #btn-tarefas {
    display: none !important;
  }

  /* ── Logo no header (substitui hamburger) ───────────────── */
  .cm-header-logo-mobile {
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
  }
  .cm-header-logo-mobile img {
    height: 32px;
    width: auto;
    max-width: 88px;
    object-fit: contain;
    display: block;
  }

  /* ── Título do header: centrado com logo à esquerda ─────── */
  .cm-header-title {
    max-width: calc(100vw - 180px) !important;
  }

  /* ── Page headers: wrap em mobile ───────────────────────── */
  .d-flex.justify-content-between.align-items-center.mb-3 {
    flex-wrap: wrap !important;
    gap: .5rem !important;
  }

  /* ── Tabelas sem table-responsive: scroll automático ─────── */
  .card-body:has(> table),
  .card:has(> table) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Cards clicáveis: feedback visual de toque ──────────── */
  [onclick]:active,
  a.card:active,
  .rw-at-card:active {
    opacity: .88;
    transform: scale(.99);
    transition: opacity .1s, transform .1s;
  }

  /* ── Offcanvas: visual app-like ─────────────────────────── */
  #cmOffcanvasMenu {
    --bs-offcanvas-width: min(280px, 82vw);
  }
  #cmOffcanvasMenu .offcanvas-header {
    background: var(--cm-sidebar-bg, #0f172a);
    color: #fff;
    padding: 10px 14px;
    min-height: 48px;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  #cmOffcanvasMenu .offcanvas-title {
    font-size: .88rem;
    font-weight: 700;
    color: rgba(255,255,255,.85);
  }
  #cmOffcanvasMenu .btn-close {
    filter: invert(1) grayscale(1);
    opacity: .7;
  }
  #cmOffcanvasMenu .offcanvas-body {
    background: var(--cm-sidebar-bg, #0f172a);
    padding: 0 !important;
  }
  #cmOffcanvasMenu .cm-sidebar-footer {
    color: rgba(255,255,255,.45);
  }

  /* ── Filtros na lista: campos full-width em mobile ──────── */
  .rw-filtros .form-select,
  .rw-filtros .form-control {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* ── Inputs de hora: garantia de toque confortável ──────── */
  input[type="time"].form-control {
    min-height: 44px !important;
    font-size: 1rem !important;
    cursor: pointer;
    padding-left: 10px !important;
  }

}

/* ════════════════════════════════════════════════════════════════
   PADRÃO GLOBAL — tabelas compactas (table-sm)
   Regra explícita em td/th prevalece sobre font-size herdado
   da <table>, padronizando todos os .85rem/.83rem espalhados.
   ════════════════════════════════════════════════════════════════ */
.table.table-sm > thead > tr > th,
.table.table-sm > tbody > tr > td,
.table.table-sm > tbody > tr > th,
.table.table-sm > tfoot > tr > td {
  padding-top:    3px;
  padding-bottom: 3px;
  padding-left:   8px;
  padding-right:  8px;
  font-size:      .82rem;
  line-height:    1.3;
}

/* Botões dentro de células table-sm não inflam a linha */
.table.table-sm td .btn,
.table.table-sm th .btn {
  line-height: 1;
  vertical-align: middle;
}
