/* ============================================================
   PMO PMBCN — main.css  (layout consistente com header.php)
   ============================================================ */
:root {
  --pet:      #123C55;
  --tur:      #00A6A6;
  --bg:       #f0f2f5;
  --card:     #ffffff;
  --border:   #e0e4e8;
  --text1:    #1a1a2e;
  --text2:    #495057;
  --text3:    #6c757d;
  --sw:       240px;   /* sidebar width */
  --th:       56px;    /* topbar height */
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text1);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--tur); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══ SIDEBAR ══════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sw);
  background: var(--pet);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  transition: transform .25s ease;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
}
/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 34px; height: 34px;
  background: var(--tur);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand-icon svg { width: 20px; height: 20px; }
.sidebar-brand-text strong { font-size: .9rem; font-weight: 700; color: #fff; display: block; line-height: 1.2; }
.sidebar-brand-text span   { font-size: .68rem; color: rgba(255,255,255,.55); }
/* Nav sections */
.nav-section { padding: 14px 10px 2px; }
.nav-section-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 0 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  color: rgba(255,255,255,.72);
  font-size: .84rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: var(--tur); color: #fff; }

/* ══ TOPBAR ═══════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sw);
  right: 0;
  height: var(--th);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-left  { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: .95rem; font-weight: 600; color: var(--text1); }
.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: 6px; color: var(--text2);
  align-items: center; justify-content: center;
}
.hamburger:hover { background: var(--bg); }
.hamburger svg { width: 20px; height: 20px; display: block; }

/* User avatar + dropdown */
.user-avatar {
  width: 34px; height: 34px;
  background: var(--tur);
  color: #fff;
  border-radius: 50%;
  border: none;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.user-menu {
  display: none;
  position: absolute;
  top: 42px; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 200px;
  z-index: 300;
  overflow: hidden;
}
.user-menu.open { display: block; }
.user-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-size: .85rem;
  color: var(--text1);
  transition: background .15s;
  text-decoration: none !important;
}
.user-menu a:hover { background: var(--bg); }
.user-menu a svg { width: 15px; height: 15px; color: var(--text3); flex-shrink: 0; }

/* ══ MAIN CONTENT ════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sw);
  padding-top: var(--th);
  min-height: 100vh;
}
/* Cada página tem sua própria .page-content */
.page-content {
  padding: 28px 28px 48px 28px;
  max-width: 1400px;
  width: 100%;
}

/* ══ PAGE HEADER ═════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title    { font-size: 1.4rem; font-weight: 700; color: var(--text1); }
.page-subtitle { font-size: .86rem; color: var(--text3); margin-top: 3px; }
.page-actions  { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ══ CARDS ═══════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #fdfdfd;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.card-title { font-size: .92rem; font-weight: 600; color: var(--text1); margin: 0; }
.card-body  { padding: 20px; }
.card-footer{ padding: 12px 20px; border-top: 1px solid var(--border); background: #fdfdfd; }

/* ══ STATS ═══════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px,1fr));
  gap: 16px;
}
.stat-card {
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.stat-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); margin-bottom: 8px; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text1); line-height: 1; }

/* ══ FORMULÁRIOS ════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-row   { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }
label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 5px;
}
.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #ced4da;
  border-radius: 7px;
  font-size: .88rem;
  color: var(--text1);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  line-height: 1.4;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--tur);
  box-shadow: 0 0 0 3px rgba(0,166,166,.15);
}
.form-control[readonly], .form-control:disabled {
  background: #f5f6f8;
  color: var(--text3);
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%236c757d'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-control-sm { padding: 5px 9px; font-size: .82rem; border-radius: 6px; }
.form-text { font-size: .76rem; color: var(--text3); margin-top: 4px; }
.form-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
/* col helpers */
.col-md-2  { flex: 0 0 16.666%; max-width: 16.666%; }
.col-md-3  { flex: 0 0 25%;     max-width: 25%;     }
.col-md-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-5  { flex: 0 0 41.666%; max-width: 41.666%; }
.col-md-6  { flex: 0 0 50%;     max-width: 50%;     }
.col-md-7  { flex: 0 0 58.333%; max-width: 58.333%; }
.col-md-8  { flex: 0 0 66.666%; max-width: 66.666%; }
.col-md-9  { flex: 0 0 75%;     max-width: 75%;     }
.col-md-12 { flex: 0 0 100%;    max-width: 100%;    }

/* ══ BOTÕES ══════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: .86rem; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none !important;
  font-family: inherit;
  line-height: 1.4;
}
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 11px 22px; font-size: .95rem; }
.btn-xs { padding: 4px 10px; font-size: .76rem; border-radius: 5px; gap: 4px; }
.btn-xs i { font-size: .76rem; }
.btn-primary         { background: var(--pet); color: #fff; border-color: var(--pet); }
.btn-primary:hover   { background: #0d2d40;    color: #fff; }
.btn-success         { background: #27ae60;    color: #fff; border-color: #27ae60; }
.btn-success:hover   { background: #219653;    color: #fff; }
.btn-danger          { background: #e74c3c;    color: #fff; border-color: #e74c3c; }
.btn-danger:hover    { background: #c0392b;    color: #fff; }
.btn-warning         { background: #f39c12;    color: #fff; border-color: #f39c12; }
.btn-warning:hover   { background: #d68910;    color: #fff; }
.btn-info            { background: #2980b9;    color: #fff; border-color: #2980b9; }
.btn-info:hover      { background: #2471a3;    color: #fff; }
.btn-secondary       { background: #6c757d;    color: #fff; border-color: #6c757d; }
.btn-secondary:hover { background: #5a6268;    color: #fff; }
.btn-outline-primary   { background: transparent; color: var(--pet); border-color: var(--pet); }
.btn-outline-primary:hover   { background: var(--pet); color: #fff; }
.btn-outline-success   { background: transparent; color: #27ae60; border-color: #27ae60; }
.btn-outline-success:hover   { background: #27ae60; color: #fff; }
.btn-outline-danger    { background: transparent; color: #e74c3c; border-color: #e74c3c; }
.btn-outline-danger:hover    { background: #e74c3c; color: #fff; }
.btn-outline-secondary { background: transparent; color: var(--text2); border-color: #ced4da; }
.btn-outline-secondary:hover { background: #f5f6f8; color: var(--text1); }
.btn-outline-info      { background: transparent; color: #2980b9; border-color: #2980b9; }
.btn-outline-info:hover      { background: #2980b9; color: #fff; }
.btn-outline-light     { background: transparent; color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.4); }
.btn-outline-light:hover     { background: rgba(255,255,255,.1); color: #fff; }

/* ══ TABELAS ════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  color: var(--text1);
  background: #fff;
}
.table th {
  padding: 10px 14px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #fff;                  /* TEXTO BRANCO */
  background: var(--pet);       /* FUNDO AZUL ESCURO */
  border-bottom: none;
  white-space: nowrap;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f2f5;
  color: var(--text1);          /* TEXTO ESCURO nas células */
  vertical-align: middle;
  background: #fff;             /* FUNDO BRANCO nas células */
}
.table-hover tbody tr:hover td { background: #f7fbfd; }
.table-sm th, .table-sm td { padding: 7px 10px; }
.table-bordered td, .table-bordered th { border: 1px solid var(--border); }
.table-active td { background: #eef5fb !important; font-weight: 700; }
.thead-light th { background: #f1f3f5 !important; color: var(--text2) !important; }
.thead-dark  th { background: #343a40 !important; color: #fff !important; }

/* ══ BADGES ═════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .73rem; font-weight: 700;
  white-space: nowrap;
  line-height: 1.4;
}
/* Texto escuro em badges claros, branco em badges escuros */
.badge-success   { background: #d4edda; color: #155724; }
.badge-warning   { background: #fff3cd; color: #7d5a00; }
.badge-danger    { background: #f8d7da; color: #721c24; }
.badge-info      { background: #d1ecf1; color: #0c5460; }
.badge-primary   { background: #cfe2ff; color: #084298; }
.badge-secondary { background: #e9ecef; color: #41464b; }
.badge-dark      { background: #d3d3d4; color: #141619; }
.badge-light     { background: #fefefe; color: #636464; border: 1px solid #dee2e6; }

/* ══ ALERTAS ════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
  color: var(--text1); /* garante legibilidade */
}
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning { background: #fff3cd; color: #7d5a00; border-color: #ffeeba; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

/* ══ MODAL ══════════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.open { display: flex; }
.modal-dialog {
  background: var(--card);
  border-radius: 12px;
  width: 100%; max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header  { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title   { font-size: 1rem; font-weight: 700; color: var(--text1); }
.modal-close   { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text3); line-height: 1; }
.modal-body    { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer  { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ══ TABS ═══════════════════════════════════════════════════ */
.nav-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  list-style: none;
}
.nav-tabs .nav-item { list-style: none; }
.nav-tabs .nav-link {
  display: block;
  padding: 8px 16px;
  font-size: .85rem; font-weight: 600;
  color: var(--text3);
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
  text-decoration: none !important;
  cursor: pointer;
}
.nav-tabs .nav-link:hover { color: var(--pet); }
.nav-tabs .nav-link.active { color: var(--pet); border-bottom-color: var(--tur); background: rgba(0,166,166,.05); }

/* ══ PAGINATION ═════════════════════════════════════════════ */
.pagination { display: flex; gap: 4px; list-style: none; flex-wrap: wrap; }
.page-item .page-link {
  padding: 6px 12px; border: 1px solid var(--border);
  border-radius: 6px; color: var(--pet); font-size: .84rem;
  background: #fff; text-decoration: none; transition: all .15s; cursor: pointer;
}
.page-item.active .page-link { background: var(--pet); color: #fff; border-color: var(--pet); }
.page-item .page-link:hover { background: var(--bg); }

/* ══ LISTAS ═════════════════════════════════════════════════ */
.list-group { list-style: none; }
.list-group-item { padding: 10px 16px; border-bottom: 1px solid var(--border); background: #fff; color: var(--text1); font-size: .86rem; }
.list-group-item:last-child { border-bottom: none; }
.list-group-flush .list-group-item { border-left: none; border-right: none; border-radius: 0; }
.list-group-item-success { background: #f0faf4 !important; color: #155724 !important; }
.list-group-item-info    { background: #e8f4fd !important; color: #0c5460 !important; }
.list-group-item-danger  { background: #fdf3f3 !important; color: #721c24 !important; }
.list-group-item-warning { background: #fffbf0 !important; color: #7d5a00 !important; }

/* ══ CUSTOM CONTROLS ════════════════════════════════════════ */
.custom-control { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.custom-control-input { width: 16px; height: 16px; cursor: pointer; }
.custom-control-label { font-size: .88rem; color: var(--text2); cursor: pointer; font-weight: 400; }
.custom-file-input { display: none; }
.custom-file-label {
  display: block; padding: 8px 12px;
  border: 1px dashed #ced4da; border-radius: 7px;
  cursor: pointer; font-size: .86rem; color: var(--text3); background: #fafafa;
}
.custom-file-label:hover { border-color: var(--tur); }

/* ══ UTILITIES ══════════════════════════════════════════════ */
.d-flex    { display: flex !important; }
.d-block   { display: block !important; }
.d-none    { display: none !important; }
.d-grid    { display: grid !important; }
.align-items-center  { align-items: center !important; }
.align-items-start   { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-2     { gap: .5rem !important; }
.gap-3     { gap: 1rem !important; }
.font-weight-bold { font-weight: 700 !important; }
.text-center   { text-align: center !important; }
.text-right    { text-align: right !important; }
.text-muted    { color: var(--text3) !important; }
.text-dark     { color: var(--text1) !important; }
.text-white    { color: #fff !important; }
.text-primary  { color: var(--pet) !important; }
.text-success  { color: #27ae60 !important; }
.text-danger   { color: #e74c3c !important; }
.text-warning  { color: #d68910 !important; }
.text-info     { color: #2980b9 !important; }
.text-nowrap   { white-space: nowrap !important; }
.small         { font-size: .82rem !important; }
.w-100         { width: 100% !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.ml-1 { margin-left: .25rem; } .ml-2 { margin-left: .5rem; } .ml-3 { margin-left: 1rem; }
.mr-1 { margin-right: .25rem; } .mr-2 { margin-right: .5rem; } .mr-3 { margin-right: 1rem; }
.p-0  { padding: 0 !important; }
.py-1 { padding-top:.25rem !important; padding-bottom:.25rem !important; }
.py-2 { padding-top:.5rem !important;  padding-bottom:.5rem !important;  }
.py-3 { padding-top:1rem !important;   padding-bottom:1rem !important;   }
.py-4 { padding-top:1.5rem !important; padding-bottom:1.5rem !important; }
.py-5 { padding-top:3rem !important;   padding-bottom:3rem !important;   }
.px-2 { padding-left:.5rem !important; padding-right:.5rem !important;   }
.px-3 { padding-left:1rem !important;  padding-right:1rem !important;    }
.border-left-success { border-left:4px solid #27ae60 !important; }
.border-left-warning { border-left:4px solid #f39c12 !important; }
.border-left-danger  { border-left:4px solid #e74c3c !important; }
.border-left-primary { border-left:4px solid var(--pet) !important; }
.border-success { border-color:#27ae60 !important; }
.border-warning { border-color:#f39c12 !important; }
.border-danger  { border-color:#e74c3c !important; }
.bg-light  { background:#f8f9fa !important; color:var(--text1) !important; }
.bg-white  { background:#fff !important; }
.rounded   { border-radius:8px !important; }
.shadow    { box-shadow:0 4px 16px rgba(0,0,0,.1) !important; }
/* Row grid */
.row { display:flex; flex-wrap:wrap; margin:0 -10px; }
.row>[class*=col-] { padding:0 10px; }
.col-12 { flex:0 0 100%; max-width:100%; }
.col-6  { flex:0 0 50%;  max-width:50%;  }
.col-4  { flex:0 0 33.333%; max-width:33.333%; }

/* Form inline */
.form-inline { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; }
.form-inline .form-group { margin-bottom:0; }


/* ══ BOTÕES DE AÇÃO NAS TABELAS ════════════════════════════ */
.action-btns { display: flex; gap: 5px; align-items: center; flex-wrap: nowrap; }
.action-btns form { margin: 0; display: inline-flex; }
/* ══ FOOTER ═════════════════════════════════════════════════ */
.main-footer {
  text-align: center;
  padding: 16px 24px;
  font-size: .76rem;
  color: var(--text3);
  border-top: 1px solid var(--border);
  background: var(--card);
  margin-top: 40px;
}

/* ══ RESPONSIVO ══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .topbar { left: 0; padding: 0 16px; }
  .hamburger { display: flex; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .form-row { flex-direction: column; gap: 0; }
  .col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,
  .col-md-7,.col-md-8,.col-md-9 { flex:0 0 100%; max-width:100%; }
  .row>[class*=col-] { flex:0 0 100%; max-width:100%; margin-bottom:16px; }
  .page-header { flex-direction: column; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-actions .btn { flex:1; justify-content:center; }
}

/* Hotfix menu/header v10 - evita SVGs gigantes quando há cache ou conflito de CSS */
.sidebar-brand-icon{width:34px!important;height:34px!important;min-width:34px!important;max-width:34px!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;}
.sidebar-brand-icon svg{width:20px!important;height:20px!important;min-width:20px!important;max-width:20px!important;display:block!important;}
.nav-item svg{width:16px!important;height:16px!important;min-width:16px!important;max-width:16px!important;display:inline-block!important;flex-shrink:0!important;}
.user-menu{min-width:220px!important;max-width:280px!important;width:max-content!important;}
.user-menu a{display:flex!important;align-items:center!important;gap:8px!important;}
.user-menu a svg{width:15px!important;height:15px!important;min-width:15px!important;max-width:15px!important;display:inline-block!important;flex-shrink:0!important;}
.hamburger svg{width:20px!important;height:20px!important;min-width:20px!important;max-width:20px!important;display:block!important;}

/* ══ COMPATIBILIDADE VISUAL — MÓDULOS ADMIN / APIs / SEGURANÇA ═══════════ */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text1);
}
.section-desc {
  font-size: .86rem;
  color: var(--text3);
  margin-top: 3px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.kpi-card {
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.kpi-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text3);
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text1);
  line-height: 1;
}
.card-subtitle {
  font-size: .78rem;
  color: var(--text3);
  margin-top: 3px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.tab {
  display: block;
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text3);
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, background .15s;
  text-decoration: none !important;
}
.tab:hover { color: var(--pet); }
.tab.active {
  color: var(--pet);
  border-bottom-color: var(--tur);
  background: rgba(0,166,166,.05);
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  color: var(--text1);
  background: #fff;
}
.table-wrap table th {
  padding: 10px 14px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #fff;
  background: var(--pet);
  border-bottom: none;
  white-space: nowrap;
}
.table-wrap table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table-wrap table tbody tr:hover { background: #f8fbfc; }
.btn-outline, .btn-ghost {
  background: transparent;
  color: var(--pet);
  border-color: #ced4da;
}
.btn-outline:hover, .btn-ghost:hover {
  background: #f5f6f8;
  color: var(--text1);
}

/* ══ KANBAN PMO — Pendências e Planos de Ação ═════════════════════════════ */
.kanban-dashboard-card .card-body { padding: 14px; }
.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.kanban-board-pendencias,
.kanban-board-acoes {
  grid-auto-columns: minmax(300px, 1fr);
}
.kanban-board-dashboard {
  grid-auto-columns: minmax(245px, 1fr);
}
.kanban-column {
  background: #f7f9fb;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kanban-column-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.kanban-column-header h3 {
  font-size: .88rem;
  color: var(--text1);
  margin: 0;
  font-weight: 700;
}
.kanban-column-header p {
  margin: 2px 0 0;
  font-size: .72rem;
  color: var(--text3);
}
.kanban-count {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--pet);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: 0 8px;
}
.kanban-count-success { background: #27ae60; }
.kanban-count-warning { background: #f39c12; }
.kanban-count-danger { background: #e74c3c; }
.kanban-count-info { background: #2980b9; }
.kanban-count-secondary { background: #6c757d; }
.kanban-column-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kanban-card {
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 13px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
}
.kanban-card-primary { border-left: 4px solid var(--pet); }
.kanban-card-info { border-left: 4px solid #2980b9; }
.kanban-card-warning { border-left: 4px solid #f39c12; }
.kanban-card-danger { border-left: 4px solid #e74c3c; }
.kanban-card-success { border-left: 4px solid #27ae60; }
.kanban-action-card { border-left: 4px solid var(--tur); }
.kanban-card-title {
  font-size: .9rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text1);
  margin-bottom: 6px;
}
.kanban-card-title a { color: var(--text1); text-decoration: none !important; }
.kanban-card-title a:hover { color: var(--tur); }
.kanban-card-project {
  font-size: .78rem;
  font-weight: 600;
  margin: -2px 0 6px;
}
.kanban-card-project a { color: var(--pet); text-decoration: none !important; }
.kanban-card-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.kanban-card-meta span {
  background: #f0f3f7;
  color: var(--text3);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: .68rem;
  font-weight: 600;
}
.kanban-card-owner {
  color: var(--text3);
  font-size: .76rem;
  margin-bottom: 8px;
}
.kanban-card-list {
  margin: 0 0 10px 0;
  padding-left: 16px;
  color: var(--text2);
  font-size: .78rem;
}
.kanban-card-list li { margin: 2px 0; }
.kanban-card-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 7px 0 8px;
}
.kanban-empty {
  border: 1px dashed #cbd4de;
  border-radius: 12px;
  padding: 16px;
  color: var(--text3);
  background: rgba(255,255,255,.65);
  font-size: .82rem;
  text-align: center;
}
.kanban-empty-success {
  border-color: #b7e0c4;
  background: #f0faf4;
  color: #155724;
  font-weight: 600;
}
.kanban-more {
  display: block;
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed var(--border);
  color: var(--pet);
  font-weight: 700;
  font-size: .78rem;
  text-decoration: none !important;
}
.kanban-more:hover { background: #f0f7f7; color: var(--tur); }

@media (max-width: 900px) {
  .kanban-board,
  .kanban-board-pendencias,
  .kanban-board-acoes,
  .kanban-board-dashboard {
    grid-auto-columns: minmax(260px, 86vw);
  }
}

/* ============================================================
   Monitoramento & Controle
   ============================================================ */
.mon-page .page-header { align-items: flex-start; gap: 16px; }
.mon-filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mon-filter-form select {
  min-width: 280px;
  max-width: 520px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text1);
  padding: 0 12px;
  font-size: .84rem;
  outline: none;
}
.mon-filter-form select:focus { border-color: var(--tur); box-shadow: 0 0 0 3px rgba(0,166,166,.12); }
.mon-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.mon-summary-strip > div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.mon-summary-strip span { display: block; color: var(--text3); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.mon-summary-strip strong { font-size: 1.08rem; color: var(--text1); }
.mon-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.mon-metric-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 3px 12px rgba(0,0,0,.055);
  border-top: 4px solid var(--tur);
}
.mon-metric-danger { border-top-color: #e74c3c; }
.mon-metric-warning { border-top-color: #f39c12; }
.mon-metric-success { border-top-color: #27ae60; }
.mon-metric-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.mon-metric-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #eef6f6; font-size: 1.15rem;
}
.mon-metric-title { font-weight: 800; color: var(--text1); font-size: .95rem; }
.mon-metric-subtitle { color: var(--text3); font-weight: 700; font-size: .75rem; }
.mon-gauge-wrap { display: flex; flex-direction: column; align-items: center; margin: 8px 0 10px; }
.mon-gauge-face {
  position: relative;
  width: 176px;
  height: 88px;
  border-radius: 176px 176px 0 0;
  overflow: hidden;
  background: conic-gradient(from 270deg at 50% 100%, #e74c3c 0deg 62deg, #f2c94c 62deg 126deg, #27ae60 126deg 180deg, transparent 180deg 360deg);
}
.mon-gauge-face::after {
  content: '';
  position: absolute; left: 24px; right: 24px; bottom: 0;
  height: 64px;
  border-radius: 128px 128px 0 0;
  background: #fff;
}
.mon-gauge-needle {
  position: absolute;
  left: 50%; bottom: 0;
  width: 3px; height: 72px;
  background: #202b3c;
  border-radius: 999px;
  transform-origin: bottom center;
  z-index: 3;
  transition: transform .35s ease;
}
.mon-gauge-center {
  position: absolute;
  left: 50%; bottom: -6px;
  width: 18px; height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: #aab2bd;
  border: 4px solid #fff;
  z-index: 4;
}
.mon-gauge-value { margin-top: -4px; font-size: 1.8rem; line-height: 1; font-weight: 800; color: var(--text1); }
.mon-gauge-value small { font-size: .8rem; margin-left: 2px; color: var(--text3); }
.mon-metric-desc { font-size: .78rem; color: var(--text3); line-height: 1.35; margin: 0; text-align: center; }
.mon-progress-card, .mon-control-card, .mon-rules-card { margin-bottom: 18px; }
.mon-line-chart { width: 100%; overflow-x: auto; }
.mon-line-chart svg { width: 100%; min-width: 620px; height: auto; display: block; }
.mon-line-chart .axis { stroke: #cbd5df; stroke-width: 1.2; }
.mon-line-chart .gridline { stroke: #edf1f5; stroke-width: 1; }
.mon-line-chart .tick-label, .mon-line-chart .x-label { fill: var(--text3); font-size: 12px; font-weight: 600; }
.mon-line-chart polyline { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.mon-line-chart .line-plan { stroke: #a8b1bc; stroke-dasharray: 7 7; }
.mon-line-chart .line-real { stroke: var(--tur); }
.mon-line-chart .dot-plan { fill: #a8b1bc; stroke: #fff; stroke-width: 2; }
.mon-line-chart .dot-real { fill: var(--tur); stroke: #fff; stroke-width: 2; }
.mon-chart-legend { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 6px; color: var(--text3); font-size: .78rem; font-weight: 700; flex-wrap: wrap; }
.mon-chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 999px; margin-right: 5px; vertical-align: -1px; }
.mon-chart-legend .plan { background: #a8b1bc; }
.mon-chart-legend .real { background: var(--tur); }
.mon-dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.mon-chart-card .card-body { min-height: 244px; }
.mon-pie-layout { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 16px; }
.mon-pie {
  position: relative;
  width: 154px; height: 154px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
.mon-pie::after {
  content: '';
  position: absolute; inset: 36px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0,0,0,.05);
}
.mon-pie span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--text1); z-index: 2;
}
.mon-pie-legend { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mon-legend-row { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; gap: 8px; align-items: center; font-size: .77rem; color: var(--text2); }
.mon-legend-row i { width: 10px; height: 10px; border-radius: 3px; }
.mon-legend-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-legend-row strong { font-weight: 800; color: var(--text1); }
.mon-empty-chart { min-height: 176px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text3); border: 1px dashed #cbd4de; border-radius: 12px; background: #fafbfc; padding: 16px; font-size: .84rem; }
.mon-stacked-bars { display: flex; flex-direction: column; gap: 10px; }
.mon-stacked-head { display: grid; grid-template-columns: minmax(120px, 1fr) 44px 50px 44px; color: var(--text3); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.mon-stacked-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr) 70px; gap: 8px; align-items: center; }
.mon-stacked-label { font-size: .78rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-stacked-track { height: 18px; border-radius: 999px; overflow: hidden; background: #edf1f5; display: flex; }
.mon-stacked-track span { height: 100%; display: block; min-width: 0; }
.mon-stacked-counts { color: var(--text3); font-size: .72rem; font-weight: 800; text-align: right; }
.risk-high { background: #e74c3c; }
.risk-medium { background: #f2c94c; }
.risk-low { background: #27ae60; }
.mon-chart-legend.compact { justify-content: flex-start; margin-top: 8px; gap: 12px; }
.mon-small-gauge-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.mon-small-gauge { text-align: center; border: 1px solid var(--border); border-radius: 14px; padding: 14px 10px; background: #fff; }
.mon-small-gauge-face {
  position: relative; margin: 0 auto 4px;
  width: 142px; height: 71px;
  border-radius: 142px 142px 0 0;
  overflow: hidden;
  background: conic-gradient(from 270deg at 50% 100%, #e74c3c 0deg 62deg, #f2c94c 62deg 126deg, #27ae60 126deg 180deg, transparent 180deg 360deg);
}
.mon-small-danger .mon-small-gauge-face, .mon-small-warning .mon-small-gauge-face, .mon-small-success .mon-small-gauge-face { }
.mon-small-gauge-face::after { content:''; position:absolute; left:20px; right:20px; bottom:0; height:50px; border-radius:100px 100px 0 0; background:#fff; }
.mon-small-gauge-needle { position:absolute; left:50%; bottom:0; width:3px; height:58px; background:#202b3c; border-radius:99px; transform-origin: bottom center; z-index:3; }
.mon-small-gauge-center { position:absolute; left:50%; bottom:-5px; width:15px; height:15px; margin-left:-7.5px; border-radius:50%; background:#aab2bd; border:3px solid #fff; z-index:4; }
.mon-small-gauge-value { font-size: 1.35rem; font-weight: 850; color: var(--text1); line-height: 1; }
.mon-small-gauge-title { font-size:.94rem; font-weight: 800; color: var(--text1); margin-top: 4px; }
.mon-small-gauge-caption { font-size:.72rem; color: var(--text3); }
.mon-buckets-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.mon-bucket-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: #fafbfc; }
.mon-bucket-card h4 { font-size: .86rem; margin: 0 0 10px; color: var(--text1); }
.mon-bucket-row { display: grid; grid-template-columns: 72px minmax(0,1fr) 28px; gap: 8px; align-items: center; margin: 8px 0; }
.mon-bucket-row span { font-size: .72rem; color: var(--text3); font-weight: 700; }
.mon-bucket-row strong { font-size: .78rem; color: var(--text1); text-align: right; }
.mon-bucket-track { height: 8px; background: #e6ebf0; border-radius: 99px; overflow: hidden; }
.mon-bucket-fill { height: 100%; border-radius: 99px; background: var(--tur); }
.mon-bucket-critico, .mon-bucket-atrasado, .mon-bucket-baixo, .mon-bucket-alto { background: #e74c3c; }
.mon-bucket-atencao, .mon-bucket-medio { background: #f2c94c; }
.mon-bucket-adequado, .mon-bucket-no_prazo { background: #27ae60; }
.mon-rules-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.mon-rules-grid div { background: #fafbfc; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.mon-rules-grid strong { display:block; color: var(--text1); margin-bottom: 4px; }
.mon-rules-grid span { color: var(--text3); font-size: .78rem; line-height: 1.35; }
@media (max-width: 1200px) {
  .mon-metrics-grid, .mon-small-gauge-grid, .mon-buckets-grid, .mon-rules-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mon-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .mon-summary-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mon-pie-layout { grid-template-columns: 1fr; justify-items: center; }
  .mon-pie-legend { width: 100%; }
}
@media (max-width: 640px) {
  .mon-metrics-grid, .mon-small-gauge-grid, .mon-buckets-grid, .mon-rules-grid, .mon-summary-strip { grid-template-columns: 1fr; }
  .mon-filter-form select { min-width: 100%; max-width: 100%; }
  .mon-stacked-row { grid-template-columns: 1fr; gap: 4px; }
  .mon-stacked-counts { text-align: left; }
}


/* ══ HOTFIX KANBAN FULL PAGE — sem rolagem horizontal ═════════════════ */
.kanban-full-page {
  max-width: none;
  width: 100%;
  overflow-x: hidden;
}
.kanban-full-page .kanban-board,
.kanban-full-page .kanban-board-pendencias,
.kanban-full-page .kanban-board-acoes {
  display: grid;
  grid-auto-flow: row;
  grid-auto-columns: initial;
  width: 100%;
  max-width: 100%;
  gap: 12px;
  overflow-x: hidden;
  padding-bottom: 0;
  scrollbar-width: none;
}
.kanban-full-page .kanban-board::-webkit-scrollbar,
.kanban-full-page .kanban-board-pendencias::-webkit-scrollbar,
.kanban-full-page .kanban-board-acoes::-webkit-scrollbar { display: none; }
.kanban-full-page .kanban-board-pendencias {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.kanban-full-page .kanban-board-acoes {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.kanban-full-page .kanban-column {
  min-width: 0;
  width: 100%;
  min-height: 0;
}
.kanban-full-page .kanban-column-header {
  padding: 11px 10px 9px;
  min-width: 0;
}
.kanban-full-page .kanban-column-header > div,
.kanban-full-page .kanban-column-header h3,
.kanban-full-page .kanban-column-header p {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-full-page .kanban-count { flex-shrink: 0; }
.kanban-full-page .kanban-column-body {
  max-height: calc(100vh - 365px);
  min-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  gap: 9px;
}
.kanban-full-page .kanban-card {
  min-width: 0;
  max-width: 100%;
  padding: 10px;
}
.kanban-full-page .kanban-card-title,
.kanban-full-page .kanban-card-project,
.kanban-full-page .kanban-card-owner,
.kanban-full-page .kanban-card-list,
.kanban-full-page .kanban-card-list li {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}
.kanban-full-page .kanban-card-title { font-size: .84rem; }
.kanban-full-page .kanban-card-list { font-size: .74rem; }
.kanban-full-page .kanban-card-meta span,
.kanban-full-page .kanban-card-chips span,
.kanban-full-page .badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.kanban-full-page .kanban-card .btn,
.kanban-full-page .kanban-card a.btn {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  line-height: 1.2;
  padding-left: 8px;
  padding-right: 8px;
}

@media (max-width: 1500px) {
  .kanban-full-page .kanban-board-pendencias { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kanban-full-page .kanban-board-acoes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kanban-full-page .kanban-column-body { max-height: none; min-height: 260px; }
}
@media (max-width: 980px) {
  .kanban-full-page .kanban-board-pendencias,
  .kanban-full-page .kanban-board-acoes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .kanban-full-page { padding-left: 16px; padding-right: 16px; }
  .kanban-full-page .kanban-board-pendencias,
  .kanban-full-page .kanban-board-acoes { grid-template-columns: 1fr; }
}

/* ══ HOTFIX GLOBAL DE LARGURA E RESPONSIVIDADE — v12 ═════════════════════
   Objetivo: todas as páginas internas ocuparem a mesma largura útil do
   Kanban Pendências, sem sobra artificial à direita e com melhor adaptação
   para tablets e smartphones. */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.main-content {
  width: calc(100% - var(--sw));
  max-width: calc(100% - var(--sw));
  overflow-x: hidden;
}
.page-content {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  overflow-x: hidden;
}
.page-content > * {
  max-width: 100%;
}
.card,
.stat-card,
.kpi-card,
.table-responsive,
.table-wrap,
.mon-page,
.api-page,
.kanban-full-page,
.stats-grid,
.grid-4,
.row,
.form-row,
.page-header,
.section-header {
  min-width: 0;
  max-width: 100%;
}
.card-body,
.card-header,
.card-footer {
  min-width: 0;
}
.table-responsive,
.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}
.table-responsive table,
.table-wrap table,
table.table {
  max-width: 100%;
}

/* Listagem de projetos e painéis com tabelas largas: mantém a página cheia,
   mas a rolagem, quando inevitável, fica restrita à tabela e não à página. */
.page-content .card:has(.table-responsive),
.page-content .card:has(.table-wrap) {
  width: 100%;
}
.action-btns {
  flex-wrap: wrap;
}

/* Monitoramento & Controle: ocupa toda a largura útil e quebra os blocos
   antes de gerar barra horizontal. */
.mon-page {
  max-width: none !important;
  width: 100% !important;
}
.mon-page .card,
.mon-summary-strip,
.mon-metrics-grid,
.mon-dashboard-grid,
.mon-small-gauge-grid,
.mon-buckets-grid,
.mon-rules-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.mon-line-chart {
  max-width: 100%;
}
.mon-line-chart svg {
  min-width: 0;
}

/* Kanbans: preserva o comportamento sem barra horizontal. */
.kanban-full-page {
  max-width: none !important;
  width: 100% !important;
  padding-left: 28px;
  padding-right: 28px;
}

@media (max-width: 1200px) {
  .page-content { padding: 22px 20px 40px; }
  .stats-grid,
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .main-content {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }
  .page-content,
  .kanban-full-page {
    padding: 18px 16px 36px !important;
  }
  .topbar {
    width: 100%;
    max-width: 100%;
  }
  .page-header,
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-actions,
  .mon-filter-form {
    width: 100%;
  }
  .page-actions .btn,
  .mon-filter-form .btn,
  .mon-filter-form select,
  .form-control,
  select.form-control,
  input.form-control {
    max-width: 100%;
  }
  .table-responsive,
  .table-wrap {
    border-radius: 10px;
  }
}

@media (max-width: 640px) {
  .page-content,
  .kanban-full-page {
    padding: 14px 12px 32px !important;
  }
  .stats-grid,
  .grid-4,
  .mon-summary-strip,
  .mon-metrics-grid,
  .mon-dashboard-grid,
  .mon-small-gauge-grid,
  .mon-buckets-grid,
  .mon-rules-grid {
    grid-template-columns: 1fr !important;
  }
  .card-header,
  .card-body,
  .card-footer {
    padding-left: 14px;
    padding-right: 14px;
  }
  .btn {
    white-space: normal;
    justify-content: center;
  }
  .page-actions .btn,
  .form-actions .btn {
    width: 100%;
  }
  .table th,
  .table td,
  .table-wrap table th,
  .table-wrap table td {
    padding: 9px 10px;
  }
}
