:root {
    --primary-color: #007bff;
    --primary-hover-color: #0056b3;
    --primary-focus-ring: rgba(0, 123, 255, 0.25);
    --primary-color-light: #cfe2ff;
    --primary-color-darker: #004085;
    --success-color: #28a745;
    --success-hover-color: #1e7e34;
    --warning-color: #ffc107;
    --warning-hover-color: #d39e00;
    --red-color: #dc3545;
    --red-hover-color: #bd2130;
    --red-focus-ring: rgba(220, 53, 69, 0.25);
    --accent-teal-color: #20c997;
    --accent-teal-hover-color: #17a2b8;
    --accent-teal-focus-ring: rgba(32, 201, 151, 0.25);
    --accent-teal-light: #d1ecf1;
    --accent-purple-color: #6f42c1;
    --accent-purple-hover-color: #5a32a3;
    --accent-purple-focus-ring: rgba(111, 66, 193, 0.25);
    --accent-purple-light: #e0cffc;
    --info-color: #17a2b8;
    --info-light-bg: #d1ecf1;
    --gray-50: #f8f9fa;
    --gray-100: #f4f6f9;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --white-color: #ffffff;
    --gray-background: var(--gray-100);
    --content-background: var(--white-color);
    --border-color: var(--gray-300);
    --border-color-light: var(--gray-200);
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.07);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    --shadow-inner: inset 0 2px 4px 0 rgba(0,0,0,0.04);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 0.75rem;
    --border-radius-2xl: 1.5rem;
    --border-radius-full: 9999px;
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --navbar-height: 50px;
    --card-border-radius: var(--border-radius-lg);
    --input-border-radius: var(--border-radius-md);
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
}
body {
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--gray-background);
    color: var(--gray-800);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}
.main-content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    width: 100%;
}
.navbar-custom {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--shadow-md);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: box-shadow var(--transition-normal), background-color var(--transition-normal), backdrop-filter var(--transition-normal);
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color-light);
}
.navbar-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar-brand {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast), transform var(--transition-bounce);
}
.navbar-brand:hover {
    color: var(--primary-hover-color);
    transform: scale(1.03);
}
.navbar-burger-custom {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
    outline: none;
}
.navbar-burger-custom span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gray-800);
    border-radius: var(--border-radius-full);
    transition: all var(--transition-bounce);
    transform-origin: center;
}
.navbar-burger-custom.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.navbar-burger-custom.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
.navbar-menu-custom {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    width: 100%;
    background-color: var(--white-color);
    box-shadow: var(--shadow-lg);
    padding: 0.25rem 0;
    border-top: 1px solid var(--border-color-light);
    max-height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
}
.navbar-menu-custom.is-active { display: flex; }
@media (min-width: 768px) {
    .navbar-burger-custom { display: none; }
    .navbar-menu-custom {
        display: flex !important;
        flex-direction: row;
        position: static;
        width: auto;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
        align-items: center;
        border-top: none;
        max-height: none;
        overflow-y: visible;
    }
    .navbar-menu-custom > *:not(:last-child) {
        margin-right: 1rem;
    }
}
.navbar-item-custom {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--gray-700);
    font-weight: 500;
    border-radius: var(--border-radius-md);
    transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
    position: relative;
}
.navbar-item-custom:hover {
    color: var(--accent-teal-color);
    background-color: var(--accent-teal-light);
    transform: translateY(-1px) scale(1.01);
    box-shadow: var(--shadow-xs);
}
.navbar-item-custom.active-link {
    color: var(--primary-color);
    font-weight: 600;
}
.navbar-item-custom.active-link::after {
    content: '';
    position: absolute;
    bottom: 0.2rem;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: var(--border-radius-full);
    animation: underline-appear 0.3s ease-out;
}
@keyframes underline-appear {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}
.nav-hidden { display: none !important; }
.button-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-normal), transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
    outline: none;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
}
.button-custom:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px) scale(1.02);
}
.button-custom:active {
    transform: translateY(-1px) scale(1);
    box-shadow: var(--shadow-sm);
}
.button-custom:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
    box-shadow: 0 0 0 3px var(--primary-focus-ring), var(--shadow-sm);
}
.button-primary { background-color: var(--primary-color); color: var(--white-color); }
.button-primary:hover { background-color: var(--primary-hover-color); box-shadow: var(--shadow-md), 0 0 6px var(--primary-focus-ring); }
.button-light { background-color: var(--white-color); color: var(--gray-700); border: 1px solid var(--border-color); }
.button-light:hover { background-color: var(--gray-50); border-color: var(--gray-500); color: var(--gray-900); }
.button-red { background-color: var(--red-color); color: var(--white-color); }
.button-red:hover { background-color: var(--red-hover-color); box-shadow: var(--shadow-md), 0 0 6px var(--red-focus-ring); }
.button-red:focus-visible { outline: 2px solid var(--red-color); box-shadow: 0 0 0 3px var(--red-focus-ring), var(--shadow-sm); }
.button-secondary { background-color: var(--accent-teal-color); color: var(--white-color); }
.button-secondary:hover { background-color: var(--accent-teal-hover-color); box-shadow: var(--shadow-md), 0 0 6px var(--accent-teal-focus-ring); }
.button-secondary:focus-visible { outline: 2px solid var(--accent-teal-color); box-shadow: 0 0 0 3px var(--accent-teal-focus-ring), var(--shadow-sm); }
.button-purple { background-color: var(--accent-purple-color); color: var(--white-color); }
.button-purple:hover { background-color: var(--accent-purple-hover-color); box-shadow: var(--shadow-md), 0 0 6px var(--accent-purple-focus-ring); }
.button-purple:focus-visible { outline: 2px solid var(--accent-purple-color); box-shadow: 0 0 0 3px var(--accent-purple-focus-ring), var(--shadow-sm); }
.button-outline-primary { background-color: transparent; color: var(--primary-color); border: 1px solid var(--primary-color); }
.button-outline-primary:hover { background-color: var(--primary-color-light); color: var(--primary-hover-color); border-color: var(--primary-hover-color); transform: translateY(-1px) scale(1.01); box-shadow: var(--shadow-sm); }
.button-outline-primary:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--white-color), 0 0 0 4px var(--primary-color), var(--shadow-sm); }
.button-outline-red { background-color: transparent; color: var(--red-color); border: 1px solid var(--red-color); }
.button-outline-red:hover { background-color: var(--red-focus-ring); color: var(--red-hover-color); border-color: var(--red-hover-color); transform: translateY(-1px) scale(1.01); box-shadow: var(--shadow-sm); }
.button-outline-red:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--white-color), 0 0 0 4px var(--red-color), var(--shadow-sm); }
.button-success { background-color: var(--success-color); color: var(--white-color); }
.button-success:hover { background-color: var(--success-hover-color); box-shadow: var(--shadow-md), 0 0 6px rgba(40, 167, 69, 0.25); }
.button-warning { background-color: var(--warning-color); color: var(--white-color); }
.button-warning:hover { background-color: var(--warning-hover-color); box-shadow: var(--shadow-md), 0 0 6px rgba(40, 167, 69, 0.25); }
.hero-section {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color-light) 0%, var(--accent-teal-light) 100%);
    width: 100%;
    border-bottom-left-radius: var(--border-radius-lg);
    border-bottom-right-radius: var(--border-radius-lg);
    margin-bottom: 1.5rem;
}
.hero-content { max-width: 48rem; margin: 0 auto; }
.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color-darker);
    margin-bottom: 0.75rem;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--gray-700);
    max-width: 40rem;
    margin: 0 auto 1.25rem auto;
}
@media (min-width: 768px) {
    .hero-title { font-size: 3.25rem; }
    .hero-subtitle { font-size: 1.25rem; }
    .hero-section { padding: 4rem 1rem; border-bottom-left-radius: var(--border-radius-xl); border-bottom-right-radius: var(--border-radius-xl); }
}
.site-footer {
    background-color: var(--gray-900);
    color: var(--gray-400);
    text-align: center;
    padding: 1.25rem 0;
    margin-top: auto;
    box-shadow: var(--shadow-inner);
}
.footer-container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.footer-text { font-size: var(--font-size-sm); }
.footer-text a { color: var(--primary-color-light); text-decoration: none; transition: color var(--transition-fast); }
.footer-text a:hover { color: var(--white-color); text-decoration: underline; }
.modal-custom {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    z-index: 1050; padding: 0.75rem;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    backdrop-filter: blur(4px) saturate(120%);
    -webkit-backdrop-filter: blur(4px) saturate(120%);
}
.modal-hidden { opacity: 0; visibility: hidden; }
.modal-custom.is-active { opacity: 1; visibility: visible; }
.modal-background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(17, 24, 39, 0.65); }
.modal-content-custom {
    background-color: var(--content-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 1.25rem;
    max-width: 30rem;
    width: 100%; position: relative; z-index: 1;
    transform: scale(0.95) translateY(10px); opacity: 0;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease-out;
    will-change: transform, opacity;
    border-top: 3px solid var(--primary-color);
}
#orderDetailsModal .modal-content-custom {
    max-width: 40rem;
}
#orderDetailsModal .compact-modal-content {
    padding: 1rem;
}
#orderDetailsModal .compact-modal-title {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}
#orderDetailsModal .compact-stock-card {
    padding: 0.5rem;
    margin-bottom: 0.5rem !important;
    background-color: var(--gray-50);
}
#orderDetailsModal .compact-stock-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color-darker);
    margin-bottom: 0.3rem;
}
#orderDetailsModal .compact-label {
    font-size: 0.8rem;
    margin-bottom: 0.1rem;
}
#orderDetailsModal .compact-text {
    font-size: 0.85rem;
    padding: 0.15rem;
    border-bottom: 1px solid var(--border-color-light);
}
#orderDetailsModal .modal-stock-quantities .compact-text {
    font-weight: bold;
    border-bottom: none;
}
#orderDetailsModal .compact-detail-row {
    margin-bottom: 0.3rem;
    gap: 0.5rem;
}
#orderDetailsModal .compact-hr {
    margin: 0.5rem 0;
    border-color: var(--border-color-light);
}
#orderDetailsModal .compact-section-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.15rem;
    margin-top: 0.3rem;
}
#orderDetailsModal .compact-field {
    margin-bottom: 0.5rem;
}
#orderDetailsModal .compact-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}
#orderDetailsModal .compact-help {
    font-size: 0.75rem;
    margin-top: 0.15rem;
}
#orderDetailsModal .field-group-custom {
    margin-top: 1rem;
    gap: 0.3rem;
}
#orderDetailsModal .compact-button {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}
.modal-custom.is-active .modal-content-custom { transform: scale(1) translateY(0); opacity: 1; }
.modal-close-button {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: transparent; border: none; font-size: 1.65rem;
    color: var(--gray-500); cursor: pointer; padding: 0.2rem;
    line-height: 1; border-radius: var(--border-radius-full);
    transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-bounce);
}
.modal-close-button:hover { color: var(--red-color); background-color: var(--gray-100); transform: rotate(90deg) scale(1.1); }
.modal-title {
    font-size: 1.5rem;
    font-weight: 700; text-align: center;
    color: var(--primary-color-darker);
    margin-bottom: 0.5rem;
}
.modal-subtitle {
    text-align: center; color: var(--gray-500);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}
.field-custom { margin-bottom: 1rem; position: relative; }
.label-custom {
    display: block; color: var(--gray-700);
    font-size: var(--font-size-sm); font-weight: 500;
    margin-bottom: 0.25rem;
}
.control-custom { position: relative; }
.input-custom, .select-custom select, .textarea-custom {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--input-border-radius);
    box-shadow: var(--shadow-xs); outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    background-color: var(--white-color); color: var(--gray-800);
    font-size: 0.9375rem;
}
.input-custom::placeholder, .textarea-custom::placeholder { color: var(--gray-400); opacity: 0.8; }
.input-custom:hover, .select-custom select:hover, .textarea-custom:hover { border-color: var(--gray-500); box-shadow: var(--shadow-sm); }
.input-custom:focus, .select-custom select:focus, .textarea-custom:focus {
    border-color: var(--accent-teal-color);
    box-shadow: 0 0 0 2px var(--accent-teal-focus-ring), var(--shadow-xs);
    background-color: var(--white-color);
}
.input-custom.input-error, .select-custom select.input-error, .textarea-custom.input-error {
    border-color: var(--red-color);
    box-shadow: 0 0 0 2px var(--red-focus-ring), var(--shadow-xs);
}
.has-icons-left-custom .input-custom { padding-left: 2.5rem; }
.icon-custom { position: absolute; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; transition: color var(--transition-fast); }
.input-custom:focus ~ .icon-custom, .textarea-custom:focus ~ .icon-custom { color: var(--accent-teal-color); }
.input-custom.input-error ~ .icon-custom, .textarea-custom.input-error ~ .icon-custom { color: var(--red-color); }
.icon-left-custom { left: 0.75rem; }
.icon-right-custom { right: 0.75rem; }
.select-custom { display: inline-block; position: relative; width: 100%; }
.select-custom select { appearance: none; -webkit-appearance: none; -moz-appearance: none; padding-right: 2.5rem; cursor: pointer; }
.select-custom .icon-right-custom { pointer-events: none; display: flex; align-items: center; justify-content: center; height: 100%; transition: transform var(--transition-bounce); }
.select-custom select:focus + .icon-right-custom { transform: rotate(180deg) scale(1.05); color: var(--accent-teal-color); }
.select-custom .icon-right-custom i { font-size: 0.8125rem; }
.radio-group-custom { display: flex; gap: 0.75rem; margin-top: 0.375rem; flex-wrap: wrap; }
.radio-custom {
    display: flex; align-items: center; cursor: pointer;
    font-size: 0.9375rem; color: var(--gray-700);
    padding: 0.25rem 0.125rem;
    position: relative; border-radius: var(--border-radius-md);
}
.radio-custom:focus-within { outline: 2px solid var(--accent-purple-color); outline-offset: 1px; }
.radio-custom input[type="radio"] {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    width: 1.125rem; height: 1.125rem;
    border: 2px solid var(--gray-400); border-radius: var(--border-radius-full);
    margin-right: 0.5rem;
    position: relative; outline: none; cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-bounce);
}
.radio-custom input[type="radio"]:checked { border-color: var(--accent-purple-color); background-color: var(--accent-purple-color); box-shadow: 0 0 4px var(--accent-purple-focus-ring); }
.radio-custom input[type="radio"]:checked::before {
    content: ''; display: block; width: 0.4375rem; height: 0.4375rem;
    background-color: var(--white-color); border-radius: var(--border-radius-full);
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0);
    transition: transform var(--transition-bounce);
}
.radio-custom input[type="radio"]:checked::before { transform: translate(-50%, -50%) scale(1); }
.radio-custom:hover input[type="radio"]:not(:checked) { border-color: var(--accent-purple-hover-color); }
.help-message { font-size: 0.8125rem; margin-top: 0.25rem; line-height: 1.4; transition: color 0.2s; }
.help-hidden { display: none !important; }
.help-danger { color: var(--red-hover-color); font-weight: 500; }
.help-success { color: var(--success-hover-color); font-weight: 500; }
.help-info { color: var(--info-color); font-weight: 500; }
.text-center { text-align: center; }
.field-group-custom { display: flex; flex-direction: column; justify-content: center; margin-top: 1.25rem; gap: 0.5rem; }
.modal-detail-row { display: flex; justify-content: space-between; margin-bottom: 0.4rem; gap: 0.75rem; align-items: flex-start; }
.modal-detail-item { flex-grow: 1; min-width: 0; padding: 0.2rem; border-radius: var(--border-radius-sm); transition: background-color var(--transition-normal), transform var(--transition-normal), box-shadow var(--transition-normal); }
.modal-detail-item:hover { background-color: var(--primary-color-light); transform: translateY(-1px) scale(1.005); box-shadow: var(--shadow-sm); }
.modal-detail-item-full { flex-basis: 100%; }
.modal-detail-row .label-custom { margin-bottom: 0.1rem; font-size: 0.75rem; font-weight: 600; color: var(--gray-600); transition: color var(--transition-fast); }
.modal-detail-item:hover .label-custom { color: var(--primary-hover-color); }
.modal-detail-text { font-size: 0.875rem; color: var(--gray-800); padding: 0.3rem 0.15rem; border-bottom: 1px solid var(--border-color-light); margin-bottom: 0; word-wrap: break-word; transition: border-color var(--transition-fast), color var(--transition-fast); }
.modal-detail-item:hover .modal-detail-text { border-color: var(--primary-hover-color); color: var(--gray-900); }
.modal-stock-quantities { margin-top: 0.5rem; }
.modal-stock-quantities .modal-detail-item { text-align: center; }
.modal-stock-quantities .modal-detail-item:hover { background-color: var(--accent-teal-light); }
.modal-stock-quantities .modal-detail-text { border-bottom: none; font-weight: 500; }
#stockDetailsMessage { margin-top: 1rem; margin-bottom: 1rem; min-height: 1.125rem; }
#stockDetailsModal .field-group-custom { margin-top: 0.75rem; display: flex; justify-content: center; }
#stockDetailsModal .field-group-custom .button-custom.button-red { min-width: 100px; }
.table-custom tfoot.table-footer-custom { background-color: var(--gray-200); border-top: 2px solid var(--gray-400); }
.table-custom tfoot.table-footer-custom td { padding: 0.75rem 1rem; font-weight: 600; color: var(--gray-800); }
.table-custom tfoot.table-footer-custom td.total-label { text-align: right; }
.table-custom tfoot.table-footer-custom td.total-value { text-align: left; }
@media (min-width: 640px) {
    .field-group-custom:not(#stockDetailsModal .field-group-custom) { flex-direction: row; gap: 0.75rem; }
    .field-group-custom:not(#stockDetailsModal .field-group-custom) > .button-custom { width: auto; }
}
.field-group-custom.stock-fields { flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
@media (min-width: 640px) {
    .field-group-custom.stock-fields { flex-direction: row; justify-content: space-between; }
    .field-group-custom.stock-fields .field-custom { flex: 1; margin-bottom: 0; }
    .field-group-custom.stock-fields .field-custom:not(:last-child) { margin-right: 0.75rem; }
}
.card-custom {
    background-color: var(--content-background);
    border-radius: var(--card-border-radius);
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    width: 100%;
    margin-bottom: 1.5rem;
    transition: box-shadow var(--transition-slow), transform var(--transition-slow);
    border: 1px solid var(--border-color-light); position: relative; overflow: hidden;
}
.card-custom::before { content: ''; position: absolute; top: 0; left: 0; width: 0%; height: 3px; background-color: var(--accent-purple-color); transition: width var(--transition-slow) ease-out; }
.card-custom:hover::before { width: 100%; }
.card-custom:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px) scale(1.005); }
.form-card { max-width: 34rem; }
.table-card { max-width: 70rem; }
.card-title {
    font-size: 1.375rem;
    font-weight: 700; text-align: center; color: var(--gray-800);
    margin-bottom: 1rem;
}
.table-controls { display: flex; flex-direction: column; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 0.75rem; }
@media (min-width: 768px) {
    .table-controls { flex-direction: row; }
    .table-controls .field-custom:first-child { flex-grow: 1; max-width: 350px; }
    .table-controls .field-custom:first-child .input-custom.search-input { border-radius: var(--border-radius-full); padding-left: 2.75rem; }
    .table-controls .field-custom:first-child .icon-left-custom { left: 1rem; font-size: 1rem; }
    .table-controls .field-custom:last-child { flex-grow: 0; flex-shrink: 0; display: flex; align-items: center; gap: 0.375rem; }
    .table-controls .label-custom.label-hidden-mobile { display: block; margin-bottom: 0; }
}
.table-controls .label-custom.label-hidden-mobile { display: none; }
.input-custom.search-input { padding-left: 2.5rem; }
.table-container-custom {
    overflow-x: auto; border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md); border: 1px solid var(--border-color);
    background-color: var(--content-background);
}
.table-custom { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; }
.table-custom thead { background-color: var(--primary-color-light); position: sticky; top: 0; z-index: 10; }
.table-custom th {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-hover-color); text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left; border-bottom: 2px solid var(--primary-color);
}
.table-custom td {
    padding: 0.75rem 1rem;
    font-size: var(--font-size-sm); color: var(--gray-700);
    border-bottom: 1px solid var(--border-color-light);
    white-space: normal; word-break: break-word;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}
@media (min-width: 640px) { .table-custom td.td-nowrap { white-space: nowrap; } }
.table-custom tbody tr:last-child td { border-bottom: none; }
.table-custom tbody tr.table-row-hover { cursor: pointer; }
.table-custom tbody tr.table-row-hover:hover { background-color: var(--accent-purple-light); }
.table-custom tbody tr.table-row-hover:hover td { color: var(--accent-purple-hover-color); }
.pagination-controls-custom { display: flex; justify-content: center; align-items: center; margin-top: 1.25rem; gap: 0.25rem; flex-wrap: wrap; padding: 0.75rem 0; }
.pagination-controls-custom a, .pagination-controls-custom span.pagination-ellipsis {
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    font-weight: 500; text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-normal), transform var(--transition-bounce);
    border: 1px solid var(--border-color); line-height: 1.25;
}
.pagination-controls-custom a { color: var(--gray-700); background-color: var(--white-color); }
.pagination-controls-custom a:hover { background-color: var(--primary-color-light); border-color: var(--primary-color); color: var(--primary-hover-color); box-shadow: var(--shadow-xs); transform: translateY(-1px) scale(1.02); }
.pagination-controls-custom a:active { transform: translateY(0); }
.pagination-controls-custom a.is-current { background-color: var(--accent-purple-color); color: var(--white-color); border-color: var(--accent-purple-color); font-weight: 600; box-shadow: var(--shadow-sm); transform: scale(1.02); }
.pagination-controls-custom a.is-current:hover { background-color: var(--accent-purple-hover-color); border-color: var(--accent-purple-hover-color); }
.pagination-controls-custom a.is-disabled { opacity: 0.6; cursor: not-allowed; background-color: var(--gray-200); border-color: var(--gray-300); box-shadow: none; transform: none; }
.pagination-controls-custom a.is-disabled:hover { background-color: var(--gray-200); }
.pagination-controls-custom .pagination-ellipsis { color: var(--gray-500); border: 1px solid transparent; background-color: transparent; padding: 0.5rem 0.25rem; }
.pagination-list-custom { display: flex; list-style: none; gap: 0.25rem; margin: 0 0.375rem; }
@media (max-width: 600px) { .pagination-list-custom { justify-content: center; flex-wrap: wrap; } }
.autocomplete-dropdown-custom {
    position: absolute; background-color: var(--white-color);
    border: 1px solid var(--border-color); border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 180px;
    overflow-y: auto; width: 100%; z-index: 10000;
    top: calc(100% + 2px);
    left: 0; opacity: 0; transform: translateY(-8px) scaleY(0.95);
    transition: opacity var(--transition-normal), transform var(--transition-normal) cubic-bezier(0.25, 0.8, 0.25, 1), visibility var(--transition-normal);
    will-change: opacity, transform; transform-origin: top center;
}
.autocomplete-dropdown-custom:not(.help-hidden) { opacity: 1; transform: translateY(0) scaleY(1); visibility: visible; }
.autocomplete-item-custom {
    padding: 0.5rem 1rem;
    cursor: pointer; color: var(--gray-700);
    transition: background-color var(--transition-fast), color var(--transition-fast), padding-left var(--transition-normal), border-left-color var(--transition-fast);
    border-bottom: 1px solid var(--border-color-light); border-left: 2px solid transparent;
}
.autocomplete-item-custom:last-child { border-bottom: none; }
.autocomplete-item-custom:hover, .autocomplete-item-custom.is-active { background-color: var(--accent-teal-color); color: var(--white-color); padding-left: 1.25rem; border-left-color: var(--accent-teal-hover-color); }
.label-custom.label-error { color: var(--red-color); }
.form-row-group {
    margin-bottom: 1rem;
}
.form-row-group .field-custom.field-in-row {
}
@media (min-width: 768px) {
    .form-row-group {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        align-items: flex-start;
    }
    .form-row-group .field-custom.field-in-row {
        flex: 1;
        margin-bottom: 0;
    }
}
.table-custom tbody tr.row-pending {
    background-color: #fff3cd;
}
.table-custom tbody tr.row-pending:hover {
    background-color: #ffeeba;
}
.table-custom tbody tr.row-pending td {
    color: #856404;
}
.table-custom tbody tr.row-confirmed {
    background-color: #d4edda;
}
.table-custom tbody tr.row-confirmed:hover {
    background-color: #c3e6cb;
}
.table-custom tbody tr.row-confirmed td {
    color: #155724;
}
.table-custom tbody tr.table-row-hover:not(.row-pending):not(.row-confirmed):hover {
    background-color: var(--accent-purple-light);
}
.table-custom tbody tr.table-row-hover:not(.row-pending):not(.row-confirmed):hover td {
    color: var(--accent-purple-hover-color);
}
#orderDetailsModal .card-custom {
    border: 1px solid var(--border-color-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
}
#orderDetailsModal .modal-stock-quantities .modal-detail-item .label-custom {
    font-size: 0.75rem;
    margin-bottom: 0.1rem;
}
#orderDetailsModal .modal-stock-quantities .modal-detail-item .modal-detail-text {
    font-size: 0.9rem;
    padding: 0.2rem 0.1rem;
    border-bottom: none;
}
#orderDetailsModal .modal-stock-quantities .field-custom {
    margin-bottom: 0.25rem;
}
#orderDetailsModal .modal-stock-quantities .input-custom {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
.permission-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color-light);
    margin-bottom: 0;
}
.permission-item:last-child {
    border-bottom: none;
}
.permission-label {
    margin-bottom: 0;
    flex-grow: 1;
    margin-right: 1rem;
    font-size: 0.9rem;
}
.toggle-switch-control {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}
.toggle-switch-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: var(--transition-fast);
    border-radius: var(--border-radius-full);
}
.toggle-switch-label .toggle-switch-inner {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--white-color);
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: var(--shadow-xs);
}
.toggle-switch-checkbox:checked + .toggle-switch-label {
    background-color: var(--success-color);
}
.toggle-switch-checkbox:focus-visible + .toggle-switch-label {
    box-shadow: 0 0 0 2px var(--white-color), 0 0 0 4px var(--success-color);
}
.toggle-switch-checkbox:checked + .toggle-switch-label .toggle-switch-inner {
    transform: translateX(24px);
}
@media (max-width: 767px) {
    .main-content-area { padding: 1rem 0.75rem; }
    .card-custom { padding: 1rem; border-radius: var(--border-radius-md); }
    .card-custom:hover { transform: translateY(-2px) scale(1.003); }
    .modal-content-custom { padding: 1rem; margin: 0 0.5rem; border-radius: var(--border-radius-md); }
    .button-custom { padding: 0.5rem 1rem; font-size: 0.875rem; }
    .hero-title { font-size: 1.875rem; }
    .hero-subtitle { font-size: 0.9375rem; }
    .table-custom th, .table-custom td { padding: 0.625rem 0.75rem; font-size: 0.8125rem; }
    .table-custom th { font-size: 0.75rem; }
    .permission-item { flex-direction: column; align-items: flex-start; }
    .permission-label { margin-bottom: 0.5rem; }
    #exportPlumbersToExcelButton, #exportRetailerStockToExcelButton, #exportUsersToExcelButton, #exportStockToExcelButton, #exportOrdersToExcelButton { display: none !important; }
    
}
@media (max-width: 480px) {
    .navbar-brand { font-size: 1.4rem; }
    .hero-title { font-size: 1.6rem; }
    .hero-subtitle { font-size: 0.875rem; }
    .card-title { font-size: 1.125rem; }
    .modal-title { font-size: 1.25rem; }
    .button-custom { padding: 0.5rem 0.875rem; font-size: 0.8125rem; }
    .pagination-controls-custom a, .pagination-controls-custom span.pagination-ellipsis { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
    .pagination-list-custom { margin: 0 0.125rem; }
    .input-custom, .select-custom select, .textarea-custom { padding: 0.5rem 0.75rem; font-size: 0.875rem; }
    #exportPlumbersToExcelButton .button-custom { display: none !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }

.sortable-header {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
}
.sortable-header:hover {
    background-color: var(--gray-200);
}
.sort-icon {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: var(--gray-500);
    transition: color 0.2s;
}
.sortable-header .sort-icon.sort-asc,
.sortable-header .sort-icon.sort-desc {
    color: var(--primary-color);
}
.table-custom thead th.sortable-header {
}