:root {
    --etec-red: #C41E3A;
    --etec-dark-red: #8B0000;
    --etec-wine: #722F37;
    --etec-light-red: #DC143C;
    --etec-red-rgb: 196, 30, 58;
    --etec-dark-red-rgb: 139, 0, 0;
    --etec-wine-rgb: 114, 47, 55;
    --etec-light-red-rgb: 220, 20, 60;
    --etec-black: #1a1a1a;
    --etec-white: #ffffff;
    --etec-gray: #f8f9fa;
    --surface-soft: #fff7f8;
    --surface-border: rgba(114, 47, 55, 0.14);
    --surface-shadow: 0 14px 34px rgba(92, 20, 34, 0.12);
    --theme-focus-shadow: 0 0 0 0.2rem rgba(196, 30, 58, 0.25);
    --login-surface-start: #f4e9ea;
    --login-surface-end: #ebe1e2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--etec-gray);
    color: var(--etec-black);
    overflow-x: hidden;
}

.app-page-shell {
    padding-bottom: 8px;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(var(--etec-red-rgb), 0.22), transparent 35%),
        linear-gradient(135deg, var(--login-surface-start) 0%, #f8f9fa 45%, var(--login-surface-end) 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 920px);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: center;
}

.login-brand h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--etec-dark-red);
}

.login-brand p {
    font-size: 1.1rem;
    color: #5a5a5a;
    max-width: 440px;
}

.login-badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(var(--etec-dark-red-rgb), 0.08);
    color: var(--etec-dark-red);
    font-weight: 700;
}

/* Navbar */
.bg-etec {
    background: linear-gradient(135deg, var(--etec-dark-red) 0%, var(--etec-red) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 3px solid var(--etec-wine);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--theme-header-text, var(--etec-white)) !important;
    letter-spacing: 0.5px;
}

.navbar-brand i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.nav-link {
    color: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.9) !important;
    font-weight: 500;
    padding: 8px 15px !important;
    margin: 0 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.1);
    color: var(--theme-header-text, var(--etec-white)) !important;
}

.nav-link.active {
    background-color: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.16);
    color: var(--theme-header-text, var(--etec-white)) !important;
}

.navbar-user {
    flex-wrap: wrap;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(18px);
}

.navbar-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: max-content;
    line-height: 1.2;
    text-align: right;
}

.navbar-user-name,
.navbar-user-role {
    width: 100%;
    text-align: right;
}

.btn-topbar-menu {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.24);
    color: var(--theme-header-text, var(--etec-white));
    background: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.12);
}

.btn-topbar-menu:hover,
.btn-topbar-menu:focus {
    color: var(--theme-header-text, var(--etec-white));
    background: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.2);
}

.btn-navbar-accent {
    border: 1px solid rgba(var(--etec-red-rgb), 0.18);
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
    color: var(--etec-white);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.btn-navbar-accent:hover,
.btn-navbar-accent:focus {
    color: var(--etec-white);
    background: linear-gradient(135deg, var(--etec-dark-red), var(--etec-red));
}

.btn-navbar-accent[data-push-state="enabled"] {
    background: linear-gradient(135deg, var(--surface-soft), #ffffff);
    color: var(--etec-wine);
    border-color: rgba(var(--etec-red-rgb), 0.25);
}

.app-topbar .btn-navbar-accent {
    border-color: rgba(255,255,255,0.24);
    background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
}

.app-topbar .btn-navbar-accent:hover,
.app-topbar .btn-navbar-accent:focus {
    background: linear-gradient(135deg, rgba(255,255,255,0.24), rgba(255,255,255,0.12));
}

.app-topbar .btn-navbar-accent[data-push-state="enabled"] {
    border-color: rgba(255,255,255,0.95);
}

.navbar-notification-btn span {
    line-height: 1;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-notification-widget {
    position: relative;
}

.app-notification-button {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.24);
    color: var(--etec-white);
    background: rgba(255,255,255,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-notification-button:hover,
.app-notification-button:focus {
    color: var(--etec-white);
    background: rgba(255,255,255,0.2);
}

.app-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ffc107;
    color: #1a1a1a;
    border: 2px solid var(--etec-dark-red);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 15px;
    text-align: center;
}

.app-notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    display: none;
    z-index: 1065;
    overflow: hidden;
    border: 1px solid var(--app-border, rgba(31, 41, 55, 0.12));
    border-radius: 12px;
    background: #fff;
    color: var(--etec-black);
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.18);
}

.app-notification-widget.is-open .app-notification-panel {
    display: block;
}

.app-notification-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.10);
}

.app-notification-panel__header .btn-link {
    color: var(--etec-red);
    text-decoration: none;
    font-weight: 700;
}

.app-notification-list {
    max-height: 340px;
    overflow: auto;
}

.app-notification-item {
    display: block;
    padding: 11px 14px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.08);
    color: var(--etec-black);
    text-decoration: none;
}

.app-notification-item:hover,
.app-notification-item:focus {
    background: var(--surface-soft);
    color: var(--etec-black);
}

.app-notification-item.is-unread {
    background: rgba(var(--etec-red-rgb), 0.06);
}

.app-notification-item__title {
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.25;
}

.app-notification-item__body {
    margin-top: 3px;
    color: #667085;
    font-size: 0.8rem;
    line-height: 1.3;
}

.app-notification-item__time {
    margin-top: 5px;
    color: #98a2b3;
    font-size: 0.72rem;
}

.app-notification-empty {
    padding: 18px 14px;
    color: #667085;
    font-size: 0.86rem;
    text-align: center;
}

.app-notification-history {
    display: block;
    padding: 11px 14px;
    color: var(--etec-red);
    text-align: center;
    text-decoration: none;
    font-weight: 750;
    border-top: 1px solid rgba(31, 41, 55, 0.10);
}

.app-notification-history:hover,
.app-notification-history:focus {
    background: var(--surface-soft);
    color: var(--etec-dark-red);
}

.mobile-menu-drawer,
.app-menu-drawer {
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
}

.mobile-menu-drawer .offcanvas-body,
.app-menu-drawer .offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    background:
        radial-gradient(circle at top right, rgba(var(--etec-red-rgb), 0.12), transparent 38%),
        linear-gradient(180deg, #fffefe 0%, var(--surface-soft) 100%);
}

.mobile-drawer-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 22px;
    background: var(--etec-white);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
}

.mobile-drawer-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
    color: var(--etec-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.4rem;
}

.mobile-drawer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-drawer-school {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--etec-wine);
    font-weight: 700;
}

.mobile-drawer-user {
    font-size: 1rem;
    font-weight: 700;
}

.mobile-drawer-role {
    font-size: 0.9rem;
    color: #6c757d;
}

.mobile-drawer-actions {
    display: grid;
    gap: 12px;
}

.mobile-drawer-actions .btn {
    justify-content: center;
    padding-top: 12px;
    padding-bottom: 12px;
}

.mobile-drawer-section {
    display: grid;
    gap: 10px;
}

.mobile-drawer-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--etec-wine);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mobile-drawer-links {
    display: grid;
    gap: 10px;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--etec-white);
    border: 1px solid var(--surface-border);
    text-decoration: none;
    color: var(--etec-black);
    box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}

.mobile-drawer-link.active {
    border-color: rgba(var(--etec-red-rgb), 0.35);
    color: var(--etec-red);
}

.mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1035;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px;
    border-radius: 24px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 18px 40px rgba(34, 20, 24, 0.18);
    backdrop-filter: blur(18px);
}

.mobile-bottom-nav__item {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #6c757d;
    text-decoration: none;
    border-radius: 18px;
    padding: 10px 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}

.mobile-bottom-nav__item i {
    font-size: 1.2rem;
}

.mobile-bottom-nav__item.active,
.mobile-bottom-nav__item--button:focus,
.mobile-bottom-nav__item--button:hover {
    background: var(--surface-soft);
    color: var(--etec-red);
}

.mobile-bottom-nav__item--button {
    appearance: none;
}

.settings-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
}

.settings-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.12);
    color: var(--etec-white);
}

.dropdown-menu {
    border: 2px solid var(--etec-red);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.dropdown-item {
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--etec-red);
    color: var(--etec-white);
}

.dropdown-item i {
    margin-right: 8px;
}

/* Header Card */
.header-card {
    background: linear-gradient(135deg, var(--etec-red) 0%, var(--etec-wine) 100%);
    padding: 30px;
    border-radius: 15px;
    color: var(--etec-white);
    box-shadow: 0 5px 20px rgba(var(--etec-red-rgb), 0.3);
    border: 2px solid var(--etec-wine);
}

.header-card h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.header-card h1 i {
    margin-right: 15px;
}

/* Stat Cards */
.stat-card {
    background: var(--etec-white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-card.stat-primary {
    border-color: var(--etec-red);
}

.stat-card.stat-success {
    border-color: var(--etec-wine);
}

.stat-card.stat-danger {
    border-color: var(--etec-dark-red);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-right: 20px;
}

.stat-primary .stat-icon {
    background: linear-gradient(135deg, var(--etec-red), var(--etec-light-red));
    color: var(--etec-white);
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, var(--etec-wine), var(--etec-red));
    color: var(--etec-white);
}

.stat-danger .stat-icon {
    background: linear-gradient(135deg, var(--etec-dark-red), var(--etec-red));
    color: var(--etec-white);
}

.stat-content h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--etec-red);
}

.stat-content p {
    margin: 0;
    color: #6c757d;
    font-weight: 500;
}

/* Card Custom */
.card-custom {
    background: var(--etec-white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    border: 2px solid var(--etec-red);
    margin-bottom: 20px;
}

.card-custom h5 {
    color: var(--etec-red);
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.card-custom h5 i {
    margin-right: 10px;
}

/* Alert List */
.alert-list {
    max-height: 400px;
    overflow-y: auto;
}

.alert-item {
    padding: 15px;
    background: var(--surface-soft);
    border-left: 4px solid var(--etec-red);
    margin-bottom: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.alert-item:hover {
    background: rgba(var(--etec-red-rgb), 0.1);
    transform: translateX(5px);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
    color: var(--etec-white);
}

.table thead th {
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: var(--surface-soft);
    transform: scale(1.01);
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-color: #f0f0f0;
    word-break: break-word;
}

/* Badges */
.badge {
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Buttons */
.btn-etec {
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
    color: var(--etec-white);
    border: none;
    padding: 10px 25px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-etec:hover {
    background: linear-gradient(135deg, var(--etec-dark-red), var(--etec-red));
    color: var(--etec-white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--etec-red-rgb), 0.4);
}

.btn-outline-etec {
    border: 2px solid var(--etec-red);
    color: var(--etec-red);
    background: transparent;
    padding: 10px 25px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-outline-etec:hover {
    background: var(--etec-red);
    color: var(--etec-white);
    border-color: var(--etec-red);
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--etec-black);
    margin-bottom: 8px;
}

.form-control, .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--etec-red);
    box-shadow: var(--theme-focus-shadow);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--etec-wine);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover,
.password-toggle:focus {
    background: var(--surface-soft);
    color: var(--etec-red);
}

.form-control.is-invalid,
.form-select.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--status-critical-dot);
    background-image: none;
    padding-right: 12px;
}

.password-field .form-control.is-invalid,
.was-validated .password-field .form-control:invalid {
    padding-right: 46px;
}

.password-field .form-control.is-invalid + .password-toggle,
.was-validated .password-field .form-control:invalid + .password-toggle {
    color: var(--status-critical-dot);
}

.invalid-feedback[data-platform-validation="true"] {
    width: auto;
    margin-top: 6px;
    color: var(--status-critical-fg);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.25;
}

.invalid-feedback[data-platform-validation="true"]::before {
    content: "\F33A";
    display: inline-block;
    margin-right: 5px;
    font-family: "bootstrap-icons";
    font-size: 0.78rem;
    vertical-align: -0.08em;
}

/* Category Cards */
.category-card {
    background: var(--etec-white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    border: 2px solid;
    transition: all 0.3s ease;
}

.category-card-collapsed {
    background: var(--etec-white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card-collapsed:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.category-card-collapsed.active {
    border-width: 3px;
}

.category-products {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    transition: max-height 0.4s ease-out, margin-top 0.4s ease-out;
}

.category-products.show {
    max-height: 5000px;
    margin-top: 20px;
}

.category-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.expand-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.category-card-collapsed.active .expand-icon {
    transform: rotate(180deg);
}

.product-card.hidden {
    display: none !important;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid;
}

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--etec-white);
    margin-right: 15px;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.product-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid;
    transition: all 0.3s ease;
    min-height: 200px;
}

.product-item:hover {
    background: var(--etec-gray);
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(var(--etec-red-rgb), 0.2);
}

.product-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    line-height: 1.3;
}

.product-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.product-info .text-muted {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-info strong {
    display: inline-block;
    margin-top: 2px;
}

.stock-badge {
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.stock-normal {
    background: #d4edda;
    color: #155724;
}

.stock-low {
    background: #fff3cd;
    color: #856404;
}

.stock-critical {
    background: #f8d7da;
    color: #721c24;
}

/* Modal */
.modal-header {
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
    color: var(--theme-header-text, var(--etec-white));
    border-bottom: none;
}

.modal-title {
    color: inherit;
    font-weight: 700;
}

.modal-header .modal-title {
    color: var(--theme-header-text, var(--etec-white)) !important;
}

.modal-header .btn-close {
    filter: var(--theme-header-text-filter, invert(1) grayscale(100%) brightness(200%));
    opacity: 0.85;
}

.modal-content {
    border: 2px solid var(--etec-red);
    border-radius: 12px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--etec-red);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Loading Spinner */
.spinner-border-etec {
    color: var(--etec-red);
}

.school-card {
    border-top-width: 4px;
}

.school-list-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.school-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 3px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.school-avatar img,
.school-avatar .school-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.school-avatar.school-avatar-lg {
    width: 112px;
    height: 112px;
    min-width: 112px;
}

.school-photo-preview {
    position: relative;
    display: inline-flex;
}

.school-photo-remove-form {
    position: absolute;
    top: -7px;
    right: -7px;
}

.school-photo-remove {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--etec-red);
    box-shadow: 0 5px 14px rgba(var(--etec-dark-red-rgb), 0.24);
}

.school-photo-remove:hover,
.school-photo-remove:focus-visible {
    background: var(--etec-dark-red);
    transform: scale(1.06);
}

.arkhos-confirm-modal {
    overflow: hidden;
    border: 1px solid rgba(var(--etec-red-rgb), 0.2);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(var(--etec-dark-red-rgb), 0.2);
}

.arkhos-confirm-modal .modal-header {
    color: #fff;
    background: linear-gradient(135deg, var(--etec-dark-red), var(--etec-red));
}

.arkhos-confirm-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.arkhos-confirm-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--etec-red);
    background: #fff;
}

.arkhos-confirm-modal .modal-body {
    padding: 24px;
    color: #332326;
    line-height: 1.55;
}

.arkhos-confirm-modal .modal-footer {
    padding: 0 24px 24px;
    border-top: 0;
}

.arkhos-confirm-modal .btn-danger {
    background: var(--etec-red);
    border-color: var(--etec-red);
}

.arkhos-confirm-modal .btn-danger:hover,
.arkhos-confirm-modal .btn-danger:focus-visible {
    background: var(--etec-dark-red);
    border-color: var(--etec-dark-red);
}

@media (max-width: 575.98px) {
    .arkhos-confirm-modal .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .arkhos-confirm-modal .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

.school-avatar-fallback {
    color: var(--etec-red);
    font-size: 1.6rem;
}

.mobile-header h1 {
    font-size: 2rem;
}

.mobile-product-list {
    display: grid;
    gap: 16px;
}

.mobile-product-card {
    margin-bottom: 0;
    border-width: 2px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.mobile-product-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--etec-wine);
    font-weight: 700;
}

.mobile-filter-bar {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 12px;
}

.mobile-stock-pill {
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
}

.settings-avatar-wrap {
    display: flex;
    justify-content: center;
}

.settings-avatar {
    width: 96px;
    height: 96px;
    border-color: rgba(0,0,0,0.08);
    max-width: none;
    object-fit: cover;
}

.theme-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.theme-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fafafa;
}

.theme-chip.active {
    border-color: var(--etec-red);
    box-shadow: 0 0 0 2px rgba(var(--etec-red-rgb), 0.12);
}

.theme-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-block;
}

.theme-color-picker {
    display: grid;
    gap: 10px;
}

.theme-color-control {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.theme-color-control .form-control-color {
    width: 46px;
    height: 46px;
    padding: 4px;
    border-radius: 10px;
}

.theme-color-summary {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.theme-color-summary strong {
    color: var(--etec-wine);
    font-size: 0.95rem;
}

.theme-color-summary span {
    color: #6c757d;
    font-size: 0.84rem;
    line-height: 1.25;
}

.theme-rgb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.theme-rgb-grid .form-label {
    color: var(--etec-wine);
    margin-bottom: 4px;
}

.contact-drawer-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
}

.centered-drawer .modal-content {
    border: 1px solid var(--surface-border);
    border-radius: 18px;
}

.centered-drawer .modal-header {
    background: transparent;
    color: var(--etec-black);
}

.centered-drawer .modal-body {
    display: grid;
    gap: 12px;
}

.contact-drawer-panel > i,
.contact-drawer-panel .modal-body > i {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
    color: var(--etec-white);
    font-size: 1.5rem;
}

.contact-drawer-message {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.contact-drawer-message > i {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
    color: var(--etec-white);
    font-size: 1.5rem;
}

.contact-drawer-message h5 {
    margin-bottom: 8px;
}

.contact-drawer-panel h5 {
    color: var(--etec-red);
    margin-bottom: 0;
}

.contact-drawer-panel p {
    color: #6c757d;
    margin-bottom: 0;
}

.settings-inline-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fffafa, #f8f4f5);
    border: 1px solid var(--surface-border);
}

.settings-inline-title {
    font-weight: 700;
    color: var(--etec-wine);
}

.history-filter-card {
    position: relative;
}

.history-filter-drawer {
    height: auto;
    max-height: 88vh;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.history-filter-drawer .offcanvas-body {
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
}

.mobile-compact-summary {
    display: none;
}

.mobile-compact-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-compact-row span {
    color: var(--etec-black);
}

.mobile-compact-row strong,
.mobile-compact-meta strong {
    color: var(--etec-wine);
    font-weight: 700;
}

.mobile-compact-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    color: #6c757d;
    font-size: 0.92rem;
}

.mobile-pair-summary {
    display: none;
}

.mobile-pair-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-pair-row span {
    color: var(--etec-black);
}

.mobile-pair-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    color: #6c757d;
    font-size: 0.92rem;
}

.category-card-collapsed.is-clickable {
    cursor: pointer;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--etec-red);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--etec-dark-red);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        padding-bottom: 96px;
    }

    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .row {
        --bs-gutter-x: 12px;
    }

    .navbar-user {
        width: 100%;
        justify-content: space-between;
        padding-top: 12px;
    }

    .navbar-user-meta {
        align-items: flex-start;
        min-width: 0;
        text-align: left;
    }

    .navbar-user-name,
    .navbar-user-role {
        text-align: left;
    }

    .header-card h1 {
        font-size: 1.8rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .navbar-brand {
        font-size: 1rem;
        max-width: calc(100% - 56px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-brand h1 {
        font-size: 2.2rem;
    }

    .card-custom,
    .header-card {
        padding: 20px;
        border-radius: 22px;
        box-shadow: var(--surface-shadow);
    }

    .mobile-filter-bar {
        grid-template-columns: 1fr;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .header-card {
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .category-card-collapsed {
        border-radius: 20px;
        padding: 16px;
    }

    .category-summary {
        gap: 10px;
    }

    .category-info {
        min-width: 0;
    }

    .category-title {
        font-size: 1.15rem;
    }

    .product-item {
        border-radius: 18px;
        padding: 16px;
    }

    .product-name {
        font-size: 1rem;
    }

    .mobile-product-card {
        border-radius: 22px;
    }

    .mobile-product-list {
        gap: 12px;
    }

    .settings-inline-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .product-item {
        min-height: auto;
    }

    .category-summary,
    .school-list-header {
        align-items: flex-start;
    }

    .table-responsive {
        overflow: visible;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        background: #fff;
        border: 1px solid #ececec;
        border-radius: 18px;
        padding: 10px 12px;
        margin-bottom: 12px;
        box-shadow: 0 10px 26px rgba(0,0,0,0.07);
        transform: none !important;
    }

    .table tbody td {
        border: none;
        padding: 8px 0;
        text-align: left !important;
    }

    .table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--etec-wine);
        margin-bottom: 4px;
    }

    .table tbody td[colspan] {
        text-align: center !important;
    }

    .table tbody td[colspan]::before {
        display: none;
    }

    .table tbody td .d-flex {
        width: 100%;
    }

    .table tbody td .btn,
    .table tbody td form .btn {
        width: 100%;
    }

    .table tbody td form {
        width: 100%;
    }

    .table tbody td .gap-2 {
        gap: 8px !important;
    }

    .table tbody tr.collapse td {
        padding-top: 12px;
    }

    canvas {
        max-width: 100%;
    }

    .table-mobile-compact tbody td:not(:first-child) {
        display: none;
    }

    .table-mobile-compact tbody td:first-child::before {
        display: none;
    }

    .table-mobile-compact .mobile-compact-summary {
        display: block;
    }

    .table-mobile-compact tbody td:first-child > :not(.mobile-compact-summary) {
        display: none;
    }

    .table-mobile-compact .mobile-compact-row + .mobile-compact-row {
        margin-top: 8px;
    }

    .table-mobile-pairs tbody tr:not(.collapse) td:not(:first-child) {
        display: none;
    }

    .table-mobile-pairs tbody tr:not(.collapse) td.mobile-visible-actions {
        display: block;
        border-top: 0;
        padding-top: 0;
    }

    .table-mobile-pairs tbody tr:not(.collapse) td.mobile-visible-actions::before {
        display: none;
    }

    .table-mobile-pairs tbody tr:not(.collapse) td:first-child::before {
        display: none;
    }

    .table-mobile-pairs .mobile-pair-summary {
        display: block;
    }

    .table-mobile-pairs tbody tr:not(.collapse) td:first-child > :not(.mobile-pair-summary) {
        display: none;
    }

    .table-mobile-pairs .mobile-pair-row + .mobile-pair-row {
        margin-top: 8px;
    }

    .table-mobile-pairs .mobile-pair-meta strong,
    .table-mobile-pairs .mobile-pair-row strong {
        color: var(--etec-wine);
    }

    .admin-user-mobile-card {
        padding: 2px 0;
    }

    .admin-user-mobile-card__head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
    }

    .admin-user-mobile-card__head > div {
        min-width: 0;
    }

    .admin-user-mobile-card__head strong {
        display: block;
        color: var(--app-heading);
        font-size: 0.94rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .admin-user-mobile-card__head span:not(.admin-user-mobile-card__status) {
        display: block;
        color: var(--app-muted);
        font-size: 0.78rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .admin-user-mobile-card__status {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 58px;
        padding: 4px 8px;
        border-radius: 999px;
        font-size: 0.72rem;
        font-weight: 750;
        line-height: 1;
        white-space: nowrap;
    }

    .admin-user-mobile-card__status.is-active {
        color: var(--status-good-fg);
        background: var(--status-good-bg);
    }

    .admin-user-mobile-card__status.is-inactive {
        color: var(--status-critical-fg);
        background: var(--status-critical-bg);
    }

    .admin-user-mobile-card__body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: stretch;
    }

    .admin-user-mobile-card__body span {
        min-width: 0;
        padding: 8px 10px;
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius-sm);
        background: var(--surface-soft);
        color: var(--app-heading);
        font-size: 0.8rem;
        font-weight: 650;
        overflow-wrap: anywhere;
    }

    .admin-user-mobile-card__body small {
        display: block;
        margin-bottom: 2px;
        color: var(--app-muted);
        font-size: 0.68rem;
        font-weight: 750;
        text-transform: uppercase;
        letter-spacing: 0;
    }

    .table-mobile-pairs tbody tr:not(.collapse) td.mobile-visible-actions .btn {
        margin-top: 10px;
        border-radius: var(--app-radius-sm);
    }
}

/* Mobile UX density refactor */
:root {
    --app-radius: 10px;
    --app-radius-sm: 8px;
    --app-border: rgba(31, 41, 55, 0.12);
    --app-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    --app-shadow-raised: 0 8px 20px rgba(16, 24, 40, 0.08);
    --app-muted: #667085;
    --app-page: #f6f7f9;
}

body {
    background-color: var(--app-page);
    line-height: 1.35;
}

.container.py-4,
.container-fluid.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

.header-card {
    background: var(--etec-white);
    padding: 16px 18px;
    border-radius: var(--app-radius);
    color: var(--etec-black);
    border: 1px solid var(--app-border);
    border-left: 4px solid var(--etec-red);
    box-shadow: var(--app-shadow);
}

.header-card h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    color: var(--etec-dark-red);
    font-size: 1.45rem;
    font-weight: 750;
    line-height: 1.15;
}

.header-card h1 i {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--app-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    color: var(--etec-red);
    background: var(--surface-soft);
    font-size: 1rem;
}

.header-card p {
    color: var(--app-muted);
    font-size: 0.92rem;
}

.card-custom {
    padding: 16px;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
    margin-bottom: 16px;
}

.card-custom h5,
.card-custom .h4,
.card-custom h2.h4 {
    color: var(--etec-dark-red);
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 12px;
}

.card-custom h5 i {
    margin-right: 6px;
}

.stat-card {
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-left: 4px solid transparent;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.stat-card:hover,
.category-card:hover,
.category-card-collapsed:hover,
.product-item:hover,
.table tbody tr:hover,
.btn-etec:hover {
    transform: none;
}

.stat-card.stat-primary,
.stat-card.stat-success,
.stat-card.stat-danger {
    border-color: var(--app-border);
}

.stat-card.stat-primary {
    border-left-color: var(--etec-red);
}

.stat-card.stat-success {
    border-left-color: var(--etec-wine);
}

.stat-card.stat-danger {
    border-left-color: var(--etec-dark-red);
}

.stat-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: var(--app-radius-sm);
    font-size: 1.15rem;
    margin-right: 0;
}

.stat-content h3 {
    font-size: 1.45rem;
    line-height: 1;
}

.stat-content p {
    font-size: 0.82rem;
    line-height: 1.2;
}

.btn-etec,
.btn-outline-etec {
    min-height: 40px;
    padding: 0.52rem 0.9rem;
    border-radius: var(--app-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: none;
}

.btn-outline-etec {
    border-width: 1px;
}

.form-label {
    margin-bottom: 5px;
    color: #344054;
    font-size: 0.82rem;
    font-weight: 650;
}

.form-control,
.form-select {
    min-height: 42px;
    padding: 0.56rem 0.75rem;
    border: 1px solid #d0d5dd;
    border-radius: var(--app-radius-sm);
    background-color: var(--etec-white);
    font-size: 0.94rem;
    box-shadow: none;
}

.form-control-lg,
.form-select-lg {
    min-height: 46px;
    padding: 0.62rem 0.85rem;
    font-size: 0.98rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--etec-red-rgb), 0.7);
    box-shadow: 0 0 0 3px rgba(var(--etec-red-rgb), 0.12);
}

textarea.form-control {
    min-height: 88px;
}

.app-select {
    position: relative;
    width: 100%;
}

.app-select-native {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.app-select__button {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d0d5dd;
    border-radius: var(--app-radius-sm);
    background: var(--etec-white);
    color: var(--etec-black);
    padding: 0.56rem 2.15rem 0.56rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    font-size: 0.94rem;
    line-height: 1.25;
}

.app-select--lg .app-select__button {
    min-height: 46px;
    padding-top: 0.62rem;
    padding-bottom: 0.62rem;
    font-size: 0.98rem;
}

.app-select__button:focus {
    outline: none;
    border-color: rgba(var(--etec-red-rgb), 0.7);
    box-shadow: 0 0 0 3px rgba(var(--etec-red-rgb), 0.12);
}

.app-select.is-invalid .app-select__button {
    border-color: #dc3545;
}

.app-select.is-invalid .app-select__button:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.app-select__button:disabled {
    color: #98a2b3;
    background: #f2f4f7;
}

.app-select__value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-select__value.is-placeholder {
    color: #98a2b3;
}

.app-select__icon {
    position: absolute;
    right: 12px;
    color: var(--etec-wine);
    font-size: 0.86rem;
    transition: transform 0.16s ease;
}

.app-select.is-open .app-select__icon {
    transform: rotate(180deg);
}

.app-select__menu {
    position: absolute;
    z-index: 1060;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: min(280px, 56vh);
    overflow: auto;
    display: none;
    padding: 6px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--etec-white);
    box-shadow: var(--app-shadow-raised);
}

.app-select.is-open .app-select__menu {
    display: grid;
    gap: 2px;
}

.app-select__search {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--app-border);
    background: var(--etec-white);
}

.app-select__search-icon {
    color: var(--etec-wine);
    font-size: 0.9rem;
}

.app-select__search-input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--etec-black);
    font-size: 0.92rem;
}

.app-select__search-input::placeholder {
    color: #98a2b3;
}

.app-select__options {
    display: grid;
    gap: 2px;
    overflow: auto;
}

.app-select--searchable .app-select__menu {
    overflow: hidden;
}

.app-select--searchable.has-empty-search .app-select__options::after {
    content: "Nenhuma opção encontrada";
    padding: 10px;
    color: #667085;
    font-size: 0.9rem;
}

.table-responsive:has(.app-select.is-open) {
    overflow: visible;
}

.app-select__option {
    width: 100%;
    border: 0;
    border-radius: var(--app-radius-sm);
    background: transparent;
    color: var(--etec-black);
    padding: 9px 10px;
    text-align: left;
    font-size: 0.92rem;
    line-height: 1.25;
}

.app-select__option:hover,
.app-select__option:focus,
.app-select__option.is-selected {
    background: var(--surface-soft);
    color: var(--etec-dark-red);
}

.app-select__option:disabled {
    color: #98a2b3;
}

.filter-surface {
    padding: 10px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--app-shadow);
}

.filter-surface h5 {
    color: var(--etec-dark-red);
    font-size: 0.98rem;
    line-height: 1.2;
}

.mobile-filter-bar {
    grid-template-columns: minmax(0, 1.35fr) minmax(118px, 0.85fr);
    gap: 8px;
    align-items: center;
}

.category-card,
.category-card-collapsed {
    padding: 12px;
    margin-bottom: 10px;
    border-width: 1px !important;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.category-card-collapsed.active {
    border-width: 1px !important;
}

.category-info {
    gap: 10px;
}

.category-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--app-radius-sm);
    font-size: 1rem;
    margin-right: 0;
}

.category-title {
    font-size: 1.05rem;
    line-height: 1.2;
}

.expand-icon {
    font-size: 1.05rem;
}

.category-products.show {
    margin-top: 10px;
}

.product-item {
    min-height: 0;
    padding: 10px;
    border: 1px solid var(--app-border);
    border-left: 3px solid;
    border-radius: var(--app-radius);
    background: var(--etec-white);
    box-shadow: none;
}

.product-name {
    font-size: 0.94rem;
    line-height: 1.2;
}

.product-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    color: #475467;
    font-size: 0.82rem;
}

.product-info > div {
    min-width: 0;
    padding: 6px 7px;
    border-radius: var(--app-radius-sm);
    background: #f8fafc;
    line-height: 1.2;
}

.product-info > div strong {
    display: block;
    margin-top: 0;
    color: #667085;
    font-size: 0.67rem;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.product-info > .mt-2 {
    grid-column: 1 / -1;
    margin-top: 0 !important;
}

.product-info > .small,
.product-info > .text-muted.small {
    padding: 0;
    background: transparent;
    color: #667085 !important;
    font-size: 0.76rem;
}

.stock-badge,
.mobile-stock-pill,
.badge {
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 0.75rem;
    line-height: 1.1;
}

.alert {
    padding: 10px 12px;
    border-radius: var(--app-radius-sm);
}

.alert-item {
    padding: 10px 12px;
    border-radius: var(--app-radius-sm);
    margin-bottom: 8px;
}

.mobile-product-list {
    gap: 10px;
}

.mobile-product-card {
    border-width: 1px;
    box-shadow: var(--app-shadow);
}

.mobile-product-card h5 {
    font-size: 1rem;
}

.mobile-product-category {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.table thead th {
    padding: 10px 12px;
    font-size: 0.82rem;
}

.table tbody td {
    padding: 10px 12px;
}

.table tbody tr:hover {
    background-color: rgba(var(--etec-red-rgb), 0.04);
}

.chart-frame {
    height: 260px;
    position: relative;
}

.metric-strip {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

.report-metric-strip > [class*="col-"] > div {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius) !important;
    box-shadow: var(--app-shadow);
}

.report-metric-strip h2 {
    margin-bottom: 2px;
    font-size: 1.35rem;
    font-weight: 750;
}

.repeatable-field__items {
    display: grid;
    gap: 8px;
}

.repeatable-field__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 8px;
    align-items: center;
}

.repeatable-field__item .repeatable-add,
.repeatable-field__item .repeatable-remove {
    grid-column: 2;
    grid-row: 1;
}

.repeatable-add,
.repeatable-remove {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
}

.optional-school-staff {
    margin-left: 12px;
    padding-left: 14px;
    border-left: 2px solid var(--surface-border);
}

.optional-school-staff__toggle {
    width: 100%;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--surface-soft);
    color: var(--app-heading);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    text-align: left;
}

.optional-school-staff__toggle span {
    display: grid;
    gap: 2px;
}

.optional-school-staff__toggle strong {
    font-size: 0.9rem;
    line-height: 1.2;
}

.optional-school-staff__toggle small {
    color: var(--app-muted);
    font-size: 0.76rem;
}

.optional-school-staff__toggle i {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: var(--app-radius-sm);
    background: #fff;
    color: var(--etec-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.optional-school-staff__toggle[aria-expanded="true"] i {
    transform: rotate(45deg);
}

.optional-school-staff__body {
    padding-top: 12px;
}

.optional-school-staff__body > h6,
.optional-school-staff__body > p.small,
.optional-school-staff__body > p.text-muted {
    display: none;
}

.optional-school-staff__body > .mb-3,
.optional-school-staff__body > .row {
    margin-left: 0;
    margin-right: 0;
}

.product-metric-grid .card-custom {
    display: grid;
    align-content: center;
    gap: 6px;
}

.product-metric-grid .card-custom strong {
    color: var(--app-muted);
    font-size: 0.76rem;
    line-height: 1.15;
}

.product-metric-grid .card-custom .fs-4 {
    color: var(--etec-dark-red);
    font-size: 1.08rem !important;
    font-weight: 750;
    line-height: 1.15;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 76px;
    }

    .container,
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .container.py-4,
    .container-fluid.py-4,
    .container.py-3 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .header-card,
    .card-custom {
        padding: 12px;
        border-radius: var(--app-radius);
        box-shadow: var(--app-shadow);
    }

    .header-card h1 {
        font-size: 1.18rem;
        margin-bottom: 2px;
    }

    .header-card h1 i {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 0.9rem;
    }

    .header-card p {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .metric-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-left: 0;
        margin-right: 0;
    }

    .metric-strip > [class*="col-"] {
        width: auto;
        padding: 0;
        margin-bottom: 0 !important;
    }

    .stat-card {
        min-height: 78px;
        padding: 10px;
        flex-direction: row;
        text-align: left;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        margin-bottom: 0;
        font-size: 0.95rem;
    }

    .stat-content h3 {
        font-size: 1.18rem;
    }

    .stat-content p {
        font-size: 0.73rem;
    }

    .mobile-bottom-nav {
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
        border: 0;
        border-top: 1px solid rgba(31, 41, 55, 0.12);
        box-shadow: 0 -8px 20px rgba(16, 24, 40, 0.08);
    }

    .mobile-bottom-nav__item {
        border-radius: var(--app-radius-sm);
        padding: 7px 4px 6px;
        gap: 2px;
        font-size: 0.67rem;
    }

    .mobile-bottom-nav__item i {
        font-size: 1.05rem;
    }

    .app-notification-button {
        width: 40px;
        height: 40px;
        border-radius: var(--app-radius-sm);
    }

    .app-notification-widget--mobile .app-notification-panel {
        position: fixed;
        top: 58px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 150px);
    }

    .app-notification-list {
        max-height: min(360px, calc(100vh - 260px));
    }

    .mobile-filter-bar {
        grid-template-columns: minmax(0, 1.25fr) minmax(112px, 0.85fr);
    }

    .filter-surface {
        padding: 8px;
    }

    .category-card-collapsed {
        padding: 10px;
        margin-bottom: 8px;
    }

    .category-products .row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
    }

    .category-products .product-card {
        width: auto;
        padding: 0;
        margin-bottom: 0 !important;
    }

    .product-item {
        height: 100%;
        padding: 9px;
        border-radius: var(--app-radius-sm);
    }

    .product-name {
        font-size: 0.84rem;
    }

    .product-info {
        gap: 5px;
        font-size: 0.74rem;
    }

    .product-info > div {
        padding: 5px;
    }

    .product-info > div strong {
        font-size: 0.6rem;
    }

    .stock-badge,
    .mobile-stock-pill,
    .badge {
        padding: 4px 7px;
        font-size: 0.68rem;
    }

    .product-metric-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-left: 0;
        margin-right: 0;
    }

    .product-metric-grid > [class*="col-"] {
        width: auto;
        padding: 0;
    }

    .product-metric-grid .card-custom {
        min-height: 82px;
        margin-bottom: 0;
    }

    .chart-frame {
        height: 210px;
    }

    .table tbody tr {
        border-radius: var(--app-radius);
        padding: 8px 10px;
        margin-bottom: 8px;
        box-shadow: var(--app-shadow);
    }

    .table tbody td {
        padding: 6px 0;
    }

    .table tbody td::before {
        font-size: 0.68rem;
        letter-spacing: 0.02em;
        margin-bottom: 2px;
    }

    .table tbody td .btn,
    .table tbody td form .btn {
        width: auto;
    }

    .table tbody td form {
        width: auto;
    }

    .table-mobile-compact .mobile-compact-row,
    .table-mobile-pairs .mobile-pair-row {
        gap: 6px;
    }

    .mobile-compact-row,
    .mobile-pair-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mobile-compact-row span,
    .mobile-pair-row span,
    .mobile-compact-meta,
    .mobile-pair-meta {
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .app-select__menu {
        max-height: min(260px, 48vh);
    }
}

@media (max-width: 390px) {
    .category-products .row {
        grid-template-columns: 1fr;
    }

    .mobile-filter-bar {
        grid-template-columns: 1fr;
    }
}

/* Full product UX refresh */
:root {
    --app-radius: 8px;
    --app-radius-sm: 6px;
    --app-border: rgba(15, 23, 42, 0.1);
    --app-border-strong: rgba(15, 23, 42, 0.16);
    --app-page: #f7f8fa;
    --app-surface: #ffffff;
    --app-surface-muted: #f2f4f7;
    --app-muted: #667085;
    --app-text: #172033;
    --app-heading: #111827;
    --app-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    --app-shadow-raised: 0 10px 24px rgba(16, 24, 40, 0.1);
    --status-normal-bg: #e8f7ee;
    --status-normal-fg: #166534;
    --status-normal-dot: #22c55e;
    --status-low-bg: #fff7df;
    --status-low-fg: #92400e;
    --status-low-dot: #f59e0b;
    --status-critical-bg: #feecee;
    --status-critical-fg: #b42318;
    --status-critical-dot: #ef4444;
    --status-info-bg: #eaf2ff;
    --status-info-fg: #175cd3;
    --status-info-dot: #3b82f6;
    --status-neutral-bg: #eef2f6;
    --status-neutral-fg: #475467;
    --status-neutral-dot: #98a2b3;
}

html {
    background: var(--app-page);
}

body {
    color: var(--app-text);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.86), rgba(247,248,250,0.94) 240px),
        var(--app-page);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0;
}

.login-page {
    background: #f7f8fa;
}

.login-shell {
    padding: 24px 16px;
}

.login-panel {
    width: min(100%, 860px);
    grid-template-columns: 0.95fr 1fr;
    gap: 18px;
}

.login-brand h1 {
    color: var(--app-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0;
}

.login-brand p {
    color: var(--app-muted);
}

.login-badge {
    background: var(--surface-soft);
    color: var(--etec-dark-red);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    font-size: 0.78rem;
}

.login-card {
    border: 1px solid var(--app-border);
}

.container.py-4,
.container-fluid.py-4,
.container.py-3 {
    max-width: 1320px;
}

.bg-etec {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.app-topbar {
    backdrop-filter: blur(18px);
}

.app-topbar-shell {
    min-height: 58px;
    gap: 12px;
}

.navbar-brand {
    max-width: min(360px, 58vw);
    color: var(--app-heading) !important;
    font-size: 1rem;
    letter-spacing: 0;
    gap: 8px;
    display: inline-flex;
    align-items: center;
}

.navbar-brand i {
    width: 30px;
    height: 30px;
    margin-right: 0;
    border-radius: var(--app-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--etec-red);
    background: var(--surface-soft);
    font-size: 0.98rem;
}

.navbar-brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-links {
    gap: 3px;
}

.nav-link {
    color: #475467 !important;
    padding: 7px 10px !important;
    margin: 0;
    border-radius: var(--app-radius-sm);
    font-size: 0.88rem;
    font-weight: 650;
}

.nav-link i {
    color: #98a2b3;
}

.nav-link:hover,
.nav-link.active {
    color: var(--etec-dark-red) !important;
    background: var(--surface-soft);
}

.nav-link:hover i,
.nav-link.active i {
    color: var(--etec-red);
}

.navbar-user-meta,
.navbar-user-name,
.navbar-user-role {
    color: var(--app-text) !important;
}

.navbar-user-name {
    font-size: 0.86rem;
    font-weight: 750;
}

.navbar-user-role {
    color: var(--app-muted) !important;
    font-size: 0.74rem;
}

.btn-topbar-menu,
.btn-topbar-drawer,
.app-notification-button,
.app-topbar .btn-navbar-accent {
    color: #344054;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
}

.btn-topbar-menu:hover,
.btn-topbar-menu:focus,
.btn-topbar-drawer:hover,
.btn-topbar-drawer:focus,
.btn-topbar-drawer.is-active,
.app-notification-button:hover,
.app-notification-button:focus,
.app-topbar .btn-navbar-accent:hover,
.app-topbar .btn-navbar-accent:focus {
    color: var(--etec-dark-red);
    background: var(--surface-soft);
    border-color: var(--surface-border);
}

.app-notification-badge {
    background: var(--status-critical-dot);
    color: #fff;
    border-color: #fff;
}

.app-notification-panel,
.app-menu-drawer,
.dropdown-menu {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-raised);
}

.dropdown-item {
    border-radius: var(--app-radius-sm);
    font-size: 0.88rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--surface-soft);
    color: var(--etec-dark-red);
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
    background: var(--status-critical-bg);
    color: var(--status-critical-fg) !important;
}

.mobile-drawer-profile {
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    background: #fff;
}

.mobile-drawer-link {
    border-radius: var(--app-radius-sm);
}

.mobile-drawer-link.active {
    background: var(--surface-soft);
    color: var(--etec-dark-red);
}

.header-card {
    position: relative;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--app-border);
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: var(--app-text);
}

.header-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 3px;
    border-radius: 99px;
    background: var(--etec-red);
    opacity: 0.8;
}

.header-card h1 {
    color: var(--app-heading);
    font-size: clamp(1.14rem, 1.1vw + 0.9rem, 1.55rem);
    font-weight: 760;
    letter-spacing: 0;
    margin-bottom: 2px;
}

.header-card h1 i {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: var(--app-radius-sm);
    color: var(--etec-red);
    background: var(--surface-soft);
}

.header-card p {
    max-width: 720px;
    color: var(--app-muted);
    font-size: 0.88rem;
    line-height: 1.35;
}

.card-custom,
.stat-card,
.filter-surface,
.category-card,
.category-card-collapsed,
.mobile-product-card,
.school-card,
.report-metric-strip > [class*="col-"] > div {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

.card-custom {
    padding: 14px;
    margin-bottom: 14px;
}

.card-custom h5,
.card-custom .h4,
.card-custom h2.h4 {
    color: var(--app-heading);
    font-size: 0.98rem;
    font-weight: 750;
    margin-bottom: 10px;
    letter-spacing: 0;
}

.card-custom h5 i,
.card-custom .h4 i,
.card-custom h2.h4 i {
    color: var(--etec-red);
}

.card-custom p {
    color: var(--app-muted);
    font-size: 0.88rem;
    line-height: 1.35;
}

.stat-card {
    min-height: 86px;
    padding: 12px;
    border-left: 3px solid var(--surface-border);
}

.stat-card.stat-primary {
    border-left-color: var(--status-info-dot);
}

.stat-card.stat-success {
    border-left-color: var(--status-normal-dot);
}

.stat-card.stat-danger {
    border-left-color: var(--status-critical-dot);
}

.stat-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: var(--app-radius-sm);
    background: var(--app-surface-muted) !important;
    color: var(--etec-red) !important;
}

.stat-card.stat-success .stat-icon {
    color: var(--status-normal-fg) !important;
    background: var(--status-normal-bg) !important;
}

.stat-card.stat-danger .stat-icon {
    color: var(--status-critical-fg) !important;
    background: var(--status-critical-bg) !important;
}

.stat-content h3,
.report-metric-strip h2 {
    color: var(--app-heading);
    font-size: 1.28rem;
    font-weight: 780;
}

.stat-content p,
.report-metric-strip small {
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 650;
}

.btn-etec {
    background: var(--etec-red);
    border: 1px solid var(--etec-red);
    border-radius: var(--app-radius-sm);
    color: #fff;
    box-shadow: none;
}

.btn-etec:hover,
.btn-etec:focus {
    background: var(--etec-dark-red);
    border-color: var(--etec-dark-red);
    color: #fff;
    box-shadow: none;
}

.btn-outline-etec {
    border: 1px solid var(--app-border-strong);
    color: var(--app-text);
    background: #fff;
}

.btn-outline-primary,
.btn-outline-danger,
.btn-outline-secondary {
    border-radius: var(--app-radius-sm);
    border-color: var(--app-border-strong);
    color: var(--app-text);
    background: #fff;
}

.btn-outline-etec:hover,
.btn-outline-etec:focus,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-light.border:hover,
.btn-light.border:focus {
    background: var(--surface-soft);
    border-color: var(--surface-border);
    color: var(--etec-dark-red);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: var(--status-critical-bg);
    border-color: rgba(239, 68, 68, 0.24);
    color: var(--status-critical-fg);
}

.btn-sm {
    --bs-btn-padding-y: 0.33rem;
    --bs-btn-padding-x: 0.55rem;
    --bs-btn-font-size: 0.78rem;
}

.form-label {
    color: #475467;
    font-size: 0.78rem;
    font-weight: 700;
}

.form-control,
.form-select,
.app-select__button {
    min-height: 40px;
    border-color: #d9dee7;
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
    font-size: 0.9rem;
    background-color: #fff;
}

.form-control::placeholder {
    color: #98a2b3;
}

.form-control:focus,
.form-select:focus,
.app-select__button:focus {
    border-color: rgba(var(--etec-red-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--etec-red-rgb), 0.1);
}

.app-select__menu {
    border-radius: var(--app-radius);
}

.app-select__option {
    border-radius: var(--app-radius-sm);
    font-size: 0.88rem;
}

.filter-surface {
    padding: 9px;
    background: rgba(255, 255, 255, 0.86);
}

.mobile-filter-bar {
    gap: 8px;
}

.table-responsive {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
}

.card-custom > .table-responsive,
.card-custom .table-responsive {
    margin-top: 4px;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(248, 250, 252, 0.76);
    --bs-table-hover-bg: rgba(234, 242, 255, 0.42);
    color: var(--app-text);
}

.table thead {
    position: sticky;
    top: 58px;
    z-index: 2;
    background: #f8fafc;
    color: #667085;
    box-shadow: inset 0 -1px 0 var(--app-border);
}

.table thead th {
    padding: 8px 10px;
    color: #667085;
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 760;
    line-height: 1.15;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr {
    border-color: var(--app-border);
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background: var(--bs-table-hover-bg);
}

.table tbody td {
    padding: 8px 10px;
    border-color: #eef2f6;
    font-size: 0.88rem;
    line-height: 1.25;
}

.table.table-sm tbody td,
.table.table-sm thead th {
    padding: 7px 9px;
}

.table-danger,
.table-danger > * {
    --bs-table-bg: var(--status-critical-bg);
    --bs-table-color: var(--status-critical-fg);
}

.table-warning,
.table-warning > * {
    --bs-table-bg: var(--status-low-bg);
    --bs-table-color: var(--status-low-fg);
}

.table-secondary,
.table-secondary > * {
    --bs-table-bg: var(--status-neutral-bg);
    --bs-table-color: var(--status-neutral-fg);
}

.badge,
.stock-badge,
.mobile-stock-pill,
.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 760;
    line-height: 1;
    white-space: nowrap;
}

.stock-badge::before,
.mobile-stock-pill::before,
.status-chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.8;
}

.badge::before {
    content: none;
    display: none;
}

.badge.bg-success::before,
.badge.bg-danger::before,
.badge.bg-warning::before,
.badge.bg-info::before,
.badge.text-bg-success::before,
.badge.text-bg-danger::before,
.badge.text-bg-warning::before,
.badge.text-bg-info::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.8;
}

.stock-normal,
.bg-success,
.text-bg-success,
.bg-success-subtle,
.status-chip--normal,
.status-chip--success,
.status-chip--confirmed {
    background: var(--status-normal-bg) !important;
    color: var(--status-normal-fg) !important;
    border-color: rgba(34, 197, 94, 0.18) !important;
}

.stock-low,
.bg-warning,
.text-bg-warning,
.bg-warning-subtle,
.status-chip--low,
.status-chip--pending {
    background: var(--status-low-bg) !important;
    color: var(--status-low-fg) !important;
    border-color: rgba(245, 158, 11, 0.2) !important;
}

.stock-critical,
.bg-danger,
.text-bg-danger,
.bg-danger-subtle,
.status-chip--critical,
.status-chip--danger,
.status-chip--rejected,
.status-chip--cancelled {
    background: var(--status-critical-bg) !important;
    color: var(--status-critical-fg) !important;
    border-color: rgba(239, 68, 68, 0.18) !important;
}

.bg-info,
.text-bg-info,
.bg-info-subtle,
.status-chip--review,
.status-chip--info {
    background: var(--status-info-bg) !important;
    color: var(--status-info-fg) !important;
    border-color: rgba(59, 130, 246, 0.18) !important;
}

.bg-secondary,
.text-bg-secondary,
.status-chip--neutral {
    background: var(--status-neutral-bg) !important;
    color: var(--status-neutral-fg) !important;
    border-color: rgba(152, 162, 179, 0.22) !important;
}

.alert {
    border-width: 1px;
    border-radius: var(--app-radius);
    font-size: 0.9rem;
}

.alert-success {
    color: var(--status-normal-fg);
    background: var(--status-normal-bg);
    border-color: rgba(34, 197, 94, 0.16);
}

.alert-warning,
.alert-info {
    color: var(--status-low-fg);
    background: var(--status-low-bg);
    border-color: rgba(245, 158, 11, 0.16);
}

.alert-danger {
    color: var(--status-critical-fg);
    background: var(--status-critical-bg);
    border-color: rgba(239, 68, 68, 0.16);
}

.alert-list {
    display: grid;
    gap: 8px;
    max-height: 330px;
}

.alert-item {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    margin: 0;
    border: 1px solid rgba(239, 68, 68, 0.14);
    border-left: 3px solid var(--status-critical-dot);
    background: var(--status-critical-bg);
    color: var(--status-critical-fg);
}

.alert-item small {
    color: rgba(180, 35, 24, 0.78) !important;
}

.product-item {
    border-left-width: 3px;
    box-shadow: none;
}

.product-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-info > div {
    background: #f8fafc;
    border: 1px solid #eef2f6;
}

.mobile-product-list {
    display: grid;
    gap: 10px;
}

.mobile-product-card {
    position: relative;
    overflow: hidden;
}

.mobile-product-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--status-normal-dot);
}

.mobile-product-category {
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 750;
}

.school-card {
    border-left: 3px solid var(--surface-border);
}

.chart-frame {
    height: 230px;
}

.modal-content {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-raised);
}

.modal-header,
.modal-footer {
    border-color: var(--app-border);
}

.modal-title {
    color: inherit;
    font-weight: 760;
}

.product-modal .modal-header {
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
    color: var(--theme-header-text, var(--etec-white));
}

.product-modal .modal-title {
    color: inherit;
}

.product-list-table {
    display: none;
}

.category-products > .table-responsive:has(.product-list-table) {
    display: none;
}

.product-admin-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--surface-border);
}

.product-card-actions .btn {
    min-height: 38px;
}

.surplus-card-grid + .table-responsive {
    display: none;
}

.surplus-product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.surplus-card-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--surface-border);
}

.surplus-card-actions:has(form) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.surplus-card-actions form {
    display: flex;
    margin: 0;
}

.surplus-card-actions .btn {
    width: 100%;
    min-height: 38px;
}

.surplus-card-editor {
    margin-top: 12px;
}

.surplus-card-editor form {
    margin: 0;
}

.pagination-surface {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--surface-border);
}

#historicoMovimentacoes,
#historicoRecebido,
#historicoEnviado,
#relatorioLotes,
#relatorioEstoqueDetalhado,
#relatorioExcedentesPublicados,
#relatorioHistoricoPublicacoes,
#dashboardAlertas,
#dashboardMovimentacoes,
#afericoesRecentes,
#produtoLotes,
#produtoEntradas,
#produtoSaidas,
#notificacoesHistorico,
#adminUsers,
#adminTransferHistory {
    scroll-margin-top: 92px;
}

.dashboard-movement-table th:first-child,
.dashboard-movement-table td:first-child {
    width: 104px;
    min-width: 104px;
}

.dashboard-movement-table td:first-child {
    text-align: center;
}

.dashboard-movement-table .badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    white-space: nowrap;
}

.pagination-status {
    min-width: 72px;
    color: var(--etec-black);
    font-size: 0.92rem;
    text-align: center;
}

.pagination-jump {
    position: relative;
    margin: 0;
}

.pagination-jump .form-control {
    width: 72px;
    text-align: center;
}

.pagination-surface .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 34px;
}

.pagination-feedback {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    z-index: 2;
    width: max-content;
    max-width: 170px;
    transform: translateX(-50%);
    color: #dc3545;
    font-size: 0.72rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

.category-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
}

.category-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 36px;
    min-width: 36px;
    height: 34px;
    padding-inline: 0;
}

@media (max-width: 767.98px) {
    .dashboard-page {
        padding-bottom: 96px !important;
    }

    .category-summary {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
    }

    .category-actions {
        width: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .category-actions .btn {
        flex: 0 0 36px;
    }
}

/* --------------------------------------------------------------------------
   Despensa Escolar — interface da versão de escola única
   -------------------------------------------------------------------------- */
:root {
    --brand-50: #fff4f3;
    --brand-100: #fde5e5;
    --brand-500: #c51c29;
    --brand-600: #b30d1c;
    --brand-700: #8c0914;
    --warm-50: #fffaf2;
    --warm-100: #fff0d7;
    --accent-500: #f6a10b;
    --app-page: #fbf8f6;
    --app-surface: #ffffff;
    --app-surface-muted: #faf6f4;
    --app-text: #382e2f;
    --app-heading: #281b1d;
    --app-muted: #78686a;
    --app-border: #eee3e1;
    --app-border-strong: #ddcdca;
    --app-radius: 16px;
    --app-radius-sm: 11px;
    --app-shadow: 0 1px 2px rgba(76, 22, 29, 0.04), 0 8px 24px rgba(76, 22, 29, 0.05);
    --app-shadow-raised: 0 18px 45px rgba(76, 22, 29, 0.13);
}

body {
    background:
        radial-gradient(circle at 4% 0%, rgba(179, 13, 28, 0.055), transparent 24rem),
        var(--app-page);
    color: var(--app-text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -0.008em;
}

.container,
.container-fluid {
    --bs-gutter-x: 2rem;
}

.app-topbar {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid var(--app-border) !important;
    box-shadow: 0 1px 0 rgba(27, 44, 37, 0.02) !important;
    min-height: 72px;
}

.app-topbar-shell {
    min-height: 72px;
    padding-left: clamp(16px, 3vw, 42px);
    padding-right: clamp(16px, 3vw, 42px);
}

.navbar-brand {
    align-items: center;
    color: var(--app-heading) !important;
    display: inline-flex;
    gap: 11px;
    letter-spacing: -0.02em;
    margin-right: clamp(20px, 4vw, 56px);
}

.app-brand-mark,
.brand-mark {
    align-items: center;
    background: var(--brand-600);
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.app-brand-mark img,
.brand-mark img {
    display: block;
    height: 100%;
    object-fit: cover;
    transform: scale(1.28);
    width: 100%;
}

.app-brand-mark i,
.brand-mark i {
    font-size: 1.15rem;
    margin: 0;
}

.app-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    max-width: 260px;
}

.app-brand-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-brand-copy small {
    color: var(--app-muted);
    font-size: .67rem;
    font-weight: 550;
    letter-spacing: .02em;
    margin-top: 4px;
}

.app-topbar .nav-link {
    border-radius: 10px;
    color: var(--app-muted) !important;
    font-size: .88rem;
    font-weight: 650;
    margin: 0 2px;
    padding: 9px 11px !important;
}

.app-topbar .nav-link:hover {
    background: var(--brand-50);
    color: var(--brand-700) !important;
}

.app-topbar .nav-link.active {
    background: var(--brand-100);
    color: var(--brand-700) !important;
}

.app-notification-button,
.btn-topbar-drawer,
.btn-topbar-menu {
    background: #fff !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 11px !important;
    box-shadow: none !important;
    color: var(--app-text) !important;
}

.app-notification-button:hover,
.btn-topbar-drawer:hover,
.btn-topbar-menu:hover {
    background: var(--app-surface-muted) !important;
    border-color: var(--app-border-strong) !important;
}

.app-notification-badge {
    background: var(--accent-500);
    border-color: #fff;
    color: #fff;
}

.header-card {
    align-items: center;
    background: linear-gradient(135deg, #edf5f0 0%, #f8f5eb 100%);
    border: 1px solid #dce8e1;
    border-radius: 20px;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    min-height: 132px;
    overflow: hidden;
    padding: clamp(22px, 3vw, 36px);
    position: relative;
}

.header-card::after {
    background: rgba(255, 255, 255, .45);
    border: 22px solid rgba(255, 255, 255, .26);
    border-radius: 50%;
    content: "";
    height: 170px;
    pointer-events: none;
    position: absolute;
    right: -45px;
    top: -76px;
    width: 170px;
}

.header-card::before {
    display: none !important;
}

.header-card h1 {
    color: var(--app-heading);
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    font-weight: 760;
    letter-spacing: -.045em;
    line-height: 1.08;
    margin: 0 0 8px;
}

.header-card h1 > i {
    display: none;
}

.header-card p {
    color: #64736c;
    font-size: .98rem;
}

.page-eyebrow {
    color: var(--brand-600);
    display: block;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .11em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.card-custom,
.stat-card,
.modal-content,
.offcanvas {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.card-custom {
    padding: clamp(18px, 2.3vw, 25px);
}

.card-custom h5 {
    color: var(--app-heading);
    font-size: 1rem;
    font-weight: 720;
    letter-spacing: -.02em;
}

.card-custom h5 i {
    color: var(--brand-600);
}

.stat-card {
    border-left: 1px solid var(--app-border) !important;
    gap: 14px;
    min-height: 104px;
    padding: 18px;
}

.stat-card:hover {
    box-shadow: var(--app-shadow);
    transform: none;
}

.dashboard-stat-grid .stat-icon {
    background: var(--brand-50) !important;
    border: 1px solid var(--brand-100);
    border-radius: 13px;
    color: var(--brand-600) !important;
    height: 46px;
    width: 46px;
}

.dashboard-stat-grid .stat-card.stat-success .stat-icon,
.dashboard-stat-grid .stat-card.stat-danger .stat-icon,
.dashboard-stat-grid .stat-card.stat-warning .stat-icon {
    background: var(--brand-50) !important;
    color: var(--brand-600) !important;
}

.dashboard-stat-grid .stat-card.stat-danger .stat-icon {
    background: #fff2ed !important;
    border-color: #f6d7c8;
    color: #a94f2f !important;
}

.dashboard-stat-grid .stat-card.stat-warning .stat-icon {
    background: #fff8e8 !important;
    border-color: #f2e2b8;
    color: #8a641c !important;
}

.dashboard-stat-grid .stat-content h3 {
    color: var(--app-heading);
    font-size: 1.7rem;
    font-weight: 760;
    letter-spacing: -.04em;
}

.dashboard-stat-grid .stat-content p {
    color: var(--app-muted);
    font-size: .82rem;
    font-weight: 600;
}

.btn {
    border-radius: 11px;
    font-weight: 650;
    min-height: 42px;
    padding: .58rem 1rem;
}

.btn-etec,
.btn-sm.btn-etec,
.login-card .btn-etec {
    background: var(--brand-600) !important;
    border-color: var(--brand-600) !important;
    box-shadow: 0 5px 14px rgba(179, 13, 28, .16);
    color: #fff !important;
}

.btn-etec:hover,
.btn-etec:focus,
.btn-sm.btn-etec:hover,
.login-card .btn-etec:hover {
    background: var(--brand-700) !important;
    border-color: var(--brand-700) !important;
}

.btn-outline-etec {
    background: #fff !important;
    border-color: var(--app-border-strong) !important;
    color: var(--app-text) !important;
}

.btn-outline-etec:hover,
.btn-outline-etec:focus {
    background: var(--brand-50) !important;
    border-color: var(--brand-500) !important;
    color: var(--brand-700) !important;
}

.form-label {
    color: #384640;
    font-size: .82rem;
    font-weight: 680;
    margin-bottom: 7px;
}

.form-control,
.form-select,
.app-select__button {
    background-color: #fff;
    border-color: var(--app-border-strong);
    border-radius: 11px;
    color: var(--app-text);
    min-height: 45px;
}

.form-control:focus,
.form-select:focus,
.app-select.is-open .app-select__button {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(179, 13, 28, .12);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--brand-50);
    color: var(--app-text);
    font-size: .88rem;
}

.table thead th {
    background: var(--app-surface-muted);
    border-bottom: 1px solid var(--app-border);
    color: var(--app-muted);
    font-size: .7rem;
    font-weight: 780;
    letter-spacing: .055em;
    padding: 12px 14px;
    text-transform: uppercase;
}

.table tbody td {
    border-color: var(--app-border);
    padding: 14px;
    vertical-align: middle;
}

.alert {
    border: 1px solid transparent;
    border-radius: 13px;
}

.alert-info {
    background: #edf5f1;
    border-color: #d8e9e0;
    color: #8c0914;
}

.login-page {
    background:
        radial-gradient(circle at 12% 15%, rgba(179, 13, 28, .13), transparent 28rem),
        radial-gradient(circle at 88% 85%, rgba(246, 161, 11, .14), transparent 25rem),
        #fbf8f6;
}

.login-brand-logo {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 22px;
    box-shadow: var(--app-shadow);
    display: block;
    height: 112px;
    margin-bottom: 22px;
    object-fit: cover;
    width: 112px;
}

.login-shell {
    padding: clamp(22px, 5vw, 72px);
}

.login-panel {
    gap: clamp(34px, 8vw, 100px);
    grid-template-columns: minmax(0, 1.12fr) minmax(330px, .72fr);
    width: min(100%, 1080px);
}

.login-brand h1 {
    color: var(--app-heading);
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    font-weight: 780;
    letter-spacing: -.065em;
    line-height: .98;
    margin-bottom: 22px;
}

.login-brand p {
    color: var(--app-muted);
    font-size: 1.08rem;
    line-height: 1.65;
    max-width: 560px;
}

.login-badge {
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: .76rem;
    letter-spacing: .02em;
    padding: 8px 12px;
}

.login-feature-list {
    display: grid;
    gap: 10px;
    margin-top: 26px;
}

.login-feature-list span {
    align-items: center;
    color: #47564f;
    display: flex;
    font-size: .9rem;
    gap: 9px;
}

.login-feature-list i {
    color: var(--brand-500);
}

.login-card {
    border: 1px solid rgba(206, 215, 209, .8);
    border-radius: 22px;
    box-shadow: var(--app-shadow-raised);
    padding: clamp(24px, 4vw, 34px);
}

.login-card-heading {
    align-items: center;
    display: flex;
    gap: 13px;
    margin-bottom: 26px;
}

.login-card-heading h5 {
    font-size: 1.15rem;
    margin: 0 0 3px;
}

.login-card-heading p,
.login-help {
    color: var(--app-muted);
    font-size: .78rem;
    margin: 0;
}

.login-help {
    border-top: 1px solid var(--app-border);
    line-height: 1.45;
    margin-top: 22px !important;
    padding-top: 18px;
}

.mobile-bottom-nav {
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--app-border);
    border-radius: 18px;
    bottom: 10px;
    box-shadow: 0 15px 38px rgba(27, 44, 37, .16);
    left: 10px;
    padding: 6px;
    right: 10px;
}

.mobile-bottom-nav__item {
    color: var(--app-muted);
}

.mobile-bottom-nav__item.active {
    background: var(--brand-100);
    color: var(--brand-700);
}

@media (max-width: 991.98px) {
    .app-brand-copy small {
        display: none;
    }

    .login-panel {
        gap: 28px;
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .login-brand h1 {
        font-size: clamp(2.35rem, 10vw, 3.4rem);
    }
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 82px;
    }

    .container,
    .container-fluid {
        --bs-gutter-x: 1.25rem;
    }

    .app-topbar,
    .app-topbar-shell {
        min-height: 64px;
    }

    .app-brand-mark {
        border-radius: 10px;
        height: 36px;
        width: 36px;
    }

    .header-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
        min-height: 0;
        padding: 22px;
    }

    .header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .header-actions .btn {
        font-size: .78rem;
        padding-left: .65rem;
        padding-right: .65rem;
    }

    .dashboard-stat-grid .stat-card {
        min-height: 104px;
        padding: 13px;
    }

    .login-shell {
        padding: 28px 20px;
    }

    .login-brand p {
        font-size: .96rem;
    }

    .login-feature-list {
        display: none;
    }
}

.mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.96);
    border-color: var(--app-border);
}

.mobile-bottom-nav__item {
    color: #667085;
}

.mobile-bottom-nav__item.active,
.mobile-bottom-nav__item--button:focus,
.mobile-bottom-nav__item--button:hover {
    color: var(--etec-dark-red);
    background: var(--surface-soft);
}

@media (min-width: 992px) {
    .table-responsive {
        max-height: min(70vh, 680px);
        overflow: auto;
    }

    .card-custom:has(> form) {
        padding: 16px;
    }

    .card-custom form > .row {
        --bs-gutter-x: 0.75rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
    }

    .login-panel {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .login-brand {
        text-align: left;
    }

    .login-brand h1 {
        font-size: 2rem;
    }

    .app-topbar-shell {
        min-height: 54px;
    }

    .navbar-brand {
        font-size: 0.9rem;
    }

    .navbar-brand i {
        width: 28px;
        height: 28px;
    }

    .header-card {
        padding: 11px 10px 10px 14px;
        margin-bottom: 10px !important;
    }

    .header-card::before {
        top: 13px;
        bottom: 13px;
    }

    .header-card h1 {
        font-size: 1.08rem;
    }

    .header-card h1 i {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 0.84rem;
    }

    .header-card p {
        display: none;
    }

    .card-custom {
        padding: 11px;
        margin-bottom: 10px;
    }

    .card-custom h5,
    .card-custom .h4,
    .card-custom h2.h4 {
        font-size: 0.94rem;
        margin-bottom: 8px;
    }

    .stat-card {
        min-height: 68px;
        padding: 9px;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .stat-content h3,
    .report-metric-strip h2 {
        font-size: 1.08rem;
    }

    .filter-surface {
        position: sticky;
        top: 54px;
        z-index: 15;
        padding: 7px;
        border-radius: var(--app-radius);
        box-shadow: 0 8px 16px rgba(16, 24, 40, 0.08);
    }

    .form-control,
    .form-select,
    .app-select__button {
        min-height: 38px;
        font-size: 0.86rem;
    }

    .btn-etec,
    .btn-outline-etec {
        min-height: 38px;
    }

    .table-responsive {
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .table thead {
        display: none;
    }

    .table tbody {
        display: grid;
        gap: 8px;
    }

    .table tbody tr:not(.collapse) {
        display: block;
        border: 1px solid var(--app-border);
        border-left: 3px solid var(--surface-border);
        border-radius: var(--app-radius);
        background: #fff;
        box-shadow: var(--app-shadow);
        padding: 9px 10px;
        margin-bottom: 0;
    }

    .table tbody tr.table-danger:not(.collapse) {
        border-left-color: var(--status-critical-dot);
    }

    .table tbody tr.table-warning:not(.collapse) {
        border-left-color: var(--status-low-dot);
    }

    .table tbody tr.movement-row--entry:not(.collapse) {
        border-left-color: var(--status-normal-dot);
    }

    .table tbody tr.movement-row--exit:not(.collapse) {
        border-left-color: var(--status-critical-dot);
    }

    .table tbody td {
        border: 0;
        padding: 5px 0;
    }

    .mobile-pair-row,
    .mobile-compact-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .mobile-pair-row span,
    .mobile-compact-row span,
    .mobile-pair-meta,
    .mobile-compact-meta {
        color: var(--app-text);
        font-size: 0.76rem;
    }

    .mobile-pair-meta,
    .mobile-compact-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 5px 8px;
        margin-top: 6px;
        color: var(--app-muted);
    }

    .table-mobile-pairs .mobile-pair-meta strong,
    .table-mobile-pairs .mobile-pair-row strong,
    .table-mobile-compact .mobile-compact-row strong,
    .table-mobile-compact .mobile-compact-meta strong {
        color: var(--app-muted);
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .product-info > div:nth-of-type(5),
    .product-info > div:nth-of-type(6) {
        display: none;
    }

    .chart-frame {
        height: 190px;
    }

    .app-bottom-sheet .modal-dialog {
        align-items: flex-end;
        min-height: 100%;
        margin: 0;
        padding: 0;
    }

    .app-bottom-sheet .modal-content {
        border-radius: 16px 16px 0 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
    }

    .app-bottom-sheet .modal-body {
        padding-bottom: 18px;
    }
}

/* Theme identity correction */
.bg-etec {
    background: linear-gradient(135deg, var(--etec-dark-red) 0%, var(--etec-red) 58%, var(--etec-wine) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 22px rgba(var(--etec-dark-red-rgb), 0.18);
}

.navbar-brand,
.navbar-user-meta,
.navbar-user-name,
.navbar-user-role {
    color: var(--theme-header-text, #fff) !important;
}

.navbar-brand i {
    color: var(--theme-header-text, #fff);
    background: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.16);
}

.nav-link {
    color: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.84) !important;
}

.nav-link i {
    color: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.72);
}

.nav-link:hover,
.nav-link.active {
    color: var(--theme-header-text, #fff) !important;
    background: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.16);
}

.nav-link:hover i,
.nav-link.active i {
    color: var(--theme-header-text, #fff);
}

.btn-topbar-menu,
.btn-topbar-drawer,
.app-notification-button,
.app-topbar .btn-navbar-accent {
    color: var(--theme-header-text, #fff);
    background: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.13);
    border-color: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.24);
    box-shadow: none;
}

.btn-topbar-menu:hover,
.btn-topbar-menu:focus,
.btn-topbar-drawer:hover,
.btn-topbar-drawer:focus,
.btn-topbar-drawer.is-active,
.app-notification-button:hover,
.app-notification-button:focus,
.app-topbar .btn-navbar-accent:hover,
.app-topbar .btn-navbar-accent:focus {
    color: var(--theme-header-text, #fff);
    background: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.22);
    border-color: rgba(var(--theme-header-text-rgb, 255, 255, 255), 0.34);
}

.header-card {
    padding: 14px 16px;
    border: 1px solid var(--surface-border);
    border-left: 4px solid var(--etec-red);
    border-radius: var(--app-radius);
    background: linear-gradient(135deg, var(--surface-soft), #fff 68%);
    box-shadow: var(--app-shadow);
}

.header-card::before {
    display: none;
}

.header-card h1 i {
    color: #fff;
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
}

.table thead {
    top: 0;
    background: #f8fafc;
}

.table thead th {
    vertical-align: top !important;
    text-align: left !important;
    line-height: 1.2;
    padding-top: 9px;
    padding-bottom: 9px;
}

.table tbody td {
    vertical-align: top;
}

.mobile-bottom-nav {
    border-top: 3px solid var(--etec-red);
}

.mobile-bottom-nav__item.active {
    color: var(--etec-dark-red);
    background: var(--surface-soft);
}

.report-launcher {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

.report-launcher-card {
    min-height: 116px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
    color: var(--app-heading);
    text-decoration: none;
}

.report-launcher-card:hover,
.report-launcher-card:focus {
    color: var(--etec-dark-red);
    border-color: var(--surface-border);
    background: linear-gradient(135deg, var(--surface-soft), #fff);
}

.report-launcher-card__icon {
    width: 42px;
    height: 42px;
    border-radius: var(--app-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine));
    font-size: 1.1rem;
}

.report-launcher-card h5 {
    margin: 0;
    color: inherit;
}

.report-launcher-card span:not(.report-launcher-card__icon) {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.product-list-table .product-main {
    display: grid;
    gap: 2px;
}

.product-list-table .product-title {
    color: var(--app-heading);
    font-weight: 760;
}

.product-list-table .product-meta {
    color: var(--app-muted);
    font-size: 0.78rem;
}

.product-stock-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-stock-inline span {
    padding: 4px 7px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    color: #475467;
    font-size: 0.74rem;
    font-weight: 650;
}

.product-actions-mobile {
    margin-top: 8px;
}

@media (max-width: 768px) {
    .bg-etec {
        box-shadow: 0 4px 14px rgba(var(--etec-dark-red-rgb), 0.16);
    }

    .filter-surface {
        top: 54px;
        border-color: var(--surface-border);
    }

    .header-card {
        padding: 10px 12px;
        border-radius: var(--app-radius);
    }

    .table tbody tr:not(.collapse) {
        border-left-color: var(--etec-red);
    }

    .table tbody tr.table-warning:not(.collapse) {
        border-left-color: var(--status-low-dot);
    }

    .table tbody tr.table-danger:not(.collapse) {
        border-left-color: var(--status-critical-dot);
    }

    .table tbody tr.table-secondary:not(.collapse) {
        border-left-color: var(--status-neutral-dot);
    }

    .report-launcher-card {
        min-height: 92px;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 9px;
        padding: 11px;
    }

    .report-launcher-card__icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

.page-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.btn-sm.btn-etec,
.btn-sm.btn-outline-etec,
.btn-sm.btn-outline-primary,
.btn-sm.btn-outline-secondary,
.btn-sm.btn-outline-success,
.btn-sm.btn-outline-danger,
.btn-sm.btn-light {
    min-height: 34px;
    padding: 0.38rem 0.68rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.1;
    white-space: nowrap;
}

.btn-outline-success {
    border-radius: var(--app-radius-sm);
    border-color: var(--app-border-strong);
    color: var(--app-text);
    background: #fff;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background: var(--status-normal-bg);
    border-color: rgba(34, 197, 94, 0.26);
    color: var(--status-normal-fg);
}

.table-actions,
.table tbody td .d-flex.flex-wrap.gap-2,
.table tbody td .d-flex.flex-column.gap-2 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px !important;
    align-items: stretch;
}

.table-actions form,
.table tbody td .d-flex.flex-wrap.gap-2 form,
.table tbody td .d-flex.flex-column.gap-2 form {
    display: flex;
    margin: 0;
}

.table-actions .btn-sm,
.table tbody td .d-flex.flex-wrap.gap-2 .btn-sm,
.table tbody td .d-flex.flex-column.gap-2 .btn-sm {
    min-width: 92px;
}

@media (max-width: 767.98px) {
    .mobile-visible-actions .table-actions {
        border-top: 1px solid var(--surface-border);
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 10px;
        padding-top: 10px;
    }

    .mobile-visible-actions .table-actions form {
        display: flex;
        margin: 0;
    }

    .mobile-visible-actions .table-actions .btn {
        width: 100%;
        min-height: 38px;
    }

    .mobile-visible-actions .table-actions form:only-child,
    .mobile-visible-actions .table-actions form:nth-last-child(3):first-child,
    .mobile-visible-actions .table-actions form:nth-last-child(3):first-child ~ form {
        grid-column: span 2;
    }
}

.dashboard-stat-grid {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

.dashboard-stat-grid .stat-card {
    border-color: var(--surface-border);
    border-left-color: var(--etec-red);
}

.dashboard-stat-grid .stat-card.stat-primary {
    border-left-color: var(--etec-red);
}

.dashboard-stat-grid .stat-card.stat-success {
    border-left-color: var(--etec-wine);
}

.dashboard-stat-grid .stat-card.stat-danger {
    border-left-color: var(--etec-dark-red);
}

.dashboard-stat-grid .stat-icon {
    color: #fff !important;
    background: linear-gradient(135deg, var(--etec-red), var(--etec-wine)) !important;
}

.dashboard-stat-grid .stat-card.stat-success .stat-icon {
    color: #fff !important;
    background: linear-gradient(135deg, var(--etec-wine), var(--etec-red)) !important;
}

.dashboard-stat-grid .stat-card.stat-danger .stat-icon {
    color: #fff !important;
    background: linear-gradient(135deg, var(--etec-dark-red), var(--etec-red)) !important;
}

.dashboard-stat-grid .stat-content h3 {
    color: var(--etec-dark-red);
}

.quick-stock-list .mobile-product-card {
    display: grid;
    gap: 12px;
}

.quick-stock-list .mobile-product-card > .mb-3 {
    margin-bottom: 0 !important;
}

.quick-stock-list .mobile-product-card .row.align-items-end {
    --bs-gutter-x: 0.5rem;
}

.quick-stock-list .mobile-product-card .btn-lg {
    min-height: 46px;
    padding: 0.6rem 0.85rem;
    font-size: 0.92rem;
}

.login-page {
    background:
        radial-gradient(circle at top left, rgba(var(--etec-red-rgb), 0.22), transparent 35%),
        linear-gradient(135deg, var(--login-surface-start) 0%, #f8f9fa 45%, var(--login-surface-end) 100%);
}

.login-panel {
    width: min(100%, 920px);
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

.login-brand h1 {
    color: var(--etec-dark-red);
    font-size: 3rem;
    font-weight: 800;
}

.login-brand p {
    color: #5a5a5a;
    font-size: 1.1rem;
}

.login-badge {
    background: rgba(var(--etec-dark-red-rgb), 0.08);
    color: var(--etec-dark-red);
    border: 0;
}

.login-card {
    border-color: transparent;
    box-shadow: var(--surface-shadow);
}

.login-card .btn-etec {
    background: linear-gradient(135deg, #C41E3A, #8B0000) !important;
    border-color: #C41E3A !important;
    color: #fff !important;
}

.login-card .btn-etec:hover,
.login-card .btn-etec:focus {
    background: linear-gradient(135deg, #8B0000, #722F37) !important;
    border-color: #8B0000 !important;
    color: #fff !important;
}

.login-card .btn-outline-etec,
.contact-drawer-panel .btn-etec {
    border-color: #C41E3A !important;
    color: #8B0000 !important;
}

.login-card .btn-outline-etec {
    background: #fff !important;
}

.login-card .btn-outline-etec:hover,
.login-card .btn-outline-etec:focus,
.contact-drawer-panel .btn-etec,
.contact-drawer-panel .btn-etec:hover,
.contact-drawer-panel .btn-etec:focus {
    background: linear-gradient(135deg, #C41E3A, #8B0000) !important;
    border-color: #C41E3A !important;
    color: #fff !important;
}

@media (max-width: 768px) {
    .page-action-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-action-row .btn {
        min-width: 0;
        width: 100%;
    }

    .dashboard-stat-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-left: 0;
        margin-right: 0;
    }

    .dashboard-stat-grid > [class*="col-"] {
        width: auto;
        padding: 0;
        margin-bottom: 0 !important;
    }

    .dashboard-stat-grid .stat-card {
        min-height: 92px;
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 9px;
        align-items: center;
        padding: 11px;
    }

    .dashboard-stat-grid .stat-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 1rem;
    }

    .dashboard-stat-grid .stat-content h3 {
        font-size: 1.2rem;
    }

    .dashboard-stat-grid .stat-content p {
        font-size: 0.74rem;
    }

    .quick-stock-list .category-products .row {
        grid-template-columns: 1fr;
    }

    .login-panel {
        grid-template-columns: 1fr;
        width: min(100%, 380px);
        max-width: 380px;
    }

    .login-brand h1 {
        font-size: 2rem;
    }

    .login-shell {
        padding: 24px 22px;
    }

    .login-card {
        padding: 18px;
    }

    .centered-drawer .modal-dialog {
        width: min(100% - 44px, 380px);
        margin-left: auto;
        margin-right: auto;
    }

    .contact-drawer-panel {
        padding: 18px;
    }
}

/* Print Styles */
@media print {
    .navbar, .btn, .alert {
        display: none !important;
    }
    
    .card-custom {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Theme contrast */
.btn-etec,
.btn-sm.btn-etec,
.login-card .btn-etec,
.contact-drawer-panel .btn-etec,
.contact-drawer-panel .btn-etec:hover,
.contact-drawer-panel .btn-etec:focus {
    color: var(--theme-button-text, #fff) !important;
}

.btn-etec:hover,
.btn-etec:focus,
.btn-sm.btn-etec:hover,
.btn-sm.btn-etec:focus,
.login-card .btn-etec:hover,
.login-card .btn-etec:focus {
    color: var(--theme-button-text, #fff) !important;
}

.btn-etec i,
.btn-sm.btn-etec i,
.login-card .btn-etec i,
.contact-drawer-panel .btn-etec i {
    color: inherit !important;
}

.centered-drawer .modal-header,
.contact-drawer-panel .modal-header {
    color: var(--app-heading, #111827) !important;
}

.centered-drawer .modal-header .modal-title,
.contact-drawer-panel .modal-header .modal-title {
    color: var(--app-heading, #111827) !important;
}

.centered-drawer .modal-header .btn-close,
.contact-drawer-panel .modal-header .btn-close {
    filter: none !important;
    opacity: 0.72;
}
/* Legal consent and document */
.legal-page {
    max-width: 960px;
}

.legal-document {
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 8px;
    padding: 28px;
}

.legal-document section + section {
    border-top: 1px solid #e6e9ef;
    margin-top: 22px;
    padding-top: 22px;
}

.legal-document h2 {
    color: #1f2937;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.legal-document p {
    color: #4b5563;
    line-height: 1.65;
    margin: 0;
}

.legal-review-note {
    align-items: flex-start;
    background: #eef6ff;
    border-left: 3px solid #2563eb;
    color: #334155;
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding: 14px 16px;
}

.legal-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.legal-consent-modal .modal-body {
    padding: 24px;
}

.legal-consent-icon {
    align-items: center;
    background: var(--surface-soft, #f3f4f6);
    border-radius: 8px;
    color: var(--etec-red);
    display: flex;
    font-size: 1.5rem;
    height: 48px;
    justify-content: center;
    margin-bottom: 18px;
    width: 48px;
}

.legal-consent-modal h6 {
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 700;
}

.legal-consent-modal p {
    color: #64748b;
    line-height: 1.55;
}

.legal-consent-link {
    color: var(--etec-red);
    font-weight: 600;
    text-decoration: none;
}

/* Product exchanges */
.exchange-list {
    display: grid;
    gap: 10px;
}

.exchange-row {
    align-items: center;
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: 8px;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 16px 18px;
}

.exchange-row__main {
    min-width: 0;
}

.exchange-row__title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.exchange-row__details {
    display: grid;
    gap: 12px 24px;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.exchange-row__details span {
    color: #334155;
    min-width: 0;
    overflow-wrap: anywhere;
}

.exchange-row__details small {
    color: #64748b;
    display: block;
    font-size: .72rem;
    font-weight: 700;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.exchange-row__actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

@media (max-width: 767.98px) {
    .legal-document {
        padding: 20px 16px;
    }

    .legal-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .legal-actions form,
    .legal-actions .btn {
        width: 100%;
    }

    .exchange-row {
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
    }

    .exchange-row__details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .exchange-row__actions {
        justify-content: flex-end;
    }

    .exchange-row__actions .btn-etec {
        flex: 1 1 auto;
    }
}

/* Ajustes finais de especificidade da identidade Despensa Escolar. */
body.login-page {
    background:
        radial-gradient(circle at 12% 15%, rgba(179, 13, 28, .13), transparent 28rem),
        radial-gradient(circle at 88% 85%, rgba(246, 161, 11, .15), transparent 25rem),
        #fbf8f6 !important;
}

.login-brand h1 {
    color: var(--app-heading) !important;
    font-size: clamp(2.6rem, 5vw, 4.8rem) !important;
    font-weight: 780 !important;
    letter-spacing: -.065em;
    line-height: .98;
}

.login-brand p,
.login-help {
    color: var(--app-muted) !important;
}

.login-badge {
    background: var(--brand-100) !important;
    color: var(--brand-700) !important;
}

.login-card .btn-etec,
.login-card .btn-etec:hover,
.login-card .btn-etec:focus,
.btn-etec,
.btn-etec:hover,
.btn-etec:focus {
    background: var(--brand-600) !important;
    border-color: var(--brand-600) !important;
    color: #fff !important;
}

.app-topbar.bg-etec {
    background: rgba(255, 255, 255, .94) !important;
    border-bottom: 1px solid var(--app-border) !important;
}

.app-topbar .navbar-brand,
.app-topbar .navbar-brand strong {
    color: var(--app-heading) !important;
}

@media (max-width: 991.98px) {
    .login-brand h1 {
        font-size: clamp(2.35rem, 10vw, 3.4rem) !important;
    }
}

/* Identidade Arkhos e refinamentos responsivos da versão de escola única. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
canvas {
    max-width: 100%;
}

.row > [class*="col-"] {
    min-width: 0;
}

body.login-page {
    background:
        radial-gradient(circle at 12% 15%, rgba(179, 13, 28, .13), transparent 28rem),
        radial-gradient(circle at 88% 85%, rgba(246, 161, 11, .15), transparent 25rem),
        #fbf8f6 !important;
}

.app-brand-mark,
.brand-mark {
    background: #fff;
    border: 1px solid rgba(179, 13, 28, .14);
    box-shadow: 0 5px 16px rgba(101, 7, 14, .1);
    overflow: hidden;
}

.app-brand-mark img,
.brand-mark img {
    display: block;
    height: 100%;
    object-fit: cover;
    transform: scale(1.28);
    width: 100%;
}

.header-card {
    background: linear-gradient(135deg, #fff2f1 0%, #fff9ee 100%);
    border-color: rgba(179, 13, 28, .14);
}

.header-card::after {
    border-color: rgba(246, 161, 11, .14);
    background: rgba(255, 255, 255, .48);
}

.btn-etec,
.btn-sm.btn-etec,
.login-card .btn-etec,
.login-card .btn-etec:hover,
.login-card .btn-etec:focus {
    background: linear-gradient(135deg, #b30d1c, #8c0914) !important;
    border-color: #b30d1c !important;
    box-shadow: 0 6px 16px rgba(179, 13, 28, .17);
}

.btn-etec:hover,
.btn-etec:focus,
.btn-sm.btn-etec:hover,
.btn-sm.btn-etec:focus {
    background: linear-gradient(135deg, #9f0b18, #65070e) !important;
    border-color: #8c0914 !important;
}

.form-control:focus,
.form-select:focus,
.app-select.is-open .app-select__button {
    border-color: #c51c29;
    box-shadow: 0 0 0 3px rgba(179, 13, 28, .12);
}

.login-badge {
    background: #fde5e5 !important;
    color: #8c0914 !important;
}

.login-feature-list i,
.card-custom h5 i,
.page-eyebrow {
    color: #b30d1c;
}

.app-notification-badge,
.badge.bg-warning {
    background-color: #f6a10b !important;
}

.table-responsive {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table td,
.table th,
.card-custom,
.header-card,
.app-brand-copy {
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    .app-menu-drawer {
        max-width: min(92vw, 420px);
    }

    .login-brand-logo {
        height: 88px;
        margin-bottom: 16px;
        width: 88px;
    }
}

@media (max-width: 767.98px) {
    input,
    select,
    textarea,
    .form-control,
    .form-select,
    .app-select__button {
        font-size: 16px;
    }

    .app-topbar-shell {
        gap: 8px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar-brand {
        gap: 8px;
        margin-right: 4px;
        max-width: calc(100% - 100px);
        min-width: 0;
    }

    .app-brand-copy {
        max-width: min(58vw, 220px);
        min-width: 0;
    }

    .app-brand-copy strong {
        font-size: .82rem;
    }

    .header-card {
        gap: 13px;
        padding: 16px;
    }

    .header-card h1 {
        font-size: 1.3rem;
        line-height: 1.15;
    }

    .header-card p {
        display: block;
        font-size: .82rem;
        line-height: 1.4;
        margin-bottom: 0;
    }

    .header-actions,
    .page-action-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .header-actions > *,
    .header-actions form,
    .header-actions .btn,
    .page-action-row > *,
    .page-action-row .btn {
        min-width: 0;
        width: 100%;
    }

    .card-custom {
        padding: 14px;
    }

    .card-custom > .d-flex.justify-content-between,
    .card-custom > .d-flex.flex-md-row {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .card-custom > .d-flex.justify-content-between .btn,
    .card-custom > .d-flex.flex-md-row .btn {
        width: 100%;
    }

    .metric-strip,
    .report-metric-strip,
    .dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-launcher {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-left: 0;
        margin-right: 0;
    }

    .report-launcher > [class*="col-"] {
        padding: 0;
        width: auto;
    }

    .report-launcher-card {
        height: 100%;
        min-width: 0;
    }

    .pagination-surface {
        flex-wrap: wrap;
        gap: 7px;
    }

    .pagination-status {
        flex: 1 1 100%;
        order: -1;
    }

    .pagination-jump .form-control {
        width: 66px;
    }

    .quick-stock-list .mobile-product-card,
    .mobile-product-card {
        min-width: 0;
        padding: 13px;
    }

    .quick-stock-list .mobile-product-card .row.align-items-end > [class*="col-"] {
        margin-bottom: 8px;
        width: 100%;
    }

    .quick-stock-list .mobile-product-card .btn-lg {
        width: 100%;
    }

    .app-select__menu,
    .app-notification-panel {
        max-width: calc(100vw - 20px);
    }

    .modal-dialog {
        margin-left: 10px;
        margin-right: 10px;
        width: auto;
    }

    .modal-body,
    .modal-header,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .mobile-bottom-nav__item {
        min-width: 0;
    }
}

@media (max-width: 430px) {
    .header-actions,
    .page-action-row {
        grid-template-columns: 1fr;
    }

    .report-launcher {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-strip,
    .report-metric-strip,
    .dashboard-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-stat-grid .stat-card {
        grid-template-columns: 32px minmax(0, 1fr);
        padding: 9px;
    }

    .dashboard-stat-grid .stat-icon {
        height: 32px;
        min-width: 32px;
        width: 32px;
    }

    .mobile-filter-bar {
        grid-template-columns: 1fr;
    }

    .mobile-bottom-nav__item {
        font-size: .62rem;
        padding-left: 2px;
        padding-right: 2px;
    }
}

/* Aferição de temperatura */
.temperature-entry-card {
    background: linear-gradient(145deg, #fff 0%, #fff9f3 100%);
    border-color: rgba(164, 90, 50, .2) !important;
    box-shadow: 0 10px 28px rgba(52, 35, 26, .06);
}

.temperature-entry-meta dt,
.temperature-entry-meta dd {
    margin-bottom: .35rem;
}

.temperature-entry-meta dt {
    color: var(--bs-secondary-color);
    font-weight: 600;
}

.temperature-reading {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #fff1e8;
    color: #7a341c;
    font-weight: 700;
    padding: .35rem .65rem;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .temperature-entry-card {
        padding: 14px !important;
    }

    .temperature-entry-card .input-group,
    .temperature-entry-card .form-control,
    .temperature-entry-card .btn {
        min-height: 46px;
    }
}

/* Dashboard: composição mobile e gráficos legíveis */
@media (max-width: 767.98px) {
    .dashboard-page .dashboard-hero-row {
        display: block;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 12px !important;
        width: 100%;
    }

    .dashboard-page .dashboard-hero-row > .col-12 {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }

    .dashboard-page .dashboard-hero-row .header-card {
        gap: 14px;
        min-height: 0;
        padding: 16px;
        width: 100%;
    }

    .dashboard-page .dashboard-hero-row .header-card h1 {
        font-size: 1.35rem;
        overflow-wrap: anywhere;
    }

    .dashboard-page .dashboard-hero-row .header-actions {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .dashboard-page .dashboard-hero-row .header-actions .btn {
        align-items: center;
        display: inline-flex;
        font-size: .78rem;
        gap: 5px;
        justify-content: center;
        min-width: 0;
        padding-left: .5rem;
        padding-right: .5rem;
        white-space: nowrap;
    }

    .dashboard-page .dashboard-stat-grid {
        margin-bottom: 14px !important;
    }

    .dashboard-page .dashboard-stat-grid .stat-content {
        min-width: 0;
    }

    .dashboard-page .dashboard-stat-grid .stat-content p {
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .dashboard-page .chart-frame {
        max-width: 100%;
        min-width: 0;
    }

    .dashboard-page .dashboard-status-chart {
        height: 230px;
    }

    .dashboard-page .dashboard-movement-table tbody td:first-child {
        min-width: 0;
        text-align: left;
        width: 100%;
    }

    .dashboard-page .dashboard-movement-table tbody td:first-child > .badge {
        display: none !important;
    }

    .dashboard-page .dashboard-movement-table .mobile-compact-summary {
        min-width: 0;
        width: 100%;
    }

    .dashboard-page .dashboard-movement-table .mobile-compact-row {
        align-items: start;
        gap: 8px 12px;
        width: 100%;
    }

    .dashboard-page .dashboard-movement-table .mobile-compact-row span,
    .dashboard-page .dashboard-movement-table .mobile-compact-meta span {
        min-width: 0;
        overflow-wrap: break-word;
        word-break: normal;
    }

    .dashboard-page .dashboard-movement-table .dashboard-movement-main {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    }
}

@media (max-width: 359.98px) {
    .dashboard-page .dashboard-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Mantém o ornamento no fundo e prioriza o conteúdo dos cabeçalhos. */
.header-card::after {
    z-index: 0;
}

.header-card > * {
    position: relative;
    z-index: 1;
}

/* Logos atuais e versão enxuta do conteúdo no layout original do login. */
.app-brand-mark img,
.brand-mark img {
    object-fit: contain;
    padding: 3px;
    transform: none;
}

/* A marca do cabeçalho usa diretamente o PNG transparente, sem cartão ao redor. */
.app-topbar .app-brand-mark {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    height: 52px;
    overflow: visible;
    width: 52px;
}

.app-topbar .app-brand-mark img {
    height: 100%;
    padding: 0;
    width: 100%;
}

@media (max-width: 767.98px) {
    .app-topbar .app-brand-mark {
        height: 44px;
        width: 44px;
    }
}

.login-panel-minimal {
    align-items: center;
    gap: clamp(24px, 4vw, 38px);
    grid-template-columns: minmax(0, 1fr);
    max-width: 480px;
}

.arkhos-brand-lockup {
    align-items: flex-end;
    display: flex;
    gap: 0;
    justify-content: center;
    max-width: 100%;
}

.login-brand-minimal {
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;
}

.login-brand-minimal .login-brand-logo {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex: 0 0 auto;
    height: auto;
    margin: 0;
    object-fit: contain;
    padding: 0;
    width: clamp(124px, 13vw, 154px);
}

.arkhos-brand-word {
    color: #241719;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: clamp(3.6rem, 6vw, 4.8rem);
    font-weight: 800;
    letter-spacing: .018em;
    line-height: .82;
    margin: 0 0 25px -14px;
}

.arkhos-brand-tagline {
    color: var(--app-muted, #6f6363);
    font-size: 0.86rem;
    font-weight: 650;
    letter-spacing: 0.045em;
    left: 50%;
    margin: 0;
    max-width: 100%;
    position: absolute;
    text-align: center;
    top: calc(100% - 0.35rem);
    transform: translateX(-50%);
    white-space: nowrap;
}

.login-card-minimal {
    background:
        radial-gradient(circle at 100% 0, rgba(246, 162, 0, .09), transparent 145px),
        linear-gradient(155deg, #ffffff 0%, #fffafa 100%);
    border: 1px solid rgba(179, 13, 28, .13);
    box-shadow:
        0 24px 55px rgba(65, 22, 27, .11),
        0 8px 18px rgba(65, 22, 27, .06),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    overflow: hidden;
    padding: 34px;
    position: relative;
}

.login-card-minimal::before {
    background: linear-gradient(90deg, var(--brand-600) 0 72%, #f6a200 72% 100%);
    content: "";
    height: 4px;
    inset: 0 0 auto;
    position: absolute;
}

.login-card-minimal form {
    display: grid;
    gap: 20px;
}

.login-form-group {
    min-width: 0;
}

.login-card-minimal .form-label {
    color: var(--app-heading);
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap > .bi:first-child {
    color: #9a7c7f;
    font-size: 1.05rem;
    left: 17px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: color .18s ease, transform .18s ease;
    z-index: 2;
}

.login-card-minimal .form-control {
    background: rgba(255, 255, 255, .92);
    border: 1px solid #e4d4d3;
    border-radius: 14px;
    box-shadow: 0 3px 9px rgba(52, 25, 28, .035), inset 0 1px 2px rgba(52, 25, 28, .025);
    min-height: 54px;
    padding-left: 48px;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.login-card-minimal .password-field .form-control {
    padding-right: 48px;
}

.login-card-minimal .login-input-wrap:focus-within > .bi:first-child {
    color: var(--brand-600);
    transform: translateY(-50%) scale(1.06);
}

.login-card-minimal .form-control:focus {
    background: #fff;
    border-color: rgba(179, 13, 28, .72);
    box-shadow: 0 0 0 4px rgba(179, 13, 28, .09), 0 8px 18px rgba(52, 25, 28, .06);
}

.login-card-minimal .btn-etec {
    align-items: center;
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(179, 13, 28, .22);
    display: flex;
    justify-content: center;
    min-height: 54px;
    position: relative;
    transition: box-shadow .18s ease, transform .18s ease;
}

.login-card-minimal .btn-etec .bi {
    font-size: 1.1rem;
    position: absolute;
    right: 19px;
    transition: transform .18s ease;
}

.login-card-minimal .btn-etec:hover,
.login-card-minimal .btn-etec:focus-visible {
    box-shadow: 0 13px 26px rgba(179, 13, 28, .28);
    transform: translateY(-1px);
}

.login-card-minimal .btn-etec:hover .bi,
.login-card-minimal .btn-etec:focus-visible .bi {
    transform: translateX(3px);
}

@media (max-width: 575.98px) {
    .login-panel-minimal {
        gap: 24px;
    }

    .login-brand-minimal {
        align-items: center;
        display: flex;
        flex-direction: column;
        text-align: center;
    }

    .login-brand-minimal .login-brand-logo {
        width: clamp(102px, 29vw, 124px);
    }

    .arkhos-brand-word {
        font-size: clamp(3rem, 15vw, 4rem);
        letter-spacing: .018em;
        margin: 0 0 19px -11px;
    }

    .arkhos-brand-tagline {
        font-size: 0.78rem;
        top: calc(100% - 0.85rem);
    }

    .login-card-minimal {
        padding: 28px 22px 24px;
        width: 100%;
    }
}

.entry-origin-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.entry-origin-option {
    cursor: pointer;
    margin: 0;
}

.entry-origin-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.entry-origin-option > span {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    align-items: center;
    min-height: 76px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--app-border, #ead8d3);
    border-radius: 16px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.entry-origin-option i {
    grid-row: 1 / 3;
    color: var(--etec-red, #b5091b);
    font-size: 1.35rem;
}

.entry-origin-option strong,
.entry-origin-option small {
    display: block;
}

.entry-origin-option small {
    color: #6f6363;
}

.entry-origin-option input:checked + span {
    border-color: var(--etec-red, #b5091b);
    background: #fff7f5;
    box-shadow: 0 0 0 3px rgba(181, 9, 27, 0.1);
}

.entry-origin-option input:focus-visible + span {
    outline: 3px solid rgba(181, 9, 27, 0.2);
    outline-offset: 2px;
}

.apm-lot-notice {
    padding-top: 1.65rem;
}

#temperaturaNotice[hidden] {
    display: none !important;
}

@media (max-width: 575.98px) {
    .entry-origin-selector {
        grid-template-columns: 1fr;
    }

    .apm-lot-notice {
        padding-top: 0;
    }
}

/* Ajustes finais de densidade e alinhamento no mobile. */
@media (max-width: 767.98px) {
    .temperature-history-table tbody tr:not(.collapse) {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 16px;
    }

    .temperature-history-table tbody td {
        min-width: 0;
        padding: 0 !important;
        width: auto !important;
        overflow-wrap: anywhere;
    }

    .temperature-history-table tbody td:first-child {
        grid-column: 1 / -1;
    }

    .temperature-history-table tbody td::before {
        margin-bottom: 3px;
    }

    .temperature-entry-card form > .col-sm-5 {
        width: 42%;
    }

    .temperature-entry-card form > .col-sm-7 {
        width: 58%;
    }

    .merendeira-mobile-actions {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 8px;
        width: 100%;
    }

    .merendeira-mobile-actions > button,
    .merendeira-mobile-actions > form,
    .merendeira-mobile-actions > form > button {
        margin: 0;
        min-width: 0;
        width: 100% !important;
    }

    .merendeira-mobile-actions .btn {
        min-height: 42px;
    }
}
