:root {
  --uff-blue: #123a78;
  --uff-blue-dark: #0b2858;
  --uff-blue-soft: #eaf1fb;
  --surface: #ffffff;
  --surface-muted: #f5f7fb;
  --text: #172033;
  --text-muted: #65708a;
  --border: #dfe5ef;
  --success: #19734b;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(24, 39, 75, .09);
}

html, body { min-height: 100%; font-size: 22px; }

/* Tipografia ampliada para melhorar a leitura em todo o sistema. */
body, .form-control, .btn, .dropdown-menu, .table { font-size: 22px; }
.form-control { min-height: 48px; }
.btn { min-height: 44px; }

body.app-body {
  margin: 0;
  padding-top: 76px;
  color: var(--text);
  background: var(--surface-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.app-navbar {
  min-height: 64px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(105deg, var(--uff-blue-dark), var(--uff-blue));
  box-shadow: 0 4px 18px rgba(8, 34, 78, .18);
}

.app-navbar .navbar-brand { height: 64px; padding: 12px 20px; color: #fff !important; line-height: 20px; }
.app-brand-mark { float: left; width: 40px; height: 40px; margin-right: 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 11px; background: rgba(255,255,255,.14); text-align: center; line-height: 40px; }
.app-brand-copy { display: inline-block; }
.app-brand-copy strong, .app-brand-copy small { display: block; }
.app-brand-copy strong { font-size: 21px; letter-spacing: .01em; }
.app-brand-copy small { margin-top: 1px; color: rgba(255,255,255,.72); font-size: 17px; font-weight: 400; }
.app-navbar .navbar-nav > li > a { padding-top: 22px; padding-bottom: 22px; color: rgba(255,255,255,.88) !important; font-weight: 500; }
.app-navbar .navbar-nav > li > a:hover, .app-navbar .navbar-nav > li > a:focus, .app-navbar .navbar-nav > .active > a, .app-navbar .navbar-nav > .open > a { background: rgba(255,255,255,.13) !important; color: #fff !important; }
.app-navbar .dropdown-menu { padding: 8px; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.app-navbar .dropdown-menu > li > a, .app-logout-button { padding: 9px 12px !important; border-radius: 7px; color: var(--text) !important; }
.app-navbar .dropdown-menu > li > a:hover, .app-logout-button:hover { background: var(--uff-blue-soft) !important; text-decoration: none; }
.app-logout-button { width: 100%; border: 0; background: transparent; text-align: left; }
.app-navbar .navbar-toggle { margin-top: 15px; border-color: rgba(255,255,255,.4); }
.app-navbar .navbar-toggle .icon-bar { background: #fff; }

.app-container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 48px; }
.app-hero { position: relative; overflow: hidden; margin-bottom: 22px; padding: 30px 34px; border-radius: 18px; color: #fff; background: linear-gradient(120deg, var(--uff-blue-dark), #1957a6); box-shadow: var(--shadow); }
.app-hero::after { position: absolute; top: -70px; right: -45px; width: 240px; height: 240px; border: 32px solid rgba(255,255,255,.07); border-radius: 50%; content: ""; }
.app-eyebrow { margin: 0 0 7px; color: #c9dcf7; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.app-hero h1 { position: relative; z-index: 1; margin: 0; font-size: 30px; font-weight: 650; }
.app-hero p:last-child { position: relative; z-index: 1; max-width: 650px; margin: 9px 0 0; color: rgba(255,255,255,.8); }
.app-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.app-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 5px 18px rgba(24,39,75,.05); }
.app-summary-card { display: flex; min-height: 112px; padding: 20px; align-items: center; box-shadow: none; }
.app-summary-icon { display: inline-flex; flex: 0 0 64px; width: 64px; height: 64px; margin-right: 17px; border-radius: 17px; color: var(--uff-blue); background: #e8f0fb; align-items: center; justify-content: center; }
.app-summary-card span.app-summary-icon { display: inline-flex; align-items: center; justify-content: center; }
.app-summary-icon svg { display: block; width: 44px !important; height: 44px !important; margin: 0; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.app-summary-card strong, .app-summary-card span { display: block; }
.app-summary-card strong { margin-bottom: 3px; font-size: 22px; }
.app-summary-card span { color: var(--text-muted); font-size: 13px; }
.app-section { padding: 24px; }
.app-section-header { display: flex; gap: 16px; margin-bottom: 20px; align-items: flex-end; justify-content: space-between; }
.app-section-header h2 { margin: 0 0 4px; font-size: 20px; font-weight: 650; }
.app-section-header p { margin: 0; color: var(--text-muted); }
.app-filter { min-width: 250px; }
.app-filter label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.app-filter .form-control { height: 40px; border-color: var(--border); border-radius: 9px; box-shadow: none; }
.stock-alert { padding: 18px 20px; border: 1px solid #f4c7c3; border-left: 4px solid var(--danger); border-radius: 10px; color: #7a271a; background: #fff5f4; }
.stock-alert.is-ok { border-color: #a9dbc4; border-left-color: var(--success); color: #12593b; background: #f0fbf6; }
.stock-alert h3 { margin: 0 0 10px; font-size: 16px; }
.stock-alert ul { margin: 0; padding-left: 20px; }
.stock-alert li + li { margin-top: 7px; }
.app-loading { padding: 24px; color: var(--text-muted); text-align: center; }
.quick-links { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.quick-link { display: block; padding: 16px; border: 1px solid var(--border); border-radius: 11px; color: var(--text); background: #fff; transition: transform .15s ease,border-color .15s ease,box-shadow .15s ease; }
.quick-link:hover, .quick-link:focus { border-color: #9bb9e2; color: var(--uff-blue); text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(24,63,122,.09); }
.quick-link .glyphicon { margin-right: 7px; color: var(--uff-blue); }

/* Componentes das páginas internas */
.page-header-modern { display: flex; gap: 18px; margin: 0 0 22px; padding: 0; border: 0; align-items: flex-end; justify-content: space-between; }
.page-header-modern h1 { margin: 0 0 5px; color: var(--uff-blue-dark); font-size: 28px; font-weight: 700; }
.page-header-modern p { margin: 0; color: var(--text-muted); }
.page-header-action { flex: 0 0 auto; }
.page-layout { display: grid; grid-template-columns: minmax(280px,340px) minmax(0,1fr); gap: 20px; align-items: start; }
.cadastro-modal-layout { display: block; }
.cadastro-source { display: none; }
.panel-modern { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(24,39,75,.05); }
.panel-modern-header { padding: 19px 21px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.panel-modern-header h2 { margin: 0 0 4px; color: var(--text); font-size: 18px; font-weight: 650; }
.panel-modern-header p { margin: 0; color: var(--text-muted); font-size: 13px; }
.panel-modern-body { padding: 21px; }
.form-modern .form-group { margin-bottom: 17px; }
.form-modern label { margin-bottom: 7px; color: #39445b; font-size: 13px; font-weight: 650; }
.form-modern .optional { color: var(--text-muted); font-size: 11px; font-weight: 400; }
.form-modern .form-control { height: 42px; border-color: var(--border); border-radius: 9px; box-shadow: none; }
.form-modern .form-control:focus { border-color: #6b97d1; box-shadow: 0 0 0 3px rgba(32,91,166,.1); }
.btn-modern { min-height: 40px; padding: 9px 16px; border-radius: 9px; font-weight: 650; }
.btn-modern.btn-primary { border-color: var(--uff-blue); background: var(--uff-blue); }
.btn-modern.btn-primary:hover, .btn-modern.btn-primary:focus { border-color: var(--uff-blue-dark); background: var(--uff-blue-dark); }
.btn-block-modern { width: 100%; }
.filters-modern { display: grid; grid-template-columns: minmax(170px,.8fr) minmax(220px,1.2fr) auto auto; gap: 12px; align-items: end; }
.filters-modern .form-group { margin: 0; }
.filters-modern label { margin-bottom: 7px; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.filter-check { min-height: 40px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfe; white-space: nowrap; }
.filter-check input { margin: 0 6px 0 0; vertical-align: -1px; }
.table-region { margin-top: 20px; }
.table-summary { display: flex; margin-bottom: 10px; color: var(--text-muted); font-size: 13px; align-items: center; justify-content: space-between; }
.table-responsive-modern { overflow-x: auto; border: 1px solid var(--border); border-radius: 11px; }
.table-modern { min-width: 760px; margin: 0; }
.table-modern.table-compact { width: 100%; min-width: 0; table-layout: auto; }
.table-modern.table-compact .actions-cell { width: 96px; }
.table-modern > thead > tr > th { padding: 12px 13px; border: 0; border-bottom: 1px solid var(--border); color: #536079; background: #f7f9fc; font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
.table-modern > tbody > tr > td { padding: 12px 13px; border-top: 1px solid #edf0f5; vertical-align: middle; }
.table-modern > tbody > tr:first-child > td { border-top: 0; }
.table-modern > tbody > tr:hover { background: #f8fbff; }
.table-modern .text-right { text-align: right; }
.table-modern .actions-cell { width: 96px; white-space: nowrap; text-align: right; }
.status-badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.2; }
.status-badge.is-success { color: #14643f; background: #e8f7ef; }
.status-badge.is-warning { color: #874b00; background: #fff2d8; }
.status-badge.is-danger { color: #9f2118; background: #fdecea; }
.status-badge.is-muted { color: #596579; background: #eef1f5; }
.stock-number { font-weight: 700; font-variant-numeric: tabular-nums; }
.stock-number.is-low { color: var(--danger); }
.action-button { width: 32px; height: 32px; padding: 0; border-radius: 8px; line-height: 30px; }
.empty-state { padding: 42px 20px; color: var(--text-muted); text-align: center; }
.empty-state .glyphicon { display: block; margin-bottom: 10px; color: #9aabc3; font-size: 27px; }
.pagination-modern { margin: 16px 0 0; }
.pagination-modern > li > a { margin: 0 2px; border-color: var(--border); border-radius: 7px !important; color: var(--uff-blue); }
.pagination-modern > .active > a, .pagination-modern > .active > a:hover { border-color: var(--uff-blue); background: var(--uff-blue); }
.pagination-compact > li > a, .pagination-compact > li > span { min-width: 34px; padding: 7px 10px; text-align: center; }
.pagination-compact > li.pagination-ellipsis > span { border-color: transparent; color: var(--text-muted); background: transparent; }
.pagination-compact > li.disabled > a { color: #a7afbd; background: #f8f9fb; pointer-events: none; }
.pagination-shell { overflow-x: auto; text-align: center; -webkit-overflow-scrolling: touch; }
.pagination-shell .pagination { display: inline-block; white-space: nowrap; }
.responsive-record-table { min-width: 1050px; table-layout: auto; }
.modal-modern .modal-content { overflow: hidden; border: 0; border-radius: 14px; box-shadow: 0 20px 60px rgba(20,35,65,.24); }
.modal-modern .modal-header { padding: 18px 21px; border-bottom-color: var(--border); background: #fbfcfe; }
.modal-modern .modal-title { color: var(--uff-blue-dark); font-weight: 650; }
.modal-modern .modal-body { padding: 21px; }
.modal-modern .modal-footer { padding: 15px 21px; border-top-color: var(--border); }

body.login-page { display: flex; min-height: 100vh; margin: 0; padding: 28px; align-items: center; justify-content: center; color: var(--text); background: linear-gradient(135deg,#eef3fa,#f8fafc 55%,#e7eef8); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif; }
.login-shell { display: grid; overflow: hidden; width: min(940px,100%); min-height: 540px; grid-template-columns: 1.08fr .92fr; border: 1px solid rgba(19,58,120,.12); border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(24,39,75,.16); }
.login-visual { position: relative; min-height: 540px; background: #fff url("../img/login.jpg") center / contain no-repeat; }
.login-panel { display: flex; padding: 52px 46px; flex-direction: column; justify-content: center; }
.login-badge { display: inline-flex; width: 48px; height: 48px; margin-bottom: 24px; border-radius: 14px; color: #fff; background: var(--uff-blue); align-items: center; justify-content: center; font-size: 20px; }
.login-panel h1 { margin: 0 0 8px; color: var(--uff-blue-dark); font-size: 28px; font-weight: 700; }
.login-subtitle { margin: 0 0 30px; color: var(--text-muted); line-height: 1.55; }
.login-panel .form-group { margin-bottom: 18px; }
.login-panel label { margin-bottom: 7px; color: #39445b; font-size: 13px; }
.login-panel .form-control { height: 46px; border: 1px solid var(--border); border-radius: 10px; box-shadow: none; font-size: 15px; }
.login-panel .form-control:focus { border-color: #6b97d1; box-shadow: 0 0 0 3px rgba(32,91,166,.12); }
.login-submit { width: 100%; min-height: 46px; margin-top: 4px; border: 0; border-radius: 10px; background: var(--uff-blue); font-weight: 650; }
.login-submit:hover, .login-submit:focus { background: var(--uff-blue-dark); }
.login-error { display: none; margin-bottom: 18px; padding: 11px 13px; border: 1px solid #f4c7c3; border-radius: 8px; color: #8a271d; background: #fff5f4; font-size: 13px; }
.login-footer { margin-top: 26px; color: #8992a5; font-size: 12px; text-align: center; }

/* Mantém textos auxiliares e tabelas confortáveis, inclusive onde havia tamanhos inline. */
body .table { font-size: 22px !important; }
body small, body .small { font-size: 19px; }
.app-eyebrow, .app-filter label, .filters-modern label { font-size: 19px; }
.form-modern label, .panel-modern-header p, .table-summary, .app-summary-card span { font-size: 20px; }
.table-modern > thead > tr > th, .status-badge, .responsive-record-table > tbody > tr > td::before { font-size: 18px; }
.login-panel label, .login-error, .login-footer { font-size: 20px; }

@media (max-width: 991px) {
  .app-navbar .navbar-header { float: none; }
  .app-navbar .navbar-toggle { display: block; }
  .app-navbar .navbar-collapse.collapse { display: none !important; }
  .app-navbar .navbar-collapse.collapse.in { display: block !important; }
  .app-navbar .navbar-nav, .app-navbar .navbar-nav > li, .app-navbar .navbar-right { float: none !important; }
  .app-navbar .navbar-nav > li > a { padding-top: 12px; padding-bottom: 12px; }
  .app-navbar .navbar-collapse { border-top-color: rgba(255,255,255,.16); box-shadow: none; }
  .app-navbar .navbar-nav .open .dropdown-menu { margin: 0 8px 8px; padding: 5px; border: 0; border-radius: 9px; background: rgba(3,22,52,.2); box-shadow: none; }
  .app-navbar .navbar-nav .open .dropdown-menu > li > a,
  .app-navbar .navbar-nav .open .dropdown-menu .app-logout-button { color: rgba(255,255,255,.9) !important; }
  .app-navbar .navbar-nav .open .dropdown-menu > li > a:hover,
  .app-navbar .navbar-nav .open .dropdown-menu > li > a:focus,
  .app-navbar .navbar-nav .open .dropdown-menu .app-logout-button:hover,
  .app-navbar .navbar-nav .open .dropdown-menu .app-logout-button:focus { color: #fff !important; background: rgba(255,255,255,.12) !important; }
  .app-navbar .navbar-nav .open .dropdown-menu .divider { background-color: rgba(255,255,255,.18); }
  .app-grid, .quick-links { grid-template-columns: 1fr; }
  .login-shell { max-width: 500px; grid-template-columns: 1fr; }
  .login-visual { min-height: 230px; }
  .page-layout { grid-template-columns: 1fr; }
  .filters-modern { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body.app-body { padding-top: 66px; }
  .app-container { width: min(100% - 20px,1180px); padding-top: 14px; }
  .app-hero, .app-section { padding: 20px; border-radius: 13px; }
  .app-hero h1 { font-size: 24px; }
  .app-section-header { display: block; }
  .app-filter { min-width: 0; margin-top: 16px; }
  body.login-page { padding: 12px; }
  .login-shell { min-height: 0; border-radius: 16px; }
  .login-visual { min-height: 180px; }
  .login-panel { padding: 30px 24px; }
  .page-header-modern { display: block; }
  .page-header-action { width: 100%; margin-top: 14px; }
  .filters-modern { grid-template-columns: 1fr; }
  .panel-modern-body, .panel-modern-header { padding: 17px; }
  .responsive-record-wrap { overflow: visible; border: 0; }
  .responsive-record-table { display: block; min-width: 0; background: transparent; }
  .responsive-record-table thead { display: none; }
  .responsive-record-table tbody, .responsive-record-table tr { display: block; width: 100%; }
  .responsive-record-table tbody tr { overflow: hidden; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(24,39,75,.05); }
  .responsive-record-table > tbody > tr > td { display: grid; width: 100%; min-height: 42px; padding: 10px 12px; grid-template-columns: minmax(112px,40%) minmax(0,1fr); gap: 10px; border: 0; border-bottom: 1px solid #edf0f5; text-align: right; overflow-wrap: anywhere; }
  .responsive-record-table > tbody > tr > td:last-child { border-bottom: 0; }
  .responsive-record-table > tbody > tr > td::before { color: var(--text-muted); content: attr(data-label); font-size: 11px; font-weight: 750; letter-spacing: .03em; text-align: left; text-transform: uppercase; }
}
