body.cm-1-navbar,
body.cm-login {
  min-height: 100vh;
  background: #eaf1f6;
  color: #263238;
}

:root {
  --p2p-radius-sm: 10px;
  --p2p-radius: 14px;
  --p2p-radius-lg: 18px;
  --p2p-panel: #ffffff;
  --p2p-border: #d8e3ec;
}

#global {
  background: #eaf1f6;
  padding-bottom: 0;
}

.container-fluid > .panel,
.panel {
  border: 1px solid #d8e3ec;
  border-radius: var(--p2p-radius);
  box-shadow: 0 8px 18px rgba(44, 62, 80, .06);
  overflow: hidden;
}

.container-fluid > .panel:first-child {
  margin-top: 24px;
}

.panel-body {
  border-radius: var(--p2p-radius);
  padding: 26px;
}

.panel-heading {
  border-radius: var(--p2p-radius) var(--p2p-radius) 0 0;
}

.cm-container-white,
.alert,
.popover,
.modal-content,
.dropdown-menu,
.pagination,
.list-group-item {
  border-radius: 8px;
}

.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
select,
textarea {
  border: 1px solid #ccd8e2;
  border-radius: var(--p2p-radius-sm);
  box-shadow: none;
  min-height: 38px;
  padding: 8px 12px;
}

.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, .16);
  outline: none;
}

.btn,
button,
input[type="button"],
input[type="submit"] {
  border-radius: 8px;
  box-shadow: none;
}

.btn-primary {
  background-color: #2f99d4;
  border-color: #2587c7;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #2587c7;
  border-color: #1f78b1;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

.table,
table:not(.ui-datepicker-calendar) {
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: #263238;
}

table th:first-child {
  border-top-left-radius: 8px;
}

table th:last-child {
  border-top-right-radius: 8px;
}

td,
th {
  border-color: #dce5ec !important;
}

.table > thead > tr > th,
table:not(.ui-datepicker-calendar) th {
  background: #edf5fb;
  color: #263238;
  font-weight: 700;
}

.table > tbody > tr > td,
table:not(.ui-datepicker-calendar) td {
  background: #fff;
  color: #263238;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
  background: #f7fbfe;
}

.text-muted,
small,
code {
  color: #64717d;
}

code {
  background: #eef5fa;
  border: 1px solid #d8e3ec;
  border-radius: 5px;
  padding: 2px 5px;
}

#cm-menu {
  background: #e5f1fa;
  box-shadow: none;
}

#cm-menu-content {
  border-right-color: #cfe0eb;
  background: #e5f1fa;
  top: 50px;
  height: auto;
  bottom: 0;
}

#cm-menu-scroller,
#cm-menu-items-wrapper {
  background: #e5f1fa;
}

#cm-menu-scroller {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 84px;
  scrollbar-color: rgba(148, 171, 188, .72) transparent;
  scrollbar-width: thin;
}

#cm-menu #cm-menu-scroller::-webkit-scrollbar {
  display: block;
  width: 8px;
}

#cm-menu #cm-menu-scroller::-webkit-scrollbar-track {
  background: transparent;
}

#cm-menu #cm-menu-scroller::-webkit-scrollbar-thumb {
  background: rgba(148, 171, 188, .72);
  border-radius: 999px;
}

.cm-menu-items:after {
  background: #e5f1fa;
  height: 40px;
}

.cm-menu-items li.menu-section {
  margin: 12px 18px 4px;
  padding: 0;
  list-style: none;
}

.cm-menu-items li.menu-section span {
  display: block;
  color: #6f8290;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.cm-menu-items li a {
  margin: 4px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, .38);
  box-shadow: none;
  color: #33424c;
  min-height: 38px;
  line-height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cm-menu-items li a:hover {
  background-color: rgba(255, 255, 255, .72);
  border-color: #c7dfef;
  color: #263238;
}

.cm-menu-items li.current a,
.cm-menu-items li.active.current a {
  background-color: rgba(255, 255, 255, .62);
  border-color: #c7dfef;
  box-shadow: inset 4px 0 0 #3498db, 0 8px 18px rgba(52, 152, 219, .12);
  color: #163447;
  font-weight: 800;
}

.cm-menu-items li.current a {
  position: relative;
}

.menu-current-mark {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 9px;
  height: 9px;
  margin-top: -4px;
  border-radius: 50%;
  background: #3498db;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, .18);
}

.cm-navbar,
.cm-navbar > .btn,
.cm-navbar > * > .btn,
.cm-navbar .dropdown > .btn {
  border-radius: 0;
}

.painel-theme-toggle {
  position: fixed;
  top: 0;
  right: 58px;
  z-index: 5000;
  display: block;
  width: 42px;
  min-width: 42px;
  height: 50px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .18);
  border-right: 1px solid rgba(255, 255, 255, .12);
  background: transparent;
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  line-height: 50px;
  text-align: center;
  letter-spacing: 0;
}

.painel-theme-toggle:hover,
.painel-theme-toggle:focus {
  background: rgba(255, 255, 255, .12);
  outline: none;
}

.painel-theme-toggle-login {
  top: 14px;
  right: 14px;
  height: 42px;
  width: 42px;
  min-width: 42px;
  line-height: 42px;
  border-radius: 8px;
  background: #2f99d4;
}

#showPassword {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #c7d5df;
  background: #f7fafc;
  color: #34495e;
  font-weight: 700;
}

#showPassword:hover,
#showPassword:focus {
  background: #eef5fa;
  border-color: #9fc5dc;
  color: #263238;
}

.theme-icon {
  display: inline-block;
  line-height: 1;
}

.cm-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 6px 10px;
  color: #fff;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.cm-logo img {
  max-width: 180px;
  max-height: 42px;
  object-fit: contain;
}

.cm-logo span {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cm-footer {
  background: #eaf1f6;
  border-top: 1px solid #d4dee7;
  color: #687682;
  position: static !important;
  bottom: auto !important;
  clear: both;
  padding: 0 20px;
  font-size: 13px;
  line-height: 40px;
  min-height: 40px;
  text-align: center;
}

.cm-footer .pull-right {
  display: block;
  float: none !important;
  margin: 0;
  text-align: center;
}

@media (min-width: 992px) {
  .cm-footer {
    left: 0;
  }

  body.cm-menu-toggled .cm-footer {
    left: 0;
  }

  body.cm-menu-toggled #cm-menu-content,
  body.cm-menu-toggled #cm-menu-scroller,
  body.cm-menu-toggled #cm-menu-items-wrapper {
    overflow: hidden;
  }

  body.cm-menu-toggled .cm-menu-items li a {
    width: 40px;
    height: 44px;
    min-width: 40px;
    margin: 6px 5px;
    padding: 0;
    border-color: transparent;
    border-radius: var(--p2p-radius-sm);
    background-position: center center;
    background-size: 24px 24px;
    color: transparent;
    line-height: 44px;
    text-indent: -9999px;
    box-shadow: none;
  }

  body.cm-menu-toggled .cm-menu-items li a:hover,
  body.cm-menu-toggled .cm-menu-items li.current a,
  body.cm-menu-toggled .cm-menu-items li.active.current a {
    background-color: rgba(255, 255, 255, .18);
    border-color: transparent;
    box-shadow: inset 3px 0 0 #3498db;
  }

  body.cm-menu-toggled .menu-current-mark {
    display: none;
  }

  html.theme-dark body.cm-menu-toggled .cm-menu-items li a:hover,
  html.theme-dark body.cm-menu-toggled .cm-menu-items li.current a,
  html.theme-dark body.cm-menu-toggled .cm-menu-items li.active.current a {
    background-color: rgba(255, 255, 255, .075);
    box-shadow: inset 3px 0 0 #4db1e8;
  }
}

body.cm-login .text-center {
  background: #f8fbfd !important;
  border-bottom: 1px solid #d8e3ec !important;
  box-shadow: 0 4px 18px rgba(44, 62, 80, .06);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 16px;
  background: linear-gradient(135deg, #eaf1f6 0%, #d8ecf8 45%, #f7fbfe 100%);
}

.login-card {
  width: 100%;
  max-width: 410px;
  padding: 30px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #d8e3ec;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(35, 56, 72, .16);
}

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.login-brand img {
  max-width: 180px;
  max-height: 92px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 14px;
}

.login-brand h1 {
  margin: 0;
  color: #1f2d3d;
  font-size: 30px;
  font-weight: 800;
}

.login-brand p {
  margin: 8px 0 0;
  color: #64717d;
}

.login-card form {
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.login-card label {
  color: #374957;
  font-weight: 700;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 18px;
  color: #64717d !important;
  font-weight: 600 !important;
}

body.cm-login form {
  display: block;
  padding: 22px 18px 18px;
  background: #fff;
  border: 1px solid #d8e3ec;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(44, 62, 80, .10);
}

body.cm-login .input-group-addon {
  border-color: #ccd8e2;
  background: #f4f8fb;
  border-radius: 8px 0 0 8px;
}

.dashboard-wrap .metric-card {
  border-radius: 8px;
}

.dashboard-panel {
  overflow: visible;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #d8e3ec;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #edf7fd 100%);
}

.dashboard-hero h2 {
  margin: 0;
  color: #1f2d3d;
  font-size: 30px;
  font-weight: 800;
}

.dashboard-hero p {
  margin: 8px 0 0;
  color: #64717d;
}

.dashboard-kicker {
  color: #2587c7;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.metric-value.metric-small {
  font-size: 24px;
}

@media(max-width:767px) {
  .dashboard-hero {
    display: block;
  }

  .dashboard-hero .btn {
    margin-top: 16px;
  }

  .metric-grid {
    grid-template-columns: 1fr !important;
  }

  .local-admin-header {
    display: block;
  }

  .local-admin-header .btn {
    margin-top: 12px;
  }
}

.dashboard-wrap {
  max-width: 1060px !important;
}

.dashboard-section {
  margin: 22px 0 !important;
}

.dashboard-title {
  margin-bottom: 16px !important;
}

.metric-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 18px !important;
}

.metric-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #d8e3ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(44, 62, 80, .07);
}

.metric-card.highlight {
  background: #eefaf5;
  border-color: #bfe8d5;
}

.metric-single {
  margin: 12px 0 22px;
  max-width: 280px;
}

.metric-label {
  color: #64717d;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 6px;
  color: #1f2d3d;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 18px;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #dce5ec;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(44, 62, 80, .06);
}

.data-table th {
  background: #f4f8fb;
  color: #263238;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 13px 14px;
  white-space: nowrap;
}

.data-table td {
  color: #34495e;
  font-size: 14px;
  padding: 12px 14px;
  vertical-align: middle;
  word-break: normal;
}

.data-table tr:nth-child(even) td {
  background: #fbfdff;
}

.data-table .btn {
  display: inline-block;
  width: auto;
  min-width: 0;
  padding: 4px 8px;
  white-space: nowrap;
}

.data-table a {
  font-weight: 700;
}

.local-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.local-admin-header h2 {
  margin-top: 0;
}

.local-admin-header .text-muted {
  margin-bottom: 0;
}

.local-admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}

.local-admin-card {
  padding: 16px;
  border: 1px solid #d8e3ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(44, 62, 80, .06);
}

.local-admin-card .label {
  color: #64717d;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.local-admin-card .value {
  margin-top: 5px;
  color: #1f2d3d;
  font-size: 24px;
  font-weight: 800;
}

.status-pill {
  display: inline-block;
  min-width: 70px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef5fa;
  color: #34495e;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.status-pill.ok,
.status-pill.ativo,
.status-pill.online {
  background: #e4f6ed;
  color: #167a45;
}

.status-pill.warn,
.status-pill.teste,
.status-pill.degraded {
  background: #fff3d6;
  color: #9a6500;
}

.status-pill.danger,
.status-pill.bloqueado,
.status-pill.vencido,
.status-pill.offline {
  background: #fde7e7;
  color: #a83232;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.inline-actions .btn {
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.inline-actions form {
  display: inline-flex;
  margin: 0;
  flex: 0 0 auto;
}

.local-admin-form {
  margin-top: 12px;
  padding-top: 8px;
}

.local-admin-form .form-group {
  min-height: 0;
}

tr.collapse td {
  background: #f7fafc !important;
}

.tg {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8e3ec !important;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(44, 62, 80, .06);
}

.tg th,
.tg td {
  background: #fff !important;
  border-color: #d8e3ec !important;
  color: #34495e !important;
  padding: 12px 14px !important;
}

.tg th {
  background: #f4f8fb !important;
  color: #263238 !important;
  font-weight: 700 !important;
  text-transform: uppercase;
}

.tg tr:nth-child(even) td {
  background: #fbfdff !important;
}

/* P2P polish: newer admin screens should feel softer and consistent. */
.page-p2p .panel,
.page-p2p .panel-body,
.page-p2p .local-admin-card,
.page-p2p .data-table,
.page-p2p .data-table-wrap,
.page-p2p .tg,
.page-p2p .alert,
.page-p2p .form-control,
.page-p2p .btn,
.page-p2p .dropdown-menu,
.page-p2p .status-pill,
.page-p2p-atualizacoes .panel,
.page-p2p-atualizacoes .panel-body,
.page-p2p-atualizacoes .data-table,
.page-p2p-atualizacoes .data-table-wrap,
.page-p2p-atualizacoes .alert,
.page-p2p-atualizacoes .form-control,
.page-p2p-atualizacoes .btn {
  border-radius: var(--p2p-radius) !important;
}

.page-p2p .btn-xs,
.page-p2p .status-pill,
.page-p2p-atualizacoes .btn-xs,
.page-p2p-atualizacoes .label {
  border-radius: 999px !important;
}

.page-p2p .panel,
.page-p2p-atualizacoes .panel {
  background: var(--p2p-panel);
  border-color: var(--p2p-border);
}

.page-p2p .panel .panel,
.page-p2p-atualizacoes .panel .panel {
  margin-top: 18px;
  box-shadow: 0 8px 22px rgba(44, 62, 80, .07);
}

.page-p2p .form-control,
.page-p2p-atualizacoes .form-control {
  min-height: 30px;
}

.page-p2p .btn,
.page-p2p-atualizacoes .btn {
  border: 0;
  font-weight: 800;
}

.page-p2p .data-table,
.page-p2p-atualizacoes .data-table {
  box-shadow: 0 10px 26px rgba(44, 62, 80, .08);
}

.page-p2p .data-table th,
.page-p2p-atualizacoes .data-table th {
  border-top: 0 !important;
}

.page-p2p .inline-actions {
  align-items: center;
}

.apk-upload-progress-track {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: rgba(52, 152, 219, .18);
}

.apk-upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f99d4, #14b8a6, #74d16d);
  transition: width .18s ease;
}

.apk-upload-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #64717d;
  font-weight: 800;
}

html.theme-dark body.cm-1-navbar,
html.theme-dark body.cm-login {
  background: #1f2933;
  color: #dbe4ec;
}

html.theme-dark #global {
  background: #1f2933;
}

html.theme-dark .container-fluid > .panel,
html.theme-dark .panel,
html.theme-dark body.cm-login form {
  background: #27323d;
  border-color: #3a4754;
  color: #dbe4ec;
  box-shadow: 0 8px 18px rgba(5, 12, 20, .22);
}

html.theme-dark .panel-body,
html.theme-dark .panel-heading {
  background: #27323d;
  color: #dbe4ec;
}

html.theme-dark .table,
html.theme-dark table:not(.ui-datepicker-calendar) {
  background: #2b3743;
  color: #dbe4ec;
}

html.theme-dark .table > thead > tr > th,
html.theme-dark table:not(.ui-datepicker-calendar) th {
  background: #22303d;
  color: #edf4fa;
}

html.theme-dark .table > tbody > tr > td,
html.theme-dark table:not(.ui-datepicker-calendar) td {
  background: #2b3743;
  color: #dbe4ec;
}

html.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > td {
  background: #263340;
}

html.theme-dark .text-muted,
html.theme-dark small {
  color: #b7c6d4;
}

html.theme-dark code {
  background: #22303d;
  border-color: #435261;
  color: #dbe4ec;
}

html.theme-dark .cm-navbar-primary,
html.theme-dark #cm-menu .cm-navbar {
  background: #2d8fc8;
  border-color: #236f9d;
}

html.theme-dark #cm-menu,
html.theme-dark #cm-menu-content,
html.theme-dark #cm-menu-scroller,
html.theme-dark #cm-menu-items-wrapper,
html.theme-dark .cm-menu-items:after {
  background: #24313d;
}

html.theme-dark #cm-menu-content {
  border-right-color: #3a4754;
}

html.theme-dark .cm-menu-items li a {
  background-color: rgba(255, 255, 255, .045);
  border-color: transparent;
  color: #d7e0e8;
}

html.theme-dark .cm-menu-items li.menu-section span {
  color: #84a0b4;
}

html.theme-dark .cm-menu-items li a:hover {
  background-color: rgba(255, 255, 255, .085);
  border-color: #405365;
  color: #fff;
}

html.theme-dark .cm-menu-items li.current a,
html.theme-dark .cm-menu-items li.active.current a {
  background-color: rgba(255, 255, 255, .075);
  border-color: #405365;
  box-shadow: inset 4px 0 0 #4db1e8, 0 10px 22px rgba(0, 0, 0, .18);
  color: #fff;
  font-weight: 800;
}

html.theme-dark .menu-current-mark {
  background: #4db1e8;
  color: #10202d;
}

html.theme-dark .cm-footer {
  background: #1f2933;
  border-top-color: #33414f;
  color: #aebcca;
}

html.theme-dark .form-control,
html.theme-dark input[type="text"],
html.theme-dark input[type="password"],
html.theme-dark input[type="email"],
html.theme-dark input[type="number"],
html.theme-dark input[type="url"],
html.theme-dark select,
html.theme-dark textarea {
  background: #202a35;
  border-color: #425161;
  color: #e3ebf2;
}

html.theme-dark .form-control:focus,
html.theme-dark input[type="text"]:focus,
html.theme-dark input[type="password"]:focus,
html.theme-dark input[type="email"]:focus,
html.theme-dark input[type="number"]:focus,
html.theme-dark input[type="url"]:focus,
html.theme-dark select:focus,
html.theme-dark textarea:focus {
  border-color: #4db1e8;
  box-shadow: 0 0 0 3px rgba(77, 177, 232, .18);
}

html.theme-dark #showPassword {
  background: #33414f;
  border-color: #536678;
  color: #edf4fa;
}

html.theme-dark #showPassword:hover,
html.theme-dark #showPassword:focus {
  background: #3d4d5d;
  border-color: #6b8195;
  color: #fff;
}

html.theme-dark body.cm-login .text-center {
  background: #27323d !important;
  border-bottom-color: #3a4754 !important;
  box-shadow: 0 4px 18px rgba(5, 12, 20, .20);
}

html.theme-dark .login-shell {
  background: linear-gradient(135deg, #18222c 0%, #213140 55%, #111820 100%);
}

html.theme-dark .login-card {
  background: rgba(43, 55, 67, .96);
  border-color: #435261;
  box-shadow: 0 18px 45px rgba(5, 12, 20, .28);
}

html.theme-dark .login-brand h1,
html.theme-dark .login-card label {
  color: #edf4fa;
}

html.theme-dark .login-brand p,
html.theme-dark .login-remember {
  color: #b7c6d4 !important;
}

html.theme-dark body.cm-login .input-group-addon {
  background: #222d38;
  border-color: #425161;
  color: #c7d3df;
}

html.theme-dark .metric-card,
html.theme-dark .data-table {
  background: #2b3743;
  border-color: #435261;
  color: #dbe4ec;
  box-shadow: 0 6px 16px rgba(5, 12, 20, .18);
}

html.theme-dark .metric-card.highlight {
  background: #263a35;
  border-color: #2f9f68;
}

html.theme-dark .dashboard-hero {
  background: linear-gradient(135deg, #2b3743 0%, #223242 100%);
  border-color: #435261;
}

html.theme-dark .dashboard-hero h2 {
  color: #edf4fa;
}

html.theme-dark .dashboard-hero p {
  color: #b7c6d4;
}

html.theme-dark .dashboard-title,
html.theme-dark .metric-value {
  color: #edf4fa;
}

html.theme-dark .metric-label,
html.theme-dark .data-table td {
  color: #bdcad6;
}

html.theme-dark .data-table th {
  background: #24313d;
  color: #dbe4ec;
}

html.theme-dark .data-table tr:nth-child(even) td {
  background: #283440;
}

html.theme-dark .local-admin-card {
  background: #2b3743;
  border-color: #435261;
  color: #dbe4ec;
  box-shadow: 0 6px 16px rgba(5, 12, 20, .18);
}

html.theme-dark .local-admin-card .label,
html.theme-dark .local-admin-header .text-muted {
  color: #aebcca;
}

html.theme-dark .local-admin-card .value,
html.theme-dark .local-admin-header h2,
html.theme-dark h3 {
  color: #edf4fa;
}

html.theme-dark tr.collapse td {
  background: #24313d !important;
}

html.theme-dark .status-pill {
  background: #33414f;
  color: #dbe4ec;
}

html.theme-dark .status-pill.ok,
html.theme-dark .status-pill.ativo,
html.theme-dark .status-pill.online {
  background: #203f35;
  color: #7fe0a9;
}

html.theme-dark .status-pill.warn,
html.theme-dark .status-pill.teste,
html.theme-dark .status-pill.degraded {
  background: #463918;
  color: #ffd986;
}

html.theme-dark .status-pill.danger,
html.theme-dark .status-pill.bloqueado,
html.theme-dark .status-pill.vencido,
html.theme-dark .status-pill.offline {
  background: #4a282d;
  color: #ffb3b3;
}

html.theme-dark .tg {
  background: #2b3743;
  border-color: #435261 !important;
  box-shadow: 0 6px 16px rgba(5, 12, 20, .18);
}

html.theme-dark .tg th,
html.theme-dark .tg td {
  background: #2b3743 !important;
  border-color: #435261 !important;
  color: #dbe4ec !important;
}

html.theme-dark .tg th {
  background: #24313d !important;
  color: #edf4fa !important;
}

html.theme-dark .tg tr:nth-child(even) td {
  background: #283440 !important;
}

html.theme-dark td,
html.theme-dark th {
  border-color: #435261 !important;
}

html.theme-dark .dropdown-menu,
html.theme-dark .modal-content,
html.theme-dark .popover,
html.theme-dark .list-group-item,
html.theme-dark .cm-container-white {
  background: #27323d;
  border-color: #3a4754;
  color: #dbe4ec;
}

html.theme-dark .dropdown-menu a {
  color: #dbe4ec;
}

html.theme-dark .dropdown-menu a:hover,
html.theme-dark .dropdown-menu a:focus {
  background: #33414f;
  color: #fff;
}

html.theme-dark .page-p2p-atualizacoes #global,
html.theme-dark body.page-p2p-atualizacoes #global {
  background: #1f2933;
}

html.theme-dark .page-p2p-atualizacoes .container-fluid > .panel {
  background: transparent;
  border: 0;
  box-shadow: none;
}

html.theme-dark .page-p2p-atualizacoes .container-fluid > .panel > .panel-body {
  background: #27323d;
  border: 1px solid #3a4754;
  box-shadow: 0 8px 22px rgba(5, 12, 20, .24);
  color: #dbe4ec;
}

html.theme-dark .page-p2p-atualizacoes label,
html.theme-dark .page-p2p-atualizacoes h2,
html.theme-dark .page-p2p-atualizacoes h3 {
  color: #edf4fa;
}

html.theme-dark .page-p2p-atualizacoes .help-block,
html.theme-dark .page-p2p-atualizacoes small {
  color: #aebcca;
}

html.theme-dark .page-p2p-assistente .assistant-tabs a,
html.theme-dark .page-p2p .assistant-tabs a {
  border-radius: var(--p2p-radius-sm);
}

html.theme-dark .page-p2p-assistente .step-box,
html.theme-dark .page-p2p-assistente .tmdb-card,
html.theme-dark .page-p2p-assistente .table-wrap {
  border-radius: var(--p2p-radius);
}

html.theme-dark .page-p2p-assistente .assistant-table th:first-child {
  border-top-left-radius: var(--p2p-radius-sm);
}

html.theme-dark .page-p2p-assistente .assistant-table th:last-child {
  border-top-right-radius: var(--p2p-radius-sm);
}

.apk-upload-progress {
  clear: both;
  margin-top: 8px;
}

.apk-upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #506170;
  font-weight: 700;
}

.apk-upload-progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe7f0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}

.apk-upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f99d4 0%, #4db1e8 45%, #6ee7b7 100%);
  transition: width .18s ease;
}

html.theme-dark .apk-upload-progress-head {
  color: #dbe4ec;
}

html.theme-dark .apk-upload-progress-track {
  background: #1b2530;
  border: 1px solid #3a4754;
}

/* Production polish: keep P2P admin screens readable, fast to scan, and hard to break with long URLs/names. */
.page-p2p .container-fluid {
  max-width: 1680px;
}

.page-p2p .local-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-p2p .local-admin-header h2,
.page-p2p .local-admin-header p,
.page-p2p h3,
.page-p2p label {
  overflow-wrap: anywhere;
}

.page-p2p .inline-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-p2p .inline-actions form {
  display: inline-flex;
  margin: 0;
  flex: 0 0 auto;
}

/* Dense IPTV list: actions stay on ONE horizontal line (never stacked). */
.page-p2p .data-table .inline-actions {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 4px;
  min-width: 0;
  width: auto;
}

.page-p2p .data-table .inline-actions form,
.page-p2p .data-table .inline-actions .btn {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto;
}

.page-p2p .catalog-channel-table {
  min-width: 1080px;
}

.page-p2p .catalog-ops {
  min-width: 360px;
  align-items: center;
}

.page-p2p .catalog-ops .btn {
  min-width: 86px;
}

.page-p2p .catalog-status-stack {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 260px;
}

.page-p2p .catalog-last-view {
  display: block;
  width: 100%;
  color: #6b7c8f;
  font-weight: 700;
}

.page-p2p .inline-action {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  vertical-align: middle;
}

.page-p2p .local-admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-p2p .local-admin-subheader {
  margin-top: 26px;
}

.page-p2p .btn {
  min-height: 34px;
  white-space: normal;
}

/* Compact table/action pills — no fat min-width that forces wrap/stack. */
.page-p2p .data-table .btn,
.page-p2p .inline-actions .btn {
  white-space: nowrap !important;
  min-width: 0 !important;
  width: auto !important;
  flex-shrink: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.page-p2p .btn-xs {
  min-height: 24px;
  line-height: 1.2;
  padding: 2px 8px;
}

/* Dense client list rows (~36–44px). */
.page-p2p .data-table th,
.page-p2p .data-table td {
  padding: 3px 6px !important;
  vertical-align: middle !important;
}

.page-p2p .data-table .form-control,
.page-p2p .data-table select.form-control,
.page-p2p .data-table input.form-control {
  height: 28px !important;
  min-height: 28px !important;
  padding: 2px 6px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

.page-p2p .data-table .btn,
.page-p2p .data-table .btn-xs {
  height: 26px;
  min-height: 26px !important;
  padding: 2px 7px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  border-radius: 3px !important;
}

.page-p2p .data-table tr.add-login-row td {
  padding: 1px 6px 4px !important;
  background: transparent !important;
}

.page-p2p .data-table tr.add-login-row .form-control {
  height: 24px !important;
  min-height: 24px !important;
  width: 110px;
}

.page-p2p .local-admin-form .form-control,
.page-p2p .local-admin-form select.form-control {
  height: 30px !important;
  min-height: 30px !important;
  padding: 4px 8px !important;
  font-size: 13px !important;
}

.page-p2p .local-admin-form .form-group {
  margin-bottom: 6px !important;
  min-height: 0 !important;
}

.page-p2p .data-table-wrap,
.page-p2p .table-wrap {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.page-p2p .data-table,
.page-p2p .assistant-table,
.page-p2p .table-wrap table {
  width: 100%;
  min-width: 860px;
  table-layout: auto;
}

.page-p2p .data-table th,
.page-p2p .data-table td,
.page-p2p .assistant-table th,
.page-p2p .assistant-table td,
.page-p2p .table-wrap th,
.page-p2p .table-wrap td {
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.page-p2p .data-table .form-control,
.page-p2p .data-table select,
.page-p2p .data-table input,
.page-p2p .data-table button,
.page-p2p .data-table .btn,
.page-p2p .data-table label {
  overflow-wrap: normal;
  word-break: normal;
}

.page-p2p .data-table td small,
.page-p2p .assistant-table td small,
.page-p2p .table-wrap td small {
  display: inline-block;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.page-p2p input[type="checkbox"] {
  min-height: 0;
}

.page-p2p .form-control,
.page-p2p select,
.page-p2p textarea {
  max-width: 100%;
}

.page-p2p .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.page-dashboard .license-success-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 8px;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid rgba(70, 199, 148, .36);
  background: linear-gradient(135deg, rgba(47, 153, 212, .18), rgba(70, 199, 148, .16));
  color: #f7fbff;
}

.page-dashboard .license-success-kicker {
  color: #75d6ff;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 5px;
}

.page-dashboard .license-success-banner strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.page-dashboard .license-success-banner p {
  color: #c7d8e5;
  margin: 7px 0 0;
}

@media (max-width: 900px) {
  .page-p2p .panel-body {
    padding: 16px;
  }

  .page-p2p .local-admin-summary {
    grid-template-columns: 1fr !important;
  }

  .page-p2p .local-admin-header .inline-actions,
  .page-p2p .local-admin-header .btn {
    width: 100%;
  }
}

/* Mantem os ultimos botoes do menu acessiveis em telas baixas e no navegador com barra inferior. */
#cm-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

#cm-menu-content {
  position: fixed !important;
  top: 50px !important;
  bottom: 0 !important;
  left: 0 !important;
  height: calc(100dvh - 50px) !important;
  max-height: calc(100dvh - 50px) !important;
  overflow: hidden !important;
}

#cm-menu-items-wrapper {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

#cm-menu-scroller {
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  height: 100% !important;
  max-height: 100% !important;
  padding-bottom: 72px !important;
  -webkit-overflow-scrolling: touch;
}

.cm-menu-items:after {
  height: 72px !important;
}

.cm-menu-items {
  padding-bottom: 72px !important;
}

.cm-menu-items li.menu-section {
  margin-top: 2px !important;
  margin-bottom: 0 !important;
}

.cm-menu-items li.menu-section span {
  font-size: 8px !important;
  line-height: 10px !important;
}

.cm-menu-items li a {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  min-height: 23px !important;
  height: 23px !important;
  line-height: 23px !important;
  font-size: 12px !important;
}

.cm-menu-items li:last-child {
  margin-bottom: 56px !important;
}

body.cm-menu-toggled #cm-menu-scroller {
  overflow-y: scroll !important;
  overflow-x: hidden !important;
}

body.cm-menu-toggled #cm-menu-content,
body.cm-menu-toggled #cm-menu-items-wrapper {
  overflow: hidden !important;
}

/*
 * Trava permanente do layout do painel.
 * O Clearmin guarda o estado cm-menu-toggled em cookie e, em desktop,
 * aplica translateX/margens que podem deixar a lateral sobreposta ao painel.
 * Aqui o painel passa a ter uma geometria fixa: menu no canto esquerdo,
 * topo/conteudo/rodape sempre nascendo depois dele.
 */
:root {
  --p2p-sidebar-width: clamp(320px, 18.5vw, 360px);
  --p2p-navbar-height: 50px;
}

@media (min-width: 992px) {
  body.cm-1-navbar:not(.cm-login) {
    overflow-x: hidden !important;
  }

  body.cm-1-navbar:not(.cm-login) #cm-menu {
    left: 0 !important;
    width: var(--p2p-sidebar-width) !important;
    min-width: var(--p2p-sidebar-width) !important;
    max-width: var(--p2p-sidebar-width) !important;
    transform: none !important;
    z-index: 3000 !important;
  }

  body.cm-1-navbar:not(.cm-login) #cm-menu .cm-navbar,
  body.cm-1-navbar:not(.cm-login) #cm-menu-content,
  body.cm-1-navbar:not(.cm-login) #cm-menu-items-wrapper,
  body.cm-1-navbar:not(.cm-login) #cm-menu-scroller,
  body.cm-1-navbar:not(.cm-login) #cm-menu .cm-menu-items {
    left: 0 !important;
    width: var(--p2p-sidebar-width) !important;
    min-width: var(--p2p-sidebar-width) !important;
    max-width: var(--p2p-sidebar-width) !important;
    transform: none !important;
  }

  body.cm-1-navbar:not(.cm-login) #cm-header,
  body.cm-1-navbar:not(.cm-login) header {
    left: var(--p2p-sidebar-width) !important;
    width: calc(100vw - var(--p2p-sidebar-width)) !important;
    transform: none !important;
  }

  body.cm-1-navbar:not(.cm-login) #global {
    margin-left: var(--p2p-sidebar-width) !important;
    width: calc(100vw - var(--p2p-sidebar-width)) !important;
    min-height: 100vh !important;
    transform: none !important;
  }

  body.cm-1-navbar:not(.cm-login) #global > .container-fluid {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.cm-1-navbar:not(.cm-login) .cm-footer {
    left: var(--p2p-sidebar-width) !important;
    width: calc(100vw - var(--p2p-sidebar-width)) !important;
    transform: none !important;
  }

  body.cm-1-navbar:not(.cm-login) .cm-navbar .pull-right,
  body.cm-1-navbar:not(.cm-login) .cm-footer .pull-left,
  body.cm-1-navbar:not(.cm-login) .cm-menu-items li {
    transform: none !important;
  }
}

@media (max-width: 991px) {
  body.cm-1-navbar:not(.cm-login) #global,
  body.cm-1-navbar:not(.cm-login) #global > .container-fluid {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.cm-1-navbar:not(.cm-login) #cm-menu {
    width: var(--p2p-sidebar-width) !important;
    max-width: calc(100vw - 24px) !important;
  }
}

/* Tamanho final do menu: legivel no desktop, mas ainda compacto e rolavel. */
body.cm-1-navbar:not(.cm-login) #cm-menu .cm-logo span {
  font-size: 16px !important;
  line-height: var(--p2p-navbar-height) !important;
}

body.cm-1-navbar:not(.cm-login) .cm-menu-items li.menu-section {
  margin: 5px 14px 1px !important;
}

body.cm-1-navbar:not(.cm-login) .cm-menu-items li.menu-section span {
  font-size: 10px !important;
  line-height: 13px !important;
  letter-spacing: .06em !important;
}

body.cm-1-navbar:not(.cm-login) .cm-menu-items li a {
  height: 29px !important;
  min-height: 29px !important;
  line-height: 29px !important;
  font-size: 14px !important;
  padding-left: 62px !important;
  padding-right: 28px !important;
  background-position: 22px center !important;
  background-size: 21px 21px !important;
}

@media (max-height: 760px) {
  body.cm-1-navbar:not(.cm-login) .cm-menu-items li a {
    height: 27px !important;
    min-height: 27px !important;
    line-height: 27px !important;
    font-size: 13px !important;
  }

  body.cm-1-navbar:not(.cm-login) .cm-menu-items li.menu-section {
    margin-top: 3px !important;
  }
}
