/* =============================================================
   LOGIUN — Modern Design System
   Sobrescreve INSPINIA v2.4 / Bootstrap 3 visualmente
   Mantém compatibilidade estrutural com todas as views existentes
   ============================================================= */

/* ─────────────────────────────────────────────
   1. DESIGN TOKENS (CSS Variables)
   ───────────────────────────────────────────── */
:root {
  --l-primary:    #2563EB;
  --l-primary-h:  #1d4ed8;
  --l-success:    #10B981;
  --l-success-h:  #059669;
  --l-warning:    #F59E0B;
  --l-warning-h:  #d97706;
  --l-danger:     #EF4444;
  --l-danger-h:   #dc2626;
  --l-info:       #0EA5E9;

  --l-navy:       #1a2332;   /* sidebar bg */
  --l-navy-h:     #151c28;   /* sidebar hover */
  --l-navy-b:     #243044;   /* sidebar border/divider */

  --l-bg:         #F1F5F9;   /* page background */
  --l-surface:    #FFFFFF;   /* card/panel surface */
  --l-border:     #E2E8F0;   /* default border */
  --l-border-h:   #CBD5E1;   /* border hover */

  --l-text:       #0F172A;   /* primary text */
  --l-text-sec:   #475569;   /* secondary text */
  --l-muted:      #94A3B8;   /* muted/placeholder */

  --l-radius:     8px;
  --l-radius-sm:  4px;
  --l-radius-lg:  12px;

  --l-shadow-sm:  0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
  --l-shadow:     0 2px 4px rgba(0,0,0,.06), 0 4px 8px rgba(0,0,0,.06);
  --l-shadow-lg:  0 4px 6px rgba(0,0,0,.07), 0 10px 15px rgba(0,0,0,.07);

  --l-font:       'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --l-transition: 0.15s ease;
}

/* ─────────────────────────────────────────────
   2. BASE RESETS
   ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--l-font) !important;
  background: var(--l-bg) !important;
  color: var(--l-text) !important;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--l-primary); transition: color var(--l-transition); }
a:hover { color: var(--l-primary-h); text-decoration: none; }

/* ─────────────────────────────────────────────
   3. SIDEBAR / NAVIGATION
   ───────────────────────────────────────────── */
.navbar-default.navbar-static-side {
  background: var(--l-navy) !important;
  border-right: none !important;
  box-shadow: 2px 0 8px rgba(0,0,0,.15);
}

.navbar-default.navbar-static-side .nav > li > a,
.navbar-default.navbar-static-side .nav > li > a:hover,
.navbar-default.navbar-static-side .nav > li > a:focus {
  color: #CBD5E1 !important;
  background: transparent !important;
  border-left: none !important;
}

.navbar-default.navbar-static-side .nav > li.active > a,
.navbar-default.navbar-static-side .nav > li.active > a:hover {
  color: #FFFFFF !important;
  background: rgba(37, 99, 235, 0.42) !important;
  border-left: 3px solid #60A5FA !important;
}

.navbar-default.navbar-static-side .nav > li > a:hover {
  background: rgba(255,255,255,.08) !important;
  color: #F1F5F9 !important;
}

/* Sidebar icons */
.navbar-default.navbar-static-side .nav > li > a i {
  color: #64748B;
  margin-right: 8px;
  font-size: 14px;
  transition: color var(--l-transition);
  width: 16px;
  text-align: center;
}
.navbar-default.navbar-static-side .nav > li.active > a i {
  color: #93C5FD !important;
}
.navbar-default.navbar-static-side .nav > li > a:hover i {
  color: #CBD5E1 !important;
}

/* Profile / logo area */
.nav-header {
  background: var(--l-navy-h) !important;
  padding: 20px 16px !important;
}
.nav-header .profile-element { padding: 0 !important; }
.nav-header .profile-logo { max-width: 110px; }
.nav-header .dropdown-toggle .font-bold { color: #F1F5F9 !important; font-size: 13px; }
.nav-header .text-muted { color: #94A3B8 !important; font-size: 11px; }

/* Submenu */
.nav-second-level { background: rgba(0,0,0,.15) !important; }
.nav-second-level li a {
  color: #94A3B8 !important;
  font-size: 12px !important;
  padding: 8px 16px 8px 38px !important;
}
.nav-second-level li.active a,
.nav-second-level li a:hover {
  color: #F1F5F9 !important;
  background: rgba(255,255,255,.05) !important;
}

/* Mini navbar mode */
.mini-navbar .nav-label { display: none; }
.mini-navbar .navbar-default.navbar-static-side { width: 70px !important; }
/* Hide large logo, show mini logo */
.mini-navbar .sidebar-brand { display: none !important; }
.logo-element { display: none; }
.mini-navbar .logo-element { display: block !important; }

/* Sidebar scrollbar */
.sidebar-collapse { scrollbar-width: thin; scrollbar-color: var(--l-navy-b) var(--l-navy); }
.sidebar-collapse::-webkit-scrollbar { width: 4px; }
.sidebar-collapse::-webkit-scrollbar-track { background: var(--l-navy); }
.sidebar-collapse::-webkit-scrollbar-thumb { background: var(--l-navy-b); border-radius: 4px; }

/* Sidebar brand logo (replaces profile-element) */
.sidebar-brand { padding: 4px 0 8px; display: flex; align-items: center; }
.sidebar-brand .profile-logo { max-width: 110px; }

/* Sidebar nav badges — corrige classes BS5 no contexto BS3 */
#side-menu .badge {
  font-size: 10px;
  padding: 2px 7px;
  font-weight: 700;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
  min-width: 18px;
}
#side-menu .bg-danger { background-color: #EF4444 !important; color: #fff !important; }
#side-menu .position-absolute { position: static !important; }
#side-menu .translate-middle { transform: none !important; }
#side-menu .top-0, #side-menu .start-100 { top: auto !important; left: auto !important; }

/* Sidebar flex layout to pin footer to bottom */
.navbar-default.navbar-static-side {
  display: flex !important;
  flex-direction: column !important;
}
.sidebar-collapse {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

/* Sidebar footer — user card */
.sidebar-footer {
  flex-shrink: 0;
  background: var(--l-navy-h);
  border-top: 1px solid var(--l-navy-b);
  padding: 10px 14px;
}

.sidebar-user-card {
  display: flex !important;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  padding: 6px 4px;
  border-radius: var(--l-radius-sm);
  transition: background var(--l-transition);
}
.sidebar-user-card:hover { background: rgba(255,255,255,.07); }

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--l-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.sidebar-user-name {
  display: block;
  color: #F1F5F9;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-company {
  display: block;
  color: #64748B;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-chevron {
  color: #475569;
  font-size: 11px;
  flex-shrink: 0;
  transition: transform var(--l-transition);
}
.sidebar-user-card[aria-expanded="true"] .sidebar-user-chevron { transform: rotate(180deg); }

/* Sidebar user dropdown menu */
.sidebar-user-menu {
  bottom: 100% !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  margin-bottom: 6px !important;
  background: #1e2d42 !important;
  border: 1px solid var(--l-navy-b) !important;
}
.sidebar-user-menu > li > a {
  color: #CBD5E1 !important;
  padding: 9px 16px !important;
  font-size: 13px !important;
}
.sidebar-user-menu > li > a:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; }
.sidebar-user-menu > li > a i { width: 16px; margin-right: 8px; color: #64748B; }
.sidebar-user-menu .divider { background: var(--l-navy-b) !important; }

/* Mini navbar: hide text, center avatar */
.mini-navbar .sidebar-user-info,
.mini-navbar .sidebar-user-chevron { display: none !important; }
.mini-navbar .sidebar-footer { padding: 10px 8px; }
.mini-navbar .sidebar-user-card { justify-content: center; }
.mini-navbar .sidebar-user-menu { left: 70px !important; bottom: 0 !important; min-width: 200px; }

/* ─────────────────────────────────────────────
   4. TOP NAVBAR
   ───────────────────────────────────────────── */
.row.border-bottom { border-bottom: 1px solid var(--l-border) !important; box-shadow: var(--l-shadow-sm); }

.navbar.navbar-static-top {
  background: var(--l-surface) !important;
  border: none !important;
  min-height: 50px;
}

.navbar-minimalize {
  background: transparent !important;
  border: 1px solid var(--l-border) !important;
  color: var(--l-text-sec) !important;
  border-radius: var(--l-radius-sm) !important;
  padding: 6px 10px !important;
  margin: 8px 12px !important;
  transition: all var(--l-transition) !important;
}
.navbar-minimalize:hover {
  background: var(--l-bg) !important;
  border-color: var(--l-border-h) !important;
  color: var(--l-primary) !important;
}

.navbar-top-links > li > a {
  color: var(--l-text-sec) !important;
  padding: 15px 12px !important;
  transition: color var(--l-transition) !important;
}
.navbar-top-links > li > a:hover { color: var(--l-primary) !important; background: transparent !important; }

.navbar-top-links .label {
  background: var(--l-danger) !important;
  border-radius: 10px !important;
  font-size: 10px !important;
  padding: 2px 5px !important;
}

/* Dropdown menus */
.dropdown-menu {
  border: 1px solid var(--l-border) !important;
  border-radius: var(--l-radius) !important;
  box-shadow: var(--l-shadow-lg) !important;
  padding: 6px 0 !important;
  margin-top: 4px !important;
}
.dropdown-menu > li > a {
  color: var(--l-text-sec) !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  transition: all var(--l-transition) !important;
}
.dropdown-menu > li > a:hover { background: var(--l-bg) !important; color: var(--l-primary) !important; }
.dropdown-menu > li.divider, .dropdown-menu .divider { background: var(--l-border) !important; margin: 4px 0 !important; }

/* Company switcher — topbar dropdown (right side) */
.topbar-company-li { display: flex; align-items: center; }

.topbar-company-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  background: var(--l-bg) !important;
  border: 1px solid var(--l-border) !important;
  border-radius: 20px !important;
  padding: 4px 10px 4px 5px !important;
  margin: 7px 4px !important;
  cursor: pointer;
  transition: all var(--l-transition);
  color: var(--l-text-sec) !important;
  max-width: 220px;
  height: 34px;
  text-decoration: none !important;
}
.topbar-company-toggle:hover,
.topbar-company-toggle:focus {
  background: var(--l-surface) !important;
  border-color: var(--l-primary) !important;
  color: var(--l-primary) !important;
}

.company-avatar-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--l-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.company-name-chip {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  display: inline-block;
  vertical-align: middle;
  font-weight: 500;
  font-size: 13px;
}
.company-chevron { font-size: 10px; opacity: .55; }

/* Company switch dropdown menu */
.company-switch-menu {
  min-width: 220px;
  max-height: 50vh;
  overflow-y: auto;
}
.company-switch-current > a {
  color: var(--l-primary) !important;
  font-weight: 600 !important;
  cursor: default;
}
.company-switch-current > a:hover {
  background: transparent !important;
  color: var(--l-primary) !important;
}
.company-switch-current > a i { color: var(--l-primary); margin-right: 6px; }

/* Messages and alerts dropdown — scrollable */
.dropdown-messages,
.dropdown-alerts {
  max-height: 65vh;
  overflow-y: auto;
  min-width: 300px;
  scrollbar-width: thin;
  scrollbar-color: var(--l-border) transparent;
}
.dropdown-messages::-webkit-scrollbar,
.dropdown-alerts::-webkit-scrollbar { width: 4px; }
.dropdown-messages::-webkit-scrollbar-thumb,
.dropdown-alerts::-webkit-scrollbar-thumb { background: var(--l-border); border-radius: 4px; }

/* "Ver mensagens/notificações" footer — always stick inside the dropdown */
.dropdown-messages .link-block,
.dropdown-alerts .link-block {
  position: sticky;
  bottom: 0;
  background: var(--l-surface);
  border-top: 1px solid var(--l-border);
  padding: 8px 0;
  z-index: 1;
}
.dropdown-messages-box { padding: 10px 14px; }

/* ─────────────────────────────────────────────
   5. PAGE WRAPPER
   ───────────────────────────────────────────── */
#page-wrapper { background: var(--l-bg) !important; }
.wrapper-content { padding: 20px !important; }

/* Breadcrumb */
.breadcrumb {
  background: transparent !important;
  padding: 8px 0 !important;
  margin: 0 !important;
  font-size: 12px;
}
.breadcrumb > .active { color: var(--l-text-sec) !important; }
.breadcrumb > li + li::before { color: var(--l-muted) !important; }

/* Page title in header section */
.navbar-header h2 { font-size: 16px !important; font-weight: 600 !important; color: var(--l-text) !important; margin: 0; line-height: 50px; }

/* ─────────────────────────────────────────────
   6. IBOX / CARDS (principal componente de conteúdo)
   ───────────────────────────────────────────── */
.ibox {
  background: var(--l-surface) !important;
  border: 1px solid var(--l-border) !important;
  border-radius: var(--l-radius-lg) !important;
  box-shadow: var(--l-shadow-sm) !important;
  margin-bottom: 20px !important;
  overflow: hidden;
}
.ibox:hover { box-shadow: var(--l-shadow) !important; }

.ibox-title {
  background: var(--l-surface) !important;
  border-bottom: 1px solid var(--l-border) !important;
  border-top: none !important;
  border-radius: var(--l-radius-lg) var(--l-radius-lg) 0 0 !important;
  padding: 14px 20px !important;
  min-height: unset !important;
}
.ibox-title h5 {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--l-text) !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px;
}
.ibox-title .label { font-size: 10px !important; }

.ibox-content {
  background: var(--l-surface) !important;
  border-top: none !important;
  padding: 20px !important;
}

.ibox-tools { display: flex; gap: 6px; align-items: center; }
.ibox-tools a { color: var(--l-muted) !important; }
.ibox-tools a:hover { color: var(--l-primary) !important; }

/* ─────────────────────────────────────────────
   7. BUTTONS
   ───────────────────────────────────────────── */
.btn {
  border-radius: var(--l-radius-sm) !important;
  font-weight: 500 !important;
  font-size: 12px !important;
  letter-spacing: .01em;
  transition: all var(--l-transition) !important;
  border-width: 1px !important;
  line-height: 1.5 !important;
}
.btn:focus { outline: 2px solid var(--l-primary); outline-offset: 2px; box-shadow: none !important; }

.btn-default {
  background: var(--l-surface) !important;
  border-color: var(--l-border) !important;
  color: var(--l-text-sec) !important;
}
.btn-default:hover {
  background: var(--l-bg) !important;
  border-color: var(--l-border-h) !important;
  color: var(--l-text) !important;
}

.btn-primary {
  background: var(--l-primary) !important;
  border-color: var(--l-primary) !important;
  color: #fff !important;
}
.btn-primary:hover { background: var(--l-primary-h) !important; border-color: var(--l-primary-h) !important; }

.btn-success {
  background: var(--l-success) !important;
  border-color: var(--l-success) !important;
  color: #fff !important;
}
.btn-success:hover { background: var(--l-success-h) !important; border-color: var(--l-success-h) !important; }

.btn-danger {
  background: var(--l-danger) !important;
  border-color: var(--l-danger) !important;
  color: #fff !important;
}
.btn-danger:hover { background: var(--l-danger-h) !important; border-color: var(--l-danger-h) !important; }

.btn-warning {
  background: var(--l-warning) !important;
  border-color: var(--l-warning) !important;
  color: #fff !important;
}
.btn-warning:hover { background: var(--l-warning-h) !important; border-color: var(--l-warning-h) !important; }

.btn-info {
  background: var(--l-info) !important;
  border-color: var(--l-info) !important;
  color: #fff !important;
}

.btn-xs { padding: 3px 8px !important; font-size: 11px !important; }
.btn-sm { padding: 5px 12px !important; font-size: 12px !important; }
.btn-lg { padding: 10px 20px !important; font-size: 14px !important; }

/* Filtro button */
.btn-filtro {
  background: var(--l-bg) !important;
  border: 1px solid var(--l-border) !important;
  color: var(--l-text-sec) !important;
}
.btn-filtro.ativo {
  background: var(--l-primary) !important;
  border-color: var(--l-primary) !important;
  color: #fff !important;
}
.btn-filtro:hover {
  background: var(--l-primary) !important;
  border-color: var(--l-primary) !important;
  color: #fff !important;
}

/* ─────────────────────────────────────────────
   8. FORM CONTROLS
   ───────────────────────────────────────────── */
.form-control {
  border: 1px solid var(--l-border) !important;
  border-radius: var(--l-radius-sm) !important;
  background: var(--l-surface) !important;
  color: var(--l-text) !important;
  font-size: 13px !important;
  height: 34px !important;
  padding: 6px 10px !important;
  box-shadow: none !important;
  transition: border-color var(--l-transition), box-shadow var(--l-transition) !important;
}
.form-control:focus {
  border-color: var(--l-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  outline: none !important;
}
.form-control::placeholder { color: var(--l-muted) !important; }

textarea.form-control { height: auto !important; }

.control-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--l-text-sec) !important;
  margin-bottom: 4px !important;
}

.input-group-addon {
  background: var(--l-bg) !important;
  border: 1px solid var(--l-border) !important;
  color: var(--l-text-sec) !important;
  border-radius: var(--l-radius-sm) !important;
}

/* Select2 integration styling */
.select2-container--default .select2-selection--single {
  border: 1px solid var(--l-border) !important;
  border-radius: var(--l-radius-sm) !important;
  height: 34px !important;
  background: var(--l-surface) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 34px !important;
  color: var(--l-text) !important;
  padding: 0 10px !important;
  font-size: 13px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 32px !important;
  right: 6px !important;
}
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--l-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}
.select2-dropdown {
  border: 1px solid var(--l-border) !important;
  border-radius: var(--l-radius) !important;
  box-shadow: var(--l-shadow-lg) !important;
}
.select2-results__option { font-size: 13px !important; padding: 8px 12px !important; color: var(--l-text) !important; }
.select2-results__option--highlighted {
  background: var(--l-primary) !important;
}
.select2-search--dropdown .select2-search__field {
  border: 1px solid var(--l-border) !important;
  border-radius: var(--l-radius-sm) !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
}

/* ─────────────────────────────────────────────
   9. TABLES
   ───────────────────────────────────────────── */
.table {
  font-size: 13px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.table > thead > tr > th {
  background: var(--l-bg) !important;
  color: var(--l-text-sec) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  border-bottom: 1px solid var(--l-border) !important;
  border-top: none !important;
  padding: 10px 12px !important;
  white-space: nowrap;
}
.table > tbody > tr > td {
  border: none !important;
  padding: 10px 12px !important;
  color: var(--l-text) !important;
  vertical-align: middle !important;
}
.table > tbody > tr {
  border-bottom: 1px solid var(--l-border) !important;
}
.table > tbody > tr:first-child > td { border-top: none !important; }
.table-hover > tbody > tr:hover > td { background: #F8FAFF !important; }
.table-striped > tbody > tr:nth-of-type(odd) > td { background: rgba(241,245,249,.5) !important; }

.table-responsive {
  border: none !important;
  border-radius: var(--l-radius) !important;
  overflow-x: auto;
}

/* ─────────────────────────────────────────────
   10. MODALS
   ───────────────────────────────────────────── */
.modal-content {
  border: none !important;
  border-radius: var(--l-radius-lg) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.2) !important;
  overflow: hidden;
}
.modal-header {
  background: var(--l-surface) !important;
  border-bottom: 1px solid var(--l-border) !important;
  padding: 16px 20px !important;
}
.modal-title { font-size: 15px !important; font-weight: 600 !important; color: var(--l-text) !important; }
.modal-header .close {
  color: var(--l-muted) !important;
  opacity: 1 !important;
  font-size: 18px !important;
  margin-top: -2px !important;
}
.modal-header .close:hover { color: var(--l-danger) !important; }
.modal-body { padding: 20px !important; }
.modal-footer {
  background: var(--l-bg) !important;
  border-top: 1px solid var(--l-border) !important;
  padding: 14px 20px !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}
.modal-backdrop.in { opacity: .4 !important; }

/* ─────────────────────────────────────────────
   11. BADGES, LABELS, ALERTS
   ───────────────────────────────────────────── */
.label {
  border-radius: 4px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  padding: 3px 7px !important;
  letter-spacing: .03em;
}
.label-default { background: var(--l-muted) !important; }
.label-primary { background: var(--l-primary) !important; }
.label-success { background: var(--l-success) !important; }
.label-warning { background: var(--l-warning) !important; color: #fff !important; }
.label-danger  { background: var(--l-danger) !important; }
.label-info    { background: var(--l-info) !important; }

.badge {
  background: var(--l-primary) !important;
  border-radius: 10px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  padding: 2px 6px !important;
}

.alert {
  border: none !important;
  border-radius: var(--l-radius) !important;
  border-left: 4px solid !important;
  padding: 12px 16px !important;
  font-size: 13px !important;
}
.alert-success { background: #ECFDF5 !important; border-left-color: var(--l-success) !important; color: #065F46 !important; }
.alert-danger  { background: #FEF2F2 !important; border-left-color: var(--l-danger) !important; color: #991B1B !important; }
.alert-warning { background: #FFFBEB !important; border-left-color: var(--l-warning) !important; color: #92400E !important; }
.alert-info    { background: #EFF6FF !important; border-left-color: var(--l-info) !important; color: #1E40AF !important; }

/* ─────────────────────────────────────────────
   12. PAGINATION
   ───────────────────────────────────────────── */
.pagination { margin: 12px 0 !important; }
.pagination > li > a,
.pagination > li > span {
  border: 1px solid var(--l-border) !important;
  color: var(--l-text-sec) !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  transition: all var(--l-transition) !important;
  background: var(--l-surface) !important;
}
.pagination > li > a:hover { background: var(--l-bg) !important; border-color: var(--l-border-h) !important; color: var(--l-primary) !important; }
.pagination > .active > a,
.pagination > .active > span {
  background: var(--l-primary) !important;
  border-color: var(--l-primary) !important;
  color: #fff !important;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span { border-radius: var(--l-radius-sm) 0 0 var(--l-radius-sm) !important; }
.pagination > li:last-child > a,
.pagination > li:last-child > span  { border-radius: 0 var(--l-radius-sm) var(--l-radius-sm) 0 !important; }

/* ─────────────────────────────────────────────
   13. PANELS (usados em alguns views)
   ───────────────────────────────────────────── */
.panel {
  border: 1px solid var(--l-border) !important;
  border-radius: var(--l-radius-lg) !important;
  box-shadow: var(--l-shadow-sm) !important;
  margin-bottom: 20px !important;
}
.panel-heading {
  border-radius: var(--l-radius-lg) var(--l-radius-lg) 0 0 !important;
  padding: 12px 16px !important;
  font-weight: 600 !important;
}
.panel-default > .panel-heading { background: var(--l-bg) !important; border-bottom: 1px solid var(--l-border) !important; color: var(--l-text) !important; }
.panel-body { padding: 16px !important; }

/* ─────────────────────────────────────────────
   14. TOASTR OVERRIDES
   ───────────────────────────────────────────── */
#toast-container > div {
  border-radius: var(--l-radius) !important;
  box-shadow: var(--l-shadow-lg) !important;
  border: none !important;
  font-size: 13px !important;
  opacity: 1 !important;
}
#toast-container > .toast-success { background-color: var(--l-success) !important; }
#toast-container > .toast-error   { background-color: var(--l-danger) !important; }
#toast-container > .toast-warning { background-color: var(--l-warning) !important; }
#toast-container > .toast-info    { background-color: var(--l-info) !important; }

/* ─────────────────────────────────────────────
   15. LOADING OVERLAY
   ───────────────────────────────────────────── */
.carregando {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(15, 23, 42, 0.5) !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
  gap: 12px !important;
}
.carregando .fa-spinner { position: static !important; color: #fff !important; font-size: 32px !important; }
.carregando .mensagem   { position: static !important; color: #fff !important; font-size: 14px !important; font-weight: 500 !important; }

/* ─────────────────────────────────────────────
   16. WELLS
   ───────────────────────────────────────────── */
.well {
  background: var(--l-bg) !important;
  border: 1px solid var(--l-border) !important;
  border-radius: var(--l-radius) !important;
  box-shadow: none !important;
  padding: 16px !important;
}

/* ─────────────────────────────────────────────
   17. FILTROS / SEÇÕES COLAPSÁVEIS
   ───────────────────────────────────────────── */
.filtro {
  background: var(--l-bg) !important;
  border: 1px solid var(--l-border) !important;
  border-radius: var(--l-radius) !important;
  padding: 16px !important;
  margin-bottom: 16px !important;
}
.filtro .botoes {
  padding-top: 8px !important;
  margin-top: 12px !important;
  border-top: 1px solid var(--l-border) !important;
}

/* ─────────────────────────────────────────────
   18. MISCELLANEOUS
   ───────────────────────────────────────────── */

/* Glyphicon substitute via Font Awesome (datepicker usa glyphicon) */
.glyphicon-calendar:before      { font-family: 'Font Awesome 5 Free' !important; content: "\f133" !important; font-weight: 900 !important; }
.glyphicon-chevron-left:before  { font-family: 'Font Awesome 5 Free' !important; content: "\f053" !important; font-weight: 900 !important; }
.glyphicon-chevron-right:before { font-family: 'Font Awesome 5 Free' !important; content: "\f054" !important; font-weight: 900 !important; }

/* Remove Bootstrap 3 box-shadow padrão */
.form-control, .btn, .panel, .well { box-shadow: none; }

/* HR moderno */
hr { border-color: var(--l-border) !important; margin: 16px 0 !important; }

/* Footer */
.footer { border-top: 1px solid var(--l-border) !important; background: var(--l-surface) !important; padding: 12px 20px !important; font-size: 12px !important; color: var(--l-muted) !important; }

/* ─────────────────────────────────────────────
   19. RESPONSIVO
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .wrapper-content { padding: 12px !important; }
  .ibox-content { padding: 14px !important; }
  .modal-footer { flex-direction: column-reverse !important; }
  .modal-footer .btn { width: 100% !important; }
}

/* ─────────────────────────────────────────────
   20. SCROLLBAR GLOBAL (opcional, sutil)
   ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--l-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--l-border-h); }

/* ─────────────────────────────────────────────
   21. LOGIN MODERNO
   ───────────────────────────────────────────── */

/* Wrapper centraliza vertical e horizontalmente */
.login-modern-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

/* Card com glassmorphism */
.login-modern-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 44px 36px 32px;
  animation-duration: 0.6s;
}

/* Header */
.login-modern-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-modern-logo {
  width: 180px;
  height: auto;
  margin-bottom: 16px;
}

.login-modern-subtitle {
  color: var(--l-text-sec);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
  font-weight: 400;
}

/* Form */
.login-modern-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Campo de input com ícone */
.login-field {
  position: relative;
}

.login-field-icon {
  position: absolute;
  right: 14px;
  top: 22px;
  color: var(--l-muted);
  font-size: 14px;
  z-index: 2;
  pointer-events: none;
  transition: color var(--l-transition);
  display: flex;
  align-items: center;
  height: 44px;
  line-height: 44px;
}

.login-field:focus-within .login-field-icon {
  color: var(--l-primary);
}

.login-field-input label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--l-text-sec);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.login-field-input .form-control {
  width: 100%;
  height: 44px;
  padding: 10px 40px 10px 14px;
  font-size: 14px;
  color: var(--l-text);
  background: rgba(241, 245, 249, 0.7);
  border: 1.5px solid var(--l-border);
  border-radius: var(--l-radius);
  transition: all var(--l-transition);
  box-shadow: none;
}

.login-field-input .form-control::placeholder {
  color: var(--l-muted);
  font-weight: 400;
}

.login-field-input .form-control:focus {
  background: #fff;
  border-color: var(--l-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

/* Erro de validação */
.login-field-error {
  display: block;
  font-size: 12px;
  color: var(--l-danger);
  margin-top: 4px;
  padding-left: 2px;
}

/* Botão de login */
.login-modern-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  margin-top: 6px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--l-primary) 0%, #1d4ed8 100%);
  border: none;
  border-radius: var(--l-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  letter-spacing: 0.02em;
}

.login-modern-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.login-modern-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.login-modern-btn i {
  font-size: 13px;
  transition: transform 0.2s ease;
}

.login-modern-btn:hover i {
  transform: translateX(3px);
}

/* Links */
.login-modern-links {
  text-align: center;
  margin-top: 2px;
}

.login-modern-links a {
  font-size: 13px;
  color: var(--l-primary);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--l-transition);
}

.login-modern-links a:hover {
  color: var(--l-primary-h);
  text-decoration: underline;
}

/* Footer */
.login-modern-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.login-modern-footer span {
  font-size: 12px;
  color: var(--l-muted);
  font-weight: 400;
}

/* Responsivo mobile */
@media (max-width: 480px) {
  .login-modern-card {
    padding: 32px 24px 24px;
    border-radius: 16px;
    margin: 0 8px;
  }

  .login-modern-logo {
    width: 150px;
  }

  .login-modern-subtitle {
    font-size: 13px;
  }

  .login-field-input .form-control {
    height: 42px;
    font-size: 14px;
  }

  .login-modern-btn {
    height: 44px;
    font-size: 14px;
  }
}

/* ========================================================
   === TRANSFERÊNCIAS — Componentes modernos (tf-*) v1.1
   ======================================================== */

/* --- KPI Cards --- */
.tf-kpi-card {
    display: block !important;
    width: 100%;
    min-height: 76px;
    border-radius: 14px;
    padding: 16px 18px;
    color: #fff !important;
    background: #2563EB;
    box-shadow: 0 4px 16px rgba(0,0,0,.14);
    cursor: pointer;
    transition: all .18s ease;
    text-decoration: none !important;
    margin-bottom: 12px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.tf-kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}
.tf-kpi-card:hover,
.tf-kpi-card:focus,
.tf-kpi-card:active {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(0,0,0,.2);
    color: #fff !important;
    text-decoration: none !important;
}
.tf-kpi-card:visited {
    color: #fff !important;
}
.tf-kpi-card__icon {
    float: left;
    width: 42px;
    height: 42px;
    line-height: 42px;
    opacity: .9;
    font-size: 28px;
    text-align: center;
    margin-right: 14px;
}
.tf-kpi-card__body {
    overflow: hidden;
    text-align: right;
    padding-top: 2px;
}
.tf-kpi-card__value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    display: block;
    margin: 0 0 4px 0;
}
.tf-kpi-card__label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .88;
    display: block;
    margin: 0;
    font-weight: 500;
}
.tf-kpi--blue   { background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%) !important; }
.tf-kpi--navy   { background: linear-gradient(135deg, #1e3a5f 0%, #0f2a47 100%) !important; }
.tf-kpi--red    { background: linear-gradient(135deg, #EF4444 0%, #b91c1c 100%) !important; }
.tf-kpi--gray   { background: linear-gradient(135deg, #64748B 0%, #475569 100%) !important; }
.tf-kpi--teal   { background: linear-gradient(135deg, #0891B2 0%, #0e7490 100%) !important; }

/* --- Badges de situação --- */
.tf-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.tf-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    opacity: .7;
}
.tf-badge i { font-size: 10px; opacity: .8; cursor: pointer; }
.tf-badge--gerada      { background: #FEF3C7; color: #92400E; }
.tf-badge--andamento   { background: #DBEAFE; color: #1E40AF; }
.tf-badge--concluida   { background: #D1FAE5; color: #065F46; }
.tf-badge--divergencia { background: #FEE2E2; color: #991B1B; }
.tf-badge--cancelada   { background: #F1F5F9; color: #64748B; }

/* --- Realce de linhas da tabela --- */
#itens-transferencia tbody tr.tr-serial > td {
    background-color: #FEFCE8 !important;
}
#itens-transferencia tbody tr.tr-serial {
    border-left: 3px solid #EAB308 !important;
    border-bottom: 1px solid #EAB308 !important;
}
#itens-transferencia tbody tr.tr-atrasada > td {
    background-color: #FEF2F2 !important;
}
#itens-transferencia tbody tr.tr-atrasada {
    border-left: 3px solid #EF4444 !important;
    border-bottom: 1px solid #EF4444 !important;
}
#itens-transferencia tbody tr.tr-gerada > td {
    background-color: #FFFBEB !important;
}
#itens-transferencia tbody tr.tr-gerada {
    border-left: 3px solid #FCD34D !important;
    border-bottom: 1px solid #FDE68A !important;
}

/* --- Grupo de ações (dropdown) --- */
.tf-action-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: nowrap;
}
.tf-action-group > .btn,
.tf-action-group > .btn-group > .btn {
    border-radius: 6px !important;
}
.tf-action-group .dropdown-menu {
    min-width: 220px !important;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,.14);
    border: 1px solid #E2E8F0;
    padding: 6px 0;
    right: 0 !important;
    left: auto !important;
    margin-right: 0;
}
.tf-action-group .dropdown-menu > li > a,
.tf-action-group .dropdown-menu > li > button {
    padding: 10px 16px !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center;
    gap: 10px;
    color: #0F172A;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.tf-action-group .dropdown-menu > li > a:hover,
.tf-action-group .dropdown-menu > li > button:hover {
    background: #F1F5F9 !important;
    color: #0F172A;
    text-decoration: none;
}
.tf-action-group .dropdown-menu > li > a i,
.tf-action-group .dropdown-menu > li > button i {
    width: 16px;
    font-size: 14px;
    text-align: center;
    flex-shrink: 0;
}
.tf-action-group .dropdown-menu > li.divider { margin: 4px 0; }
.tf-action-group .dropdown-menu > li > a.item-danger,
.tf-action-group .dropdown-menu > li > button.item-danger { color: #DC2626; }
.tf-action-group .dropdown-menu > li > a.item-danger:hover,
.tf-action-group .dropdown-menu > li > button.item-danger:hover { background: #FEF2F2; }
