: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(--etec-white) !important;
    letter-spacing: 0.5px;
}

.navbar-brand i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.nav-link {
    color: rgba(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(255,255,255,0.1);
    color: var(--etec-white) !important;
}

.nav-link.active {
    background-color: rgba(255,255,255,0.16);
    color: 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(255,255,255,0.24);
    color: var(--etec-white);
    background: rgba(255,255,255,0.12);
}

.btn-topbar-menu:hover,
.btn-topbar-menu:focus {
    color: var(--etec-white);
    background: rgba(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);
}

/* 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(--etec-white);
    border-bottom: none;
}

.modal-title {
    font-weight: 700;
}

.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-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-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: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);
    }
}

/* 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__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;
}

.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-add,
.repeatable-remove {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 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: var(--app-heading);
    font-weight: 760;
}

.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 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: #fff !important;
}

.navbar-brand i {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.nav-link {
    color: rgba(255, 255, 255, 0.84) !important;
}

.nav-link i {
    color: rgba(255, 255, 255, 0.72);
}

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

.nav-link:hover i,
.nav-link.active i {
    color: #fff;
}

.btn-topbar-menu,
.btn-topbar-drawer,
.app-notification-button,
.app-topbar .btn-navbar-accent {
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(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: #fff;
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(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;
}

.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;
    }
}
