/* style-sistema.css - Padrão alinhado ao jp.cobrancas */

:root {
  --terciary: #002f4b;
  --terciary-100: #00213a;
  --primary-blue: #002f4b;
  --accent-teal: #0d9488;
  --primary: #0d9488;
  --secondary: #0f766e;
  --primary-color: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #14b8a6;
  --secondary-color: #002f4b;
  --accent-color: #0d9488;
  --accent-blue: #0d9488;
  --white: #FFFFFF;
  --stone-100: #F5F7FA;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --control-height: 40px;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08);
  --shadow-md: 0 8px 24px rgb(0 47 75 / 0.08);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-hover: rgba(13, 148, 136, 0.18);
  --border-radius: 8px;
  --border-radius-lg: 12px;
}

/* Body - fundo claro como jp.cobrancas */
body.sistema-padrao {
  font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--stone-100);
  color: var(--gray-800);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Header - azul escuro como jp.cobrancas */
header.sistema-header {
  background-color: var(--terciary);
  color: var(--white);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.sistema-header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
}

.sistema-header .logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--white);
}

.sistema-header .logo img {
  height: 3rem;
  width: auto;
  object-fit: contain;
}

.sistema-header nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.sistema-header .nav-link {
  color: var(--white);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.sistema-header .nav-link:hover {
  background-color: var(--terciary-100);
}

.sistema-header .nav-link.active {
  background-color: var(--accent-teal);
  color: var(--white);
}

.sistema-header .nav-link.nav-sair:hover {
  background-color: rgba(239, 68, 68, 0.3);
}

/* Ícones no header sempre brancos (fundo escuro) */
.sistema-header .nav-link i,
.sistema-header .nav-link .fa,
.sistema-header .nav-link .fas,
.sistema-header .nav-link .far,
.sistema-header .nav-link .fab {
  color: inherit !important;
}

/* Container */
.sistema-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  flex: 1;
}

/* Main */
main.sistema-main,
main.main-content {
  flex: 1;
  padding: 2rem 0;
}

/* Breadcrumb - estilo jp.cobrancas */
.sistema-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.sistema-breadcrumb a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color 0.2s;
}

.sistema-breadcrumb a:hover {
  color: var(--terciary);
}

.sistema-breadcrumb span:last-child {
  color: var(--gray-700);
  font-weight: 500;
}

.sistema-breadcrumb .breadcrumb-sep {
  font-size: 0.65rem;
  color: var(--gray-400);
}

/* Page header com ícone - estilo jp.cobrancas */
.sistema-page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.sistema-page-header-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #002f4b 0%, #004d73 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  font-size: 1.5rem;
  box-shadow: 0 4px 14px rgba(0, 47, 75, 0.25);
  flex-shrink: 0;
}

/* Ícones dentro do page-header sempre brancos (padrão jp.cobrancas) */
.sistema-page-header-icon i,
.sistema-page-header-icon .fa,
.sistema-page-header-icon .fas,
.sistema-page-header-icon .far,
.sistema-page-header-icon .fab {
  color: #fff !important;
}

.sistema-page-header-text h1,
.sistema-page-header-text .page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--terciary);
  margin: 0 0 0.25rem 0;
}

.sistema-page-header-text p,
.sistema-page-header-text .page-subtitle {
  font-size: 0.95rem;
  color: var(--gray-500);
  margin: 0;
}

/* Section - estilo jp.cobrancas */
.sistema-section {
  background-color: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgb(0 0 0 / 0.06);
  border: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.sistema-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.sistema-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--terciary);
}

/* Cabeçalhos de tabela: fundo escuro + texto branco (padrão jp.cobrancas) */
.sistema-section thead th,
.table-container thead th,
table thead th {
  background: linear-gradient(135deg, #002f4b 0%, #004d73 100%) !important;
  color: #fff !important;
  font-weight: 600;
}

/* Ícones em botões herdam a cor do texto (evita ícone escuro em botão escuro) */
.btn i, .btn .fa, .btn .fas, .btn .far, .btn .fab,
button i, button .fa, button .fas {
  color: inherit !important;
}

/* Cards - estilo jp.cobrancas */
.sistema-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.sistema-card {
  background-color: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
}

.sistema-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(13, 148, 136, 0.4);
}

/* Mobile menu */
.sistema-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 992px) {
  .sistema-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sistema-header .header-content {
    flex-wrap: wrap;
  }
  .sistema-header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--terciary-100);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }
  .sistema-header nav.open {
    display: flex;
  }
}

@media (min-width: 993px) {
  .sistema-header nav {
    display: flex !important;
  }
}

@media (min-width: 993px) {
  .sistema-header nav {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .sistema-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Section title com ícone teal - estilo jp.cobrancas */
.sistema-section-title-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--terciary);
}

.sistema-section-title-icon i,
.sistema-section-title-icon .fa,
.sistema-section-title-icon .fas {
  color: var(--accent-teal) !important;
}

/* Empty state - quando listas/tabelas estão vazias */
.sistema-empty-state {
  padding: 3rem 2rem;
  text-align: center;
}

.sistema-empty-state-icon {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: 1rem;
  display: block;
}

.sistema-empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.sistema-empty-state-text {
  font-size: 0.95rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.sistema-empty-state .btn {
  margin-top: 0.5rem;
}

table td .sistema-empty-state {
  display: block;
  width: 100%;
}

/* Compatibilidade com classes do jp.cobrancas */
.empty-state { padding: 3rem 2rem; text-align: center; }
.empty-state-icon { font-size: 3rem; color: var(--gray-300); margin-bottom: 1rem; display: block; }
.empty-state-icon i, .empty-state-icon .fa, .empty-state-icon .fas { color: var(--gray-300) !important; }
.empty-state-title { font-size: 1.1rem; font-weight: 600; color: var(--gray-600); margin-bottom: 0.5rem; }
.empty-state-text { font-size: 0.95rem; color: var(--gray-500); margin-bottom: 1rem; }
table td .empty-state { display: block; width: 100%; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
  width: 60%;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.table-skeleton td {
  padding: 1rem !important;
  vertical-align: middle !important;
}

.table-skeleton .skeleton-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.table-skeleton .skeleton-row .skeleton {
  flex: 1;
  height: 1.25rem;
}

/* ===== Padrão visual 2026 (navy + teal) — carregar DEPOIS dos estilos da página ===== */
.btn,
button.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--control-height);
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 8px !important;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
button.btn:hover,
a.btn:hover {
  transform: none !important;
}

.btn-primary,
button.btn-primary,
a.btn-primary,
.login-btn {
  background: #0d9488 !important;
  color: #fff !important;
}

.btn-primary:hover,
.login-btn:hover {
  background: #0f766e !important;
  box-shadow: none !important;
}

.btn-secondary,
button.btn-secondary,
a.btn-secondary,
.logout-btn {
  background: #002f4b !important;
  color: #fff !important;
}

.btn-secondary:hover,
.logout-btn:hover {
  background: #003d60 !important;
  box-shadow: none !important;
}

.btn-success { background: #0d9488 !important; color: #fff !important; }
.btn-success:hover { background: #0f766e !important; }
.btn-info { background: #0284c7 !important; color: #fff !important; }
.btn-danger { background: #dc2626 !important; color: #fff !important; }

.btn-sm,
td .btn,
table .btn {
  min-height: 32px;
  padding: 0.22rem 0.55rem;
  font-size: 0.75rem;
}

.table-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
}

td:last-child .btn {
  white-space: nowrap;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="date"],
select,
textarea {
  border-radius: 8px !important;
  border: 1px solid #e5e7eb !important;
  min-height: 40px;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #0d9488 !important;
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.15) !important;
}

.card,
.menu-card,
.dashboard-card,
.caixa-section,
.sistema-section,
.sistema-card {
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.08) !important;
}

.menu-card:hover,
.dashboard-card:hover,
.produto-card:hover {
  transform: none !important;
  border-color: rgba(13, 148, 136, 0.45) !important;
  box-shadow: 0 8px 24px rgb(0 47 75 / 0.08) !important;
}

.menu-card i,
.card-icon {
  color: #0d9488 !important;
}

.modal,
.modal-bg {
  background: rgb(15 23 42 / 0.55) !important;
  backdrop-filter: blur(4px);
}

.modal-content {
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 20px 50px rgb(15 23 42 / 0.16) !important;
  background: #fff !important;
}

.modal-header {
  background: #fff !important;
  color: #002f4b !important;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 1.25rem !important;
}

.modal-header h3,
.modal-header h2 {
  color: #002f4b !important;
  font-size: 1.05rem !important;
}

.close,
.modal-close {
  background: #f5f7fa !important;
  color: #6b7280 !important;
  border-radius: 8px !important;
  width: 32px !important;
  height: 32px !important;
}

.breadcrumb,
.breadcrumb a,
.breadcrumb span {
  color: #6b7280 !important;
}

.breadcrumb a:hover {
  color: #0d9488 !important;
}

.sistema-page-header-icon {
  background: #002f4b !important;
  border-radius: 8px !important;
}

footer,
.footer {
  background: #002f4b !important;
  color: rgba(255, 255, 255, 0.8) !important;
}

button, .btn, .nav-link, a.btn {
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover, button.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.sistema-container .card,
.main-content .card,
table {
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .btn:hover { transform: none; }
}
