/* ============================================================
   SoGest — Design System (moderno · responsivo · flexível)
   ============================================================ */

/* --- 1. Tokens ---------------------------------------------- */
:root {
  --font-sans: 'Segoe UI', system-ui, -apple-system, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', 'Courier New', monospace;

  --primary: #3b82f6;
  --primary-600: #2563eb;
  --primary-50: #eff6ff;
  --success: #10b981;
  --success-50: #ecfdf5;
  --danger: #ef4444;
  --danger-50: #fef2f2;
  --warning: #f59e0b;
  --warning-50: #fffbeb;
  --info: #06b6d4;
  --info-50: #ecfeff;

  --surface: #ffffff;
  --bg: #f1f5f9;
  --bg-grad: radial-gradient(1200px 500px at 100% -10%, #dbeafe 0%, transparent 55%),
             radial-gradient(900px 420px at -10% 110%, #e0f2fe 0%, transparent 55%), var(--bg);
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;

  --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --sidebar-width: 250px;
  --sidebar-text: #cbd5e1;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);

  --ring: 0 0 0 3px rgba(59, 130, 246, .22);
  --transition: .18s ease;
}

/* --- 2. Base / tipografia ----------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-grad);
  background-attachment: fixed;
}
a { color: var(--primary-600); transition: color var(--transition); }
a:hover { color: #1d4ed8; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.01em; }
::selection { background: rgba(59, 130, 246, .25); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* --- 3. Cabeçalho ------------------------------------------- */
.navbar.main-header {
  position: sticky; top: 0; z-index: 1034;
  width: auto; margin-left: 0;
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  min-height: 56px;
  padding: .4rem 1rem;
}
@media (min-width: 992px) {
  .navbar.main-header { margin-left: var(--sidebar-width); }
  body.sidebar-collapse .navbar.main-header { margin-left: 0; }
}
.main-header .nav-link {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--muted); border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.main-header .nav-link:hover { background: rgba(15, 23, 42, .06); color: var(--text); }

.avatar-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff; font-size: .78rem; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; flex-shrink: 0;
}
.main-header .user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575.98px) {
  .main-header .user-name { display: none; }
}
.navbar-badge {
  background: var(--danger) !important; color: #fff;
  border: 2px solid #fff; min-width: 18px; height: 18px; line-height: 14px;
  padding: 0 4px; font-size: .65rem; border-radius: 9px !important;
}

/* Busca rápida (navbar) */
.quick-nav { position: relative; display: none; align-items: center; }
.quick-nav-box {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: .32rem .85rem; width: 240px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.quick-nav-box:focus-within { background: #fff; border-color: var(--primary); box-shadow: var(--ring); }
.quick-nav-box i { color: var(--muted); font-size: .82rem; }
.quick-nav-box input {
  border: 0; background: transparent; outline: none; width: 100%;
  font-size: .875rem; color: var(--text);
}
.quick-nav-box kbd {
  background: #fff; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 .35rem; font-size: .65rem; color: var(--muted);
  white-space: nowrap; flex-shrink: 0;
}
.quick-nav-results {
  position: absolute; top: calc(100% + .45rem); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 320px; overflow-y: auto; display: none; z-index: 1050; padding: .35rem;
}
.quick-nav-results.open { display: block; }
.quick-nav-results a {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem;
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: .875rem;
}
.quick-nav-results a:hover, .quick-nav-results a.active { background: var(--primary-50); color: var(--primary-600); }
.quick-nav-results .empty { padding: .7rem; color: var(--muted); font-size: .85rem; text-align: center; }

/* Dropdowns */
.dropdown-menu {
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .4rem; background: var(--surface);
}
.dropdown-item { border-radius: var(--radius-sm); padding: .5rem .9rem; font-size: .88rem; }
.dropdown-item i { width: 1.1rem; color: var(--muted); }
.dropdown-header { font-weight: 700; color: var(--text); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding-top: .6rem; }

/* --- 4. Sidebar --------------------------------------------- */
.main-sidebar {
  background: var(--sidebar-bg);
  background-color: #0f172a;
  border-right: 1px solid rgba(148, 163, 184, .12);
}
.sidebar-dark-primary .nav-pills > .nav-item > .nav-link { background: transparent; }
.brand-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .95rem 1rem; border-bottom: 1px solid rgba(148, 163, 184, .15);
}
.brand-link .brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff; font-size: .95rem; box-shadow: 0 4px 10px rgba(59, 130, 246, .4);
}
.brand-link .brand-text { color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-link .brand-text small {
  display: block; font-size: .62rem; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .14em;
}
.user-panel { border-bottom: 1px solid rgba(148, 163, 184, .15); gap: .6rem; padding: .75rem 1rem; }
.user-panel .info { gap: .1rem; }
.user-panel .info > a { color: #fff; font-size: .875rem; padding: 0; font-weight: 600; }
.user-panel .info > span {
  padding: 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #93c5fd;
}
.sidebar { padding: .5rem .6rem .75rem; }
.sidebar .nav-header {
  margin-top: .9rem; padding: 0 .65rem .35rem;
  font-size: .66rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #94a3b8;
}
.sidebar .nav-sidebar > .nav-item { margin: 1px 0; }
.sidebar .nav-sidebar > .nav-item > .nav-link {
  padding: .58rem .75rem; border-radius: var(--radius-sm);
  color: #e2e8f0; font-weight: 500; font-size: .9rem;
  position: relative; gap: .15rem;
}
.sidebar .nav-sidebar > .nav-item > .nav-link:hover { background: rgba(148, 163, 184, .18); color: #fff; }
.sidebar .nav-sidebar > .nav-item > .nav-link.active {
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(37, 99, 235, .45);
}
.sidebar .nav-sidebar > .nav-item > .nav-link.active::before {
  content: ''; position: absolute; left: -.6rem; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0; background: #93c5fd;
}
.nav-icon { color: inherit; opacity: .95; }
.nav-treeview > .nav-item > .nav-link { color: #cbd5e1; padding: .45rem 1rem .45rem 2.6rem; font-size: .85rem; border-radius: var(--radius-sm); }
.nav-treeview > .nav-item > .nav-link:hover { background: rgba(148, 163, 184, .16); color: #fff; }
.nav-treeview > .nav-item > .nav-link.active { background: rgba(59, 130, 246, .3); color: #fff; font-weight: 600; }
.nav-treeview .nav-link p { display: inline-block; margin: 0; white-space: nowrap; }
.nav-sidebar .nav-link .right { float: right; margin-top: 2px; transition: transform var(--transition); }
.nav-item.menu-open > .nav-link .right { transform: rotate(-90deg); }

/* Overlay do menu mobile */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 1037;
  background: rgba(15, 23, 42, .55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
}
@media (max-width: 991.98px) {
  body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
}

/* --- 5. Área de conteúdo ------------------------------------ */
.content-wrapper { background: transparent; box-shadow: none; }
.content-header { padding: 1rem .75rem .3rem; }
.content-header > .container-fluid { padding-left: 15px; padding-right: 15px; }
.content-header h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.breadcrumb {
  background: transparent; padding: 0; margin: 0;
  font-size: .82rem; color: var(--muted);
}
.breadcrumb-item a { color: var(--muted); }
.breadcrumb-item.active { color: var(--primary-600); font-weight: 600; }
.breadcrumb-item + .breadcrumb-item::before { content: '\203A'; color: #94a3b8; padding: 0 .45rem; font-weight: 700; }

/* --- 6. Cartões --------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: .85rem 1.15rem; font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.card-header .card-title { margin: 0; font-weight: 700; }
.card-body { padding: 1.15rem; }
.card-footer { background: #f8fafc; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }

/* --- 7. Botões ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .89rem;
  padding: .5rem 1rem; border: 1px solid transparent;
  transition: background var(--transition), box-shadow var(--transition), transform .1s ease, border-color var(--transition);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--primary-600); }
.btn-primary:hover, .btn-primary:focus { background: #1d4ed8; color: #fff; }
.btn-success { background: var(--success); }
.btn-success:hover, .btn-success:focus { background: #059669; color: #fff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover, .btn-danger:focus { background: #dc2626; color: #fff; }
.btn-warning { background: var(--warning); color: #1f2937; }
.btn-warning:hover, .btn-warning:focus { background: #d97706; color: #fff; }
.btn-info { background: var(--info); }
.btn-info:hover, .btn-info:focus { background: #0891b2; color: #fff; }
.btn-secondary { background: #e2e8f0; color: #334155; border-color: #e2e8f0; }
.btn-secondary:hover { background: #cbd5e1; color: #0f172a; }
.btn-light { background: #fff; border-color: var(--border); color: #334155; }
.btn-light:hover { background: #f8fafc; }
.btn-dark { background: #1e293b; }
.btn-dark:hover { background: #0f172a; color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; border-radius: 7px; }
.btn-lg { padding: .7rem 1.35rem; font-size: 1rem; border-radius: var(--radius); }

/* --- 8. Formulários ----------------------------------------- */
.form-group { margin-bottom: 1rem; }
.form-group > label, .col-form-label {
  display: block; margin-bottom: .38rem;
  font-size: .82rem; font-weight: 600; color: #334155;
  letter-spacing: .01em;
}
.form-control, .custom-select {
  display: block; width: 100%;
  padding: .55rem .8rem; font-size: .9rem; color: var(--text);
  background: #f8fafc; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.form-control:hover { border-color: #cbd5e1; }
.form-control:focus, .custom-select:focus {
  outline: none; background: #fff;
  border-color: var(--primary); box-shadow: var(--ring);
}
.form-control::placeholder { color: #94a3b8; }
.form-control[disabled] { background: #f1f5f9; color: #94a3b8; }
textarea.form-control { min-height: 90px; resize: vertical; }
.input-group-text {
  background: #f8fafc; border: 1.5px solid var(--border);
  color: var(--muted); border-radius: var(--radius-sm); font-size: .87rem;
}
.input-group > .form-control { border-radius: var(--radius-sm); }
.input-group-addon-left .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.form-check { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; padding-left: 0; }
.form-check input { position: static; margin: 0; accent-color: var(--primary); width: 1rem; height: 1rem; flex-shrink: 0; }
.form-check label { margin: 0; font-weight: 500; cursor: pointer; }
.was-validated .form-control:invalid { border-color: var(--danger); background: var(--danger-50); }
.was-validated .form-control:valid { border-color: var(--success); }
.form-control.is-invalid { border-color: var(--danger); background: var(--danger-50); }
.invalid-feedback { color: var(--danger); font-size: .78rem; margin-top: .3rem; }
.text-muted { color: var(--muted); }

/* --- 8b. Formulários: layout, secções e painéis --------------- */
.form-wrap { max-width: 980px; margin: 0 auto; }
.form-wrap-sm { max-width: 760px; }
.form-header-sub { font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: .2rem; }
.card-title i { margin-right: .4rem; }
.card-tools .btn i { margin-right: .3rem; }
label .req { color: var(--danger); font-weight: 700; margin-left: 1px; }
.form-text { display: block; font-size: .75rem; color: var(--muted); margin-top: .32rem; line-height: 1.4; }
.form-section { border-top: 1px dashed var(--border); padding-top: 1.05rem; margin-top: 1.05rem; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section-title {
  display: flex; align-items: center; gap: .55rem; margin-bottom: .9rem;
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-600);
}
.form-section-title i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--primary-50); color: var(--primary-600); font-size: .88rem;
  line-height: 1;
}
.card-body > .row, .card-body > .form-section > .row { margin-left: 0; margin-right: 0; }
.form-actions {
  display: flex; justify-content: flex-end; align-items: center;
  gap: .6rem; flex-wrap: wrap; background: #f8fafc;
}
.form-actions .btn i { margin-right: .35rem; }
@media (max-width: 576px) {
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
}
.info-panel {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  background: #f8fafc; border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); padding: .65rem .9rem;
  font-size: .86rem; color: #334155; min-height: 46px; line-height: 1.45;
}
.info-panel strong { font-size: 1rem; color: var(--text); font-weight: 700; }
.info-panel .hint { color: var(--muted); }
.pay-strip-title { font-size: .82rem; font-weight: 600; color: #334155; margin-bottom: .45rem; }
.pay-strip-title i { color: var(--primary); margin-right: .35rem; }
.pay-strip-title span { color: var(--muted); font-weight: 400; }
.pay-strip-items { display: flex; gap: .7rem; flex-wrap: wrap; }
.pay-strip-item {
  flex: 1 1 170px; min-width: 150px;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  background: #f8fafc; border: 1px solid var(--border); border-left: 4px solid #94a3b8;
  border-radius: var(--radius-sm); padding: .55rem .8rem;
}
.pay-strip-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.pay-strip-value { font-size: 1rem; color: var(--text); font-weight: 700; white-space: nowrap; }
.delta-pos { color: var(--success); font-weight: 700; }
.delta-neg { color: var(--danger); font-weight: 700; }
.delta-zero { color: var(--muted); font-weight: 700; }
select.form-control {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 14px;
  padding-right: 2.1rem;
}
.input-group-text { min-width: 44px; justify-content: center; }
.file-upload { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.file-upload input[type="file"] { display: none; }
.file-upload .file-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  padding: .55rem .95rem; cursor: pointer; background: #f8fafc;
  color: var(--primary-600); font-weight: 600; font-size: .85rem;
  transition: border-color var(--transition), background var(--transition);
}
.file-upload .file-btn:hover { border-color: var(--primary); background: var(--primary-50); }
.file-upload .file-name { font-size: .8rem; color: var(--muted); }
.file-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* --- 9. Tabelas --------------------------------------------- */
.table-responsive { -webkit-overflow-scrolling: touch; }
.table { margin-bottom: 0; color: var(--text); }
.table thead th {
  background: #f8fafc; color: #64748b;
  font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  border-bottom: 2px solid var(--border); border-top: 0;
  padding: .7rem .85rem; white-space: nowrap;
}
.table td { padding: .72rem .85rem; border-top: 1px solid var(--border); vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd) > td { background: #f8fafc; }
.table-hover > tbody > tr:hover > td { background: var(--primary-50); }
.table-bordered td, .table-bordered th { border-color: var(--border); }
.table-sm td, .table-sm th { padding: .45rem .7rem; }
.table tfoot td {
  background: #f1f5f9; font-weight: 700; color: var(--text);
  border-top: 2px solid var(--border); padding: .6rem .85rem;
}
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: .35rem .7rem; background: #f8fafc; width: auto !important;
}
.dataTables_wrapper .dataTables_filter input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); background: #fff; }
.dataTables_wrapper .dataTables_length select { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .25rem .4rem; background: #f8fafc; }
.dataTables_wrapper .dataTables_info { color: var(--muted); font-size: .8rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 7px !important; border: 1px solid var(--border) !important;
  margin: 0 2px; transition: all var(--transition);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--primary-600) !important; border-color: var(--primary-600) !important; color: #fff !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--primary-50) !important; color: var(--primary-600) !important; }

/* --- 10. Badges / estados ----------------------------------- */
.badge {
  display: inline-block; padding: .3em .7em; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; line-height: 1;
}
.badge-primary { background: var(--primary-50); color: var(--primary-600); }
.badge-success { background: var(--success-50); color: #047857; }
.badge-danger { background: var(--danger-50); color: #b91c1c; }
.badge-warning { background: var(--warning-50); color: #b45309; }
.badge-info { background: var(--info-50); color: #0e7490; }
.badge-dark { background: #1e293b; color: #fff; }
.badge-light { background: #f1f5f9; color: #475569; border: 1px solid var(--border); }

.alert { border: 0; border-radius: var(--radius); font-size: .89rem; padding: .85rem 1.1rem; }
.alert-success { background: var(--success-50); color: #065f46; }
.alert-danger { background: var(--danger-50); color: #991b1b; }
.alert-warning { background: var(--warning-50); color: #92400e; }
.alert-info { background: var(--info-50); color: #155e75; }

.status-active { color: var(--success); font-weight: 600; }
.status-inactive { color: var(--danger); font-weight: 600; }

/* --- 11. Small-boxes / info-boxes --------------------------- */
.small-box {
  border: 0; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 1.25rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.small-box:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.small-box > .inner { padding: 1.15rem 1.25rem .9rem; position: relative; z-index: 1; }
.small-box h3 { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; }
.small-box p { font-size: .87rem; opacity: .92; }
.small-box .icon {
  top: 14px; right: 16px; font-size: 3.2rem; opacity: .18;
  transition: transform .3s ease, opacity .3s ease;
}
.small-box:hover .icon { transform: scale(1.12) rotate(-6deg); opacity: .3; }
.small-box .small-box-footer {
  position: relative; z-index: 1; padding: .65rem 1.25rem;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: .82rem; font-weight: 600; text-decoration: none;
}
.small-box .small-box-footer:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.small-box.bg-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.small-box.bg-success { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }
.small-box.bg-danger  { background: linear-gradient(135deg, #f87171, #dc2626); color: #fff; }
.small-box.bg-warning { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; }
.small-box.bg-info    { background: linear-gradient(135deg, #22d3ee, #0891b2); color: #fff; }

.info-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: .9rem 1rem; transition: box-shadow var(--transition);
}
.info-box:hover { box-shadow: var(--shadow); }
.info-box-icon { border-radius: var(--radius-sm); box-shadow: 0 4px 10px rgba(15, 23, 42, .12); }
.info-box-number { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; display: block; }
.info-box-text { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; display: block; }

/* --- 12. Callouts ------------------------------------------- */
.callout { border-radius: var(--radius); border-left-width: 4px; font-size: .89rem; }
.callout-success { background: var(--success-50); color: #065f46; }
.callout-danger { background: var(--danger-50); color: #991b1b; }
.callout-warning { background: var(--warning-50); color: #92400e; }
.callout-info { background: var(--info-50); color: #155e75; }

/* --- 13. Modal ---------------------------------------------- */
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--border); padding: 1rem 1.35rem; }
.modal-title { font-weight: 700; }
.modal-body { padding: 1.35rem; }
.modal-footer { border-top: 1px solid var(--border); padding: .9rem 1.35rem; background: #f8fafc; }

/* --- 14. Produtos / POS ------------------------------------- */
.product-card {
  cursor: pointer; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .8rem; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
#pos-cart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); }
#posCartItems .btn { padding: 2px 8px; font-size: 11px; }
.pos-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .85rem; }
.pos-cat-bar { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.pos-cat-chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.pos-cat-chip:hover { border-color: var(--primary); color: var(--primary); }
.pos-cat-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pos-cat-chip.active .pos-cat-count { background: rgba(255, 255, 255, .25); color: #fff; }
.pos-cat-count {
  display: inline-block; min-width: 1.25rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--primary-50, #eef2ff); color: var(--primary); font-size: .7rem;
  font-weight: 700; text-align: center; line-height: 1.25rem;
}
.pos-cat-header {
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 1px solid var(--border);
  padding: .5rem 0 .25rem; margin: .6rem 0 .55rem;
}
.opacity-50 { opacity: .5; }

/* --- 15. Relatórios / gráficos ------------------------------ */
.chart-container { position: relative; height: 300px; width: 100%; }

/* --- 16. Pesquisa rápida (formulários) ---------------------- */
.quick-search { position: relative; }
.quick-search .search-results {
  position: absolute; top: calc(100% + .3rem); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 300px; overflow-y: auto; display: none; z-index: 1040;
}
.quick-search .search-results.active { display: block; }

/* --- 17. Barcodes / recibos --------------------------------- */
.barcode-display {
  font-family: var(--font-mono); font-size: 24px; text-align: center;
  padding: 20px; border: 2px dashed var(--border); border-radius: var(--radius);
  background: #f8fafc;
}
.print-receipt { max-width: 380px; margin: 0 auto; font-size: 12px; }

/* --- 18. Feedback visual ------------------------------------ */
.spinner-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
}
.spinner-overlay .spinner-border { color: #fff; }
.toast-container { position: fixed; top: 70px; right: 18px; z-index: 9999; }
.loading { opacity: .6; pointer-events: none; }
.table-highlight { animation: highlight 1.2s ease; }
@keyframes highlight { from { background-color: var(--warning-50); } to { background-color: transparent; } }
.currency-MZN::before { content: 'MT '; }

/* --- 19. Rodapé --------------------------------------------- */
.main-footer {
  background: rgba(255, 255, 255, .7); border-top: 1px solid var(--border);
  color: var(--muted); font-size: .8rem; padding: .8rem 1.1rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
}
.main-footer a { color: var(--primary-600); font-weight: 600; }
.main-footer b { color: #475569; }
.footer-meta { display: none; }
@media (min-width: 576px) { .footer-meta { display: block; } }

/* --- 20. Autenticação (login/registo) ----------------------- */
.login-page {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(99, 102, 241, .35), transparent 60%),
    radial-gradient(700px 480px at 0% 110%, rgba(6, 182, 212, .3), transparent 60%),
    linear-gradient(160deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
  background-attachment: fixed;
}
.login-logo a { color: #fff; font-weight: 800; letter-spacing: -.02em; }
.login-logo a b {
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-box { width: 400px; max-width: 92vw; margin: 6vh auto; }
.login-box .card { border: 0; box-shadow: var(--shadow-lg); }
.login-card-body { padding: 2.1rem 2rem 1.7rem; border-radius: var(--radius-lg); }
.login-box-msg { color: var(--muted); font-weight: 500; margin-bottom: 1.4rem; }
.auth-title { font-size: 1.35rem; font-weight: 800; margin-bottom: .25rem; color: var(--text); }
.auth-subtitle { color: var(--muted); font-size: .87rem; margin-bottom: 1.4rem; }
.register-page {
  background:
    radial-gradient(800px 460px at 90% 0%, rgba(59, 130, 246, .3), transparent 60%),
    radial-gradient(700px 460px at 5% 100%, rgba(16, 185, 129, .25), transparent 60%),
    linear-gradient(160deg, #0f172a, #1e293b);
  min-height: 100vh;
}
.register-box { width: 520px; max-width: 94vw; margin: 5vh auto; }

/* --- 21. Responsivo ----------------------------------------- */
@media (min-width: 768px) {
  .quick-nav { display: flex; }
}
@media (max-width: 991.98px) {
  .main-sidebar { width: var(--sidebar-width); }
  .content-wrapper, .main-footer { margin-left: 0 !important; }
  .content-wrapper { overflow-x: hidden; }
}
@media (max-width: 767.98px) {
  .content-header h1 { font-size: 1.2rem; }
  .content-header .breadcrumb { display: none; }
  .card-body { padding: .9rem; }
  .card-header { padding: .75rem .95rem; }
  .table thead th { font-size: .65rem; padding: .6rem .6rem; }
  .table td { padding: .6rem; }
  .main-header { padding: .4rem .6rem; }
  .small-box h3 { font-size: 1.5rem; }
  .dropdown-menu-lg { min-width: 15rem !important; max-width: calc(100vw - 1.5rem); }
  /* As navs ficam inline na barra (o subset bootstrap as tornava absolutas em top:100%) */
  .main-header .navbar-nav {
    position: static; right: auto; top: auto;
    background: transparent; box-shadow: none;
    flex-direction: row; align-items: center;
  }
  .main-header .navbar-nav .nav-link { padding: .45rem .55rem; }
}
@media (max-width: 576px) {
  .btn { padding: .45rem .85rem; }
  .content-header { padding: .85rem .75rem .2rem; }
  .info-box { padding: .7rem .8rem; }
  .info-box-number { font-size: 1.15rem; }
  .row > [class*="col-sm-"], .row > [class*="col-md-"], .row > [class*="col-lg-"] {
    flex: 0 0 100%; max-width: 100%;
  }
}
/* Colunas só com breakpoint md/lg empilham abaixo dele (evita overflow horizontal) */
@media (min-width: 577px) and (max-width: 991.98px) {
  .row > [class*="col-md-"]:not([class*="col-lg-"]),
  .row > [class*="col-lg-"] { flex: 0 0 100%; max-width: 100%; }
  .row > [class*="col-lg-"].col-6 { flex: 0 0 50%; max-width: 50%; }
  .row > [class*="col-lg-"].col-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .row > [class*="col-lg-"].col-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
}

/* --- 22. Acessibilidade ------------------------------------- */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nav-link:focus-visible, .dropdown-item:focus-visible { outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --- 23. Impressão ------------------------------------------ */
@media print {
  .main-header, .main-sidebar, .sidebar-overlay, .main-footer,
  .content-header, .no-print, .btn { display: none !important; }
  .content-wrapper { margin: 0 !important; background: #fff !important; min-height: 0 !important; }
  .content > .container-fluid { padding: 0 !important; }
  body { background: #fff !important; font-size: 12px; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .print-area { display: block !important; }
  a[href]::after { content: ''; }
}
