:root {
    --app-bg: #08111f;
    --app-bg-deep: #050b14;
    --app-surface: #111c2f;
    --app-surface-elevated: #162238;
    --app-surface-muted: #0d1728;
    --app-text: #edf4ff;
    --app-text-muted: #91a3bd;
    --app-border: rgba(148, 163, 184, 0.16);
    --app-border-strong: rgba(148, 163, 184, 0.28);
    --app-primary: #4f8cff;
    --app-primary-hover: #70a1ff;
    --app-primary-soft: rgba(79, 140, 255, 0.14);
    --app-accent: #22d3ee;
    --app-success: #22c55e;
    --app-warning: #fbbf24;
    --app-danger: #fb7185;
    --app-info: #38bdf8;
    --app-header-height: 4.5rem;
    --app-sidebar-width: 15.5rem;
    --app-sidebar-collapsed-width: 5.25rem;
    --app-radius-sm: 0.65rem;
    --app-radius: 0.9rem;
    --app-radius-lg: 1.15rem;
    --app-shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.16);
    --app-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
    --app-font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
        BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    --bs-body-font-family: var(--app-font);
}

[data-bs-theme="dark"] {
    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--app-text);
    --bs-secondary-color: var(--app-text-muted);
    --bs-border-color: var(--app-border);
    --bs-emphasis-color: #ffffff;
    --bs-tertiary-bg: var(--app-surface-muted);
    --bs-link-color: #75a7ff;
    --bs-link-hover-color: #a8c6ff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--app-bg-deep);
    font-size: 16px;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 92% 8%, rgba(34, 211, 238, 0.08), transparent 28rem),
        radial-gradient(circle at 35% 0%, rgba(79, 140, 255, 0.1), transparent 34rem),
        var(--app-bg);
    color: var(--app-text);
    font-family: var(--app-font);
    font-size: 1rem;
    font-synthesis: none;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Reserva o espaço dos ícones antes do carregamento da fonte externa. */
.bi {
    display: inline-flex;
    width: 1em;
    height: 1em;
    flex: 0 0 1em;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: -0.125em;
}

.bi::before {
    line-height: 1;
}

a {
    color: var(--bs-link-color);
    transition: color 160ms ease, opacity 160ms ease;
}

a:hover {
    color: var(--bs-link-hover-color);
}

::selection {
    background: rgba(79, 140, 255, 0.35);
    color: #ffffff;
}

::-webkit-scrollbar {
    width: 0.75rem;
    height: 0.75rem;
}

::-webkit-scrollbar-track {
    background: var(--app-bg-deep);
}

::-webkit-scrollbar-thumb {
    border: 0.2rem solid var(--app-bg-deep);
    border-radius: 999px;
    background: #334155;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1200;
    padding: 0.65rem 0.95rem;
    border-radius: var(--app-radius-sm);
    background: var(--app-primary);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    color: #ffffff;
    transform: translateY(0);
}

/* Estrutura principal */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    height: var(--app-header-height);
    border-bottom: 1px solid var(--app-border);
    background: rgba(8, 17, 31, 0.86);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(18px);
}

.app-header .navbar,
.app-header .container-fluid {
    min-height: 100%;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--app-text);
    text-decoration: none;
}

.app-brand:hover {
    color: #ffffff;
}

.brand-mark {
    display: inline-grid;
    width: 2.55rem;
    height: 2.55rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.82rem;
    background: linear-gradient(135deg, var(--app-primary), #6d5dfc 72%);
    box-shadow: 0 10px 28px rgba(79, 140, 255, 0.28);
    color: #ffffff;
    font-size: 1.15rem;
}

.brand-copy {
    display: grid;
    line-height: 1.2;
}

.brand-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    margin-top: 0.18rem;
    color: var(--app-text-muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.app-header-label {
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 0.72rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: rgba(17, 28, 47, 0.72);
    color: var(--app-text-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.app-header-label i {
    color: var(--app-accent);
}

.app-mobile-menu {
    display: inline-grid;
    width: 2.55rem;
    height: 2.55rem;
    padding: 0;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: 0.78rem;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 1.35rem;
}

.app-mobile-menu:hover,
.app-mobile-menu:focus-visible {
    border-color: rgba(79, 140, 255, 0.5);
    background: var(--app-primary-soft);
    color: #ffffff;
}

.app-user-area {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
}

.app-user-info {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.55rem;
    color: #dce7f7;
}

.app-user-avatar {
    display: inline-grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    background: var(--app-primary-soft);
    color: var(--app-primary-hover);
}

.app-user-name {
    max-width: 12rem;
    overflow: hidden;
    font-size: 0.84rem;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-logout-form {
    margin: 0;
}

.app-logout-button {
    min-height: 2.35rem;
    padding: 0.45rem 0.7rem;
}

.app-wrapper {
    min-height: calc(100vh - var(--app-header-height));
}

.app-stage {
    display: flex;
    min-height: calc(100vh - var(--app-header-height));
    margin-left: var(--app-sidebar-width);
    flex-direction: column;
    transition: margin-left 190ms ease;
}

.app-main {
    width: 100%;
    flex: 1;
    padding: clamp(1.25rem, 2.5vw, 2.35rem);
}

.content-shell {
    width: 100%;
    max-width: 96rem;
    margin-inline: auto;
}

/* Navegação lateral */
.sidebar-desktop {
    position: fixed;
    top: var(--app-header-height);
    bottom: 0;
    left: 0;
    z-index: 1025;
    width: var(--app-sidebar-width);
    padding: 1rem 0.9rem 1.25rem;
    overflow-x: hidden;
    overflow-y: auto;
    flex-direction: column;
    border-right: 1px solid var(--app-border);
    background: rgba(10, 20, 35, 0.92);
    backdrop-filter: blur(18px);
    transition: width 190ms ease, padding 190ms ease;
}

.sidebar-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.sidebar-toggle-btn {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: 0.72rem;
    background: var(--app-surface);
    color: var(--app-text-muted);
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:focus-visible {
    border-color: rgba(79, 140, 255, 0.5);
    background: var(--app-primary-soft);
    color: #ffffff;
}

.sidebar-toggle-btn i {
    transition: transform 190ms ease;
}

.sidebar-title {
    margin: 0 0.7rem 0.65rem;
    color: #64748b;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.78rem;
    min-height: 2.85rem;
    margin-bottom: 0.3rem;
    padding: 0.72rem 0.78rem;
    border: 1px solid transparent;
    border-radius: 0.82rem;
    color: #9aacc4;
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease,
        transform 160ms ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
    border-color: var(--app-border);
    background: rgba(255, 255, 255, 0.035);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar-link.active {
    border-color: rgba(79, 140, 255, 0.24);
    background: linear-gradient(90deg, rgba(79, 140, 255, 0.18), rgba(79, 140, 255, 0.07));
    box-shadow: inset 3px 0 0 var(--app-primary);
    color: #ffffff;
}

.sidebar-link-icon {
    width: 1.25rem;
    min-width: 1.25rem;
    color: var(--app-primary-hover);
    font-size: 1.05rem;
    text-align: center;
}

.sidebar-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-note {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.85rem 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: rgba(17, 28, 47, 0.62);
    color: var(--app-text-muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.app-sidebar-mobile {
    --bs-offcanvas-width: min(19rem, 88vw);
    border-right: 1px solid var(--app-border);
    background: #0b1525;
}

.app-sidebar-mobile .offcanvas-header {
    border-bottom: 1px solid var(--app-border);
}

body.sidebar-collapsed .sidebar-desktop {
    width: var(--app-sidebar-collapsed-width);
    padding-inline: 0.7rem;
}

body.sidebar-collapsed .app-stage {
    margin-left: var(--app-sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-toggle-wrapper {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .sidebar-link-text,
body.sidebar-collapsed .sidebar-note {
    display: none;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-inline: 0.7rem;
}

body.sidebar-collapsed .sidebar-link:hover {
    transform: none;
}

/* Cabeçalhos de página */
.content-shell > .d-flex.align-items-center.justify-content-between.mb-4 {
    gap: 1rem;
    margin-bottom: 1.5rem !important;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--app-border);
}

.content-shell > .d-flex.align-items-center.justify-content-between.mb-4 h2,
.content-shell > .d-flex.align-items-center.justify-content-between.mb-4 h3 {
    margin-bottom: 0.28rem !important;
    color: #f8fbff;
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 780;
    letter-spacing: -0.035em;
}

.content-shell > .d-flex.align-items-center.justify-content-between.mb-4 p {
    color: var(--app-text-muted) !important;
    font-size: 0.94rem;
}

/* Cards */
.card {
    --bs-card-bg: linear-gradient(145deg, rgba(22, 34, 56, 0.96), rgba(15, 26, 44, 0.96));
    --bs-card-border-color: var(--app-border);
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: var(--bs-card-bg);
    box-shadow: var(--app-shadow-sm);
}

.card-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.022);
}

.card-header h3,
.card-header h4,
.card-header h5 {
    color: #f8fbff;
    font-weight: 720;
    letter-spacing: -0.018em;
}

.card-body {
    padding: 1.2rem;
}

/* Métricas */
.metric-card {
    --metric-accent: var(--app-primary);
    --metric-accent-rgb: 79, 140, 255;
    position: relative;
    border-color: rgba(var(--metric-accent-rgb), 0.24);
}

.metric-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.22rem;
    background: var(--metric-accent);
    content: "";
}

.metric-card--active {
    --metric-accent: #2fc985;
    --metric-accent-rgb: 47, 201, 133;
}

.metric-card--linked {
    --metric-accent: #22d3ee;
    --metric-accent-rgb: 34, 211, 238;
}

.metric-card--inactive {
    --metric-accent: #e5485f;
    --metric-accent-rgb: 229, 72, 95;
}

.metric-card--stock {
    --metric-accent: #f4b942;
    --metric-accent-rgb: 244, 185, 66;
}

.metric-card__label {
    margin-bottom: 0.45rem;
    color: var(--app-text-muted);
    font-size: 0.82rem;
    font-weight: 680;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.metric-card__value {
    color: #f8fbff;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 780;
    letter-spacing: -0.04em;
    line-height: 1;
}

.metric-card__value--currency {
    font-size: clamp(1.45rem, 2.5vw, 2.1rem);
    white-space: nowrap;
}

.metric-card__icon {
    display: inline-grid;
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    border: 1px solid rgba(var(--metric-accent-rgb), 0.24);
    border-radius: 0.9rem;
    background: rgba(var(--metric-accent-rgb), 0.12);
    color: var(--metric-accent);
    font-size: 1.35rem;
    place-items: center;
}

/* Gráficos de linha do tempo */
.timeline-chart-card {
    overflow: visible;
}

.timeline-chart-period-selector .btn {
    min-width: 4.25rem;
}

.timeline-chart-period-selector .btn.active {
    border-color: var(--app-primary);
    background: var(--app-primary-soft);
    color: #ffffff;
}

.timeline-chart-container {
    position: relative;
    height: clamp(20rem, 46vw, 28rem);
    min-height: 20rem;
}

.timeline-chart-container--split {
    height: clamp(18rem, 30vw, 22rem);
    min-height: 18rem;
}

.timeline-chart-panel {
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: rgba(7, 16, 29, 0.34);
}

.timeline-chart-panel__header {
    display: flex;
    align-items: center;
    min-height: 3.25rem;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.timeline-chart-panel__header h4 {
    color: #f8fbff;
    font-weight: 720;
}

.timeline-chart-panel__icon {
    display: inline-grid;
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    border: 1px solid rgba(79, 140, 255, 0.24);
    border-radius: 0.75rem;
    background: rgba(79, 140, 255, 0.12);
    color: var(--app-primary-hover);
    font-size: 1.1rem;
    place-items: center;
}

.timeline-chart-panel__icon--success {
    border-color: rgba(47, 201, 133, 0.24);
    background: rgba(47, 201, 133, 0.12);
    color: #2fc985;
}

.timeline-chart-empty {
    display: grid;
    height: 100%;
    color: var(--app-text-muted);
    gap: 0.75rem;
    place-content: center;
    text-align: center;
}

.timeline-chart-empty i {
    color: var(--app-primary-hover);
    font-size: 2rem;
}

.card.border-secondary-subtle,
.company-link-form {
    border-color: var(--app-border) !important;
    background: rgba(7, 16, 29, 0.34);
    box-shadow: none;
}

/* Formulários */
.form-label {
    margin-bottom: 0.42rem;
    color: #dce7f7;
    font-size: 0.84rem;
    font-weight: 650;
}

.form-control,
.form-select {
    min-height: 2.75rem;
    border: 1px solid var(--app-border-strong);
    border-radius: 0.72rem;
    background-color: rgba(6, 14, 26, 0.72);
    color: var(--app-text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

textarea.form-control {
    min-height: 7rem;
}

.form-control::placeholder {
    color: #61738d;
    opacity: 1;
}

.form-control:hover:not(:disabled),
.form-select:hover:not(:disabled) {
    border-color: rgba(112, 161, 255, 0.48);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-primary);
    background-color: rgba(8, 18, 33, 0.96);
    color: #ffffff;
    box-shadow: 0 0 0 0.22rem rgba(79, 140, 255, 0.16);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    border-color: rgba(148, 163, 184, 0.12);
    background-color: rgba(148, 163, 184, 0.07);
    color: #a6b4c8;
    opacity: 1;
}

.form-text {
    color: #7f91aa;
    font-size: 0.76rem;
}

.invalid-feedback {
    margin-top: 0.42rem;
    color: #fda4af;
    font-size: 0.78rem;
}

/* Botões */
.btn {
    min-height: 2.62rem;
    padding: 0.58rem 0.92rem;
    border-radius: 0.72rem;
    font-size: 0.88rem;
    font-weight: 680;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease,
        background-color 150ms ease, color 150ms ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: #5d96ff;
    --bs-btn-hover-border-color: #5d96ff;
    --bs-btn-active-bg: #3978ea;
    --bs-btn-active-border-color: #3978ea;
    --bs-btn-focus-shadow-rgb: 79, 140, 255;
    box-shadow: 0 9px 24px rgba(79, 140, 255, 0.22);
}

.btn-danger {
    --bs-btn-bg: #e84a62;
    --bs-btn-border-color: #e84a62;
    --bs-btn-hover-bg: #f05d72;
    --bs-btn-hover-border-color: #f05d72;
    --bs-btn-focus-shadow-rgb: 232, 74, 98;
}

.btn-copy-success {
    --bs-btn-color: #86efac;
    --bs-btn-border-color: rgba(34, 197, 94, 0.7);
    --bs-btn-bg: rgba(34, 197, 94, 0.14);
}

.btn-copy-error {
    --bs-btn-color: #fda4af;
    --bs-btn-border-color: rgba(251, 113, 133, 0.7);
    --bs-btn-bg: rgba(251, 113, 133, 0.14);
}

.table-copy-field {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.table-copy-button {
    width: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.35rem;
    border-radius: 0.55rem;
}

.btn-outline-primary {
    --bs-btn-color: #8db5ff;
    --bs-btn-border-color: rgba(79, 140, 255, 0.54);
    --bs-btn-hover-bg: var(--app-primary-soft);
    --bs-btn-hover-border-color: var(--app-primary);
    --bs-btn-hover-color: #ffffff;
}

.btn-outline-secondary {
    --bs-btn-color: #a3b2c7;
    --bs-btn-border-color: rgba(148, 163, 184, 0.3);
    --bs-btn-hover-bg: rgba(148, 163, 184, 0.1);
    --bs-btn-hover-border-color: rgba(148, 163, 184, 0.5);
    --bs-btn-hover-color: #ffffff;
}

.btn-outline-info {
    --bs-btn-color: #67d4ff;
    --bs-btn-border-color: rgba(56, 189, 248, 0.55);
    --bs-btn-hover-bg: rgba(56, 189, 248, 0.14);
    --bs-btn-hover-border-color: var(--app-info);
    --bs-btn-hover-color: #dff6ff;
}

.btn-outline-warning {
    --bs-btn-color: #ffd35c;
    --bs-btn-border-color: rgba(251, 191, 36, 0.52);
    --bs-btn-hover-bg: rgba(251, 191, 36, 0.14);
    --bs-btn-hover-border-color: var(--app-warning);
    --bs-btn-hover-color: #fff3c4;
}

.btn-outline-danger {
    --bs-btn-color: #ff8fa1;
    --bs-btn-border-color: rgba(251, 113, 133, 0.5);
    --bs-btn-hover-bg: rgba(251, 113, 133, 0.14);
    --bs-btn-hover-border-color: var(--app-danger);
    --bs-btn-hover-color: #ffd7de;
}

.btn-sm {
    min-height: 2.15rem;
    padding: 0.4rem 0.68rem;
    border-radius: 0.6rem;
    font-size: 0.78rem;
}

.btn:disabled,
.btn.disabled {
    cursor: not-allowed;
    filter: saturate(0.5);
    opacity: 0.48;
}

/* Tabelas */
.table-responsive {
    overflow: auto;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: rgba(15, 26, 44, 0.82);
    box-shadow: var(--app-shadow-sm);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-text);
    --bs-table-border-color: var(--app-border);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.026);
    --bs-table-striped-color: var(--app-text);
    --bs-table-hover-bg: rgba(79, 140, 255, 0.07);
    --bs-table-hover-color: #ffffff;
    min-width: 52rem;
    margin-bottom: 0;
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    padding: 0.82rem 0.78rem;
    border-color: var(--app-border);
}

.table thead th {
    border-top: 0;
    background: rgba(7, 16, 29, 0.55);
    color: #b9c8dc;
    font-size: 0.72rem;
    font-weight: 780;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    color: #d9e4f3;
    font-size: 0.84rem;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.plates-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.plates-table > :not(caption) > * > * {
    padding: 0.4rem 0.28rem;
}

.plates-table thead th {
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: nowrap;
}

.plates-table tbody td {
    font-size: 0.8rem;
    line-height: 1.35;
    white-space: nowrap;
}

.plates-table th:first-child,
.plates-table td:first-child {
    padding-right: 0.28rem;
    padding-left: 0.6rem;
}

.plates-table .table-copy-field {
    gap: 0.2rem;
    white-space: nowrap;
}

.plates-table a {
    white-space: nowrap;
}

.table .btn-sm {
    display: inline-grid;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    place-items: center;
}

.table.plates-table .btn-sm {
    width: 1.5rem;
    min-width: 1.5rem;
    height: 1.5rem;
    min-height: 1.5rem;
}

.plates-table .badge {
    padding: 0.28rem 0.4rem;
    font-size: 0.72rem;
}

/* Feedback, badges e paginação */
.alert {
    border: 1px solid transparent;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
    color: var(--app-text);
}

.alert-success {
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(20, 83, 45, 0.48);
}

.alert-warning {
    border-color: rgba(251, 191, 36, 0.26) !important;
    background: rgba(113, 63, 18, 0.5);
}

.alert-danger {
    border-color: rgba(251, 113, 133, 0.25);
    background: rgba(127, 29, 29, 0.48);
}

.alert-info,
.alert-secondary {
    border-color: var(--app-border);
    background: rgba(30, 41, 59, 0.72);
}

.badge {
    padding: 0.42rem 0.62rem;
    font-size: 0.7rem;
    font-weight: 760;
    letter-spacing: 0.015em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.text-bg-light {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

.text-bg-warning {
    background-color: #fbbf24 !important;
    color: #3b2500 !important;
}

.text-bg-success {
    background-color: #169c52 !important;
    color: #ffffff !important;
}

.text-bg-danger {
    background-color: #e5485f !important;
    color: #ffffff !important;
}

.text-bg-secondary {
    background-color: #53627a !important;
    color: #ffffff !important;
}

.pagination {
    gap: 0.35rem;
}

.page-link {
    min-width: 2.45rem;
    padding: 0.48rem 0.68rem;
    border: 1px solid var(--app-border);
    border-radius: 0.62rem !important;
    background: var(--app-surface);
    color: #a9bad0;
    text-align: center;
}

.page-link:hover {
    border-color: rgba(79, 140, 255, 0.46);
    background: var(--app-primary-soft);
    color: #ffffff;
}

.page-item.active .page-link {
    border-color: var(--app-primary);
    background: var(--app-primary);
    box-shadow: 0 7px 18px rgba(79, 140, 255, 0.22);
    color: #ffffff;
}

.page-item.disabled .page-link {
    border-color: rgba(148, 163, 184, 0.08);
    background: rgba(148, 163, 184, 0.045);
    color: #526176;
}

.app-messages {
    margin-bottom: 1.25rem;
}

/* Autenticação */
.auth-page {
    display: grid;
    min-height: 100vh;
    padding: 1.25rem;
    place-items: center;
    background:
        radial-gradient(circle at 18% 18%, rgba(79, 140, 255, 0.18), transparent 28rem),
        radial-gradient(circle at 82% 82%, rgba(34, 211, 238, 0.1), transparent 26rem),
        var(--app-bg);
}

.auth-card {
    width: min(100%, 28rem);
    padding: clamp(1.35rem, 4vw, 2rem);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: linear-gradient(145deg, rgba(22, 34, 56, 0.97), rgba(10, 20, 35, 0.97));
    box-shadow: var(--app-shadow);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.7rem;
    padding-bottom: 1.3rem;
    border-bottom: 1px solid var(--app-border);
}

.auth-brand h1 {
    color: #f8fbff;
    font-weight: 780;
    letter-spacing: -0.03em;
}

.auth-brand p {
    font-size: 0.88rem;
}

/* Rodapé */
.app-footer {
    padding: 1.1rem clamp(1.25rem, 2.5vw, 2.35rem);
    border-top: 1px solid var(--app-border);
    background: rgba(5, 11, 20, 0.42);
    color: #71839c;
    font-size: 0.76rem;
}

.app-footer i {
    color: var(--app-primary-hover);
}

:focus-visible {
    outline: 3px solid rgba(79, 140, 255, 0.42);
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .app-stage,
    body.sidebar-collapsed .app-stage {
        margin-left: 0;
    }

    .app-main {
        padding: 1.15rem;
    }

    .app-footer {
        padding-inline: 1.15rem;
    }
}

@media (max-width: 767.98px) {
    .content-shell > .d-flex.align-items-center.justify-content-between.mb-4 {
        align-items: stretch !important;
        flex-direction: column;
    }

    .content-shell > .d-flex.align-items-center.justify-content-between.mb-4 > .btn {
        width: 100%;
    }

    .card-header,
    .card-body {
        padding: 1rem;
    }

    .d-flex.flex-wrap.align-items-center.gap-2 > .btn,
    .d-flex.flex-wrap.align-items-center.gap-2 > a.btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 575.98px) {
    :root {
        --app-header-height: 4.1rem;
    }

    .brand-subtitle {
        display: none;
    }

    .brand-mark,
    .app-mobile-menu {
        width: 2.35rem;
        height: 2.35rem;
    }

    .app-user-area {
        gap: 0.4rem;
    }

    .app-user-avatar {
        display: none;
    }

    .app-user-name {
        max-width: 6.5rem;
        font-size: 0.78rem;
    }

    .app-logout-button {
        width: 2.35rem;
        min-height: 2.35rem;
        padding: 0;
    }

    .auth-page {
        padding: 0.9rem;
    }

    .auth-card {
        padding: 1.2rem;
    }

    .app-main {
        padding: 0.9rem;
    }

    .content-shell > .d-flex.align-items-center.justify-content-between.mb-4 h2,
    .content-shell > .d-flex.align-items-center.justify-content-between.mb-4 h3 {
        font-size: 1.45rem;
    }

    .card-header.d-flex {
        align-items: stretch !important;
        flex-direction: column;
    }

    .card-header.d-flex .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
