:root {
    --primary-color: #1a428a;
    --secondary-color: #acadb0;
    --primary-hover: #143570;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --border-color: #e9ecef;
    --container-max-width: 1400px;
    
    /* Responsive base sizes */
    --base-font-size: 16px;
    --scale-factor: 1.2;
    --spacing-unit: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--base-font-size);
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a5298 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: clamp(0.625rem, 3vw, 1.25rem);
    font-size: 1rem;
    line-height: 1.5;
}

/* Login Container Styles */
.login-container {
    max-width: min(480px, 90vw);
    width: 100%;
}

.login-card {
    background: white;
    border-radius: clamp(0.625rem, 2vw, 1.25rem);
    box-shadow: 0 0.9375rem 3.125rem rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-1.875rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: clamp(1.5rem, 4vw, 2.8125rem) clamp(1.25rem, 3vw, 1.875rem) clamp(1.25rem, 3vw, 1.875rem);
    text-align: center;
    border-bottom: 0.25rem solid var(--primary-color);
    position: relative;
}

.logo-section::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(6.25rem, 20vw);
    height: 0.25rem;
    background: var(--secondary-color);
}

.logo-placeholder {
    width: min(10rem, 25vw);
    height: min(5.625rem, 18vw);
    background: linear-gradient(135deg, var(--primary-color), #2a5298);
    border-radius: clamp(0.5rem, 1.5vw, 0.75rem);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(1rem, 3vw, 1.5625rem);
    color: white;
    font-weight: bold;
    font-size: clamp(1rem, 2vw, 1.25rem);
    box-shadow: 0 0.5rem 1.25rem rgba(26, 66, 138, 0.3);
    transition: transform 0.3s ease;
}

.logo-placeholder:hover {
    transform: scale(1.05);
}

.portal-title {
    color: var(--primary-color);
    margin: 0;
    font-weight: 600;
    font-size: clamp(0.875rem, 2vw, 1.125rem);
}

.login-form-section {
    padding: clamp(1.5rem, 4vw, 2.8125rem) clamp(1.25rem, 3vw, 2.5rem);
}

.form-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.625rem;
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 1.75rem);
}

.form-subtitle {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: clamp(1.5rem, 4vw, 2.1875rem);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.form-label {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.625rem;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.form-label i {
    color: var(--primary-color);
}

.form-control {
    border: 0.125rem solid #e0e0e0;
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    padding: clamp(0.75rem, 2vw, 0.8125rem) clamp(0.875rem, 2vw, 0.9375rem);
    transition: all 0.3s ease;
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(26, 66, 138, 0.15);
    outline: none;
}

.input-group-text {
    background: white;
    border: 0.125rem solid #e0e0e0;
    border-right: none;
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem) 0 0 clamp(0.5rem, 1.5vw, 0.625rem);
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.5rem, 1.5vw, 0.625rem) 0;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.password-toggle {
    cursor: pointer;
    background: white;
    border: 0.125rem solid #e0e0e0;
    border-left: none;
    border-radius: 0 clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.5rem, 1.5vw, 0.625rem) 0;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    padding: 0 clamp(0.875rem, 2vw, 0.9375rem);
}

.password-toggle:hover {
    color: var(--primary-color);
}

.input-group:focus-within .password-toggle {
    border-color: var(--primary-color);
}

.btn-login {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    padding: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
    width: 100%;
    margin-top: clamp(1.25rem, 3vw, 1.5625rem);
    transition: all 0.3s ease;
    font-size: clamp(0.875rem, 2vw, 1rem);
    letter-spacing: 0.03125rem;
}

.btn-login:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.25rem rgba(26, 66, 138, 0.4);
    color: #fff;
}

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

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.alert {
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    border: none;
    padding: clamp(0.875rem, 2vw, 0.9375rem) clamp(1rem, 2vw, 1.125rem);
    margin-bottom: clamp(1.25rem, 3vw, 1.5625rem);
    animation: fadeIn 0.3s ease-in;
}

div#bulkActionsContainer {
    position: fixed;
    right: clamp(4rem, 10vw, 7.875rem);
    top: 50%;
    transform: translateY(-50%);
    z-index: 10010;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-0.625rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: #fee;
    color: #c33;
    border-left: 0.25rem solid #dc3545;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    margin-top: 0.375rem;
    font-weight: 500;
}

.is-invalid {
    border-color: #dc3545 !important;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-0.3125rem); }
    75% { transform: translateX(0.3125rem); }
}

.spinner-border-sm {
    width: 1.2rem;
    height: 1.2rem;
    border-width: 0.15em;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(26, 66, 138, 0.15);
}

.form-check-label {
    color: #666;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    cursor: pointer;
}

.footer-text {
    text-align: center;
    color: white;
    margin-top: clamp(1.25rem, 3vw, 1.5625rem);
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
}

.footer-text i {
    color: #90EE90;
}

.loading-spinner {
    width: 4rem;
    height: 4rem;
    border: 0.4rem solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Reset Container Styles */
.reset-container {
    max-width: min(520px, 90vw);
    width: 100%;
}

.reset-card {
    background: white;
    border-radius: clamp(0.625rem, 2vw, 1.25rem);
    box-shadow: 0 0.9375rem 3.125rem rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideIn 0.5s ease-out;
}

.header-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 3vw, 1.875rem) clamp(1.25rem, 3vw, 1.5625rem);
    text-align: center;
    border-bottom: 0.25rem solid var(--primary-color);
    position: relative;
}

.header-section::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(6.25rem, 20vw);
    height: 0.25rem;
    background: var(--secondary-color);
}

.reset-icon {
    width: min(5.625rem, 15vw);
    height: min(5.625rem, 15vw);
    background: linear-gradient(135deg, var(--primary-color), #2a5298);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(1rem, 3vw, 1.25rem);
    color: white;
    font-size: clamp(2rem, 6vw, 2.5rem);
    box-shadow: 0 0.5rem 1.25rem rgba(26, 66, 138, 0.3);
}

.page-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: clamp(1.375rem, 4vw, 1.625rem);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--secondary-color);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.user-info-box {
    background: #f8f9fa;
    border-left: 0.25rem solid var(--primary-color);
    padding: clamp(0.875rem, 2vw, 0.9375rem) clamp(1.25rem, 3vw, 1.25rem);
    border-radius: 0.5rem;
    margin-bottom: clamp(1.5rem, 4vw, 1.875rem);
}

.user-info-box p {
    margin: 0;
    color: #666;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.user-info-box strong {
    color: var(--primary-color);
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.btn-reset {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    padding: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
    width: 100%;
    margin-top: clamp(1.25rem, 3vw, 1.5625rem);
    transition: all 0.3s ease;
    font-size: clamp(0.875rem, 2vw, 1rem);
    letter-spacing: 0.03125rem;
}

.btn-reset:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.25rem rgba(26, 66, 138, 0.4);
}

.btn-reset:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-back {
    background: white;
    color: var(--primary-color);
    border: 0.125rem solid var(--primary-color);
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    padding: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
    width: 100%;
    margin-top: clamp(0.875rem, 2vw, 0.9375rem);
    transition: all 0.3s ease;
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-back:hover {
    background: var(--primary-color);
    color: white;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 0.25rem solid var(--success-color);
}

.password-requirements {
    background: #f8f9fa;
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    padding: clamp(0.875rem, 2vw, 0.9375rem);
    margin-top: clamp(1.25rem, 3vw, 1.25rem);
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
}

.password-requirements h6 {
    color: var(--primary-color);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
    margin-bottom: 0.625rem;
}

.requirement-item {
    display: flex;
    align-items: center;
    padding: 0.3125rem 0;
    color: #666;
    transition: all 0.3s ease;
}

.requirement-item i {
    margin-right: 0.5rem;
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
}

.requirement-item.met {
    color: var(--success-color);
}

.requirement-item.met i {
    color: var(--success-color);
}

.form-section {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

/* Auth Required Styles */
.auth-required-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a5298 100%);
    padding: clamp(0.625rem, 3vw, 1.25rem);
}

.auth-required-card {
    background: white;
    border-radius: clamp(0.625rem, 2vw, 1.25rem);
    box-shadow: 0 0.9375rem 3.125rem rgba(0, 0, 0, 0.3);
    padding: clamp(1.5rem, 4vw, 3.125rem) clamp(1.5rem, 4vw, 3.75rem);
    text-align: center;
    max-width: min(500px, 90vw);
    width: 100%;
    animation: slideIn 0.5s ease-out;
}

.auth-icon-error {
    width: min(6.25rem, 20vw);
    height: min(6.25rem, 20vw);
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(1.25rem, 3vw, 1.5625rem);
    color: white;
    font-size: clamp(2.5rem, 8vw, 3.125rem);
    box-shadow: 0 0.5rem 1.25rem rgba(220, 53, 69, 0.3);
    animation: shake 0.5s ease-in-out;
}

.auth-title {
    color: var(--primary-color);
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    font-weight: 700;
    margin-bottom: clamp(0.875rem, 2vw, 0.9375rem);
}

.auth-message {
    color: #666;
    font-size: clamp(0.875rem, 2vw, 1rem);
    margin-bottom: clamp(1.25rem, 3vw, 1.5625rem);
    line-height: 1.6;
}

.auth-info {
    background: #f8f9fa;
    border-left: 0.25rem solid var(--primary-color);
    padding: clamp(0.875rem, 2vw, 0.9375rem) clamp(1.25rem, 3vw, 1.25rem);
    border-radius: 0.5rem;
    margin-bottom: clamp(1.25rem, 3vw, 1.5625rem);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.auth-info i {
    color: var(--primary-color);
}

.auth-info strong {
    color: var(--primary-color);
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.btn-auth-login {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.5rem, 4vw, 1.875rem);
    font-weight: 600;
    font-size: clamp(0.875rem, 2vw, 1rem);
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    margin-top: 0.625rem;
}

.btn-auth-login:hover {
    background: var(--primary-hover);
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.25rem rgba(26, 66, 138, 0.4);
    color: white;
}

/* Dashboard Styles */
.dashboard-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    background: #f5f7fa;
}

.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a5298 100%);
    color: white;
    padding: clamp(1rem, 3vw, 1.25rem) 0;
    box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(0.75rem, 2vw, 0.9375rem);
}

.dashboard-title {
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 0.9375rem);
}

.user-welcome {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    margin: 0;
}

.user-name {
    font-weight: 600;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.header-actions {
    display: flex;
    gap: 0.625rem;
}

.btn-header {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 0.0625rem solid rgba(255, 255, 255, 0.3);
    padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(1rem, 2vw, 1.25rem);
    border-radius: 0.5rem;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-header:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-0.0625rem);
}

.btn-logout {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(220, 53, 69, 1);
}

.btn-logout:hover {
    background: rgba(200, 35, 51, 1);
}

.dashboard-content {
    padding: clamp(1.5rem, 4vw, 1.875rem) 0;
}

.content-card {
    background: white;
    border-radius: clamp(0.625rem, 2vw, 0.9375rem);
    box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.08);
    padding: clamp(1.25rem, 3vw, 1.5625rem);
    margin-bottom: clamp(1.25rem, 3vw, 1.5625rem);
}

.card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(1.25rem, 3vw, 1.5625rem);
    padding-bottom: clamp(0.875rem, 2vw, 0.9375rem);
    border-bottom: 0.125rem solid #e0e0e0;
}

.card-title {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.stock-count-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1.25rem;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
}

.search-filter-section {
    display: flex;
    gap: clamp(0.75rem, 2vw, 0.9375rem);
    margin-bottom: clamp(1.25rem, 3vw, 1.25rem);
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: min(15.625rem, 80vw);
    position: relative;
}

.search-box input {
    width: 100%;
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(2.5rem, 6vw, 3.5rem) clamp(0.75rem, 2vw, 0.875rem) clamp(0.875rem, 2vw, 0.9375rem);
    border: 0.125rem solid #e0e0e0;
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(26, 66, 138, 0.15);
}

.search-icon {
    position: absolute;
    right: clamp(0.875rem, 2vw, 0.9375rem);
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    pointer-events: none;
}

.filter-box {
    min-width: min(12.5rem, 70vw);
}

.filter-box select {
    width: 100%;
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(0.875rem, 2vw, 0.9375rem);
    border: 0.125rem solid #e0e0e0;
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    transition: all 0.3s;
    background: white;
    cursor: pointer;
}

.filter-box select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(26, 66, 138, 0.15);
}

.btn-refresh {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.25rem, 3vw, 1.25rem);
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-refresh:hover {
    background: var(--primary-hover);
    transform: translateY(-0.0625rem);
}

.table-responsive {
    overflow-x: auto;
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
}

.stock-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.stock-table thead {
    background: linear-gradient(135deg, var(--primary-color), #2a5298);
    color: white;
}

.stock-table thead th {
    padding: clamp(0.875rem, 2vw, 0.9375rem) clamp(0.75rem, 2vw, 0.8125rem);
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s;    background: var(--primary-color);
}

.stock-table thead th:hover {
    background: rgba(255, 255, 255, 0.1);
}

.stock-table thead th:first-child {
    border-top-left-radius: clamp(0.5rem, 1.5vw, 0.625rem);
}

.stock-table thead th:last-child {
    border-top-right-radius: clamp(0.5rem, 1.5vw, 0.625rem);
}

.sort-indicator {
    margin-left: 0.5rem;
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.stock-table thead th:hover .sort-indicator {
    opacity: 1;
}

.sort-indicator.active {
    opacity: 1;
}

.stock-table tbody tr {
    border-bottom: 0.0625rem solid #e0e0e0;
    transition: all 0.2s;
}

.stock-table tbody tr:hover {
    background: #f8f9fa;
}

.stock-table tbody tr:last-child {
    border-bottom: none;
}

.stock-table tbody td {
    padding: clamp(0.875rem, 2vw, 0.9375rem) clamp(0.75rem, 2vw, 0.8125rem);
    vertical-align: middle;
}

.serial-number {
    font-weight: 600;
    color: var(--primary-color);
}

.item-code {
    color: #666;
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
}

.item-desc {
    color: #333;
    max-width: min(18.75rem, 40vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.franchisee-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.625rem;
    border-radius: 0.9375rem;
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    font-weight: 600;
    display: inline-block;
}

.btn-action {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(1rem, 2vw, 1.25rem);
    border-radius: 0.375rem;
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-action:hover {
    background: var(--primary-hover);
    transform: translateY(-0.0625rem);
}

.empty-state {
    text-align: center;
    padding: clamp(2.5rem, 8vw, 3.75rem) clamp(1.25rem, 3vw, 1.25rem);
    color: #999;
}

.empty-state i {
    font-size: clamp(3rem, 10vw, 4rem);
    color: #ddd;
    margin-bottom: clamp(1.25rem, 3vw, 1.25rem);
}

.empty-state h3 {
    color: #666;
    margin-bottom: 0.625rem;
}

.empty-state p {
    color: #999;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #2a5298);
    color: white;
    border-radius: clamp(0.625rem, 2vw, 0.9375rem) clamp(0.625rem, 2vw, 0.9375rem) 0 0;
    padding: clamp(1.25rem, 3vw, 1.25rem) clamp(1.5rem, 4vw, 1.5625rem);
}

.modal-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.modal-content {
    border-radius: clamp(0.625rem, 2vw, 0.9375rem);
    border: none;
    box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: clamp(1.5rem, 4vw, 1.5625rem);
}

.detail-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 0.0625rem solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--primary-color);
    min-width: min(11.25rem, 30vw);
    flex-shrink: 0;
}

.detail-value {
    color: #333;
    flex: 1;
    word-break: break-word;
}

.modal-footer {
    padding: clamp(1.25rem, 3vw, 1.25rem) clamp(1.5rem, 4vw, 1.5625rem);
    border-top: 0.125rem solid #f0f0f0;
}

.btn-change-ownership {
    background: #28a745;
    color: white;
    border: none;
    padding: clamp(0.625rem, 2vw, 0.75rem) clamp(1.25rem, 3vw, 1.25rem);
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-change-ownership:hover {
    background: #218838;
    transform: translateY(-0.0625rem);
}

.btn-close-modal {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: clamp(0.625rem, 2vw, 0.75rem) clamp(1.25rem, 3vw, 1.25rem);
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-close-modal:hover {
    background: #9a9b9e;
}

.loading-container {
    text-align: center;
    padding: clamp(2.5rem, 8vw, 3.75rem) clamp(1.25rem, 3vw, 1.25rem);
}

.loading-spinner-large {
    width: 3.75rem;
    height: 3.75rem;
    border: 0.375rem solid #f3f3f3;
    border-top: 0.375rem solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto clamp(1.25rem, 3vw, 1.25rem);
}

/* Bulk Actions and Transfer Styles */
.select-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.select-all-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.btn-transfer-ownership {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border: none;
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.5rem, 4vw, 1.75rem);
    border-radius: clamp(0.5rem, 1.5vw, 0.75rem);
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    box-shadow: 0 0.25rem 0.9375rem rgba(255, 107, 107, 0.3);
}

.btn-transfer-ownership:hover {
    background: linear-gradient(135deg, #ee5a6f, #d63447);
    transform: translateY(-0.125rem);
    box-shadow: 0 0.375rem 1.25rem rgba(255, 107, 107, 0.4);
}

.btn-transfer-ownership i {
    font-size: clamp(1rem, 2vw, 1.125rem);
}

.stock-table tbody tr.selected {
    background: #e3f2fd !important;
    border-left: 0.1875rem solid var(--primary-color);
}

.stock-table tbody tr:has(.select-checkbox:checked) {
    background: #e3f2fd !important;
}

/* Multi-step Form Styles */
.form-step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    padding: 0 clamp(1.25rem, 3vw, 1.25rem);
}

.step-item-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-circle {
    width: clamp(2rem, 6vw, 2.5rem);
    height: clamp(2rem, 6vw, 2.5rem);
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(0.875rem, 2vw, 1rem);
    transition: all 0.3s ease;
}

.step-circle.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0.25rem 0.75rem rgba(26, 66, 138, 0.3);
}

.step-circle.completed {
    background: #28a745;
    color: white;
}

.step-label {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
    color: #6c757d;
}

.step-label.active {
    color: var(--primary-color);
}

.step-line {
    width: clamp(2.5rem, 8vw, 3.75rem);
    height: 0.125rem;
    background: #e9ecef;
    margin: 0 0.625rem;
}

.step-line.completed {
    background: #28a745;
}

.selected-items-card {
    background: #f8f9fa;
    border: 0.125rem dashed var(--primary-color);
    border-radius: clamp(0.5rem, 1.5vw, 0.75rem);
    padding: clamp(1.25rem, 3vw, 1.25rem);
    margin-bottom: clamp(1.5rem, 4vw, 1.875rem);
}

.selected-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(0.875rem, 2vw, 0.9375rem);
}

.selected-items-title {
    font-size: clamp(0.875rem, 2vw, 1rem);
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.selected-item {
    background: white;
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.5rem;
    padding: clamp(0.75rem, 2vw, 0.8125rem) clamp(1rem, 2vw, 1.25rem);
    margin-bottom: 0.625rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-item-info {
    flex: 1;
}

.selected-item-serial {
    font-weight: 600;
    color: var(--primary-color);
}

.selected-item-desc {
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    color: #6c757d;
    margin-top: 0.25rem;
}

.form-section-title {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: clamp(1.25rem, 3vw, 1.25rem);
    padding-bottom: 0.625rem;
    border-bottom: 0.125rem solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(15.625rem, 100%), 1fr));
    gap: clamp(1.25rem, 3vw, 1.25rem);
    margin-bottom: clamp(1.25rem, 3vw, 1.25rem);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: clamp(0.875rem, 2vw, 0.9375rem);
    margin-top: clamp(1.5rem, 4vw, 1.875rem);
    padding-top: clamp(1.25rem, 3vw, 1.25rem);
    border-top: 0.125rem solid var(--border-color);
}

.btn-back,
.btn-next,
.btn-submit {
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.5rem, 4vw, 2rem);
    border-radius: clamp(0.5rem, 1.5vw, 0.625rem);
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    border: none;
}

.btn-back {
    background: #6c757d;
    color: white;
}

.btn-back:hover {
    background: #5a6268;
}

.btn-next,
.btn-submit {
    background: var(--primary-color);
    color: white;
}

.btn-next:hover,
.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.75rem rgba(26, 66, 138, 0.3);
}

.confirmation-section {
    background: white;
    border: 0.0625rem solid var(--border-color);
    border-radius: clamp(0.5rem, 1.5vw, 0.75rem);
    padding: clamp(1.5rem, 4vw, 1.5625rem);
    margin-bottom: clamp(1.25rem, 3vw, 1.5625rem);
}

.confirmation-section-title {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: clamp(1.25rem, 3vw, 1.25rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-edit-section {
    background: #ffc107;
    color: #000;
    border: none;
    padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(1rem, 2vw, 1.25rem);
    border-radius: 0.5rem;
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-edit-section:hover {
    background: #e0a800;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(15.625rem, 100%), 1fr));
    gap: clamp(0.875rem, 2vw, 0.9375rem);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
}

.info-value {
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
    color: #2c3e50;
    font-weight: 500;
}

.products-table-wrapper {
    overflow-x: auto;
    margin-top: clamp(0.875rem, 2vw, 0.9375rem);
}

.products-table {
    width: 100%;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.products-table thead th {
    background: var(--light-bg);
    padding: clamp(0.75rem, 2vw, 0.8125rem);
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 0.125rem solid var(--border-color);
}

.products-table tbody td {
    padding: clamp(0.75rem, 2vw, 0.8125rem);
    border-bottom: 0.0625rem solid var(--border-color);
}

.success-container {
    text-align: center;
    padding: clamp(2.5rem, 8vw, 3.75rem) clamp(1.25rem, 3vw, 1.25rem);
}

.success-icon {
    width: min(6.25rem, 20vw);
    height: min(6.25rem, 20vw);
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2.5rem, 8vw, 3.125rem);
    margin: 0 auto clamp(1.5rem, 4vw, 1.875rem);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #28a745;
    margin-bottom: clamp(0.875rem, 2vw, 0.9375rem);
}

.success-message {
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: #6c757d;
    margin-bottom: clamp(1.5rem, 4vw, 1.875rem);
}

.success-details {
    background: #f8f9fa;
    border-radius: clamp(0.5rem, 1.5vw, 0.75rem);
    padding: clamp(1.5rem, 4vw, 1.5625rem);
    margin: clamp(1.5rem, 4vw, 1.875rem) auto;
    max-width: min(37.5rem, 90vw);
    text-align: left;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

.step-circle i {
    font-size: clamp(1rem, 2vw, 1.125rem);
}

/* Navbar Styles */
.main-navbar {
    background: white;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 0.0625rem solid var(--border-color);
    width: 100%;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1.5rem, 4vw, 2.5rem);
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
    height: clamp(4rem, 10vw, 4.375rem);
    box-sizing: border-box;
    position: relative;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 1.25rem);
    flex: 0 0 auto;
    max-width: min(15.625rem, 40vw);
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-image {
    height: clamp(2.5rem, 8vw, 3.125rem);
    width: auto;
    max-width: min(12.5rem, 30vw);
    object-fit: contain;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
    font-weight: 700;
    font-size: clamp(1.125rem, 3vw, 1.25rem);
}

.logo-placeholder i {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.3125rem;
}

.navbar-menu {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 clamp(1.25rem, 3vw, 1.25rem);
    max-width: min(37.5rem, 60vw);
    margin: 0 auto;
    overflow: visible;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-item {
    position: relative;
    flex-shrink: 0;
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    padding: clamp(0.625rem, 2vw, 0.6875rem) clamp(0.75rem, 2vw, 0.8125rem);
    color: #5a6c7d;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link i {
    font-size: clamp(1rem, 2vw, 1.125rem);
}

.nav-link:hover:not(.disabled) {
    background: var(--light-bg);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0.125rem 0.5rem rgba(26, 66, 138, 0.25);
}

.nav-link.active:hover {
    background: var(--primary-hover);
}

.badge-soon {
    background: #ffc107;
    color: #000;
    font-size: clamp(0.5rem, 1.5vw, 0.5625rem);
    padding: 0.1875rem 0.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
}

.navbar-user {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    max-width: min(15.625rem, 40vw);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 3.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 0.125rem solid transparent;
}

.user-profile:hover {
    background: var(--light-bg);
    border-color: var(--border-color);
}

.user-avatar {
    width: clamp(2.25rem, 6vw, 2.5rem);
    height: clamp(2.25rem, 6vw, 2.5rem);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #2a5298);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(0.875rem, 2vw, 1rem);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-align: left;
    max-width: min(9.375rem, 25vw);
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    color: #8898aa;
}

.dropdown-icon {
    color: #8898aa;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.user-profile:hover .dropdown-icon {
    color: var(--primary-color);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.3125rem);
    right: 0;
    min-width: min(17.5rem, 80vw);
    background: white;
    border-radius: clamp(0.5rem, 1.5vw, 0.75rem);
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.625rem);
    transition: all 0.2s ease;
    z-index: 1001;
    border: 0.0625rem solid var(--border-color);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: clamp(1.25rem, 3vw, 1.25rem);
    display: flex;
    align-items: center;
    gap: clamp(0.875rem, 2vw, 0.9375rem);
    background: var(--light-bg);
    border-radius: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.5rem, 1.5vw, 0.75rem) 0 0;
    border-bottom: 0.0625rem solid var(--border-color);
}

.user-avatar-large {
    width: clamp(2.5rem, 8vw, 3.125rem);
    height: clamp(2.5rem, 8vw, 3.125rem);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #2a5298);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    flex-shrink: 0;
}

.dropdown-user-name {
    font-weight: 600;
    color: #333;
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
    line-height: 1.3;
}

.dropdown-user-email {
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    color: #8898aa;
}

.dropdown-divider {
    height: 0.0625rem;
    background: var(--border-color);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: clamp(0.75rem, 2vw, 0.8125rem) clamp(1.25rem, 3vw, 1.25rem);
    color: #5a6c7d;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.dropdown-item i {
    font-size: clamp(1rem, 2vw, 1.125rem);
    width: 1.25rem;
    color: #8898aa;
}

.dropdown-item:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-item.text-danger {
    color: #dc3545;
}

.dropdown-item.text-danger i {
    color: #dc3545;
}

.dropdown-item.text-danger:hover {
    background: #fff5f5;
}

section.navSection.container-fluid, div#mainFooter {
    max-width: 1600px;
    padding: 0;
}

/* Load More Indicator */
.load-more-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 3vw, 1.25rem);
    color: var(--primary-color);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 500;
}

.load-more-indicator .spinner-border {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 0.125rem;
}
.btn-remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-remove-item:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-remove-item i {
    font-size: 14px;
}
/* ============================================
   ORGANIZATION SWITCHER
   ============================================ */

.org-switcher {
    position: relative;
}

.btn-org-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-org-switch:hover {
    background: white;
    border-color: var(--primary-color);
}

.btn-org-switch i:first-child {
    font-size: 16px;
}

.org-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1002;
    border: 1px solid var(--border-color);
}

.org-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.org-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.org-dropdown-item:last-child {
    border-bottom: none;
}

.org-dropdown-item:hover {
    background: var(--light-bg);
}

.org-dropdown-item.active {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
}

.org-dropdown-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.org-dropdown-id {
    font-size: 12px;
    color: #8898aa;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 66, 138, 0.95); /* Changed from black to primary color */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
}
/* ============================================
   CURRENT ORGANIZATION BADGE
   ============================================ */

.current-org-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color), #2a5298);
    color: white;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 15px;
    position: relative;
    box-shadow: 0 2px 8px rgba(26, 66, 138, 0.25);
    transition: all 0.2s ease;
}

.current-org-badge:hover {
    box-shadow: 0 4px 12px rgba(26, 66, 138, 0.35);
    transform: translateY(-1px);
}

.current-org-badge i {
    font-size: 16px;
}

#currentOrgName {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-switcher-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1002;
    border: 1px solid var(--border-color);
}

.org-switcher-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.org-dropdown-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.org-dropdown-id {
    font-size: 12px;
    color: #8898aa;
}
/* ============================================
   CURRENT ORGANIZATION BADGE
   ============================================ */

#currentOrgName {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-switcher-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1002;
    border: 1px solid var(--border-color);
}

.org-switcher-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.org-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.org-dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.org-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.org-dropdown-item:hover {
    background: var(--light-bg);
}

.org-dropdown-item.active {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
}

.org-dropdown-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.org-dropdown-id {
    font-size: 12px;
    color: #8898aa;
}
/* Disabled field styling for existing customers */
.form-control:disabled {
    background-color: #f8f9fa !important;
    cursor: not-allowed !important;
    opacity: 0.8;
}

.field-loading-indicator {
    position: absolute;
    right: 15px;
    top: 38px;
    display: none;
    align-items: center;
    justify-content: center;
}

.field-loading-indicator .spinner-border-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}
@media (max-width: 992px) {
    .current-org-badge {
        width: calc(100% - 60px);
        margin-right: 10px;
        margin-bottom: 0;
        justify-content: center;
    }

    #currentOrgName {
        max-width: none;
    }

    .org-switcher-dropdown {
        left: 0;
        right: auto;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .current-org-badge {
        font-size: 12px;
        padding: 6px 12px;
    }

    #currentOrgName {
        font-size: 12px;
    }
}
@media (max-width: 992px) {
    .current-org-badge {
        order: -1;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        justify-content: center;
    }

    #currentOrgName {
        max-width: none;
    }

    .org-switcher-dropdown {
        left: 0;
        right: 0;
    }
    .org-switcher {
        order: -1;
        margin-bottom: 10px;
        width: 100%;
    }

    .btn-org-switch {
        width: 100%;
        justify-content: space-between;
    }

    .org-name {
        max-width: none;
    }

    .org-dropdown {
        right: 0;
        left: 0;
    }
}

/* ============================================
   STEP INDICATOR - MOBILE RESPONSIVE
   ============================================ */

.form-step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    padding: 0 20px;
    overflow-x: auto;
    overflow-y: hidden;
}

.step-item-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step-circle.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(26, 66, 138, 0.3);
}

.step-circle.completed {
    background: #28a745;
    color: white;
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
}

.step-label.active {
    color: var(--primary-color);
}

.step-line {
    width: 60px;
    height: 2px;
    background: #e9ecef;
    margin: 0 10px;
    flex-shrink: 0;
}

.step-line.completed {
    background: #28a745;
}

/* Mobile Step Indicator */
@media (max-width: 768px) {
    .form-step-indicator {
        padding: 0 10px;
        margin-bottom: 30px;
        justify-content: flex-start;
    }

    .step-item-indicator {
        gap: 8px;
    }

    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .step-label {
        font-size: 12px;
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .step-line {
        width: 30px;
        margin: 0 5px;
    }
}

@media (max-width: 576px) {
    .form-step-indicator {
        padding: 0 5px;
        margin-bottom: 25px;
        gap: 0;
    }

    .step-item-indicator {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .step-label {
        font-size: 10px;
        max-width: 60px;
        line-height: 1.2;
    }

    .step-line {
        width: 20px;
        margin: 0 3px;
        position: relative;
        top: -18px; /* Align with circles */
    }

    /* Alternative: Hide labels on very small screens, show only circles */
    .step-label {
        display: none;
    }

    .step-item-indicator {
        flex-direction: row;
    }

    .step-line {
        top: 0;
    }
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
/* ============================================
   CONSISTENT TABLE FONT
   ============================================ */

.stock-table,
.stock-table * {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.stock-table tbody {
    font-weight: 400;
}

.item-code,
.serial-number {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}
/* Large desktops */
@media (max-width: 1440px) {
    .navbar-content {
        padding: 0 clamp(1.5rem, 4vw, 1.875rem);
    }
    
    .dashboard-content {
        padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 1.875rem) clamp(2.5rem, 8vw, 3.75rem);
    }
}

/* Medium desktops */
@media (max-width: 1200px) {
    .navbar-content {
        padding: 0 clamp(1.25rem, 3vw, 1.25rem);
    }
    
    .navbar-menu {
        padding: 0 clamp(0.875rem, 2vw, 0.9375rem);
        max-width: min(31.25rem, 50vw);
    }
    
    .nav-links {
        gap: 0.375rem;
    }
    
    .nav-link {
        padding: clamp(0.625rem, 2vw, 0.6875rem) clamp(0.75rem, 2vw, 0.875rem);
        font-size: clamp(0.75rem, 2vw, 0.8125rem);
    }
    
    .navbar-brand,
    .navbar-user {
        max-width: min(13.75rem, 35vw);
    }
    
    .dashboard-content {
        padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 3vw, 1.25rem) clamp(2.5rem, 8vw, 3.75rem);
    }
}

/* Small desktops and tablets */
@media (max-width: 1225px) {
    .nav-link {
        padding: clamp(0.625rem, 2vw, 0.6875rem) clamp(0.75rem, 2vw, 0.8125rem);
    }
    
    .nav-link span:not(.badge-soon) {
        display: none;
    }
    
    .navbar-menu {
        max-width: min(18.75rem, 40vw);
        padding: 0 clamp(0.625rem, 2vw, 0.6875rem);
    }
    
    .nav-links {
        gap: 0.25rem;
    }
}

/* Tablets - Mobile menu */
@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: block;
    }

    .navbar-content {
        height: auto;
        padding: clamp(0.75rem, 2vw, 0.8125rem) clamp(1.25rem, 3vw, 1.25rem);
        position: relative;
        overflow: visible;
    }

    .navbar-brand {
        max-width: none;
        flex: 1;
    }

    .navbar-user {
        max-width: none;
        flex: 0 0 auto;
    }

    .navbar-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-0.625rem);
        transition: all 0.3s ease;
        border-top: 0.0625rem solid var(--border-color);
        z-index: 999;
        max-width: none;
        padding: 0;
    }

    .navbar-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-links {
        flex-direction: column;
        padding: clamp(1.25rem, 3vw, 1.25rem);
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .nav-link span {
        display: inline !important;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: clamp(0.875rem, 2vw, 0.9375rem) clamp(1rem, 2vw, 1.25rem);
        font-size: clamp(0.75rem, 2vw, 0.875rem);
    }

    .user-info {
        display: none;
    }

    .dropdown-icon {
        display: none;
    }

    .user-dropdown {
        right: clamp(1.25rem, 3vw, 1.25rem);
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    .navbar-content {
        padding: clamp(0.75rem, 2vw, 0.8125rem) clamp(0.875rem, 2vw, 0.9375rem);
        overflow: visible;
    }

    .dashboard-content {
        padding: clamp(1.5rem, 4vw, 1.875rem) clamp(0.875rem, 2vw, 0.9375rem) clamp(2.5rem, 8vw, 3.125rem);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .footer-left,
    .footer-right {
        width: 100%;
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: clamp(0.875rem, 2vw, 0.9375rem);
    }
}
/* ============================================
   MOBILE VIEW OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Navbar - Better spacing */
    .main-navbar {
        overflow: visible;
    }

    .navbar-content {
        gap: 10px;
        overflow: visible;
    }

    .navbar-brand {
        flex: 1;
    }

    .navbar-user {
        gap: 8px;
    }

    /* Page Header - Compact */
    .page-header {
        margin-bottom: 20px;
    }

    .page-title {
        font-size: 20px;
    }

    .page-title i {
        font-size: 24px;
    }

    .page-description {
        font-size: 13px;
    }

    /* Stats Cards - Smaller */
    .card-stats-row {
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 24px;
    }

    /* Transfer Ownership Button - Fixed Position */
div#bulkActionsContainer {
    position: fixed;
    bottom: 0;
    transform: none;
    z-index: 10010;
    left: 0;
    right: 0;
    margin: auto;
    top: auto;
}

    .btn-transfer-ownership {
        width: 100%;
        justify-content: center;
        padding: 16px 20px;
        font-size: 14px;
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.5);
    }

    /* Search and Filters - Stacked */
    .search-filter-section {
        gap: 10px;
    }

    .search-box,
    .filter-box {
        min-width: 100%;
        width: 100%;
    }

    .search-box input,
    .filter-box select,
    .filter-box input {
        font-size: 14px;
        padding: 12px 40px 12px 14px;
    }

    .btn-refresh,
    .btn-export {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    /* Table - Card View for Mobile */
    .table-responsive {
        border: none;
        border-radius: 0;
    }

    .stock-table {
        display: block;
    }

    .stock-table thead {
        display: none;
    }

    .stock-table tbody {
        display: block;
    }

    .stock-table tbody tr {
        display: block;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .stock-table tbody tr.selected {
        border: 2px solid var(--primary-color);
        background: #e3f2fd;
        border-left: 4px solid var(--primary-color);
    }

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

    .stock-table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-color);
        display: block;
        margin-bottom: 4px;
        font-size: 12px;
        text-transform: uppercase;
    }

    /* Checkbox in card view */
    .stock-table tbody td:first-child {
        position: absolute;
        top: 15px;
        right: 15px;
        padding: 0;
    }

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

    /* Serial Number - Prominent */
    .serial-number {
        font-size: 16px;
        padding-top: 0 !important;
    }

    /* Action button - Full width */
    .stock-table tbody td:last-child {
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid var(--border-color);
    }

    .stock-table tbody td:last-child:before {
        display: none;
    }

    .btn-action {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }

    /* Item description - Allow wrap */
    .item-desc {
        max-width: none;
        white-space: normal;
        overflow: visible;
    }

    /* Content Card - Less padding */
    .content-card {
        padding: 20px 15px;
    }

    .dashboard-content {
        padding: 20px 10px 100px; /* Extra bottom padding for sticky button */
    }
}

@media (max-width: 576px) {
    .dashboard-content {
        padding: 15px 8px 100px;
    }

    .content-card {
        padding: 15px 12px;
        border-radius: 12px;
    }

    .page-title {
        font-size: 18px;
        gap: 8px;
    }

    .page-title i {
        font-size: 22px;
    }

    .btn-transfer-ownership {
        font-size: 13px;
        padding: 14px 16px;
    }

    .logo-image {
        height: clamp(2rem, 6vw, 2.5rem);
        max-width: min(9.375rem, 25vw);
    }

    .user-avatar {
        width: clamp(2rem, 6vw, 2.25rem);
        height: clamp(2rem, 6vw, 2.25rem);
        font-size: clamp(0.75rem, 2vw, 0.875rem);
    }

    .page-title {
        font-size: clamp(1.125rem, 3vw, 1.375rem);
    }

    .page-title i {
        font-size: clamp(1.375rem, 4vw, 1.625rem);
    }

    .content-card {
        padding: clamp(1.25rem, 3vw, 1.25rem);
    }
}

/* Additional responsive utilities */
@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-filter-section {
        flex-direction: column;
    }
    
    .search-box,
    .filter-box {
        min-width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-back,
    .btn-next,
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    .main-navbar {
        overflow: visible; /* Ensure sticky doesn't clip vertically */
    }

    .navbar-content {
        padding: 10px 12px;
        gap: 8px;
        overflow-x: hidden; /* Only horizontal prevention */
        overflow-y: visible; /* Allows absolute dropdown to extend */
    }

    /* Logo - Smaller */
    .navbar-brand {
        gap: 10px;
        min-width: auto;
        flex: 0 0 auto;
    }

    .logo-image {
        height: 35px;
        max-width: 110px;
    }

    /* Organization Badge - Compact */
    .navbar-user {
        gap: 6px;
        flex-wrap: nowrap;
        min-width: auto;
        overflow: revert-layer;
    }

    .current-org-badge {
        display: flex !important;
        align-items: center;
        gap: 4px;
        background: var(--primary-color);
        color: white;
        padding: 6px 10px;
        border-radius: 8px;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
        max-width: 130px;
    }

    .current-org-badge i {
        font-size: 12px;
        flex-shrink: 0;
    }

    .current-org-badge span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* User Profile - Compact */
    .user-profile {
        padding: 4px 8px;
        gap: 6px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    /* Hide user role on very small screens */
    .user-role {
        display: none;
    }

    .dropdown-icon {
        font-size: 12px;
    }
       .stock-table tbody tr {
        display: block;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 15px;
        padding: 50px 15px 15px 15px; /* Extra top padding for checkbox */
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        position: relative;
    }

    .stock-table tbody tr.selected {
        border: 2px solid var(--primary-color);
        background: #e3f2fd;
        border-left: 4px solid var(--primary-color);
    }

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

    .stock-table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-color);
        display: block;
        margin-bottom: 4px;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    /* Checkbox in card view - Top left corner */
    .stock-table tbody td:first-child {
        position: absolute;
        top: 15px;
        left: 15px;
        padding: 0;
        width: auto;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .stock-table tbody td:first-child:before {
        content: 'Select';
        font-size: 11px;
        color: #8898aa;
        font-weight: 500;
    }

    .select-checkbox,
    .select-all-checkbox {
        width: 20px;
        height: 20px;
        margin: 0;
    }

    /* Serial Number - Prominent */
    .stock-table tbody td:nth-child(2) {
        padding-top: 0;
        margin-bottom: 10px;
    }

    .serial-number {
        font-size: 15px;
        font-weight: 700;
    }

    /* Action button - Full width */
    .stock-table tbody td:last-child {
        padding-top: 12px;
        margin-top: 12px;
        border-top: 1px solid var(--border-color);
    }

    .stock-table tbody td:last-child:before {
        display: none;
    }

    .btn-action {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 14px;
    }

    /* Franchisee badge */
    .franchisee-badge {
        font-size: 11px;
        padding: 5px 12px;
    }

    /* Item description */
    .item-desc {
        max-width: none;
        white-space: normal;
        overflow: visible;
        font-size: 13px;
        line-height: 1.5;
    }

    .item-code {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .navbar-content {
        padding: 8px 10px;
    }

    .logo-image {
        height: 30px;
        max-width: 100px;
    }

    .current-org-badge {
        max-width: 110px;
        font-size: 10px;
        padding: 5px 8px;
    }

    .current-org-badge span {
        display: none; /* Hide text, show only icon on very small screens */
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .user-profile {
        padding: 4px 6px;
    }
}
/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn-header,
    .btn-action {
        display: none !important;
    }
    
    .content-card {
        box-shadow: none !important;
        border: 0.0625rem solid #ccc !important;
    }
}